00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00021
00022 #ifndef CHANNEL_H
00023 #define CHANNEL_H
00024
00025 #include <QScriptEngine>
00026
00027 #include "services/channelServices.h"
00028
00029 class Channel : public ChannelServices
00030 {
00031 Q_OBJECT
00032
00033 public:
00034
00035 Q_INVOKABLE Channel( QObject *parent = 0 ) {}
00036
00037 public:
00038
00039
00040
00041 DTC::ChannelInfoList* GetChannelInfoList ( int SourceID,
00042 int StartIndex,
00043 int Count );
00044
00045 DTC::ChannelInfo* GetChannelInfo ( int ChanID );
00046
00047 bool UpdateDBChannel ( uint MplexID,
00048 uint SourceID,
00049 uint ChannelID,
00050 const QString &CallSign,
00051 const QString &ChannelName,
00052 const QString &ChannelNumber,
00053 uint ServiceID,
00054 uint ATSCMajorChannel,
00055 uint ATSCMinorChannel,
00056 bool UseEIT,
00057 bool visible,
00058 const QString &FrequencyID,
00059 const QString &Icon,
00060 const QString &Format,
00061 const QString &XMLTVID,
00062 const QString &DefaultAuthority );
00063
00064 bool AddDBChannel ( uint MplexID,
00065 uint SourceID,
00066 uint ChannelID,
00067 const QString &CallSign,
00068 const QString &ChannelName,
00069 const QString &ChannelNumber,
00070 uint ServiceID,
00071 uint ATSCMajorChannel,
00072 uint ATSCMinorChannel,
00073 bool UseEIT,
00074 bool visible,
00075 const QString &FrequencyID,
00076 const QString &Icon,
00077 const QString &Format,
00078 const QString &XMLTVID,
00079 const QString &DefaultAuthority );
00080
00081 bool RemoveDBChannel ( uint ChannelID );
00082
00083
00084
00085 DTC::VideoSourceList* GetVideoSourceList ( void );
00086
00087 DTC::VideoSource* GetVideoSource ( uint SourceID );
00088
00089 bool UpdateVideoSource ( uint SourceID,
00090 const QString &SourceName,
00091 const QString &Grabber,
00092 const QString &UserId,
00093 const QString &FreqTable,
00094 const QString &LineupId,
00095 const QString &Password,
00096 bool UseEIT,
00097 const QString &ConfigPath,
00098 int NITId );
00099
00100 int AddVideoSource ( const QString &SourceName,
00101 const QString &Grabber,
00102 const QString &UserId,
00103 const QString &FreqTable,
00104 const QString &LineupId,
00105 const QString &Password,
00106 bool UseEIT,
00107 const QString &ConfigPath,
00108 int NITId );
00109
00110 bool RemoveVideoSource ( uint SourceID );
00111
00112 DTC::LineupList* GetDDLineupList ( const QString &Source,
00113 const QString &UserId,
00114 const QString &Password );
00115
00116 int FetchChannelsFromSource( const uint SourceId,
00117 const uint CardId,
00118 bool WaitForFinish );
00119
00120
00121
00122 DTC::VideoMultiplexList* GetVideoMultiplexList ( int SourceID,
00123 int StartIndex,
00124 int Count );
00125
00126 DTC::VideoMultiplex* GetVideoMultiplex ( int MplexID );
00127
00128 QStringList GetXMLTVIdList ( int SourceID );
00129
00130 };
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147 class ScriptableChannel : public QObject
00148 {
00149 Q_OBJECT
00150
00151 private:
00152
00153 Channel m_obj;
00154
00155 public:
00156
00157 Q_INVOKABLE ScriptableChannel( QObject *parent = 0 ) : QObject( parent ) {}
00158
00159 public slots:
00160
00161 QObject* GetChannelInfoList ( int SourceID,
00162 int StartIndex,
00163 int Count )
00164 {
00165 return m_obj.GetChannelInfoList( SourceID, StartIndex, Count );
00166 }
00167
00168 QObject* GetChannelInfo ( int ChanID )
00169 {
00170 return m_obj.GetChannelInfo( ChanID );
00171 }
00172
00173 bool UpdateDBChannel ( uint MplexID,
00174 uint SourceID,
00175 uint ChannelID,
00176 const QString &CallSign,
00177 const QString &ChannelName,
00178 const QString &ChannelNumber,
00179 uint ServiceID,
00180 uint ATSCMajorChannel,
00181 uint ATSCMinorChannel,
00182 bool UseEIT,
00183 bool visible,
00184 const QString &FrequencyID,
00185 const QString &Icon,
00186 const QString &Format,
00187 const QString &XMLTVID,
00188 const QString &DefaultAuthority )
00189 {
00190 return m_obj.UpdateDBChannel(MplexID, SourceID, ChannelID,
00191 CallSign, ChannelName, ChannelNumber,
00192 ServiceID, ATSCMajorChannel, ATSCMinorChannel,
00193 UseEIT, visible, FrequencyID, Icon, Format,
00194 XMLTVID, DefaultAuthority);
00195 }
00196
00197 bool AddDBChannel ( uint MplexID,
00198 uint SourceID,
00199 uint ChannelID,
00200 const QString &CallSign,
00201 const QString &ChannelName,
00202 const QString &ChannelNumber,
00203 uint ServiceID,
00204 uint ATSCMajorChannel,
00205 uint ATSCMinorChannel,
00206 bool UseEIT,
00207 bool visible,
00208 const QString &FrequencyID,
00209 const QString &Icon,
00210 const QString &Format,
00211 const QString &XMLTVID,
00212 const QString &DefaultAuthority )
00213 {
00214 return m_obj.AddDBChannel(MplexID, SourceID, ChannelID,
00215 CallSign, ChannelName, ChannelNumber,
00216 ServiceID, ATSCMajorChannel, ATSCMinorChannel,
00217 UseEIT, visible, FrequencyID, Icon, Format,
00218 XMLTVID, DefaultAuthority);
00219 }
00220
00221 bool RemoveDBChannel ( uint ChannelID )
00222 {
00223 return m_obj.RemoveDBChannel(ChannelID);
00224 }
00225
00226 QObject* GetVideoSourceList ( void )
00227 {
00228 return m_obj.GetVideoSourceList();
00229 }
00230
00231 QObject* GetVideoSource ( uint SourceID )
00232 {
00233 return m_obj.GetVideoSource( SourceID );
00234 }
00235
00236 bool UpdateVideoSource ( uint SourceID,
00237 const QString &SourceName,
00238 const QString &Grabber,
00239 const QString &UserId,
00240 const QString &FreqTable,
00241 const QString &LineupId,
00242 const QString &Password,
00243 bool UseEIT,
00244 const QString &ConfigPath,
00245 int NITId )
00246 {
00247 return m_obj.UpdateVideoSource( SourceID, SourceName, Grabber,
00248 UserId, FreqTable, LineupId, Password,
00249 UseEIT, ConfigPath, NITId );
00250 }
00251
00252 bool AddVideoSource ( const QString &SourceName,
00253 const QString &Grabber,
00254 const QString &UserId,
00255 const QString &FreqTable,
00256 const QString &LineupId,
00257 const QString &Password,
00258 bool UseEIT,
00259 const QString &ConfigPath,
00260 int NITId )
00261 {
00262 return m_obj.AddVideoSource( SourceName, Grabber, UserId,
00263 FreqTable, LineupId, Password,
00264 UseEIT, ConfigPath, NITId );
00265 }
00266
00267 bool RemoveVideoSource ( uint SourceID )
00268 {
00269 return m_obj.RemoveVideoSource( SourceID );
00270 }
00271
00272 QObject* GetVideoMultiplexList ( int SourceID,
00273 int StartIndex,
00274 int Count )
00275 {
00276 return m_obj.GetVideoMultiplexList( SourceID, StartIndex, Count );
00277 }
00278
00279 QObject* GetVideoMultiplex ( int MplexID )
00280 {
00281 return m_obj.GetVideoMultiplex( MplexID );
00282 }
00283
00284 QStringList GetXMLTVIdList ( int SourceID )
00285 {
00286 return m_obj.GetXMLTVIdList(SourceID);
00287 }
00288 };
00289
00290
00291 Q_SCRIPT_DECLARE_QMETAOBJECT( ScriptableChannel, QObject*);
00292
00293 #endif