6#ifndef SWIFT_SOUND_THREADEDTONEPAIRPLAYER_H
7#define SWIFT_SOUND_THREADEDTONEPAIRPLAYER_H
13#include <QReadWriteLock>
57 void handleStateChanged(QAudio::State newState);
67 void writeAmplitudeToBuffer(
double amplitude,
unsigned char *bufferPointer);
69 swift::
misc::audio::CAudioDeviceInfo m_deviceInfo;
70 QAudioSink *m_audioOutput =
nullptr;
73 QAudioFormat m_audioFormat;
Base class for a long-lived worker object which lives in its own thread.
const QObject * owner() const
Owner of the worker.
Value object encapsulating information of a audio device.
swift::misc::audio::CAudioDeviceInfo getAudioDevice() const
Used audio device.
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.
~CThreadedTonePairPlayer()=default
Destructor.
CThreadedTonePairPlayer(QObject *owner, const QString &name, const swift::misc::audio::CAudioDeviceInfo &device)
Constructor.
bool reinitializeAudio(const swift::misc::audio::CAudioDeviceInfo &device)
Reinitialize audio.
void initialize()
Called when the thread is started.
void beforeQuit() noexcept
Called before quit is called.
Free functions in swift::misc.
#define SWIFT_SOUND_EXPORT
Export a class or function from the library.