9 using namespace swift::misc::audio;
10 using namespace swift::misc::aviation;
11 using namespace swift::misc::physical_quantities;
13 namespace swift::sound
18 m_threadedPlayer->
start();
27 std::chrono::milliseconds duration {};
31 Q_ASSERT(frequencies.size() == 4);
32 const std::chrono::milliseconds oneSec(1000);
33 const CTonePair t1(frequencies.at(0), frequencies.at(1), oneSec);
35 const CTonePair t3(frequencies.at(2), frequencies.at(3), oneSec);
36 QList<CTonePair> tonePairs;
37 tonePairs << t1 << t2 << t3;
38 m_threadedPlayer->
play(volume, tonePairs);
39 duration = std::chrono::milliseconds(2500);
void quitAndWait() noexcept final
Calls quit() and blocks until the thread is finished.
void start(QThread::Priority priority=QThread::InheritPriority)
Starts a thread and moves the worker into it.
Value object encapsulating information of a audio device.
bool isValid() const
Is valid?
QList< physical_quantities::CFrequency > getFrequencies() const
List of 4 frequencies, if list is empty SELCAL code is not valid.
void gracefulShutdown()
Stop the player thread.
std::chrono::milliseconds play(int volume, const swift::misc::aviation::CSelcal &selcal)
Play SELCAL.
virtual ~CSelcalPlayer()
Destructor.
Threaded tone player. Don't use it directly but use.
void play(int volume, const QList< swift::sound::CTonePair > &tonePairs)
Play the list of tones. If the player is currently active, this call will be ignored.
Free functions in swift::misc.