00001 00007 #ifndef DBOX2CHANNEL_H 00008 #define DBOX2CHANNEL_H 00009 00010 // POSIX headers 00011 #ifdef HAVE_STDINT_H 00012 #include <stdint.h> 00013 #endif 00014 00015 // Qt headers 00016 #include <qstring.h> 00017 #include <qmutex.h> 00018 00019 // MythTV headers 00020 #include "channelbase.h" 00021 #include "tv_rec.h" 00022 00023 class DBox2Recorder; 00024 class DBox2Channel; 00025 class DBox2EPG; 00026 class QHttp; 00027 00028 class DBox2CRelay : public QObject 00029 { 00030 Q_OBJECT 00031 00032 public: 00033 DBox2CRelay(DBox2Channel *ch) : m_ch(ch) {} 00034 void SetChannel(DBox2Channel*); 00035 00036 public slots: 00037 void HttpChannelChangeDone(bool error); 00038 void HttpRequestDone(bool error); 00039 00040 private: 00041 DBox2Channel *m_ch; 00042 QMutex m_lock; 00043 }; 00044 00045 class DBox2Channel : public ChannelBase 00046 { 00047 friend class DBox2CRelay; 00048 00049 public: 00050 DBox2Channel(TVRec *parent, DBox2DBOptions *dbox2_options, int cardid); 00051 ~DBox2Channel(void) { TeardownAll(); } 00052 00053 bool SetChannelByString(const QString &chan); 00054 bool Open(void); 00055 bool IsOpen(void) const { return m_recorderAlive; } 00056 void Close(void); 00057 void SwitchToLastChannel(void); 00058 00059 QString GetChannelNameFromNumber(const QString&); 00060 QString GetChannelNumberFromName(const QString &channelName); 00061 QString GetChannelID(const QString&); 00062 00063 void EPGFinished(void); 00064 void RecorderAlive(bool); 00065 00066 void SetRecorder(DBox2Recorder*); 00067 00068 private: 00069 void HttpChannelChangeDone(bool error); 00070 void HttpRequestDone(bool error); 00071 void TeardownAll(void); 00072 void LoadChannels(void); 00073 void RequestChannelChange(QString); 00074 QString GetDefaultChannel(void); 00075 00076 private: 00077 DBox2DBOptions *m_dbox2options; 00078 int m_cardid; 00079 bool m_channelListReady; 00080 QString m_lastChannel; 00081 QString m_requestChannel; 00082 DBox2EPG *m_epg; 00083 bool m_recorderAlive; 00084 DBox2Recorder *m_recorder; 00085 00086 QHttp *http; 00087 QHttp *httpChanger; 00088 DBox2CRelay *m_relay; 00089 00090 int m_dbox2channelcount; 00091 QMap<int,QString> m_dbox2channelids; 00092 QMap<int,QString> m_dbox2channelnames; 00093 00094 QMutex m_lock; 00095 }; 00096 00097 #endif
1.5.5