/
channelscanner.h
163 lines (133 loc) · 5.33 KB
/
channelscanner.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
/* -*- Mode: c++ -*-
* vim: set expandtab tabstop=4 shiftwidth=4:
*
* Original Project
* MythTV http://www.mythtv.org
*
* Copyright (c) 2004, 2005 John Pullan <john@pullan.org>
* Copyright (c) 2005 - 2007 Daniel Kristjansson
*
* Description:
* Collection of classes to provide channel scanning functionallity
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
* Or, point your browser to http://www.gnu.org/copyleft/gpl.html
*
*/
#ifndef _CHANNEL_SCANNER_H_
#define _CHANNEL_SCANNER_H_
// Qt headers
#include <QCoreApplication>
// MythTV headers
#include "mythtvexp.h"
#include "dtvconfparser.h"
#include "iptvchannelfetcher.h"
#include "scanmonitor.h"
#include "channelscantypes.h"
#ifdef USING_VBOX
#include "vboxchannelfetcher.h"
#endif
#if !defined( USING_MINGW ) && !defined( _MSC_VER )
#include "externrecscanner.h"
#endif
class ScanMonitor;
class IPTVChannelFetcher;
class ExternRecChannelFetcher;
class ChannelScanSM;
class ChannelBase;
// Not (yet?) implemented from old scanner
// do_delete_channels, do_rename_channels, atsc_format
// TODO implement deletion of stale channels..
class MTV_PUBLIC ChannelScanner
{
Q_DECLARE_TR_FUNCTIONS(ChannelScanner)
friend class ScanMonitor;
public:
ChannelScanner() = default;
virtual ~ChannelScanner();
void Scan(int scantype,
uint cardid,
const QString &inputname,
uint sourceid,
bool do_ignore_signal_timeout,
bool do_follow_nit,
bool do_test_decryption,
bool do_fta_only,
bool do_lcn_only,
bool do_complete_only,
bool do_full_channel_search,
bool do_add_full_ts,
bool do_scanOpenTV,
ServiceRequirements service_requirements,
// stuff needed for particular scans
uint mplexid,
const QMap<QString,QString> &startChan,
const QString &freq_std,
const QString &mod,
const QString &tbl,
const QString &tbl_start = QString(),
const QString &tbl_end = QString());
virtual DTVConfParser::return_t ImportDVBUtils(
uint sourceid, int cardtype, const QString &file);
virtual bool ImportM3U(uint cardid, const QString &inputname,
uint sourceid, bool is_mpts);
virtual bool ImportVBox(uint cardid, const QString &inputname, uint sourceid,
bool ftaOnly, ServiceRequirements serviceType);
virtual bool ImportExternRecorder(uint cardid, const QString &inputname,
uint sourceid);
protected:
virtual void Teardown(void);
virtual void PreScanCommon(
int scantype, uint cardid,
const QString &inputname,
uint sourceid, bool do_ignore_signal_timeout,
bool do_test_decryption);
virtual void MonitorProgress(
bool /*lock*/, bool /*strength*/, bool /*snr*/, bool /*rotor*/) { }
virtual void HandleEvent(const ScannerEvent*) = 0;
virtual void InformUser(const QString &/*error*/) = 0;
protected:
ScanMonitor *m_scanMonitor {nullptr};
ChannelBase *m_channel {nullptr};
// Low level channel scanners
ChannelScanSM *m_sigmonScanner {nullptr};
IPTVChannelFetcher *m_iptvScanner {nullptr};
/// imported channels
DTVChannelList m_channels;
fbox_chan_map_t m_iptv_channels;
// vbox support
#ifdef USING_VBOX
VBoxChannelFetcher *m_vboxScanner {nullptr};
#endif
#if !defined( USING_MINGW ) && !defined( _MSC_VER )
ExternRecChannelScanner *m_ExternRecScanner {nullptr};
#endif
/// Only fta channels desired post scan?
bool m_freeToAirOnly {false};
/// Only channels with logical channel numbers desired post scan?
bool m_channelNumbersOnly {false};
/// Only complete channels desired post scan?
bool m_completeOnly {false};
/// Extended search for old channels post scan?
bool m_fullSearch {false};
/// Add MPTS "full transport stream" channels
bool m_addFullTS {false};
/// Scan for OpenTV channel numbers
bool m_scanOpenTV {false};
int m_sourceid {-1};
/// Services desired post scan
ServiceRequirements m_serviceRequirements {kRequireAV};
};
#endif // _CHANNEL_SCANNER_H_