1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef MPV_H
#ifdef USE_MPV
#define MPV_H
#include <QObject>
#include <mpv/client.h>
#include "videoplayer.h"
class Mpv : public VideoPlayer
{
Q_OBJECT
public:
explicit Mpv(Library &library, const BaseConfig& baseConfig, QObject* parent = 0);
~Mpv();
signals:
public slots:
// VideoPlayer interface
public:
virtual void stop();
virtual void backwards(const int seconds);
virtual void forwards(const int seconds);
virtual float incrementVolume();
virtual float decrementVolume();
protected:
virtual bool playFileImpl(QString filepath, const TvShowPlayerSettings &settings);
virtual void pauseImpl();
virtual void unPauseImpl();
virtual void getExactProgress();
signals:
void mpv_events();
private slots:
void resetMpv();
void on_mpv_events();
private:
mpv_handle* handle;
bool simpleCommand2(const char* commandName, const char* commandValue);
void handle_mpv_event(mpv_event *event);
static bool checkError(int errorCode);
};
#endif // USE_MPV
#endif // MPV_H