Just Intonation
Version 1.3.1 (19)
Explore key-independent dynamically adapting tuning in just intonation
|
Abstract base class for audio input and output. More...
#include <audiobase.h>
Public Slots | |
virtual void | connectDevice (const bool active)=0 |
Signals | |
void | onAudioDevicesAdded (const QStringList &devices) |
Signal indicating that a new audio device was plugged in (e.g. a USB headphone) More... | |
void | onAudioDevicesRemoved (const QStringList &devices) |
Signal indicating that an audio device has been removed. More... | |
void | onChangeOfAvailableAudioDevices (const QStringList &devices) |
Signal indicating that the list of available devices has been changed. More... | |
void | onCurrentDeviceParametersChanged () |
Signal indicating that the actually used audio device has changed. More... | |
void | onConnectionSuccessfullyEstablished (bool success) |
Signal indicating that successful of failed connection. More... | |
Public Member Functions | |
AudioBase () | |
Constructor. More... | |
const AudioParameters | getActualDeviceParameters () const |
Get the actual audio device parameters. More... | |
const AudioParameters | getWantedDeviceParameters () const |
Get the intended audio device parameters. More... | |
void | setActualParameters (const AudioParameters ¶meters) |
Set the actual audio device parameters. More... | |
void | setWantedParameters (const AudioParameters ¶meters) |
Set the wanted audio device parameters. More... | |
virtual void | updateListOfDevices ()=0 |
Update the list of devices, called by the DeviceGuard. More... | |
QStringList | getListOfDevices () const |
Get the current list of devices from the last update. More... | |
virtual bool | init () |
Virtual initialization function (no functionality here) More... | |
virtual bool | exit () |
Virtual exit function (no functionality here) More... | |
virtual bool | start () |
Start the thread. More... | |
virtual bool | stop () |
Stop the thread. More... | |
virtual void | suspend () |
Mark the thread as suspended. More... | |
virtual void | resume () |
Resume from the suspend mode. More... | |
bool | isActive () const |
Return true if thread is running and not suspended. More... | |
void | setVerbosity (int verbosity) |
Set verbosity level of messages. More... | |
int | getVerbosity () |
Get verbosity level. More... | |
QString | getThreadName () const |
Get thread name. More... | |
Protected Member Functions | |
virtual void | initiallyCalledWorker () |
Virtual worker function called when the thread is starting. More... | |
virtual void | finallyCalledWorker () |
Virtual worker function called when the thread stops. More... | |
virtual void | periodicallyCalledWorker () |
Virtual worker function called periodically from the timer. More... | |
void | setPriority (const QThread::Priority p) |
Set thread priority. More... | |
void | setTimerInterval (const int msec, const int firstMsec=0) |
Set timer interval for the periodically called worker. More... | |
void | setThreadName (const QString name) |
Set thread name (Linux only) More... | |
bool | isInterruptionRequested () const |
Return true if the thread was requested to interrupt or terminate. More... | |
Protected Attributes | |
QStringList | mAudioDeviceNames |
Current list of devices. More... | |
Private Attributes | |
AudioParameters | mWantedDeviceParameters |
Structure holding the device parameters. More... | |
AudioParameters | mActualDeviceParameters |
Actual device parameters. More... | |
QMutex | mAudioParameterMutex |
Access mutex. More... | |
Abstract base class for audio input and output.
This class defines the basics properties of an audio input or output interface. It manages the sampling rate, the number of used channels and the name of the audio device. To work smoothly it runs in an independent thread.
Definition at line 52 of file audiobase.h.
AudioBase::AudioBase | ( | ) |
Constructor.
Constructor, resetting member variables to default values.
Definition at line 34 of file audiobase.cpp.
|
pure virtualslot |
Connect/disconnect the audio device
active | : connect=true, disconnect=false |
|
inlinevirtualinherited |
Virtual exit function (no functionality here)
Reimplemented in AudioOutput.
Definition at line 71 of file threadbase.h.
|
inlineprotectedvirtualinherited |
Virtual worker function called when the thread stops.
Reimplemented in Tuner, and AudioOutput.
Definition at line 87 of file threadbase.h.
const AudioParameters AudioBase::getActualDeviceParameters | ( | ) | const |
Get the actual audio device parameters.
Get the actual audio device parameters (thread safe)
Definition at line 55 of file audiobase.cpp.
|
inline |
Get the current list of devices from the last update.
Definition at line 70 of file audiobase.h.
|
inherited |
Get thread name.
Definition at line 132 of file threadbase.cpp.
|
inlineinherited |
Get verbosity level.
Definition at line 80 of file threadbase.h.
const AudioParameters AudioBase::getWantedDeviceParameters | ( | ) | const |
Get the intended audio device parameters.
Get the wanted audio device parameters (thread safe)
Definition at line 70 of file audiobase.cpp.
|
inlinevirtualinherited |
Virtual initialization function (no functionality here)
Reimplemented in Tuner, AudioOutput, and SoundGenerator.
Definition at line 70 of file threadbase.h.
|
inlineprotectedvirtualinherited |
Virtual worker function called when the thread is starting.
Reimplemented in Tuner, and AudioOutput.
Definition at line 85 of file threadbase.h.
|
inherited |
Return true if thread is running and not suspended.
Definition at line 136 of file threadbase.cpp.
|
protectedinherited |
Return true if the thread was requested to interrupt or terminate.
Definition at line 128 of file threadbase.cpp.
|
signal |
Signal indicating that a new audio device was plugged in (e.g. a USB headphone)
|
signal |
Signal indicating that an audio device has been removed.
|
signal |
Signal indicating that the list of available devices has been changed.
|
signal |
Signal indicating that successful of failed connection.
|
signal |
Signal indicating that the actually used audio device has changed.
|
inlineprotectedvirtualinherited |
Virtual worker function called periodically from the timer.
Reimplemented in Tuner, and AudioDeviceGuard.
Definition at line 89 of file threadbase.h.
|
virtualinherited |
Resume from the suspend mode.
Restart the timer and clear the mSuspended flag
Reimplemented in MidiPlayer.
Definition at line 99 of file threadbase.cpp.
void AudioBase::setActualParameters | ( | const AudioParameters & | parameters | ) |
Set the actual audio device parameters.
Set actual audio device parameters (thread safe)
parameters | : Reference to the device parameters |
Definition at line 85 of file audiobase.cpp.
|
protectedinherited |
Set thread priority.
Definition at line 109 of file threadbase.cpp.
|
protectedinherited |
Set thread name (Linux only)
Definition at line 121 of file threadbase.cpp.
|
protectedinherited |
Set timer interval for the periodically called worker.
Definition at line 117 of file threadbase.cpp.
|
inherited |
Set verbosity level of messages.
Definition at line 113 of file threadbase.cpp.
void AudioBase::setWantedParameters | ( | const AudioParameters & | parameters | ) |
Set the wanted audio device parameters.
Set wanted audio device parameters (thread safe)
parameters | : Reference to the device parameters |
Definition at line 100 of file audiobase.cpp.
|
virtualinherited |
Start the thread.
Starts the thread. If the thread is suspended it will resume. If the thread is already started the function does nothing.
Reimplemented in Tuner, and AudioOutput.
Definition at line 64 of file threadbase.cpp.
|
virtualinherited |
Stop the thread.
Send a termination request to the execution loop. Wait for the thread to terminate. The active components of the thread should call isInterruptionRequested() and quit immediately if this function is true.
Reimplemented in MidiPlayer, AudioOutput, and Instrument.
Definition at line 152 of file threadbase.cpp.
|
virtualinherited |
Mark the thread as suspended.
Calling this function tells the thread that it has to wait in some sort of standby. Note that the thread itself is not terminated and that the event loop is still active. Calling this function stops the timer so that the periodicallyCalledWorker() is not active any more. In addition the mSuspended flag is set.
Reimplemented in MidiPlayer, and SoundGenerator.
Definition at line 84 of file threadbase.cpp.
|
pure virtual |
Update the list of devices, called by the DeviceGuard.
Implemented in AudioOutput.
|
private |
Actual device parameters.
Definition at line 91 of file audiobase.h.
|
protected |
Current list of devices.
Definition at line 94 of file audiobase.h.
|
mutableprivate |
Access mutex.
Definition at line 92 of file audiobase.h.
|
private |
Structure holding the device parameters.
Definition at line 90 of file audiobase.h.