MythTV  master
channelscanner_cli.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_CLI_H
31 #define CHANNEL_SCANNER_CLI_H
32 
33 // Qt headers
34 #include <QString>
35 
36 // MythTV headers
37 #include "libmythtv/mythtvexp.h"
38 #include "channelscanner.h"
39 
41 {
42  public:
43  ChannelScannerCLI(bool doScanSaveOnly, bool promptsOk)
44  : m_onlysavescan(doScanSaveOnly), m_interactive(promptsOk) {}
45  ~ChannelScannerCLI() override = default;
46 
47  void HandleEvent(const ScannerEvent *scanEvent) override; // ChannelScanner
48 
49  bool IsDone(void) const { return m_done; }
50 
51  protected:
52  void InformUser(const QString &error) override; // ChannelScanner
53  virtual void Process(const ScanDTVTransportList &_transports);
54  void MonitorProgress(bool lock, bool strength,
55  bool snr, bool rotor) override; // ChannelScanner
56  private:
57  bool m_done {false};
60  bool m_statusLock {false};
61  uint m_statusComplete {0};
62  float m_statusSnr {0.0};
63  QString m_statusText;
64  QString m_statusLastLog;
65 };
66 
67 #endif // CHANNEL_SCANNER_CLI_H
ChannelScanner::HandleEvent
virtual void HandleEvent(const ScannerEvent *)=0
error
static void error(const char *str,...)
Definition: vbi.cpp:36
ChannelScannerCLI::ChannelScannerCLI
ChannelScannerCLI(bool doScanSaveOnly, bool promptsOk)
Definition: channelscanner_cli.h:43
mythtvexp.h
ChannelScannerCLI
Definition: channelscanner_cli.h:40
ChannelScannerCLI::IsDone
bool IsDone(void) const
Definition: channelscanner_cli.h:49
channelscanner.h
ChannelScannerCLI::m_statusText
QString m_statusText
Definition: channelscanner_cli.h:63
ChannelScannerCLI::m_onlysavescan
bool m_onlysavescan
Definition: channelscanner_cli.h:58
ChannelScanner
Definition: channelscanner.h:66
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
ScannerEvent
Definition: scanmonitor.h:86
MTV_PUBLIC
#define MTV_PUBLIC
Definition: mythtvexp.h:15
ChannelScannerCLI::m_interactive
bool m_interactive
Definition: channelscanner_cli.h:59
ChannelScanner::MonitorProgress
virtual void MonitorProgress(bool, bool, bool, bool)
Definition: channelscanner.h:120
ChannelScannerCLI::m_statusLastLog
QString m_statusLastLog
Definition: channelscanner_cli.h:64