Entropy Piano Tuner  1.1.3 (documentation not yet complete)
An open-source experimental software for piano tuning by entropy minimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
AudioPlayerThreadForQt Class Reference

Class for the audio player thread. More...

#include <audioplayerthreadforqt.h>

+ Inheritance diagram for AudioPlayerThreadForQt:
+ Collaboration diagram for AudioPlayerThreadForQt:

Public Types

typedef int16_t DataFormat
 

Public Slots

void workerFunction ()
 Main worker function of the Qt audio manager. More...
 

Signals

void finished ()
 
void error (QString err)
 

Public Member Functions

 AudioPlayerThreadForQt (AudioPlayerForQt *audio)
 Constructor. More...
 
 ~AudioPlayerThreadForQt ()
 
void registerForTermination ()
 
void setPause (bool pause)
 Pause the audio player. More...
 
bool isRunning ()
 

Static Public Attributes

static const double BufferMilliseconds = 50
 

Private Member Functions

void init ()
 Initialize the audio player. More...
 
void exit ()
 Exit from the Qt audio player. More...
 
void start ()
 Start the Qt audio device. More...
 
void stop ()
 Stop the Qt audio device. More...
 

Private Attributes

AudioPlayerForQtmAudioSource
 Audio source where the data comes from. More...
 
QAudioOutput * mAudioSink
 Audio sink to which the data is sent. More...
 
QIODevice * mIODevice
 Qt IO device pointer. More...
 
std::atomic< bool > mThreadRunning
 Boolean indicating that the thread is running. More...
 
std::atomic< bool > mPause
 Boolean indicating that the thread is pausing. More...
 

Detailed Description

Class for the audio player thread.

This class serves as a container for the workerFunction in which the thread is running.

Definition at line 36 of file audioplayerthreadforqt.h.

Member Typedef Documentation

Definition at line 42 of file audioplayerthreadforqt.h.

Constructor & Destructor Documentation

AudioPlayerThreadForQt::AudioPlayerThreadForQt ( AudioPlayerForQt audio)

Constructor.

Parameters
audio: Pointer to the AudioPlayerForQt which created the instance.

Definition at line 38 of file audioplayerthreadforqt.cpp.

AudioPlayerThreadForQt::~AudioPlayerThreadForQt ( )
inline

Definition at line 44 of file audioplayerthreadforqt.h.

Member Function Documentation

void AudioPlayerThreadForQt::error ( QString  err)
signal
void AudioPlayerThreadForQt::exit ( )
private

Exit from the Qt audio player.

Definition at line 155 of file audioplayerthreadforqt.cpp.

+ Here is the call graph for this function:

void AudioPlayerThreadForQt::finished ( )
signal
void AudioPlayerThreadForQt::init ( )
private

Initialize the audio player.

This function defines the format, looks for the available audio device, manages fallbacks to supported formats, and defines the size of the internal Qt buffer.

Definition at line 59 of file audioplayerthreadforqt.cpp.

bool AudioPlayerThreadForQt::isRunning ( )
inline

Definition at line 48 of file audioplayerthreadforqt.h.

void AudioPlayerThreadForQt::registerForTermination ( )
inline

Definition at line 46 of file audioplayerthreadforqt.h.

void AudioPlayerThreadForQt::setPause ( bool  pause)

Pause the audio player.

Parameters
pausePause

Definition at line 232 of file audioplayerthreadforqt.cpp.

void AudioPlayerThreadForQt::start ( )
private

Start the Qt audio device.

Definition at line 182 of file audioplayerthreadforqt.cpp.

void AudioPlayerThreadForQt::stop ( )
private

Stop the Qt audio device.

Definition at line 210 of file audioplayerthreadforqt.cpp.

void AudioPlayerThreadForQt::workerFunction ( )
slot

Main worker function of the Qt audio manager.

Definition at line 246 of file audioplayerthreadforqt.cpp.

+ Here is the call graph for this function:

Member Data Documentation

const double AudioPlayerThreadForQt::BufferMilliseconds = 50
static

Definition at line 41 of file audioplayerthreadforqt.h.

QAudioOutput* AudioPlayerThreadForQt::mAudioSink
private

Audio sink to which the data is sent.

Definition at line 65 of file audioplayerthreadforqt.h.

AudioPlayerForQt* AudioPlayerThreadForQt::mAudioSource
private

Audio source where the data comes from.

Definition at line 64 of file audioplayerthreadforqt.h.

QIODevice* AudioPlayerThreadForQt::mIODevice
private

Qt IO device pointer.

Definition at line 66 of file audioplayerthreadforqt.h.

std::atomic<bool> AudioPlayerThreadForQt::mPause
private

Boolean indicating that the thread is pausing.

Definition at line 68 of file audioplayerthreadforqt.h.

std::atomic<bool> AudioPlayerThreadForQt::mThreadRunning
private

Boolean indicating that the thread is running.

Definition at line 67 of file audioplayerthreadforqt.h.


The documentation for this class was generated from the following files: