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 "libmythbase/mythconfig.h"
38
39#include "libmythtv/cardutil.h"
41#include "libmythtv/mythtvexp.h"
42
43#include "iptvchannelfetcher.h"
44#include "scanmonitor.h"
45#include "channelscantypes.h"
46
47#if CONFIG_VBOX
48#include "vboxchannelfetcher.h"
49#endif
50
51#if !defined( _WIN32 )
52#include "externrecscanner.h"
53#endif
54
55#if CONFIG_HDHOMERUN
56#include "hdhrchannelfetcher.h"
57#endif
58
59class ScanMonitor;
61class ExternRecChannelFetcher;
62class ChannelScanSM;
63class ChannelBase;
64
65// Not (yet?) implemented from old scanner
66// do_delete_channels, do_rename_channels, atsc_format
67// TODO implement deletion of stale channels..
68
70{
71 Q_DECLARE_TR_FUNCTIONS(ChannelScanner)
72
73 friend class ScanMonitor;
74
75 public:
77 virtual ~ChannelScanner();
78
79 void Scan(int scantype,
80 uint cardid,
81 const QString &inputname,
82 uint sourceid,
83 bool do_ignore_signal_timeout,
84 bool do_follow_nit,
85 bool do_test_decryption,
86 bool do_fta_only,
87 bool do_lcn_only,
88 bool do_complete_only,
89 bool do_full_channel_search,
90 bool do_remove_duplicates,
91 bool do_add_full_ts,
92 ServiceRequirements service_requirements,
93 // stuff needed for particular scans
94 uint mplexid,
95 const QMap<QString,QString> &startChan,
96 const QString &freq_std,
97 const QString &mod,
98 const QString &tbl,
99 const QString &tbl_start = QString(),
100 const QString &tbl_end = QString());
101
102 virtual DTVConfParser::return_t ImportDVBUtils(
103 uint sourceid, CardUtil::INPUT_TYPES cardtype, const QString &file);
104
105 virtual bool ImportM3U(uint cardid, const QString &inputname,
106 uint sourceid, bool is_mpts);
107 virtual bool ImportVBox(uint cardid, const QString &inputname, uint sourceid,
108 bool ftaOnly, ServiceRequirements serviceType);
109 virtual bool ImportExternRecorder(uint cardid, const QString &inputname,
110 uint sourceid);
111 virtual bool ImportHDHR(uint cardid, const QString &inputname, uint sourceid,
112 ServiceRequirements serviceType);
113
114 protected:
115 virtual void Teardown(void);
116
117 virtual void PreScanCommon(
118 int scantype, uint cardid,
119 const QString &inputname,
120 uint sourceid, bool do_ignore_signal_timeout,
121 bool do_test_decryption);
122
123 virtual void MonitorProgress(
124 bool /*lock*/, bool /*strength*/, bool /*snr*/, bool /*rotor*/) { }
125
126 virtual void HandleEvent(const ScannerEvent*) = 0;
127 virtual void InformUser(const QString &/*error*/) = 0;
128
129 protected:
130 ScanMonitor *m_scanMonitor {nullptr};
131 ChannelBase *m_channel {nullptr};
132
133 // Low level channel scanners
134 ChannelScanSM *m_sigmonScanner {nullptr};
135 IPTVChannelFetcher *m_iptvScanner {nullptr};
136
140
141 // vbox support
142#if CONFIG_VBOX
143 VBoxChannelFetcher *m_vboxScanner {nullptr};
144#endif
145#if !defined( _WIN32 )
146 ExternRecChannelScanner *m_externRecScanner {nullptr};
147#endif
148 // HDHomeRun channel list import
149#if CONFIG_HDHOMERUN
150 HDHRChannelFetcher *m_hdhrScanner {nullptr};
151#endif
152
154 bool m_freeToAirOnly {false};
155
157 bool m_channelNumbersOnly {false};
158
160 bool m_completeOnly {false};
161
163 bool m_fullSearch {false};
164
166 bool m_removeDuplicates {false};
167
169 bool m_addFullTS {false};
170
171 int m_sourceid {-1};
172
174 ServiceRequirements m_serviceRequirements {kRequireAV};
175};
176
177#endif // CHANNEL_SCANNER_H
ServiceRequirements
@ kRequireAV
Collection of helper utilities for input DB use.
Definition: cardutil.h:42
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
std::vector< DTVTransport > DTVChannelList
Definition: dtvconfparser.h:68
unsigned int uint
Definition: freesurround.h:24
QMap< QString, IPTVChannelInfo > fbox_chan_map_t
#define MTV_PUBLIC
Definition: mythtvexp.h:15