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