![]() |
Just Intonation
Version 1.3.1 (19)
Explore key-independent dynamically adapting tuning in just intonation
|
Sound-generating module which plays the tones held by the SoundGenerator. More...
#include <sampler.h>
Public Member Functions | |
Sampler () | |
Constructor of the Sampler without functionality. More... | |
void | init (SoundGenerator *soundgenerator) |
Initialization of the sampler. More... | |
void | exit () |
void | setParameters (const AudioParameters ¶meters) |
Set audio device parameters. More... | |
void | setMaxPacketSize (int n) |
size_t | getMaxPacketSize () |
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... | |
Private Member Functions | |
size_t | generateSound (char *charbuffer, size_t maxSize) override final |
Essential sound-generating function of the sampler. More... | |
Private Attributes | |
SoundGenerator * | pSoundGenerator |
Pointer to the SoundGenerator. More... | |
QList< Tone > * | pTones |
Pointer to the list of tones held by SoundGenerator. More... | |
QVector< qint32 > | mLeft |
QVector< qint32 > | mRight |
Audio signal to be constructed. More... | |
Sound-generating module which plays the tones held by the SoundGenerator.
This class implements the AudioGenerator from the audio library. It has to be initialized with a pointer to the SoundGenerator which allows the sampler to access the list of tones. The Sampler itself does not hold any local information about the tone being played, all that is contained in the SoundGenerator.
PULL MODE:
As implementation of AudioGenerator the sample operates in the pull mode, that is, the generateSound function is called by the QAudioDevice whenever more data is needed. If no tones are queued the sampler simply returns as much zeroes as needed. For this reason the sampler does not provide any start/stop or mute functionality, instead this should be managed directly by the audio device.
Sampler::Sampler | ( | ) |
Constructor of the Sampler without functionality.
Definition at line 37 of file sampler.cpp.
|
inline |
|
finaloverrideprivatevirtual |
Essential sound-generating function of the sampler.
This is the essential time-critical function of the sampler which generates the actual sound. The audio device calls this function whenever the audio stream needs more PCM values.
buffer | : Pointer to the array where the PCM values are stored. |
maxSize | : Maximal allowed number of bytes to be generated. |
Reimplemented from AudioGenerator.
Definition at line 81 of file sampler.cpp.
|
inlineinherited |
|
inlineinherited |
Definition at line 55 of file audiogenerator.h.
|
inherited |
void Sampler::init | ( | SoundGenerator * | soundgenerator | ) |
Initialization of the sampler.
soundgenerator | : Pointer to the SoundGenerator from where the sampler is controlled. |
Definition at line 56 of file sampler.cpp.
|
inlineinherited |
Definition at line 49 of file audiogenerator.h.
|
inherited |
Set audio device parameters.
Definition at line 50 of file audiogenerator.cpp.
|
inherited |
|
protectedinherited |
Maximal number of frames per buffer.
Definition at line 59 of file audiogenerator.h.
|
protectedinherited |
Local copy of the audio parameters.
Definition at line 58 of file audiogenerator.h.
|
private |
|
private |
Pointer to the SoundGenerator.
|
private |
Pointer to the list of tones held by SoundGenerator.