#ifndef WIDGET_H #define WIDGET_H #include "Channel.h" #include "DatabaseManager.h" #include "FocusWindow.h" #include "TimeSlider.h" #include #include QT_BEGIN_NAMESPACE namespace Ui { class Menu; } QT_END_NAMESPACE class Menu : public QWidget, public FW::FocusWindow { Q_OBJECT public: Menu(QWidget* parent = nullptr); ~Menu(); void setChannelSelectVisible(bool visible); DatabaseManager::Channel getCurPlayChannel(); void moveToCenter(); void show(); Menu* restartUI(); public slots: void move(Direction direction); void confirm(); void onAppendVideo(); signals: void btnHdmi1Checked(); void btnHdmi2Checked(); void btnVga1Checked(); void btnVga2Checked(); void btnPlaybackClicked(QVariantMap params, int segmentIndex); void resolutionOutAChanged(int); void resolutionOutBChanged(int); void resolutionInAChanged(int width, int height); void resolutionInBChanged(int width, int height); protected: // 重写父类的方法,以获取当前界面的所有可以获取焦点的控件 QList getAllFocusabelWidget() override; private slots: void on_cmbResolutionB_currentIndexChanged(int index); void on_cmbResolutionA_currentIndexChanged(int index); void on_cmbResolutionInA_currentIndexChanged(const QString& arg1); void on_cmbResolutionInB_currentIndexChanged(const QString& arg1); private: Ui::Menu* ui; DatabaseManager* db; bool channelSelectVisible = false; // 是否显示通道选择,单通道回放显示、双通道不显示 DatabaseManager::Channel curSelectChannel; // 当前选择的通道 QList segments; // 视频时间片 int curSegmentIndex; // 当前时间片 private: void renderComboBoxYear(); void renderComboBoxMonth(); void renderComboBoxDay(); void renderTimeSlider(); }; #endif // WIDGET_H