RecordControlApplication/Widget.h

74 lines
1.7 KiB
C
Raw Permalink Normal View History

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"
#include "TimeSlider.h"
#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
public slots:
void update();
void onProgressTimeout();
void onPlayEnd();
2024-03-04 16:22:40 +08:00
void onShowRecordLabel(bool show);
void onAppendVideo();
2024-08-12 11:26:42 +08:00
// 按键操作。上下左右确认返回
void onBtnMenuClicked();
void onBtnUpClicked();
void onBtnDownClicked();
void onBtnLeftClicked();
void onBtnRightClicked();
void onBtnConfirmClicked();
void onBtnReturnClicked();
void onBtnVolumnUpClicked();
void onBtnVolumnDownClicked();
2024-08-12 11:26:42 +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-01-18 15:41:43 +08:00
private:
Ui::Widget* ui;
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);
void playNextSegemnt();
void playPreSegment();
2024-03-04 16:22:40 +08:00
Channel* findChannelByName(QString name);
};
#endif // WIDG_H