MythTV  master
v2channel.h
Go to the documentation of this file.
1 // Program Name: channel.h
3 // Created : Apr. 8, 2011
4 //
5 // Copyright (c) 2011 Robert McNamara <rmcnamara@mythtv.org>
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 2 of the License, or
10 // (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, see <http://www.gnu.org/licenses/>.
23 //
25 
26 #ifndef V2CHANNEL_H
27 #define V2CHANNEL_H
28 
30 #include "v2channelInfoList.h"
31 #include "v2videoSourceList.h"
32 #include "v2videoMultiplexList.h"
33 #include "v2lineup.h"
34 #include "v2grabber.h"
35 #include "v2commMethod.h"
36 #include "v2channelScan.h"
37 #include "v2channelRestore.h"
38 
39 #define CHANNEL_SERVICE QString("/Channel/")
40 #define CHANNEL_HANDLE QString("Channel")
41 
42 
43 class V2Channel : public MythHTTPService
44 {
45  Q_OBJECT
46  Q_CLASSINFO("Version", "1.12")
47  Q_CLASSINFO("UpdateDBChannel", "methods=POST;name=bool")
48  Q_CLASSINFO("AddDBChannel", "methods=POST;name=bool")
49  Q_CLASSINFO("RemoveDBChannel", "methods=POST;name=bool")
50  Q_CLASSINFO("UpdateVideoSource", "methods=POST;name=bool")
51  Q_CLASSINFO("AddVideoSource", "methods=POST;name=int")
52  Q_CLASSINFO("RemoveAllVideoSources", "methods=POST;name=bool")
53  Q_CLASSINFO("RemoveVideoSource", "methods=POST;name=bool")
54  Q_CLASSINFO("FetchChannelsFromSource","methods=GET,POST;name=int")
55  Q_CLASSINFO("GetAvailableChanid", "methods=GET,POST;name=int")
56  Q_CLASSINFO("GetXMLTVIdList", "methods=GET,POST,HEAD;name=StringList")
57  Q_CLASSINFO("StartScan", "methods=POST;name=bool")
58  Q_CLASSINFO("StopScan", "methods=POST;name=bool")
59  Q_CLASSINFO("SendScanDialogResponse", "methods=POST;name=bool")
60  Q_CLASSINFO("SaveRestoreData", "methods=POST;name=bool")
61  Q_CLASSINFO("CopyIconToBackend", "methods=POST")
62 
63  public:
64  V2Channel();
65  ~V2Channel() override = default;
66  static void RegisterCustomTypes();
67 
68  public slots:
69 
70  /* Channel Methods */
71 
73  uint ChannelGroupID,
74  uint StartIndex,
75  uint Count,
76  bool OnlyVisible,
77  bool Details,
78  bool OrderByName,
79  bool GroupByCallsign,
80  bool OnlyTunable );
81 
82  static V2ChannelInfo* GetChannelInfo ( uint ChanID );
83 
84  bool UpdateDBChannel ( uint MplexID,
85  uint SourceID,
87  const QString &CallSign,
88  const QString &ChannelName,
89  const QString &ChannelNumber,
91  uint ATSCMajorChannel,
92  uint ATSCMinorChannel,
93  bool UseEIT,
94  bool Visible,
95  const QString &ExtendedVisible,
96  const QString &FrequencyID,
97  const QString &Icon,
98  const QString &Format,
99  const QString &XMLTVID,
100  const QString &DefaultAuthority,
101  uint ServiceType,
102  int RecPriority,
103  int TimeOffset,
104  int CommMethod );
105 
106  bool AddDBChannel ( uint MplexID,
107  uint SourceID,
108  uint ChannelID,
109  const QString &CallSign,
110  const QString &ChannelName,
111  const QString &ChannelNumber,
112  uint ServiceID,
113  uint ATSCMajorChannel,
114  uint ATSCMinorChannel,
115  bool UseEIT,
116  bool Visible,
117  const QString &ExtendedVisible,
118  const QString &FrequencyID,
119  const QString &Icon,
120  const QString &Format,
121  const QString &XMLTVID,
122  const QString &DefaultAuthority,
123  uint ServiceType,
124  int RecPriority,
125  int TimeOffset,
126  int CommMethod );
127 
128  static bool RemoveDBChannel ( uint ChannelID );
129 
130  static uint GetAvailableChanid ( void );
131 
132  static V2CommMethodList* GetCommMethodList ( void );
133 
134  /* Video Source Methods */
135 
136  static V2VideoSourceList* GetVideoSourceList ( void );
137 
139 
141  const QString &SourceName,
142  const QString &Grabber,
143  const QString &UserId,
144  const QString &FreqTable,
145  const QString &LineupId,
146  const QString &Password,
147  bool UseEIT,
148  const QString &ConfigPath,
149  int NITId,
150  uint BouquetId,
151  uint RegionId,
153  uint LCNOffset );
154 
155  static int AddVideoSource ( const QString &SourceName,
156  const QString &Grabber,
157  const QString &UserId,
158  const QString &FreqTable,
159  const QString &LineupId,
160  const QString &Password,
161  bool UseEIT,
162  const QString &ConfigPath,
163  int NITId,
164  uint BouquetId,
165  uint RegionId,
167  uint LCNOffset );
168 
169  static bool RemoveAllVideoSources ( void );
170  static bool RemoveVideoSource ( uint SourceID );
171 
172  static V2LineupList* GetDDLineupList ( const QString &Source,
173  const QString &UserId,
174  const QString &Password );
175 
176  static int FetchChannelsFromSource( uint SourceId,
177  uint CardId,
178  bool WaitForFinish );
179 
180  /* Multiplex Methods */
181 
183  uint StartIndex,
184  uint Count );
185 
186  static V2VideoMultiplex* GetVideoMultiplex ( uint MplexID );
187 
188  static QStringList GetXMLTVIdList ( uint SourceID );
189 
190  static V2GrabberList* GetGrabberList ( );
191 
192  static QStringList GetFreqTableList ( );
193 
194  static bool StartScan ( uint CardId,
195  const QString &DesiredServices,
196  bool FreeToAirOnly,
197  bool ChannelNumbersOnly,
199  bool FullChannelSearch,
200  bool RemoveDuplicates,
201  bool AddFullTS,
202  bool TestDecryptable,
203  const QString &ScanType,
204  const QString &FreqTable,
205  const QString &Modulation,
206  const QString &FirstChan,
207  const QString &LastChan,
208  uint ScanId,
209  bool IgnoreSignalTimeout,
210  bool FollowNITSetting,
211  uint MplexId,
212  const QString &Frequency,
213  const QString &Bandwidth,
214  const QString &Polarity,
215  const QString &SymbolRate,
216  const QString &Inversion,
217  const QString &Constellation,
218  const QString &ModSys,
219  const QString &CodeRateLP,
220  const QString &CodeRateHP,
221  const QString &FEC,
222  const QString &TransmissionMode,
223  const QString &GuardInterval,
224  const QString &Hierarchy,
225  const QString &RollOff);
226 
227  static V2ScanStatus* GetScanStatus ( );
228 
229  static bool StopScan ( uint Cardid);
230 
231  static V2ScanList* GetScanList ( uint SourceId);
232 
233  static bool SendScanDialogResponse ( uint Cardid,
234  const QString &DialogString,
235  int DialogButton );
236 
237  static V2ChannelRestore* GetRestoreData ( uint SourceId,
238  bool XmltvId,
239  bool Icon,
240  bool Visible);
241 
242  static bool SaveRestoreData ( uint SourceId);
243 
244  static bool CopyIconToBackend ( const QString& Url,
245  const QString& ChanId);
246  private:
247  Q_DISABLE_COPY(V2Channel)
248 
249 };
250 
251 
252 #endif
Password
static StandardSetting * Password(bool enabled)
Setting for changing password.
Definition: galleryconfig.cpp:245
V2Channel::RemoveDBChannel
static bool RemoveDBChannel(uint ChannelID)
Definition: v2channel.cpp:354
V2CommMethodList
Definition: v2commMethod.h:45
CommMethod
Definition: channelsettings.cpp:393
RemoveDuplicates
Definition: channelscanmiscsettings.h:174
v2videoMultiplexList.h
v2lineup.h
CompleteChannelsOnly
Definition: channelscanmiscsettings.h:139
V2Channel::UpdateDBChannel
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 &ExtendedVisible, const QString &FrequencyID, const QString &Icon, const QString &Format, const QString &XMLTVID, const QString &DefaultAuthority, uint ServiceType, int RecPriority, int TimeOffset, int CommMethod)
Definition: v2channel.cpp:201
V2Channel::CopyIconToBackend
static bool CopyIconToBackend(const QString &Url, const QString &ChanId)
Definition: v2channel.cpp:1180
UseEIT
Definition: videosource.cpp:594
V2Channel
Definition: v2channel.h:43
V2Channel::RemoveVideoSource
static bool RemoveVideoSource(uint SourceID)
Definition: v2channel.cpp:645
V2Channel::StopScan
static bool StopScan(uint Cardid)
Definition: v2channel.cpp:1111
V2VideoSourceList
Definition: v2videoSourceList.h:12
V2Channel::GetScanList
static V2ScanList * GetScanList(uint SourceId)
Definition: v2channel.cpp:1120
MythDate::Format
Format
Definition: mythdate.h:15
SourceID
Definition: videosource.cpp:2860
V2Channel::StartScan
static bool StartScan(uint CardId, const QString &DesiredServices, bool FreeToAirOnly, bool ChannelNumbersOnly, bool CompleteChannelsOnly, bool FullChannelSearch, bool RemoveDuplicates, bool AddFullTS, bool TestDecryptable, const QString &ScanType, const QString &FreqTable, const QString &Modulation, const QString &FirstChan, const QString &LastChan, uint ScanId, bool IgnoreSignalTimeout, bool FollowNITSetting, uint MplexId, const QString &Frequency, const QString &Bandwidth, const QString &Polarity, const QString &SymbolRate, const QString &Inversion, const QString &Constellation, const QString &ModSys, const QString &CodeRateLP, const QString &CodeRateHP, const QString &FEC, const QString &TransmissionMode, const QString &GuardInterval, const QString &Hierarchy, const QString &RollOff)
Definition: v2channel.cpp:1018
V2Channel::RegisterCustomTypes
static void RegisterCustomTypes()
Visible
Definition: channelsettings.cpp:416
V2Channel::GetChannelInfoList
static V2ChannelInfoList * GetChannelInfoList(uint SourceID, uint ChannelGroupID, uint StartIndex, uint Count, bool OnlyVisible, bool Details, bool OrderByName, bool GroupByCallsign, bool OnlyTunable)
Definition: v2channel.cpp:106
V2Channel::GetScanStatus
static V2ScanStatus * GetScanStatus()
Definition: v2channel.cpp:1090
IgnoreSignalTimeout
Definition: channelscanmiscsettings.h:52
V2Channel::GetGrabberList
static V2GrabberList * GetGrabberList()
Definition: v2channel.cpp:947
ChannelID
Definition: channelsettings.h:20
v2commMethod.h
V2ChannelInfoList
Definition: v2channelInfoList.h:10
ServiceID
Definition: channelsettings.cpp:337
v2channelScan.h
LCNOffset
Definition: videosource.cpp:484
Source
Definition: channelsettings.cpp:93
V2Channel::GetVideoMultiplex
static V2VideoMultiplex * GetVideoMultiplex(uint MplexID)
Definition: v2channel.cpp:831
V2Channel::GetXMLTVIdList
static QStringList GetXMLTVIdList(uint SourceID)
Definition: v2channel.cpp:893
V2Channel::AddVideoSource
static int AddVideoSource(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, uint BouquetId, uint RegionId, uint ScanFrequency, uint LCNOffset)
Definition: v2channel.cpp:612
V2Channel::GetAvailableChanid
static uint GetAvailableChanid(void)
Definition: v2channel.cpp:299
FreqTable
static GlobalComboBoxSetting * FreqTable()
Definition: backendsettings.cpp:251
v2channelInfoList.h
ScanFrequency
Definition: channelscanmiscsettings.h:280
V2Channel::V2Channel
V2Channel()
Definition: v2channel.cpp:100
V2Channel::UpdateVideoSource
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, uint BouquetId, uint RegionId, uint ScanFrequency, uint LCNOffset)
Definition: v2channel.cpp:497
V2Channel::GetChannelInfo
static V2ChannelInfo * GetChannelInfo(uint ChanID)
Definition: v2channel.cpp:184
V2Channel::GetVideoSource
static V2VideoSource * GetVideoSource(uint SourceID)
Definition: v2channel.cpp:443
V2Channel::SendScanDialogResponse
static bool SendScanDialogResponse(uint Cardid, const QString &DialogString, int DialogButton)
Definition: v2channel.cpp:1136
uint
unsigned int uint
Definition: compat.h:81
FullChannelSearch
Definition: channelscanmiscsettings.h:157
MythHTTPService
Definition: mythhttpservice.h:19
V2Channel::AddDBChannel
bool AddDBChannel(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 &ExtendedVisible, const QString &FrequencyID, const QString &Icon, const QString &Format, const QString &XMLTVID, const QString &DefaultAuthority, uint ServiceType, int RecPriority, int TimeOffset, int CommMethod)
Definition: v2channel.cpp:316
FollowNITSetting
Definition: channelscanmiscsettings.h:65
V2Channel::RemoveAllVideoSources
static bool RemoveAllVideoSources(void)
Definition: v2channel.cpp:638
TimeOffset
Definition: channelsettings.cpp:199
mythhttpservice.h
V2ScanList
Definition: v2channelScan.h:62
ChannelNumbersOnly
Definition: channelscanmiscsettings.h:123
V2Channel::GetRestoreData
static V2ChannelRestore * GetRestoreData(uint SourceId, bool XmltvId, bool Icon, bool Visible)
Definition: v2channel.cpp:1154
v2videoSourceList.h
Frequency
Definition: transporteditor.cpp:466
V2Channel::GetDDLineupList
static V2LineupList * GetDDLineupList(const QString &Source, const QString &UserId, const QString &Password)
Definition: v2channel.cpp:656
V2VideoMultiplexList
Definition: v2videoMultiplexList.h:11
Modulation
Definition: transporteditor.cpp:541
DesiredServices
Definition: channelscanmiscsettings.h:79
V2Channel::FetchChannelsFromSource
static int FetchChannelsFromSource(uint SourceId, uint CardId, bool WaitForFinish)
Definition: v2channel.cpp:668
V2LineupList
Definition: v2lineup.h:56
V2GrabberList
Definition: v2grabber.h:48
V2Channel::GetVideoSourceList
static V2VideoSourceList * GetVideoSourceList(void)
Definition: v2channel.cpp:384
V2Channel::GetFreqTableList
static QStringList GetFreqTableList()
Definition: v2channel.cpp:1005
V2VideoMultiplex
Definition: v2videoMultiplex.h:12
Icon
Definition: channelsettings.cpp:233
v2channelRestore.h
FreeToAirOnly
Definition: channelscanmiscsettings.h:109
V2Channel::GetVideoMultiplexList
static V2VideoMultiplexList * GetVideoMultiplexList(uint SourceID, uint StartIndex, uint Count)
Definition: v2channel.cpp:699
RollOff
Definition: transporteditor.cpp:832
V2ScanStatus
Definition: v2channelScan.h:6
V2Channel::~V2Channel
~V2Channel() override=default
V2ChannelRestore
Definition: v2channelRestore.h:19
v2grabber.h
V2VideoSource
Definition: v2videoSource.h:10
V2Channel::SaveRestoreData
static bool SaveRestoreData(uint SourceId)
Definition: v2channel.cpp:1171
V2ChannelInfo
Definition: v2programAndChannel.h:27
V2Channel::GetCommMethodList
static V2CommMethodList * GetCommMethodList(void)
Definition: v2channel.cpp:362
AddFullTS
Definition: channelscanmiscsettings.h:190