MythTV master
channelscanner_web.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_WEB_H
31#define CHANNEL_SCANNER_WEB_H
32
33// Qt headers
34#include <QString>
35
36// MythTV headers
37#include "libmythtv/mythtvexp.h"
38#include "channelscanner.h"
39
40// class RunScanner : public QRunnable
41// {
42// public:
43// virtual void run();
44// };
45
47{
48private:
49 ChannelScannerWeb(void) = default;
50
51public:
52 ~ChannelScannerWeb() override = default;
53 void HandleEvent(const ScannerEvent *scanEvent) override; // ChannelScanner
54 static ChannelScannerWeb * getInstance();
55 void ResetStatus();
56 void setupScan(int CardId);
57 void stopScan();
58 void stopMon(void);
59 void log(const QString &msg);
60
61 bool StartScan (uint CardId,
62 const QString &DesiredServices,
63 bool FreeToAirOnly,
68 bool AddFullTS,
69 bool TestDecryptable,
70 const QString &ScanType,
71 const QString &FreqTable,
72 QString Modulation,
73 const QString &FirstChan,
74 const QString &LastChan,
75 uint ScanId,
78 uint MplexId,
79 const QString &Frequency,
80 const QString &Bandwidth,
81 const QString &Polarity,
82 const QString &SymbolRate,
83 const QString &Inversion,
84 const QString &Constellation,
85 const QString &ModSys,
86 const QString &CodeRate_LP,
87 const QString &CodeRate_HP,
88 const QString &FEC,
89 const QString &Trans_Mode,
90 const QString &Guard_Interval,
91 const QString &Hierarchy,
92 const QString &RollOff);
93protected:
94 void InformUser(const QString &error) override; // ChannelScanner
95 void Process(const ScanDTVTransportList &_transports, bool success = false);
96 void MonitorProgress(bool lock, bool strength,
97 bool snr, bool rotor) override; // ChannelScanner
98
99private:
101 int m_runType {0};
102 bool m_onlysavescan {false};
103 bool m_interactive {false};
105 int m_scantype {-1};
106 int m_scanId {0};
107
108public:
109 QMutex m_mutex;
110 QWaitCondition m_waitCondition;
111 uint m_cardid {0};
112 // Status values
113 // "IDLE", "RINNUNG"
114 QString m_status{"IDLE"};
115 bool m_statusLock{false};
116 uint m_statusProgress{0};
117 int m_statusSnr{0};
119 QString m_statusLog;
121 int m_statusRotorPosition {0};
122 int m_statusSignalStrength {0};
123 QString m_dlgMsg;
124 QStringList m_dlgButtons;
125 bool m_dlgInputReq {false};
126 int m_dlgButton {-1};
127 QString m_dlgString;
128
129 // Monitor Settings
130 bool m_showSignalLock{false};
131 bool m_showSignalStrength{false};
132 bool m_showSignalNoise{false};
133 bool m_showRotorPos{false};
134
135 MThread * m_monitorThread {nullptr};
136};
137
138#endif // CHANNEL_SCANNER_WEB_H
static GlobalComboBoxSetting * FreqTable()
static ChannelScannerWeb * s_Instance
QWaitCondition m_waitCondition
ScanDTVTransportList m_transports
~ChannelScannerWeb() override=default
ChannelScannerWeb(void)=default
virtual void HandleEvent(const ScannerEvent *)=0
virtual void MonitorProgress(bool, bool, bool, bool)
virtual void InformUser(const QString &)=0
This is a wrapper around QThread that does several additional things.
Definition: mthread.h:49
std::vector< ScanDTVTransport > ScanDTVTransportList
Definition: dtvmultiplex.h:143
unsigned int uint
Definition: freesurround.h:24
#define MTV_PUBLIC
Definition: mythtvexp.h:15
def error(message)
Definition: smolt.py:409
None log(str msg, int level=LOGDEBUG)
Definition: xbmc.py:9