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 {
48 private:
49  ChannelScannerWeb(void) = default;
50 
51 public:
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,
64  bool ChannelNumbersOnly,
66  bool FullChannelSearch,
67  bool RemoveDuplicates,
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,
77  bool FollowNITSetting,
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);
93 protected:
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 
99 private:
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 
108 public:
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};
118  QString m_statusText;
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
ChannelScanner::HandleEvent
virtual void HandleEvent(const ScannerEvent *)=0
RemoveDuplicates
Definition: channelscanmiscsettings.h:174
error
static void error(const char *str,...)
Definition: vbi.cpp:36
CompleteChannelsOnly
Definition: channelscanmiscsettings.h:139
mythtvexp.h
ChannelScannerWeb::m_waitCondition
QWaitCondition m_waitCondition
Definition: channelscanner_web.h:110
ChannelScannerWeb::m_mutex
QMutex m_mutex
Definition: channelscanner_web.h:109
ChannelScannerWeb::m_dlgString
QString m_dlgString
Definition: channelscanner_web.h:127
IgnoreSignalTimeout
Definition: channelscanmiscsettings.h:52
channelscanner.h
ChannelScanner
Definition: channelscanner.h:66
ChannelScannerWeb::s_Instance
static ChannelScannerWeb * s_Instance
Definition: channelscanner_web.h:100
FreqTable
static GlobalComboBoxSetting * FreqTable()
Definition: backendsettings.cpp:251
ChannelScannerWeb::m_transports
ScanDTVTransportList m_transports
Definition: channelscanner_web.h:104
ChannelScanner::InformUser
virtual void InformUser(const QString &)=0
uint
unsigned int uint
Definition: compat.h:81
ScanDTVTransportList
std::vector< ScanDTVTransport > ScanDTVTransportList
Definition: dtvmultiplex.h:143
FullChannelSearch
Definition: channelscanmiscsettings.h:157
ChannelScannerWeb::m_dlgMsg
QString m_dlgMsg
Definition: channelscanner_web.h:123
ScannerEvent
Definition: scanmonitor.h:86
ChannelScannerWeb
Definition: channelscanner_web.h:46
FollowNITSetting
Definition: channelscanmiscsettings.h:65
ChannelScannerWeb::m_statusText
QString m_statusText
Definition: channelscanner_web.h:118
MTV_PUBLIC
#define MTV_PUBLIC
Definition: mythtvexp.h:15
ChannelNumbersOnly
Definition: channelscanmiscsettings.h:123
Frequency
Definition: transporteditor.cpp:466
Modulation
Definition: transporteditor.cpp:541
DesiredServices
Definition: channelscanmiscsettings.h:79
common.utilities.log
def log(debug, txt)
Definition: utilities.py:5
MThread
This is a wrapper around QThread that does several additional things.
Definition: mthread.h:48
ChannelScannerWeb::m_statusLog
QString m_statusLog
Definition: channelscanner_web.h:119
ChannelScannerWeb::m_statusTitleText
QString m_statusTitleText
Definition: channelscanner_web.h:120
FreeToAirOnly
Definition: channelscanmiscsettings.h:109
RollOff
Definition: transporteditor.cpp:832
ChannelScanner::MonitorProgress
virtual void MonitorProgress(bool, bool, bool, bool)
Definition: channelscanner.h:120
ChannelScannerWeb::m_dlgButtons
QStringList m_dlgButtons
Definition: channelscanner_web.h:124
AddFullTS
Definition: channelscanmiscsettings.h:190