87 lines
2.3 KiB
C++
87 lines
2.3 KiB
C++
#ifndef MAINWINDOW_H
|
|
#define MAINWINDOW_H
|
|
|
|
#include <QObject>
|
|
|
|
#include <QVector>
|
|
#include <QMainWindow>
|
|
#include <QUdpSocket>
|
|
#include <QTimer>
|
|
|
|
#include <irrKlang.h>
|
|
|
|
#include "Config.h"
|
|
#include "ZMQServer.h"
|
|
|
|
|
|
class MainWindow : public QMainWindow
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit MainWindow(const QStringList& fontFamily, QWidget* parent = nullptr);
|
|
~MainWindow();
|
|
|
|
static MainWindow& Get();
|
|
|
|
QString GetTownName(int32_t town) const;
|
|
QString GetPlaceName(int32_t town, int32_t place) const;
|
|
QString GetTitleName(int32_t town, int32_t place) const;
|
|
QString GetImageName(int32_t town, int32_t place, int32_t image) const;
|
|
Scope GetScope(int32_t town, int32_t place) const;
|
|
void SetScope(int32_t town, int32_t place, const Scope& scope);
|
|
|
|
const QStringList& GetDefaultFontFamily() const { return m_fontFamily; }
|
|
|
|
void Adjust();
|
|
|
|
void SaveConfig();
|
|
const QRect& GetTextRect() const { return m_textRect; }
|
|
const QSize& GetImageShowSize() const { return m_imageSize; }
|
|
int GetDelayRetore()const { return m_delayRestore; }
|
|
int GetCrilceDelay()const { return m_delayCricle; }
|
|
void PlayWav();
|
|
void SetNetStatus(int connected);
|
|
//void show();
|
|
|
|
protected:
|
|
void OnMessage(const QString& cmd);
|
|
void closeEvent(class QCloseEvent* event) override;
|
|
void keyPressEvent(QKeyEvent* event) override;
|
|
bool eventFilter(QObject* obj, QEvent* event) override;
|
|
|
|
void CreateMovieWidget(const QRect& movieRect);
|
|
void PlayMovie();
|
|
|
|
void ScreenChange(QScreen* screen);
|
|
|
|
private:
|
|
QWidget* m_projectWidget{ nullptr };
|
|
class DisplayMovieGLWidget* m_glWidget{ nullptr };
|
|
//class TcpClient* m_tcpClient{ nullptr };
|
|
QUdpSocket m_udpSocket;
|
|
ZMQServer zmqServer_;
|
|
Config m_config;
|
|
QVector<class CmdReceiver*> m_cmdReceivers;
|
|
QStringList m_fontFamily;
|
|
|
|
QRect m_mainScreen{ 0, 0, 5760, 3240 };
|
|
QRect m_projectScreen{ 5760, 0, 1920, 1080 };
|
|
QRect m_textRect{ 3040, 640, 500, 400 };
|
|
QSize m_imageSize{ 1960, 1200};
|
|
class TokenRequest* m_tokenRequest{ nullptr };
|
|
|
|
QString m_moviePath;
|
|
class MediaPlayer* m_mediaPlayer;
|
|
bool m_playing{ false };
|
|
QString m_wavName;
|
|
irrklang::ISoundEngine* m_soundEngine{ nullptr };
|
|
|
|
int m_delayRestore{ 20 };
|
|
int m_delayCricle{ 40 };
|
|
|
|
QTimer m_updateTimer;
|
|
};
|
|
|
|
#endif // MAINWINDOW_H
|