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 static ChannelScannerWeb * getInstance();
54 void ResetStatus();
55 void setupScan(int CardId);
56 void stopScan();
57 void stopMon(void);
58 void log(const QString &msg);
59
60 bool StartScan (uint CardId,
61 const QString &DesiredServices,
62 bool FreeToAirOnly,
67 bool AddFullTS,
68 bool TestDecryptable,
69 const QString &ScanType,
70 const QString &FreqTable,
71 QString Modulation,
72 const QString &FirstChan,
73 const QString &LastChan,
74 uint ScanId,
77 uint MplexId,
78 const QString &Frequency,
79 const QString &Bandwidth,
80 const QString &Polarity,
81 const QString &SymbolRate,
82 const QString &Inversion,
83 const QString &Constellation,
84 const QString &ModSys,
85 const QString &CodeRate_LP,
86 const QString &CodeRate_HP,
87 const QString &FEC,
88 const QString &Trans_Mode,
89 const QString &Guard_Interval,
90 const QString &Hierarchy,
91 const QString &RollOff);
92protected:
93 void HandleEvent(const ScannerEvent *scanEvent) override; // ChannelScanner
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
unsigned int uint
Definition: compat.h:60
std::vector< ScanDTVTransport > ScanDTVTransportList
Definition: dtvmultiplex.h:143
#define MTV_PUBLIC
Definition: mythtvexp.h:8
def error(message)
Definition: smolt.py:409
None log(str msg, int level=LOGDEBUG)
Definition: xbmc.py:9