teleport/client/tp-player/thr_play.h

44 lines
949 B
C
Raw Normal View History

2019-10-31 17:45:17 +00:00
#ifndef THR_PLAY_H
2019-09-02 21:40:52 +00:00
#define THR_PLAY_H
#include <QThread>
#include "update_data.h"
2019-10-31 17:45:17 +00:00
#include "downloader.h"
2019-09-02 21:40:52 +00:00
2019-11-03 19:34:11 +00:00
class MainWindow;
2019-10-31 17:45:17 +00:00
// 根据播放规则将要播放的图像发送给主UI线程进行显示
class ThrPlay : public QThread
2019-09-02 21:40:52 +00:00
{
Q_OBJECT
2019-10-31 17:45:17 +00:00
friend class ThrData;
2019-09-02 21:40:52 +00:00
public:
2019-11-03 19:34:11 +00:00
ThrPlay(MainWindow* mainwnd);
2019-10-31 17:45:17 +00:00
~ThrPlay();
2019-09-02 21:40:52 +00:00
virtual void run();
void stop();
void pause() {m_need_pause = true;}
void resume(bool relocate, uint32_t start_ms);
void speed(int s) {if(s >= 1 && s <= 16) m_speed = s;}
void skip(bool s) {m_skip = s;}
2019-09-02 21:40:52 +00:00
2019-09-16 05:53:27 +00:00
private:
void _notify_message(const QString& msg);
void _notify_error(const QString& err_msg);
2019-09-02 21:40:52 +00:00
signals:
2019-10-31 17:45:17 +00:00
void signal_update_data(UpdateData*);
2019-09-02 21:40:52 +00:00
private:
2019-11-03 19:34:11 +00:00
MainWindow* m_mainwnd;
2019-09-02 21:40:52 +00:00
bool m_need_stop;
bool m_need_pause;
int m_speed;
bool m_skip;
bool m_first_run;
uint32_t m_start_ms;
2019-09-02 21:40:52 +00:00
};
#endif // THR_PLAY_H