teleport/client/tp-player/thr_play.h

40 lines
781 B
C
Raw Normal View History

2019-09-02 21:40:52 +00:00
#ifndef THR_PLAY_H
#define THR_PLAY_H
#include <QThread>
#include "update_data.h"
2019-09-16 05:53:27 +00:00
#include "thr_download.h"
2019-09-02 21:40:52 +00:00
class ThreadPlay : public QThread
{
Q_OBJECT
public:
2019-09-16 05:53:27 +00:00
ThreadPlay(const QString& res);
~ThreadPlay();
2019-09-02 21:40:52 +00:00
virtual void run();
void stop();
void pause() {m_need_pause = true;}
void resume() {m_need_pause = false;}
void speed(int s) {if(s >= 1 && s <= 16) m_speed = 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:
void signal_update_data(update_data*);
private:
bool m_need_stop;
bool m_need_pause;
int m_speed;
2019-09-16 05:53:27 +00:00
QString m_res;
bool m_need_download;
ThreadDownload* m_thr_download;
2019-09-02 21:40:52 +00:00
};
#endif // THR_PLAY_H