-
Notifications
You must be signed in to change notification settings - Fork 341
/
channel.h
289 lines (241 loc) · 13.3 KB
/
channel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
//////////////////////////////////////////////////////////////////////////////
// Program Name: channel.h
// Created : Apr. 8, 2011
//
// Copyright (c) 2011 Robert McNamara <rmcnamara@mythtv.org>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or at your option any later version of the LGPL.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library. If not, see <http://www.gnu.org/licenses/>.
//
//////////////////////////////////////////////////////////////////////////////
#ifndef CHANNEL_H
#define CHANNEL_H
#include <QScriptEngine>
#include "services/channelServices.h"
class Channel : public ChannelServices
{
Q_OBJECT
public:
Q_INVOKABLE Channel( QObject *parent = 0 ) {}
public:
/* Channel Methods */
DTC::ChannelInfoList* GetChannelInfoList ( int SourceID,
int StartIndex,
int Count );
DTC::ChannelInfo* GetChannelInfo ( int ChanID );
bool UpdateDBChannel ( uint MplexID,
uint SourceID,
uint ChannelID,
const QString &CallSign,
const QString &ChannelName,
const QString &ChannelNumber,
uint ServiceID,
uint ATSCMajorChannel,
uint ATSCMinorChannel,
bool UseEIT,
bool visible,
const QString &FrequencyID,
const QString &Icon,
const QString &Format,
const QString &XMLTVID,
const QString &DefaultAuthority );
bool CreateDBChannel ( uint MplexID,
uint SourceID,
uint ChannelID,
const QString &CallSign,
const QString &ChannelName,
const QString &ChannelNumber,
uint ServiceID,
uint ATSCMajorChannel,
uint ATSCMinorChannel,
bool UseEIT,
bool visible,
const QString &FrequencyID,
const QString &Icon,
const QString &Format,
const QString &XMLTVID,
const QString &DefaultAuthority );
bool DeleteDBChannel ( uint ChannelID );
/* Video Source Methods */
DTC::VideoSourceList* GetVideoSourceList ( void );
DTC::VideoSource* GetVideoSource ( uint SourceID );
bool UpdateVideoSource ( uint SourceID,
const QString &SourceName,
const QString &Grabber,
const QString &UserId,
const QString &FreqTable,
const QString &LineupId,
const QString &Password,
bool UseEIT,
const QString &ConfigPath,
int NITId );
bool CreateVideoSource ( const QString &SourceName,
const QString &Grabber,
const QString &UserId,
const QString &FreqTable,
const QString &LineupId,
const QString &Password,
bool UseEIT,
const QString &ConfigPath,
int NITId );
bool DeleteVideoSource ( uint SourceID );
DTC::LineupList* GetDDLineups ( const QString &Source,
const QString &UserId,
const QString &Password );
/* Multiplex Methods */
DTC::VideoMultiplexList* GetVideoMultiplexList ( int SourceID,
int StartIndex,
int Count );
DTC::VideoMultiplex* GetVideoMultiplex ( int MplexID );
QStringList GetXMLTVIds ( int SourceID );
};
// --------------------------------------------------------------------------
// The following class wrapper is due to a limitation in Qt Script Engine. It
// requires all methods that return pointers to user classes that are derived from
// QObject actually return QObject* (not the user class *). If the user class pointer
// is returned, the script engine treats it as a QVariant and doesn't create a
// javascript prototype wrapper for it.
//
// This class allows us to keep the rich return types in the main API class while
// offering the script engine a class it can work with.
//
// Only API Classes that return custom classes needs to implement these wrappers.
//
// We should continue to look for a cleaning solution to this problem.
// --------------------------------------------------------------------------
class ScriptableChannel : public QObject
{
Q_OBJECT
private:
Channel m_obj;
public:
Q_INVOKABLE ScriptableChannel( QObject *parent = 0 ) : QObject( parent ) {}
public slots:
QObject* GetChannelInfoList ( int SourceID,
int StartIndex,
int Count )
{
return m_obj.GetChannelInfoList( SourceID, StartIndex, Count );
}
QObject* GetChannelInfo ( int ChanID )
{
return m_obj.GetChannelInfo( ChanID );
}
bool UpdateDBChannel ( uint MplexID,
uint SourceID,
uint ChannelID,
const QString &CallSign,
const QString &ChannelName,
const QString &ChannelNumber,
uint ServiceID,
uint ATSCMajorChannel,
uint ATSCMinorChannel,
bool UseEIT,
bool visible,
const QString &FrequencyID,
const QString &Icon,
const QString &Format,
const QString &XMLTVID,
const QString &DefaultAuthority )
{
return m_obj.UpdateDBChannel(MplexID, SourceID, ChannelID,
CallSign, ChannelName, ChannelNumber,
ServiceID, ATSCMajorChannel, ATSCMinorChannel,
UseEIT, visible, FrequencyID, Icon, Format,
XMLTVID, DefaultAuthority);
}
bool CreateDBChannel ( uint MplexID,
uint SourceID,
uint ChannelID,
const QString &CallSign,
const QString &ChannelName,
const QString &ChannelNumber,
uint ServiceID,
uint ATSCMajorChannel,
uint ATSCMinorChannel,
bool UseEIT,
bool visible,
const QString &FrequencyID,
const QString &Icon,
const QString &Format,
const QString &XMLTVID,
const QString &DefaultAuthority )
{
return m_obj.CreateDBChannel(MplexID, SourceID, ChannelID,
CallSign, ChannelName, ChannelNumber,
ServiceID, ATSCMajorChannel, ATSCMinorChannel,
UseEIT, visible, FrequencyID, Icon, Format,
XMLTVID, DefaultAuthority);
}
bool DeleteDBChannel ( uint ChannelID )
{
return m_obj.DeleteDBChannel(ChannelID);
}
QObject* GetVideoSourceList ( void )
{
return m_obj.GetVideoSourceList();
}
QObject* GetVideoSource ( uint SourceID )
{
return m_obj.GetVideoSource( SourceID );
}
bool UpdateVideoSource ( uint SourceID,
const QString &SourceName,
const QString &Grabber,
const QString &UserId,
const QString &FreqTable,
const QString &LineupId,
const QString &Password,
bool UseEIT,
const QString &ConfigPath,
int NITId )
{
return m_obj.UpdateVideoSource( SourceID, SourceName, Grabber,
UserId, FreqTable, LineupId, Password,
UseEIT, ConfigPath, NITId );
}
bool CreateVideoSource ( const QString &SourceName,
const QString &Grabber,
const QString &UserId,
const QString &FreqTable,
const QString &LineupId,
const QString &Password,
bool UseEIT,
const QString &ConfigPath,
int NITId )
{
return m_obj.CreateVideoSource( SourceName, Grabber, UserId,
FreqTable, LineupId, Password,
UseEIT, ConfigPath, NITId );
}
bool DeleteVideoSource ( uint SourceID )
{
return m_obj.DeleteVideoSource( SourceID );
}
QObject* GetVideoMultiplexList ( int SourceID,
int StartIndex,
int Count )
{
return m_obj.GetVideoMultiplexList( SourceID, StartIndex, Count );
}
QObject* GetVideoMultiplex ( int MplexID )
{
return m_obj.GetVideoMultiplex( MplexID );
}
QStringList GetXMLTVIds ( int SourceID )
{
return m_obj.GetXMLTVIds(SourceID);
}
};
Q_SCRIPT_DECLARE_QMETAOBJECT( ScriptableChannel, QObject*);
#endif