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 <QtGlobal>
35#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
36#include <QtSystemDetection>
37#endif
38#include <QCoreApplication>
39
40// MythTV headers
41#include "libmythbase/mythconfig.h"
42
43#include "libmythtv/cardutil.h"
45#include "libmythtv/mythtvexp.h"
46
47#include "iptvchannelfetcher.h"
48#include "scanmonitor.h"
49#include "channelscantypes.h"
50
51#if CONFIG_VBOX
52#include "vboxchannelfetcher.h"
53#endif
54
55#ifndef Q_OS_WINDOWS
56#include "externrecscanner.h"
57#endif
58
59#if CONFIG_HDHOMERUN
60#include "hdhrchannelfetcher.h"
61#endif
62
63class ScanMonitor;
65class ExternRecChannelFetcher;
66class ChannelScanSM;
67class ChannelBase;
68
69// Not (yet?) implemented from old scanner
70// do_delete_channels, do_rename_channels, atsc_format
71// TODO implement deletion of stale channels..
72
74{
75 Q_DECLARE_TR_FUNCTIONS(ChannelScanner)
76
77 friend class ScanMonitor;
78
79 public:
81 virtual ~ChannelScanner();
82
83 void Scan(int scantype,
84 uint cardid,
85 const QString &inputname,
86 uint sourceid,
87 bool do_ignore_signal_timeout,
88 bool do_follow_nit,
89 bool do_test_decryption,
90 bool do_fta_only,
91 bool do_lcn_only,
92 bool do_complete_only,
93 bool do_full_channel_search,
94 bool do_remove_duplicates,
95 bool do_add_full_ts,
96 ServiceRequirements service_requirements,
97 // stuff needed for particular scans
98 uint mplexid,
99 const QMap<QString,QString> &startChan,
100 const QString &freq_std,
101 const QString &mod,
102 const QString &tbl,
103 const QString &tbl_start = QString(),
104 const QString &tbl_end = QString());
105
106 virtual DTVConfParser::return_t ImportDVBUtils(
107 uint sourceid, CardUtil::INPUT_TYPES cardtype, const QString &file);
108
109 virtual bool ImportM3U(uint cardid, const QString &inputname,
110 uint sourceid, bool is_mpts);
111 virtual bool ImportVBox(uint cardid, const QString &inputname, uint sourceid,
112 bool ftaOnly, ServiceRequirements serviceType);
113 virtual bool ImportExternRecorder(uint cardid, const QString &inputname,
114 uint sourceid);
115 virtual bool ImportHDHR(uint cardid, const QString &inputname, uint sourceid,
116 ServiceRequirements serviceType);
117
118 protected:
119 virtual void Teardown(void);
120
121 virtual void PreScanCommon(
122 int scantype, uint cardid,
123 const QString &inputname,
124 uint sourceid, bool do_ignore_signal_timeout,
125 bool do_test_decryption);
126
127 virtual void MonitorProgress(
128 bool /*lock*/, bool /*strength*/, bool /*snr*/, bool /*rotor*/) { }
129
130 virtual void HandleEvent(const ScannerEvent*) = 0;
131 virtual void InformUser(const QString &/*error*/) = 0;
132
133 protected:
134 ScanMonitor *m_scanMonitor {nullptr};
135 ChannelBase *m_channel {nullptr};
136
137 // Low level channel scanners
138 ChannelScanSM *m_sigmonScanner {nullptr};
139 IPTVChannelFetcher *m_iptvScanner {nullptr};
140
144
145 // vbox support
146#if CONFIG_VBOX
147 VBoxChannelFetcher *m_vboxScanner {nullptr};
148#endif
149#ifndef Q_OS_WINDOWS
150 ExternRecChannelScanner *m_externRecScanner {nullptr};
151#endif
152 // HDHomeRun channel list import
153#if CONFIG_HDHOMERUN
154 HDHRChannelFetcher *m_hdhrScanner {nullptr};
155#endif
156
158 bool m_freeToAirOnly {false};
159
161 bool m_channelNumbersOnly {false};
162
164 bool m_completeOnly {false};
165
167 bool m_fullSearch {false};
168
170 bool m_removeDuplicates {false};
171
173 bool m_addFullTS {false};
174
175 int m_sourceid {-1};
176
178 ServiceRequirements m_serviceRequirements {kRequireAV};
179};
180
181#endif // CHANNEL_SCANNER_H
ServiceRequirements
@ kRequireAV
Collection of helper utilities for input DB use.
Definition: cardutil.h:44
Abstract class providing a generic interface to tuning hardware.
Definition: channelbase.h:32
Scanning class for cards that support a SignalMonitor class.
fbox_chan_map_t m_iptvChannels
DTVChannelList m_channels
imported channels
virtual void HandleEvent(const ScannerEvent *)=0
virtual void InformUser(const QString &)=0
Parses dvb-utils channel scanner output files.
Definition: dtvconfparser.h:74
unsigned int uint
Definition: compat.h:60
std::vector< DTVTransport > DTVChannelList
Definition: dtvconfparser.h:68
QMap< QString, IPTVChannelInfo > fbox_chan_map_t
#define MTV_PUBLIC
Definition: mythtvexp.h:11