2024-01-18 15:41:43 +08:00
|
|
|
#ifndef WIDG_H
|
|
|
|
#define WIDG_H
|
|
|
|
|
2024-03-04 16:22:40 +08:00
|
|
|
#include "Channel.h"
|
2024-01-18 15:41:43 +08:00
|
|
|
#include "Menu.h"
|
2024-12-24 03:51:48 +08:00
|
|
|
#include "TimeSlider.h"
|
2024-01-25 09:57:08 +08:00
|
|
|
#include <QDir>
|
2024-01-18 15:41:43 +08:00
|
|
|
#include <QMap>
|
|
|
|
#include <QTimer>
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class Widget;
|
|
|
|
}
|
|
|
|
|
|
|
|
class Widget : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit Widget(QWidget* parent = 0);
|
|
|
|
~Widget();
|
|
|
|
|
2024-08-12 11:26:42 +08:00
|
|
|
signals:
|
|
|
|
void needPlayVideo(QString types);
|
2024-01-18 15:41:43 +08:00
|
|
|
|
2024-12-24 03:51:48 +08:00
|
|
|
public slots:
|
|
|
|
void update();
|
|
|
|
|
2024-01-25 09:57:08 +08:00
|
|
|
void onProgressTimeout();
|
|
|
|
void onPlayEnd();
|
2024-03-04 16:22:40 +08:00
|
|
|
void onShowRecordLabel(bool show);
|
2024-12-24 03:51:48 +08:00
|
|
|
void onAppendVideo();
|
2024-08-12 11:26:42 +08:00
|
|
|
|
|
|
|
// 按键操作。上下左右确认返回
|
|
|
|
void onBtnMenuClicked();
|
|
|
|
void onBtnUpClicked();
|
|
|
|
void onBtnDownClicked();
|
|
|
|
void onBtnLeftClicked();
|
|
|
|
void onBtnRightClicked();
|
|
|
|
void onBtnConfirmClicked();
|
2024-05-07 15:06:36 +08:00
|
|
|
void onBtnReturnClicked();
|
2024-08-22 15:29:39 +08:00
|
|
|
void onBtnVolumnUpClicked();
|
|
|
|
void onBtnVolumnDownClicked();
|
2024-08-12 11:26:42 +08:00
|
|
|
|
|
|
|
// 播放视频
|
2024-12-24 03:51:48 +08:00
|
|
|
void onBtnPlaybackClicked(QVariantMap params, int segmentIndex);
|
|
|
|
|
|
|
|
// 分辨率更改
|
|
|
|
void onResolutionOutAChanged(int resolution);
|
|
|
|
void onResolutionOutBChanged(int resolution);
|
|
|
|
|
|
|
|
void onResolutionInAChanged(int width, int height);
|
|
|
|
void onResolutionInBChanged(int width, int height);
|
2024-05-07 15:06:36 +08:00
|
|
|
|
2024-01-18 15:41:43 +08:00
|
|
|
private:
|
|
|
|
Ui::Widget* ui;
|
|
|
|
|
2024-12-24 03:51:48 +08:00
|
|
|
Menu* menu; // 菜单指针
|
|
|
|
|
|
|
|
bool isPlayback = false; // 是否在回放
|
|
|
|
QTimer* progressTimer; // 查询播放进度的定时器
|
|
|
|
QList<TimeSlider::TimeSegment> segments; // 当天回放的时间段
|
|
|
|
int curSegmentIndex = 0; // 当前回放的时间段
|
|
|
|
QVariantMap playbackParams; // 回放参数(通道和时间)
|
2024-01-18 15:41:43 +08:00
|
|
|
|
|
|
|
private:
|
2024-03-04 16:22:40 +08:00
|
|
|
void seek(QString type);
|
2024-08-12 11:26:42 +08:00
|
|
|
void playOneChannel(QString filename);
|
|
|
|
void playTwoChannels(QString filename);
|
2024-12-24 03:51:48 +08:00
|
|
|
void playNextSegemnt();
|
|
|
|
void playPreSegment();
|
2024-03-04 16:22:40 +08:00
|
|
|
Channel* findChannelByName(QString name);
|
|
|
|
};
|
2024-01-25 09:57:08 +08:00
|
|
|
|
2024-12-24 03:51:48 +08:00
|
|
|
#endif // WIDG_H
|