teleport/client/tp-player/mainwindow.h

84 lines
1.7 KiB
C
Raw Normal View History

2019-09-02 21:40:52 +00:00
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
2019-09-16 05:53:27 +00:00
#include <QMessageBox>
#include <QTimer>
2019-09-06 12:07:13 +00:00
#include "bar.h"
2019-09-02 21:40:52 +00:00
#include "thr_play.h"
#include "update_data.h"
#include "record_format.h"
2019-09-16 05:53:27 +00:00
#include "dlgmessage.h"
2019-09-02 21:40:52 +00:00
#define PLAY_STATE_UNKNOWN 0
#define PLAY_STATE_RUNNING 1
#define PLAY_STATE_PAUSE 2
#define PLAY_STATE_STOP 3
2019-09-02 21:40:52 +00:00
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
2019-09-16 05:53:27 +00:00
void set_resource(const QString& res);
void pause();
void resume();
void restart();
void speed(int s);
2019-09-02 21:40:52 +00:00
private:
void paintEvent(QPaintEvent *e);
void mouseMoveEvent(QMouseEvent *e);
void mousePressEvent(QMouseEvent *e);
void _start_play_thread();
2019-09-02 21:40:52 +00:00
private slots:
2019-09-16 05:53:27 +00:00
void _do_first_run(); // 默认界面加载完成后,开始播放操作(可能会进行数据下载)
void _do_update_data(update_data*);
void _do_bar_fade();
void _do_bar_delay_hide();
2019-09-02 21:40:52 +00:00
private:
Ui::MainWindow *ui;
2019-09-16 05:53:27 +00:00
//bool m_shown;
bool m_show_default;
bool m_bar_shown;
QPixmap m_default_bg;
2019-09-02 21:40:52 +00:00
2019-09-16 05:53:27 +00:00
QString m_res;
ThreadPlay* m_thr_play;
2019-09-02 21:40:52 +00:00
2019-09-04 12:28:16 +00:00
QPixmap m_canvas;
2019-09-06 12:07:13 +00:00
Bar m_bar;
2019-09-02 21:40:52 +00:00
TS_RECORD_HEADER m_rec_hdr;
2019-09-03 12:19:09 +00:00
QPixmap m_pt_normal;
2019-09-02 21:40:52 +00:00
TS_RECORD_RDP_POINTER m_pt;
2019-09-16 05:53:27 +00:00
QTimer m_timer_first_run;
QTimer m_timer_bar_fade;
QTimer m_timer_bar_delay_hide;
bool m_bar_fade_in;
bool m_bar_fading;
qreal m_bar_opacity;
int m_play_state;
2019-09-16 05:53:27 +00:00
//QMessageBox* m_msg_box;
DlgMessage* m_msg_box;
2019-09-02 21:40:52 +00:00
};
#endif // MAINWINDOW_H