diff options
| author | Christoph Berg <myon@debian.org> | 2026-09-26 23:24:28 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2026-09-26 23:24:28 +0200 |
| commit | 69344560ea394c06ca94acac46a2e4c3e8b7b229 (patch) | |
| tree | ebc98370a697a9bbd6b973a14fa5113c475c6db7 /LiveAudioTestController.hpp | |
| parent | 3e9d10a67671d0bd5c7b8c3ca8088f1818322eff (diff) | |
| parent | 059831534c7e884f0a607ed86b582fd00d821731 (diff) | |
Update upstream source from tag 'upstream/3.2.0_rc1+dfsg'
Update to upstream version '3.2.0~rc1+dfsg'
with Debian dir dbff457fd2c3616d5c77b863c7bfb2186ed86047
Diffstat (limited to 'LiveAudioTestController.hpp')
| -rw-r--r-- | LiveAudioTestController.hpp | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/LiveAudioTestController.hpp b/LiveAudioTestController.hpp new file mode 100644 index 00000000..b3fc9bdd --- /dev/null +++ b/LiveAudioTestController.hpp @@ -0,0 +1,103 @@ +// -*- Mode: C++ -*- +#ifndef LIVE_AUDIO_TEST_CONTROLLER_HPP__ +#define LIVE_AUDIO_TEST_CONTROLLER_HPP__ + +#include <QObject> +#include <QSet> +#include <QString> +#include <QStringList> +#include <QTimer> +#include <vector> + +class FixtureAudioInput; +class MainWindow; +class QTextEdit; + +class LiveAudioTestController final + : public QObject +{ + Q_OBJECT + +public: + enum class Mode + { + Ft8, + Jtty + }; + + LiveAudioTestController (MainWindow * window, FixtureAudioInput * fixture, + QString expectedPath, Mode mode = Mode::Ft8, + QObject * parent = nullptr); + + void begin (); + bool succeeded () const {return m_succeeded;} + +private: + enum class DecoderStage + { + None, + EarlyStandard, + Multithreaded + }; + + static QSet<QString> readExpectedMessages (QString const& path, QString * error); + static QStringList readExpectedJttyMessages (QString const& path, QString * error); + static QString messageFromDecoderLine (QByteArray const& line); + void prepareWhenReady (); + void prepareFt8WhenReady (); + void prepareJttyWhenReady (); + void maybeFinish (); + void maybeFinishFt8 (); + void maybeFinishJtty (); + void pollJttyDisplay (); + void fail (QString const& reason); + void checkForUnexpectedModal (); + void exerciseSubmittedFt8Rollover (); + + MainWindow * m_window; + FixtureAudioInput * m_fixture; + QString m_expectedPath; + Mode m_mode; + QSet<QString> m_expected; + QStringList m_expectedJtty; + QString m_expectedJttyPrefix; + QSet<QString> m_observed; + QSet<QString> m_displayed; + QSet<QString> m_earlyObserved; + QSet<QString> m_multithreadedObserved; + QSet<QString> m_earlyRaw; + QSet<QString> m_multithreadedRaw; + QString m_initializationError; + QTimer m_timeout; + QTimer m_prepareTimer; + QTimer m_modalTimer; + QTimer m_jttyPollTimer; + QTextEdit * m_jttyAllDecodes {nullptr}; + QTextEdit * m_jttyQsoFrequency {nullptr}; + qint64 m_emittedFrames {0}; + int m_completedCycles {0}; + quint64 m_submittedGeneration {0}; + quint64 m_submittedCycle {0}; + quint64 m_rolloverEpoch {0}; + quint64 m_preRolloverEpoch {0}; + int m_rolloverAcceptedEnd {0}; + int m_rolloverAcceptedBlocks {0}; + int m_rolloverRejectedBlocks {0}; + int m_submittedCompletions {0}; + std::vector<short> m_rolloverSamples; + bool m_rolloverVerified {false}; + DecoderStage m_decoderStage {DecoderStage::None}; + bool m_sawEarlyStandardDecode {false}; + bool m_sawConfiguredMultithreadedDecode {false}; + bool m_completedMultithreadedDecode {false}; + bool m_fixtureFinished {false}; + bool m_armed {false}; + bool m_jttyAllSawPrefix {false}; + bool m_jttyQsoSawPrefix {false}; + QSet<QString> m_jttyAllFinals; + QSet<QString> m_jttyQsoFinals; + bool m_finished {false}; + bool m_succeeded {false}; +}; + +#endif |
