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 
38 #define CHANNEL_SERVICE QString("/Channel/")
39 #define CHANNEL_HANDLE QString("Channel")
40 
41 
42 class V2Channel : public MythHTTPService
43 {
44  Q_OBJECT
45  Q_CLASSINFO("Version", "1.12")
46  Q_CLASSINFO("UpdateDBChannel", "methods=POST;name=bool")
47  Q_CLASSINFO("AddDBChannel", "methods=POST;name=bool")
48  Q_CLASSINFO("RemoveDBChannel", "methods=POST;name=bool")
49  Q_CLASSINFO("UpdateVideoSource", "methods=POST;name=bool")
50  Q_CLASSINFO("AddVideoSource", "methods=POST;name=int")
51  Q_CLASSINFO("RemoveAllVideoSources", "methods=POST;name=bool")
52  Q_CLASSINFO("RemoveVideoSource", "methods=POST;name=bool")
53  Q_CLASSINFO("FetchChannelsFromSource","methods=GET,POST;name=int")
54  Q_CLASSINFO("GetAvailableChanid", "methods=GET,POST;name=int")
55  Q_CLASSINFO("GetXMLTVIdList", "methods=GET,POST,HEAD;name=StringList")
56  Q_CLASSINFO("StartScan", "methods=POST;name=bool")
57  Q_CLASSINFO("StopScan", "methods=POST;name=bool")
58  Q_CLASSINFO("SendScanDialogResponse", "methods=POST;name=bool")
59 
60  public:
61  V2Channel();
62  ~V2Channel() override = default;
63  static void RegisterCustomTypes();
64 
65  public slots:
66 
67  /* Channel Methods */
68 
70  uint ChannelGroupID,
71  uint StartIndex,
72  uint Count,
73  bool OnlyVisible,
74  bool Details,
75  bool OrderByName,
76  bool GroupByCallsign,
77  bool OnlyTunable );
78 
79  static V2ChannelInfo* GetChannelInfo ( uint ChanID );
80 
81  bool UpdateDBChannel ( uint MplexID,
82  uint SourceID,
84  const QString &CallSign,
85  const QString &ChannelName,
86  const QString &ChannelNumber,
88  uint ATSCMajorChannel,
89  uint ATSCMinorChannel,
90  bool UseEIT,
91  bool Visible,
92  const QString &ExtendedVisible,
93  const QString &FrequencyID,
94  const QString &Icon,
95  const QString &Format,
96  const QString &XMLTVID,
97  const QString &DefaultAuthority,
98  uint ServiceType,
99  int RecPriority,
100  int TimeOffset,
101  int CommMethod );
102 
103  bool AddDBChannel ( uint MplexID,
104  uint SourceID,
105  uint ChannelID,
106  const QString &CallSign,
107  const QString &ChannelName,
108  const QString &ChannelNumber,
109  uint ServiceID,
110  uint ATSCMajorChannel,
111  uint ATSCMinorChannel,
112  bool UseEIT,
113  bool Visible,
114  const QString &ExtendedVisible,
115  const QString &FrequencyID,
116  const QString &Icon,
117  const QString &Format,
118  const QString &XMLTVID,
119  const QString &DefaultAuthority,
120  uint ServiceType,
121  int RecPriority,
122  int TimeOffset,
123  int CommMethod );
124 
125  static bool RemoveDBChannel ( uint ChannelID );
126 
127  static uint GetAvailableChanid ( void );
128 
129  static V2CommMethodList* GetCommMethodList ( void );
130 
131  /* Video Source Methods */
132 
133  static V2VideoSourceList* GetVideoSourceList ( void );
134 
136 
138  const QString &SourceName,
139  const QString &Grabber,
140  const QString &UserId,
141  const QString &FreqTable,
142  const QString &LineupId,
143  const QString &Password,
144  bool UseEIT,
145  const QString &ConfigPath,
146  int NITId,
147  uint BouquetId,
148  uint RegionId,
150  uint LCNOffset );
151 
152  static int AddVideoSource ( const QString &SourceName,
153  const QString &Grabber,
154  const QString &UserId,
155  const QString &FreqTable,
156  const QString &LineupId,
157  const QString &Password,
158  bool UseEIT,
159  const QString &ConfigPath,
160  int NITId,
161  uint BouquetId,
162  uint RegionId,
164  uint LCNOffset );
165 
166  static bool RemoveAllVideoSources ( void );
167  static bool RemoveVideoSource ( uint SourceID );
168 
169  static V2LineupList* GetDDLineupList ( const QString &Source,
170  const QString &UserId,
171  const QString &Password );
172 
173  static int FetchChannelsFromSource( uint SourceId,
174  uint CardId,
175  bool WaitForFinish );
176 
177  /* Multiplex Methods */
178 
180  uint StartIndex,
181  uint Count );
182 
183  static V2VideoMultiplex* GetVideoMultiplex ( uint MplexID );
184 
185  static QStringList GetXMLTVIdList ( uint SourceID );
186 
187  static V2GrabberList* GetGrabberList ( );
188 
189  static QStringList GetFreqTableList ( );
190 
191  static bool StartScan ( uint CardId,
192  const QString &DesiredServices,
193  bool FreeToAirOnly,
194  bool ChannelNumbersOnly,
196  bool FullChannelSearch,
197  bool RemoveDuplicates,
198  bool AddFullTS,
199  bool TestDecryptable,
200  const QString &ScanType,
201  const QString &FreqTable,
202  const QString &Modulation,
203  const QString &FirstChan,
204  const QString &LastChan,
205  uint ScanId,
206  bool IgnoreSignalTimeout,
207  bool FollowNITSetting,
208  uint MplexId,
209  const QString &Frequency,
210  const QString &Bandwidth,
211  const QString &Polarity,
212  const QString &SymbolRate,
213  const QString &Inversion,
214  const QString &Constellation,
215  const QString &ModSys,
216  const QString &CodeRateLP,
217  const QString &CodeRateHP,
218  const QString &FEC,
219  const QString &TransmissionMode,
220  const QString &GuardInterval,
221  const QString &Hierarchy,
222  const QString &RollOff);
223 
224  static V2ScanStatus* GetScanStatus ( );
225 
226  static bool StopScan ( uint Cardid);
227 
228  static V2ScanList* GetScanList ( uint SourceId);
229 
230  static bool SendScanDialogResponse ( uint Cardid,
231  const QString &DialogString,
232  int DialogButton );
233 
234  private:
235  Q_DISABLE_COPY(V2Channel)
236 
237 };
238 
239 
240 #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:349
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:196
UseEIT
Definition: videosource.cpp:599
V2Channel
Definition: v2channel.h:42
V2Channel::RemoveVideoSource
static bool RemoveVideoSource(uint SourceID)
Definition: v2channel.cpp:640
V2Channel::StopScan
static bool StopScan(uint Cardid)
Definition: v2channel.cpp:1106
V2VideoSourceList
Definition: v2videoSourceList.h:12
V2Channel::GetScanList
static V2ScanList * GetScanList(uint SourceId)
Definition: v2channel.cpp:1115
MythDate::Format
Format
Definition: mythdate.h:15
SourceID
Definition: videosource.cpp:2876
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:1013
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:101
V2Channel::GetScanStatus
static V2ScanStatus * GetScanStatus()
Definition: v2channel.cpp:1085
IgnoreSignalTimeout
Definition: channelscanmiscsettings.h:52
V2Channel::GetGrabberList
static V2GrabberList * GetGrabberList()
Definition: v2channel.cpp:937
ChannelID
Definition: channelsettings.h:20
v2commMethod.h
V2ChannelInfoList
Definition: v2channelInfoList.h:10
ServiceID
Definition: channelsettings.cpp:337
v2channelScan.h
LCNOffset
Definition: videosource.cpp:489
Source
Definition: channelsettings.cpp:93
V2Channel::GetVideoMultiplex
static V2VideoMultiplex * GetVideoMultiplex(uint MplexID)
Definition: v2channel.cpp:821
V2Channel::GetXMLTVIdList
static QStringList GetXMLTVIdList(uint SourceID)
Definition: v2channel.cpp:883
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:607
V2Channel::GetAvailableChanid
static uint GetAvailableChanid(void)
Definition: v2channel.cpp:294
FreqTable
static GlobalComboBoxSetting * FreqTable()
Definition: backendsettings.cpp:251
v2channelInfoList.h
ScanFrequency
Definition: channelscanmiscsettings.h:279
V2Channel::V2Channel
V2Channel()
Definition: v2channel.cpp:95
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:492
V2Channel::GetChannelInfo
static V2ChannelInfo * GetChannelInfo(uint ChanID)
Definition: v2channel.cpp:179
V2Channel::GetVideoSource
static V2VideoSource * GetVideoSource(uint SourceID)
Definition: v2channel.cpp:438
V2Channel::SendScanDialogResponse
static bool SendScanDialogResponse(uint Cardid, const QString &DialogString, int DialogButton)
Definition: v2channel.cpp:1131
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:311
FollowNITSetting
Definition: channelscanmiscsettings.h:65
V2Channel::RemoveAllVideoSources
static bool RemoveAllVideoSources(void)
Definition: v2channel.cpp:633
TimeOffset
Definition: channelsettings.cpp:199
mythhttpservice.h
V2ScanList
Definition: v2channelScan.h:62
ChannelNumbersOnly
Definition: channelscanmiscsettings.h:123
v2videoSourceList.h
Frequency
Definition: transporteditor.cpp:466
V2Channel::GetDDLineupList
static V2LineupList * GetDDLineupList(const QString &Source, const QString &UserId, const QString &Password)
Definition: v2channel.cpp:651
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:663
V2LineupList
Definition: v2lineup.h:56
V2GrabberList
Definition: v2grabber.h:48
V2Channel::GetVideoSourceList
static V2VideoSourceList * GetVideoSourceList(void)
Definition: v2channel.cpp:379
V2Channel::GetFreqTableList
static QStringList GetFreqTableList()
Definition: v2channel.cpp:1000
V2VideoMultiplex
Definition: v2videoMultiplex.h:12
Icon
Definition: channelsettings.cpp:233
FreeToAirOnly
Definition: channelscanmiscsettings.h:109
V2Channel::GetVideoMultiplexList
static V2VideoMultiplexList * GetVideoMultiplexList(uint SourceID, uint StartIndex, uint Count)
Definition: v2channel.cpp:694
RollOff
Definition: transporteditor.cpp:832
V2ScanStatus
Definition: v2channelScan.h:6
V2Channel::~V2Channel
~V2Channel() override=default
v2grabber.h
V2VideoSource
Definition: v2videoSource.h:10
V2ChannelInfo
Definition: v2programAndChannel.h:27
V2Channel::GetCommMethodList
static V2CommMethodList * GetCommMethodList(void)
Definition: v2channel.cpp:357
AddFullTS
Definition: channelscanmiscsettings.h:190