teleport/client/tp-player/thr_play.h

44 lines
949 B
C++
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#ifndef THR_PLAY_H
#define THR_PLAY_H
#include <QThread>
#include "update_data.h"
#include "downloader.h"
class MainWindow;
// 根据播放规则将要播放的图像发送给主UI线程进行显示
class ThrPlay : public QThread
{
Q_OBJECT
friend class ThrData;
public:
ThrPlay(MainWindow* mainwnd);
~ThrPlay();
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;}
private:
void _notify_message(const QString& msg);
void _notify_error(const QString& err_msg);
signals:
void signal_update_data(UpdateData*);
private:
MainWindow* m_mainwnd;
bool m_need_stop;
bool m_need_pause;
int m_speed;
bool m_skip;
bool m_first_run;
uint32_t m_start_ms;
};
#endif // THR_PLAY_H