00001
00002
00003
00004
00005
00006
00007 #ifndef _DTVCHANNEL_H_
00008 #define _DTVCHANNEL_H_
00009
00010
00011 #include <stdint.h>
00012
00013
00014 #include <vector>
00015 using namespace std;
00016
00017
00018 #include <qmutex.h>
00019 #include <qstring.h>
00020
00021
00022 #include "channelbase.h"
00023
00024 typedef pair<uint,uint> pid_cache_item_t;
00025 typedef vector<pid_cache_item_t> pid_cache_t;
00026
00027 class TVRec;
00028
00032 class DTVChannel : public ChannelBase
00033 {
00034 public:
00035 DTVChannel(TVRec *parent);
00036 virtual ~DTVChannel();
00037
00038
00039
00041 virtual bool TuneMultiplex(uint mplexid, QString inputname) = 0;
00043 virtual bool Tune(const DTVMultiplex &tuning, QString inputname) = 0;
00045 virtual bool EnterPowerSavingMode(void) { return true; }
00046
00047
00048
00050 int GetProgramNumber(void) const
00051 { return currentProgramNum; };
00052
00054 uint GetMajorChannel(void) const
00055 { return currentATSCMajorChannel; };
00056
00058 uint GetMinorChannel(void) const
00059 { return currentATSCMinorChannel; };
00060
00062 uint GetOriginalNetworkID(void) const
00063 { return currentOriginalNetworkID; };
00064
00066 uint GetTransportID(void) const
00067 { return currentTransportID; };
00068
00070 QString GetSIStandard(void) const;
00071
00073 QString GetSuggestedTuningMode(bool is_live_tv) const;
00074
00076 QString GetTuningMode(void) const;
00077
00082 virtual void GetCachedPids(pid_cache_t &pid_cache) const
00083 { (void) pid_cache; }
00084
00085 DTVChannel *GetMaster(const QString &videodevice);
00086 const DTVChannel *GetMaster(const QString &videodevice) const;
00087
00088
00089
00091 void SetTuningMode(const QString &tuningmode);
00092
00096 virtual void SaveCachedPids(const pid_cache_t &pid_cache) const
00097 { (void) pid_cache; }
00098
00099 protected:
00101 void SetSIStandard(const QString&);
00102 void SetDTVInfo(uint atsc_major, uint atsc_minor,
00103 uint dvb_orig_netid,
00104 uint mpeg_tsid, int mpeg_pnum);
00105 void ClearDTVInfo(void) { SetDTVInfo(0, 0, 0, 0, -1); }
00106
00107 static void GetCachedPids(int chanid, pid_cache_t&);
00108 static void SaveCachedPids(int chanid, const pid_cache_t&);
00109
00110 protected:
00111 mutable QMutex dtvinfo_lock;
00112
00113 QString sistandard;
00114 QString tuningMode;
00115 int currentProgramNum;
00116 uint currentATSCMajorChannel;
00117 uint currentATSCMinorChannel;
00118 uint currentTransportID;
00119 uint currentOriginalNetworkID;
00120
00121 static QMutex master_map_lock;
00122 static QMap<QString,DTVChannel*> master_map;
00123 };
00124
00125 #endif // _DTVCHANNEL_H_