MythTV  master
vboxutils.h
Go to the documentation of this file.
1 #ifndef _VBOX_UTILS_H_
2 #define _VBOX_UTILS_H_
3 
4 // Qt headers
5 #include <QString>
6 #include <QDomDocument>
7 
8 // MythTV headers
9 #include "vboxchannelfetcher.h"
10 
11 #define VBOX_MIN_API_VERSION "VB.2.50"
12 
13 class VBox
14 {
15  public:
16  explicit VBox(const QString &url);
17  ~VBox(void) = default;
18 
19  static QStringList probeDevices(void);
20  static QString getIPFromVideoDevice(const QString &dev);
21 
22  bool isConnected(void);
23  bool checkConnection(void);
24  bool checkVersion(QString &version);
25  QDomDocument *getBoardInfo(void);
26  QStringList getTuners(void);
28 
29  protected:
30  enum ErrorCode
31  {
32  SUCCESS = 0,
41  };
42 
43  bool sendQuery(const QString &query, QDomDocument *xmlDoc);
44 
45  QString m_url;
46 
47  private:
48  static QStringList doUPNPSearch(void);
49  QString getFirstText(QDomElement &element);
50  QString getStrValue(QDomElement &element, const QString &name, int index = 0);
51  int getIntValue(QDomElement &element, const QString &name, int index = 0);
52 };
53 #endif // _VBOX_UTILS_H_
QString getFirstText(QDomElement &element)
Definition: vboxutils.cpp:425
bool isConnected(void)
bool checkVersion(QString &version)
Definition: vboxutils.cpp:216
Definition: vboxutils.h:13
static QString getIPFromVideoDevice(const QString &dev)
Definition: vboxutils.cpp:151
QMap< QString, VBoxChannelInfo > vbox_chan_map_t
VBox(const QString &url)
Definition: vboxutils.cpp:26
const char * name
Definition: ParseText.cpp:328
QString getStrValue(QDomElement &element, const QString &name, int index=0)
Definition: vboxutils.cpp:404
static QStringList probeDevices(void)
Definition: vboxutils.cpp:32
ErrorCode
Definition: vboxutils.h:30
int getIntValue(QDomElement &element, const QString &name, int index=0)
Definition: vboxutils.cpp:418
vbox_chan_map_t * getChannels(void)
Definition: vboxutils.cpp:295
~VBox(void)=default
bool checkConnection(void)
Definition: vboxutils.cpp:210
static QStringList doUPNPSearch(void)
Definition: vboxutils.cpp:68
QString m_url
Definition: vboxutils.h:45
QDomDocument * getBoardInfo(void)
Definition: vboxutils.cpp:194
QStringList getTuners(void)
returns a list of tuners in the format 'TUNERNO TUNERTYPE' eg '1 DVBT/T2'
Definition: vboxutils.cpp:270
bool sendQuery(const QString &query, QDomDocument *xmlDoc)
Definition: vboxutils.cpp:357