Entropy Piano Tuner
1.1.3 (documentation not yet complete)
An open-source experimental software for piano tuning by entropy minimization
|
Abstract adapter class for PCM-based audio output drivers. More...
#include <audioplayeradapter.h>
Public Member Functions | |
AudioPlayerAdapter () | |
Constructor, resetting default values. More... | |
virtual | ~AudioPlayerAdapter () |
Destructor without functionality. More... | |
virtual void | exit () override |
Destroy the audio device. More... | |
void | setWriter (PCMWriterInterface *interface) |
Connect the audio adapter to a PCM writer interface. More... | |
PCMWriterInterface * | getWriter () |
Get pointer to the PCM writer. More... | |
void | setMuted (bool muted) |
Mute the audio player. More... | |
bool | isMuted () |
Returns true if the player is muted. More... | |
Public Member Functions inherited from AudioBase | |
AudioBase () | |
Constructor. More... | |
virtual | ~AudioBase () |
Destructor (no functionality). More... | |
virtual void | init ()=0 |
Inizialize the audio device. More... | |
virtual void | start ()=0 |
Start/restart the audio device. More... | |
virtual void | stop ()=0 |
Stop the audio device. More... | |
const std::string & | getDeviceName () const |
Get a readable string of the name of the audio device. More... | |
void | setDeviceName (const std::string &n) |
Set the device name. More... | |
int | getSamplingRate () const |
Get the actual sampling rate. More... | |
virtual void | setSamplingRate (int rate) |
Allow the implementation to change the sampling rate during operation. More... | |
int | getChannelCount () const |
Get the actual number of channels (1=mono, 2=stereo). More... | |
virtual void | setChannelCount (int cnt) |
Set the number of channels (1=mono, 2=stereo). More... | |
Private Attributes | |
PCMWriterInterface * | mPCMWriter |
Pointer to PCM writer. More... | |
bool | mMuted |
Flag which is true if the ouput device muted. More... | |
Additional Inherited Members | |
Public Types inherited from AudioBase | |
typedef double | PCMDataType |
typedef std::vector< PCMDataType > | PacketType |
Type definition of a PCM packet (vector of PCM values). More... | |
Abstract adapter class for PCM-based audio output drivers.
This class has to be implemented by the actual sound system. In the EPT this is the AudioPlayerForQt
Note that the sound-producing component (the EPT synthesizer) does not call the audio player by itself to deliver data, instead the AudioPlayer manages the workflow and requests data from the sound-producing component.
To establish this mechanism the sound-producing component (the synthesizer) has to be derived from an abstract class called PCMWriterInterface. The request is carried out by calling a function named generateAudioPacket which is defined virtually in the PCMWriterInterface.
The present class does nothing but holding a pointer to the PCMWriterInterface. In addition it handels a mute flag.
Definition at line 50 of file audioplayeradapter.h.
AudioPlayerAdapter::AudioPlayerAdapter | ( | ) |
Constructor, resetting default values.
Definition at line 30 of file audioplayeradapter.cpp.
|
inlinevirtual |
Destructor without functionality.
Definition at line 54 of file audioplayeradapter.h.
|
overridevirtual |
Destroy the audio device.
Implements AudioBase.
Reimplemented in AudioPlayerForQt.
Definition at line 37 of file audioplayeradapter.cpp.
|
inline |
Get pointer to the PCM writer.
Definition at line 59 of file audioplayeradapter.h.
|
inline |
Returns true if the player is muted.
Definition at line 62 of file audioplayeradapter.h.
|
inline |
Mute the audio player.
Definition at line 61 of file audioplayeradapter.h.
void AudioPlayerAdapter::setWriter | ( | PCMWriterInterface * | interface | ) |
Connect the audio adapter to a PCM writer interface.
The writer interface is a software component that produces sound. In the EPT, the only component producing sound is the Synthesizer.
interface | : Pointer to the PCM writer interface to be connected. |
Definition at line 55 of file audioplayeradapter.cpp.
|
private |
Flag which is true if the ouput device muted.
Definition at line 65 of file audioplayeradapter.h.
|
private |
Pointer to PCM writer.
Definition at line 64 of file audioplayeradapter.h.