#ifndef WIDG_H #define WIDG_H #include "Channel.h" #include "Menu.h" #include "TimeSlider.h" #include #include #include #include namespace Ui { class Widget; } class Widget : public QWidget { Q_OBJECT public: explicit Widget(QWidget* parent = 0); ~Widget(); signals: void needPlayVideo(QString types); public slots: void update(); void onProgressTimeout(); void onPlayEnd(); void onShowRecordLabel(bool show); void onAppendVideo(); // 按键操作。上下左右确认返回 void onBtnMenuClicked(); void onBtnUpClicked(); void onBtnDownClicked(); void onBtnLeftClicked(); void onBtnRightClicked(); void onBtnConfirmClicked(); void onBtnReturnClicked(); void onBtnVolumnUpClicked(); void onBtnVolumnDownClicked(); // 播放视频 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); private: Ui::Widget* ui; Menu* menu; // 菜单指针 bool isPlayback = false; // 是否在回放 QTimer* progressTimer; // 查询播放进度的定时器 QList segments; // 当天回放的时间段 int curSegmentIndex = 0; // 当前回放的时间段 QVariantMap playbackParams; // 回放参数(通道和时间) private: void seek(QString type); void playOneChannel(QString filename); void playTwoChannels(QString filename); void playNextSegemnt(); void playPreSegment(); Channel* findChannelByName(QString name); }; #endif // WIDG_H