![]() |
Just Intonation
Version 1.3.1 (19)
Explore key-independent dynamically adapting tuning in just intonation
|
Virtual base class for audio-generating modules. More...
#include <audiogenerator.h>
Public Member Functions | |
AudioGenerator () | |
Constructor. More... | |
~AudioGenerator () | |
Destructor without functionality. More... | |
void | setParameters (const AudioParameters ¶meters) |
Set audio device parameters. More... | |
void | setMaxPacketSize (int n) |
size_t | getMaxPacketSize () |
virtual size_t | generateSound (char *data, size_t maxSize) |
Virtual function for sound generation. This function generates an A440 on the right and an A220 on the left channel as a test tone. Override this function in the actual implementation. More... | |
int | getSampleRate () |
void | setVerbosity (int verbosity) |
Set the verbosity level of the class-specific messages. More... | |
int | getVerbosity () |
Get the actual verbosity level. More... | |
Protected Attributes | |
AudioParameters | mParameters |
Local copy of the audio parameters. More... | |
size_t | mMaxNumberOfFrames |
Maximal number of frames per buffer. More... | |
Virtual base class for audio-generating modules.
This virtual base class has to be inherited by the actual sound-producing implementation such as a synthesizer or audio player.
The derived class should override the virtual function AudioGenerator::generateSound. If this function is not overridden it is implemented here a simple generator producing a 440 Hz sine wave for testing purposes.
Definition at line 42 of file audiogenerator.h.
AudioGenerator::AudioGenerator | ( | ) |
Constructor.
Definition at line 36 of file audiogenerator.cpp.
|
inline |
Destructor without functionality.
Definition at line 46 of file audiogenerator.h.
|
virtual |
Virtual function for sound generation. This function generates an A440 on the right and an A220 on the left channel as a test tone. Override this function in the actual implementation.
This function generates the sound in form of a vector of PCMType data packages. It is called internally by AudioOutputDevice. Whenever the sound system is ready to read new data. This call is executed in the local thread of the audio system.
The parameter maxSize specifies the maximal number of PCMType entries that may be generated and equals the available array size of data.
Each sample consists of two PCMType values (signed int from -32768 to +32767). The implementation should write at most maxSize values (maxSize/2 samples) to the data array and return the actual number of written PCMType values (two times the number of samples).
By default this function generates an A440 sine wave for testing purposes.
data | : Pointer to the buffer of bytes of the output device. |
maxSize | : Maximal number of bytes to be written. |
Reimplemented in Sampler.
Definition at line 102 of file audiogenerator.cpp.
|
inline |
|
inline |
Definition at line 55 of file audiogenerator.h.
|
inherited |
|
inline |
Definition at line 49 of file audiogenerator.h.
void AudioGenerator::setParameters | ( | const AudioParameters & | parameters | ) |
Set audio device parameters.
Definition at line 50 of file audiogenerator.cpp.
|
inherited |
|
protected |
Maximal number of frames per buffer.
Definition at line 59 of file audiogenerator.h.
|
protected |
Local copy of the audio parameters.
Definition at line 58 of file audiogenerator.h.