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 class ScanMonitor;
53 class IPTVChannelFetcher;
54 class ExternRecChannelFetcher;
55 class ChannelScanSM;
56 class ChannelBase;
57 
58 // Not (yet?) implemented from old scanner
59 // do_delete_channels, do_rename_channels, atsc_format
60 // TODO implement deletion of stale channels..
61 
63 {
64  Q_DECLARE_TR_FUNCTIONS(ChannelScanner)
65 
66  friend class ScanMonitor;
67 
68  public:
70  virtual ~ChannelScanner();
71 
72  void Scan(int scantype,
73  uint cardid,
74  const QString &inputname,
75  uint sourceid,
76  bool do_ignore_signal_timeout,
77  bool do_follow_nit,
78  bool do_test_decryption,
79  bool do_fta_only,
80  bool do_lcn_only,
81  bool do_complete_only,
82  bool do_full_channel_search,
83  bool do_remove_duplicates,
84  bool do_add_full_ts,
85  ServiceRequirements service_requirements,
86  // stuff needed for particular scans
87  uint mplexid,
88  const QMap<QString,QString> &startChan,
89  const QString &freq_std,
90  const QString &mod,
91  const QString &tbl,
92  const QString &tbl_start = QString(),
93  const QString &tbl_end = QString());
94 
95  virtual DTVConfParser::return_t ImportDVBUtils(
96  uint sourceid, int cardtype, const QString &file);
97 
98  virtual bool ImportM3U(uint cardid, const QString &inputname,
99  uint sourceid, bool is_mpts);
100  virtual bool ImportVBox(uint cardid, const QString &inputname, uint sourceid,
101  bool ftaOnly, ServiceRequirements serviceType);
102  virtual bool ImportExternRecorder(uint cardid, const QString &inputname,
103  uint sourceid);
104 
105  protected:
106  virtual void Teardown(void);
107 
108  virtual void PreScanCommon(
109  int scantype, uint cardid,
110  const QString &inputname,
111  uint sourceid, bool do_ignore_signal_timeout,
112  bool do_test_decryption);
113 
114  virtual void MonitorProgress(
115  bool /*lock*/, bool /*strength*/, bool /*snr*/, bool /*rotor*/) { }
116 
117  virtual void HandleEvent(const ScannerEvent*) = 0;
118  virtual void InformUser(const QString &/*error*/) = 0;
119 
120  protected:
121  ScanMonitor *m_scanMonitor {nullptr};
122  ChannelBase *m_channel {nullptr};
123 
124  // Low level channel scanners
125  ChannelScanSM *m_sigmonScanner {nullptr};
126  IPTVChannelFetcher *m_iptvScanner {nullptr};
127 
131 
132  // vbox support
133 #ifdef USING_VBOX
134  VBoxChannelFetcher *m_vboxScanner {nullptr};
135 #endif
136 #if !defined( USING_MINGW ) && !defined( _MSC_VER )
137  ExternRecChannelScanner *m_externRecScanner {nullptr};
138 #endif
139 
141  bool m_freeToAirOnly {false};
142 
144  bool m_channelNumbersOnly {false};
145 
147  bool m_completeOnly {false};
148 
150  bool m_fullSearch {false};
151 
153  bool m_removeDuplicates {false};
154 
156  bool m_addFullTS {false};
157 
158  int m_sourceid {-1};
159 
161  ServiceRequirements m_serviceRequirements {kRequireAV};
162 };
163 
164 #endif // CHANNEL_SCANNER_H
kRequireAV
@ kRequireAV
Definition: channelscantypes.h:9
ChannelScanner::m_channels
DTVChannelList m_channels
imported channels
Definition: channelscanner.h:129
VBoxChannelFetcher
Definition: vboxchannelfetcher.h:64
mythtvexp.h
ChannelScanner::m_iptvChannels
fbox_chan_map_t m_iptvChannels
Definition: channelscanner.h:130
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
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:62
ChannelScanSM
Scanning class for cards that support a SignalMonitor class.
Definition: channelscan_sm.h:85
uint
unsigned int uint
Definition: compat.h:79
ScannerEvent
Definition: scanmonitor.h:86
MTV_PUBLIC
#define MTV_PUBLIC
Definition: mythtvexp.h:15
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