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 /ReceiveHandoffTestController.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 'ReceiveHandoffTestController.hpp')
| -rw-r--r-- | ReceiveHandoffTestController.hpp | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/ReceiveHandoffTestController.hpp b/ReceiveHandoffTestController.hpp new file mode 100644 index 00000000..cc0f1c2f --- /dev/null +++ b/ReceiveHandoffTestController.hpp @@ -0,0 +1,66 @@ +#ifndef RECEIVE_HANDOFF_TEST_CONTROLLER_HPP +#define RECEIVE_HANDOFF_TEST_CONTROLLER_HPP + +#include <condition_variable> +#include <memory> +#include <mutex> + +#include <QObject> +#include <QTimer> + +class FixtureAudioInput; +class MainWindow; + +// Drives capture checkpoints while controlling delivery to the real GUI consumer. +class ReceiveHandoffTestController final : public QObject +{ + Q_OBJECT + +public: + ReceiveHandoffTestController (MainWindow * window, FixtureAudioInput * fixture, + QObject * parent = nullptr); + + void begin (); + bool succeeded () const {return succeeded_;} + +private: + void prepare (); + bool advance (qint64 frames, bool fresh = false, bool flush = false); + bool drain (); + bool require (bool condition, QString const& message); + void resetScenario (QString const& name); + void observe (quint64 epoch, int start, int end, bool accepted); + QString diagnostics () const; + void finish (bool success, QString const& message); + + MainWindow * window_; + FixtureAudioInput * fixture_; + QTimer retry_; + QTimer timeout_; + struct ProducerAcknowledgement + { + std::mutex mutex; + std::condition_variable changed; + QString error; + bool finished {false}; + qint64 frames {-1}; + }; + std::shared_ptr<ProducerAcknowledgement> producer_ { + std::make_shared<ProducerAcknowledgement> ()}; + qint64 capture_ {0}; + QString scenario_; + QString scenario_error_; + quint64 epoch_ {0}; + quint64 obsolete_epoch_ {0}; + qint64 sample_period_ {0}; + int accepted_ = 0; + int rejected_ = 0; + int committed_ = 0; + int rejected_end_ = 0; + int final_submissions_ = 0; + quint64 decoder_generation_ = 0; + bool finished_ {false}; + bool succeeded_ {false}; +}; + +#endif |
