2024-08-12 11:26:42 +08:00
|
|
|
#ifndef WIDGET_H
|
|
|
|
#define WIDGET_H
|
|
|
|
|
2024-12-24 03:51:48 +08:00
|
|
|
#include "Channel.h"
|
2024-08-12 11:26:42 +08:00
|
|
|
#include "DatabaseManager.h"
|
|
|
|
#include "FocusWindow.h"
|
2024-12-24 03:51:48 +08:00
|
|
|
#include "TimeSlider.h"
|
2024-08-12 11:26:42 +08:00
|
|
|
#include <QKeyEvent>
|
2024-12-24 03:51:48 +08:00
|
|
|
#include <QMap>
|
2024-08-12 11:26:42 +08:00
|
|
|
|
|
|
|
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);
|
2024-08-22 15:29:39 +08:00
|
|
|
DatabaseManager::Channel getCurPlayChannel();
|
2024-12-24 03:51:48 +08:00
|
|
|
void moveToCenter();
|
|
|
|
void show();
|
|
|
|
Menu* restartUI();
|
2024-08-12 11:26:42 +08:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void move(Direction direction);
|
|
|
|
void confirm();
|
2024-12-24 03:51:48 +08:00
|
|
|
void onAppendVideo();
|
2024-08-12 11:26:42 +08:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void btnHdmi1Checked();
|
|
|
|
void btnHdmi2Checked();
|
|
|
|
void btnVga1Checked();
|
|
|
|
void btnVga2Checked();
|
2024-12-24 03:51:48 +08:00
|
|
|
void btnPlaybackClicked(QVariantMap params, int segmentIndex);
|
|
|
|
|
|
|
|
void resolutionOutAChanged(int);
|
|
|
|
void resolutionOutBChanged(int);
|
|
|
|
|
|
|
|
void resolutionInAChanged(int width, int height);
|
|
|
|
void resolutionInBChanged(int width, int height);
|
2024-08-12 11:26:42 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// 重写父类的方法,以获取当前界面的所有可以获取焦点的控件
|
|
|
|
QList<QWidget*> getAllFocusabelWidget() override;
|
|
|
|
|
2024-12-24 03:51:48 +08:00
|
|
|
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);
|
|
|
|
|
2024-08-12 11:26:42 +08:00
|
|
|
private:
|
|
|
|
Ui::Menu* ui;
|
|
|
|
DatabaseManager* db;
|
2024-08-22 15:29:39 +08:00
|
|
|
bool channelSelectVisible = false; // 是否显示通道选择,单通道回放显示、双通道不显示
|
|
|
|
DatabaseManager::Channel curSelectChannel; // 当前选择的通道
|
2024-12-24 03:51:48 +08:00
|
|
|
QList<TimeSlider::TimeSegment> segments; // 视频时间片
|
|
|
|
int curSegmentIndex; // 当前时间片
|
2024-08-12 11:26:42 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
void renderComboBoxYear();
|
|
|
|
void renderComboBoxMonth();
|
|
|
|
void renderComboBoxDay();
|
2024-12-24 03:51:48 +08:00
|
|
|
void renderTimeSlider();
|
2024-08-12 11:26:42 +08:00
|
|
|
};
|
|
|
|
#endif // WIDGET_H
|