Go to the documentation of this file.
4 #ifndef SIGNALMONITOR_H
5 #define SIGNALMONITOR_H
12 #include <QWaitCondition>
14 #include <QCoreApplication>
15 #include <QRecursiveMutex>
36 static inline bool IsRequired(
const QString &cardtype);
37 static inline bool IsSupported(
const QString &cardtype);
55 virtual void AddFlags(uint64_t _flags);
57 bool HasFlags(uint64_t _flags)
const;
123 bool _release_stream, uint64_t wait_for_mask);
125 void run(
void)
override;
233 QString str(
"Seen(");
312 return (cardtype !=
"IMPORT" && cardtype !=
"DEMO");
321 #endif // SIGNALMONITOR_H
volatile uint64_t m_flags
static const uint64_t kDTVSigMon_WaitForAll
std::chrono::milliseconds m_minimumUpdateRate
static const uint64_t kFWSigMon_WaitForPower
virtual bool IsAllGood(void) const
static const uint64_t kDTVSigMon_NITMatch
We've seen an NIT matching our requirements.
static bool IsSupported(const QString &cardtype)
static const uint64_t kDTVSigMon_VCTMatch
We've seen a VCT matching our requirements.
int GetNormalizedValue(int newmin, int newmax) const
Returns the value normalized to the [newmin, newmax] range.
static const uint64_t kDTVSigMon_WaitForMGT
static const uint64_t kDVBSigMon_WaitForSNR
Wait for the Signal to Noise Ratio to rise above a threshold.
void SendMessage(SignalMonitorMessageType type, const SignalMonitorValue &val)
static const uint64_t kDTVSigMon_CVCTSeen
We've seen a CVCT, the cable version of the VCT.
int GetSignalStrength(void)
std::chrono::milliseconds GetUpdateRate() const
Returns milliseconds between signal monitoring events.
static const uint64_t kDTVSigMon_SDTMatch
We've seen an SDT matching our requirements.
static const uint64_t kDVBSigMon_WaitForBER
Wait for the Bit Error Rate to fall below a threshold.
static const uint64_t kDTVSigMon_PMTMatch
We've seen a PMT matching our requirements.
bool HasAnyFlag(uint64_t _flags) const
virtual void AddFlags(uint64_t _flags)
static const uint64_t kSigMon_WaitForSig
QRecursiveMutex m_statusLock
SignalMonitorValue m_scriptStatus
static bool IsRequired(const QString &cardtype)
Returns true iff the card type supports signal monitoring.
static const uint64_t kDVBSigMon_WaitForUB
Wait for uncorrected FEC blocks to fall below a threshold.
virtual void RemoveFlags(uint64_t _flags)
SignalMonitorValue m_signalStrength
static const uint64_t kDVBSigMon_WaitForPos
Wait for rotor to complete turning the antenna.
Abstract class providing a generic interface to tuning hardware.
static const uint64_t kFWSigMon_PowerSeen
We've seen the FireWire STB power state.
QString sm_flags_to_string(uint64_t flags)
SignalMonitorValue m_signalLock
std::chrono::milliseconds m_updateRate
void run(void) override
Basic signal monitoring loop.
void SendMessageAllGood(void)
static const uint64_t kDTVSigMon_CVCTMatch
We've seen a CVCT matching our requirements.
~SignalMonitor() override
Stops monitoring thread.
static const uint64_t kDTVSigMon_WaitForPMT
static const uint64_t kDTVSigMon_WaitForPAT
static const uint64_t kDTVSigMon_WaitForNIT
virtual void EmitStatus(void)
static const uint64_t kDTVSigMon_WaitForSDT
virtual void UpdateValues(void)
This should be overridden to actually do signal monitoring.
static const uint64_t kDTVSigMon_SDTSeen
We've seen a SDT, which maps DVB Channels to MPEG program numbers, and provides additional data.
static const uint64_t kFWSigMon_PowerMatch
We've seen a FireWire STB power state matching our requirements.
static const uint64_t kDTVSigMon_NITSeen
We've seen a NIT, which tells us where to find SDT and other DVB tables.
static const uint64_t kDTVSigMon_TVCTSeen
We've seen a TVCT, the terrestrial version of the VCT.
static const uint64_t kDTVSigMon_PATSeen
We've seen a PAT, which maps MPEG program numbers to pids where we find PMTs.
static const uint64_t kDTVSigMon_PMTSeen
We've seen a PMT, which maps program to audio, video and other stream PIDs.
QWaitCondition m_startStopWait
Signal monitoring base class.
bool IsGood() const
Returns true if the value is equal to the threshold, or on the right side of the threshold (depends o...
static SignalMonitor * Init(const QString &cardtype, int db_cardnum, ChannelBase *channel, bool release_stream)
static const uint64_t kDTVSigMon_VCTSeen
We've seen a VCT, which maps ATSC Channels to MPEG program numbers, and provides additional data.
virtual bool HasExtraSlowTuning(void) const
static const uint64_t kDTVSigMon_CryptSeen
We've seen something indicating whether the data stream is encrypted.
void SetUpdateRate(std::chrono::milliseconds msec)
Sets the number of milliseconds between signal monitoring attempts in the signal monitoring thread.
static const uint64_t kDTVSigMon_MGTMatch
We've seen an MGT matching our requirements.
bool GetNotifyFrontend() const
Returns whether or not a SIGNAL MythEvent is being sent regularly to the frontend.
bool HasFlags(uint64_t _flags) const
void AddListener(SignalMonitorListener *listener)
static const uint64_t kDTVSigMon_MGTSeen
We've seen a MGT, which tells us on which PIDs to find VCT and other ATSC tables.
void SetMonitoring(TVRec *parent, bool EITscan, bool monitor)
Indicate if table monitoring is needed.
void RemoveListener(SignalMonitorListener *listener)
static const uint64_t kDTVSigMon_PATMatch
We've seen a PAT matching our requirements.
This is the coordinating class of the Recorder Subsystem.
This is a wrapper around QThread that does several additional things.
static const uint64_t kDTVSigMon_TVCTMatch
We've seen a TVCT matching our requirements.
virtual void Start()
Start signal monitoring thread.
void SetNotifyFrontend(bool notify)
Enables or disables frontend notification of the current signal value.
std::vector< SignalMonitorListener * > m_listeners
virtual QStringList GetStatusList(void) const
Returns QStringList containing all signals and their current values.
bool IsErrored(void) const
uint64_t GetFlags(void) const
bool HasSignalLock(void) const
Returns true iff scriptStatus.IsGood() and signalLock.IsGood() return true.
static const uint64_t kDTVSigMon_CryptMatch
We've seen unencrypted data in data stream.
virtual void Stop()
Stop signal monitoring thread.
Q_DECLARE_TR_FUNCTIONS(SignalMonitor)
static const uint64_t kDTVSigMon_WaitForCrypt
SignalMonitor(int, ChannelBase *, uint64_t, bool)=delete
static const uint64_t kDTVSigMon_WaitForVCT