MythTV  master
channelscanner.h
Go to the documentation of this file.
1 /* -*- Mode: c++ -*-
2  * vim: set expandtab tabstop=4 shiftwidth=4:
3  *
4  * Original Project
5  * MythTV http://www.mythtv.org
6  *
7  * Copyright (c) 2004, 2005 John Pullan <john@pullan.org>
8  * Copyright (c) 2005 - 2007 Daniel Kristjansson
9  *
10  * Description:
11  * Collection of classes to provide channel scanning functionallity
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
26  * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
27  *
28  */
29 
30 #ifndef CHANNEL_SCANNER_H
31 #define CHANNEL_SCANNER_H
32 
33 // Qt headers
34 #include <QCoreApplication>
35 
36 // MythTV headers
38 #include "libmythtv/mythtvexp.h"
39 
40 #include "iptvchannelfetcher.h"
41 #include "scanmonitor.h"
42 #include "channelscantypes.h"
43 
44 #ifdef USING_VBOX
45 #include "vboxchannelfetcher.h"
46 #endif
47 
48 #if !defined( USING_MINGW ) && !defined( _MSC_VER )
49 #include "externrecscanner.h"
50 #endif
51 
52 #ifdef USING_HDHOMERUN
53 #include "hdhrchannelfetcher.h"
54 #endif
55 
56 class ScanMonitor;
57 class IPTVChannelFetcher;
58 class ExternRecChannelFetcher;
59 class ChannelScanSM;
60 class ChannelBase;
61 
62 // Not (yet?) implemented from old scanner
63 // do_delete_channels, do_rename_channels, atsc_format
64 // TODO implement deletion of stale channels..
65 
67 {
68  Q_DECLARE_TR_FUNCTIONS(ChannelScanner)
69 
70  friend class ScanMonitor;
71 
72  public:
74  virtual ~ChannelScanner();
75 
76  void Scan(int scantype,
77  uint cardid,
78  const QString &inputname,
79  uint sourceid,
80  bool do_ignore_signal_timeout,
81  bool do_follow_nit,
82  bool do_test_decryption,
83  bool do_fta_only,
84  bool do_lcn_only,
85  bool do_complete_only,
86  bool do_full_channel_search,
87  bool do_remove_duplicates,
88  bool do_add_full_ts,
89  ServiceRequirements service_requirements,
90  // stuff needed for particular scans
91  uint mplexid,
92  const QMap<QString,QString> &startChan,
93  const QString &freq_std,
94  const QString &mod,
95  const QString &tbl,
96  const QString &tbl_start = QString(),
97  const QString &tbl_end = QString());
98 
99  virtual DTVConfParser::return_t ImportDVBUtils(
100  uint sourceid, int cardtype, const QString &file);
101 
102  virtual bool ImportM3U(uint cardid, const QString &inputname,
103  uint sourceid, bool is_mpts);
104  virtual bool ImportVBox(uint cardid, const QString &inputname, uint sourceid,
105  bool ftaOnly, ServiceRequirements serviceType);
106  virtual bool ImportExternRecorder(uint cardid, const QString &inputname,
107  uint sourceid);
108  virtual bool ImportHDHR(uint cardid, const QString &inputname, uint sourceid,
109  ServiceRequirements serviceType);
110 
111  protected:
112  virtual void Teardown(void);
113 
114  virtual void PreScanCommon(
115  int scantype, uint cardid,
116  const QString &inputname,
117  uint sourceid, bool do_ignore_signal_timeout,
118  bool do_test_decryption);
119 
120  virtual void MonitorProgress(
121  bool /*lock*/, bool /*strength*/, bool /*snr*/, bool /*rotor*/) { }
122 
123  virtual void HandleEvent(const ScannerEvent*) = 0;
124  virtual void InformUser(const QString &/*error*/) = 0;
125 
126  protected:
127  ScanMonitor *m_scanMonitor {nullptr};
128  ChannelBase *m_channel {nullptr};
129 
130  // Low level channel scanners
131  ChannelScanSM *m_sigmonScanner {nullptr};
132  IPTVChannelFetcher *m_iptvScanner {nullptr};
133 
137 
138  // vbox support
139 #ifdef USING_VBOX
140  VBoxChannelFetcher *m_vboxScanner {nullptr};
141 #endif
142 #if !defined( USING_MINGW ) && !defined( _MSC_VER )
143  ExternRecChannelScanner *m_externRecScanner {nullptr};
144 #endif
145  // HDHomeRun channel list import
146 #ifdef USING_HDHOMERUN
147  HDHRChannelFetcher *m_hdhrScanner {nullptr};
148 #endif
149 
151  bool m_freeToAirOnly {false};
152 
154  bool m_channelNumbersOnly {false};
155 
157  bool m_completeOnly {false};
158 
160  bool m_fullSearch {false};
161 
163  bool m_removeDuplicates {false};
164 
166  bool m_addFullTS {false};
167 
168  int m_sourceid {-1};
169 
171  ServiceRequirements m_serviceRequirements {kRequireAV};
172 };
173 
174 #endif // CHANNEL_SCANNER_H
kRequireAV
@ kRequireAV
Definition: channelscantypes.h:9
ChannelScanner::m_channels
DTVChannelList m_channels
imported channels
Definition: channelscanner.h:135
VBoxChannelFetcher
Definition: vboxchannelfetcher.h:64
mythtvexp.h
ChannelScanner::m_iptvChannels
fbox_chan_map_t m_iptvChannels
Definition: channelscanner.h:136
build_compdb.file
file
Definition: build_compdb.py:55
scanmonitor.h
DTVChannelList
std::vector< DTVTransport > DTVChannelList
Definition: dtvconfparser.h:68
ExternRecChannelScanner
Definition: externrecscanner.h:22
HDHRChannelFetcher
Definition: hdhrchannelfetcher.h:92
ChannelBase
Abstract class providing a generic interface to tuning hardware.
Definition: channelbase.h:31
channelscantypes.h
IPTVChannelFetcher
Definition: iptvchannelfetcher.h:64
DTVConfParser
Parses dvb-utils channel scanner output files.
Definition: dtvconfparser.h:73
ChannelScanner
Definition: channelscanner.h:66
ChannelScanSM
Scanning class for cards that support a SignalMonitor class.
Definition: channelscan_sm.h:86
uint
unsigned int uint
Definition: compat.h:81
ScannerEvent
Definition: scanmonitor.h:86
MTV_PUBLIC
#define MTV_PUBLIC
Definition: mythtvexp.h:15
hdhrchannelfetcher.h
externrecscanner.h
dtvconfparser.h
ServiceRequirements
ServiceRequirements
Definition: channelscantypes.h:4
iptvchannelfetcher.h
fbox_chan_map_t
QMap< QString, IPTVChannelInfo > fbox_chan_map_t
Definition: iptvchannelfetcher.h:62
ScanMonitor
Definition: scanmonitor.h:44
vboxchannelfetcher.h