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_add_full_ts,
83  ServiceRequirements service_requirements,
84  // stuff needed for particular scans
85  uint mplexid,
86  const QMap<QString,QString> &startChan,
87  const QString &freq_std,
88  const QString &mod,
89  const QString &tbl,
90  const QString &tbl_start = QString(),
91  const QString &tbl_end = QString());
92 
93  virtual DTVConfParser::return_t ImportDVBUtils(
94  uint sourceid, int cardtype, const QString &file);
95 
96  virtual bool ImportM3U(uint cardid, const QString &inputname,
97  uint sourceid, bool is_mpts);
98  virtual bool ImportVBox(uint cardid, const QString &inputname, uint sourceid,
99  bool ftaOnly, ServiceRequirements serviceType);
100  virtual bool ImportExternRecorder(uint cardid, const QString &inputname,
101  uint sourceid);
102 
103  protected:
104  virtual void Teardown(void);
105 
106  virtual void PreScanCommon(
107  int scantype, uint cardid,
108  const QString &inputname,
109  uint sourceid, bool do_ignore_signal_timeout,
110  bool do_test_decryption);
111 
112  virtual void MonitorProgress(
113  bool /*lock*/, bool /*strength*/, bool /*snr*/, bool /*rotor*/) { }
114 
115  virtual void HandleEvent(const ScannerEvent*) = 0;
116  virtual void InformUser(const QString &/*error*/) = 0;
117 
118  protected:
119  ScanMonitor *m_scanMonitor {nullptr};
120  ChannelBase *m_channel {nullptr};
121 
122  // Low level channel scanners
123  ChannelScanSM *m_sigmonScanner {nullptr};
124  IPTVChannelFetcher *m_iptvScanner {nullptr};
125 
129 
130  // vbox support
131 #ifdef USING_VBOX
132  VBoxChannelFetcher *m_vboxScanner {nullptr};
133 #endif
134 #if !defined( USING_MINGW ) && !defined( _MSC_VER )
135  ExternRecChannelScanner *m_ExternRecScanner {nullptr};
136 #endif
137 
139  bool m_freeToAirOnly {false};
140 
142  bool m_channelNumbersOnly {false};
143 
145  bool m_completeOnly {false};
146 
148  bool m_fullSearch {false};
149 
151  bool m_addFullTS {false};
152 
153  int m_sourceid {-1};
154 
156  ServiceRequirements m_serviceRequirements {kRequireAV};
157 };
158 
159 #endif // _CHANNEL_SCANNER_H_
vector< DTVTransport > DTVChannelList
Definition: dtvconfparser.h:70
DTVChannelList m_channels
imported channels
#define MTV_PUBLIC
Definition: mythtvexp.h:15
fbox_chan_map_t m_iptv_channels
Parses dvb-utils channel scanner output files.
Definition: dtvconfparser.h:75
unsigned int uint
Definition: compat.h:140
Scanning class for cards that support a SignalMonitor class.
Abstract class providing a generic interface to tuning hardware.
Definition: channelbase.h:31
ServiceRequirements
QMap< QString, IPTVChannelInfo > fbox_chan_map_t