MythTV  master
cecadapter.h
Go to the documentation of this file.
1 #ifndef CECADAPTER_H_
2 #define CECADAPTER_H_
3 
4 #include <QMutex>
5 #include <QWaitCondition>
6 #include "mthread.h"
7 
8 #define LIBCEC_ENABLED QString("libCECEnabled")
9 #define LIBCEC_DEVICE QString("libCECDevice")
10 #define LIBCEC_BASE QString("libCECBase")
11 #define LIBCEC_PORT QString("libCECPort")
12 #define POWEROFFTV_ALLOWED QString("PowerOffTVAllowed")
13 #define POWEROFFTV_ONEXIT QString("PowerOffTVOnExit")
14 #define POWERONTV_ALLOWED QString("PowerOnTVAllowed")
15 #define POWERONTV_ONSTART QString("PowerOnTVOnStart")
16 
17 class CECAdapterPriv;
18 
19 class CECAdapter : public QObject, public MThread
20 {
21  Q_OBJECT
22 
23  public:
24  CECAdapter();
25  virtual ~CECAdapter();
26  bool IsValid();
27  void Action(const QString &action);
28 
29  protected:
30  void run() override; // MThread
31 
32  private:
33  CECAdapterPriv *m_priv {nullptr};
34  static QMutex *gLock;
35  static QMutex *gHandleActionsLock;
36  static QWaitCondition *gActionsReady;
37 };
38 
39 #endif
40 
bool IsValid()
This is a wrapper around QThread that does several additional things.
Definition: mthread.h:46
static QMutex * gHandleActionsLock
Definition: cecadapter.h:35
void run() override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
virtual ~CECAdapter()
void Action(const QString &action)
CECAdapterPriv * m_priv
Definition: cecadapter.h:33
static QMutex * gLock
Definition: cecadapter.h:34
static QWaitCondition * gActionsReady
Definition: cecadapter.h:36