|
JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins
« « « Anklang Documentation |
Wrapper class to continuously stream audio from an audio source to an AudioIODevice. More...
#include "juce_AudioSourcePlayer.h"
Public Member Functions | |
| AudioSourcePlayer () | |
| Creates an empty AudioSourcePlayer. | |
| ~AudioSourcePlayer () override | |
| Destructor. | |
| void | setSource (AudioSource *newSource) |
| Changes the current audio source to play from. | |
| AudioSource * | getCurrentSource () const noexcept |
| Returns the source that's playing. | |
| void | setGain (float newGain) noexcept |
| Sets a gain to apply to the audio data. | |
| float | getGain () const noexcept |
| Returns the current gain. | |
| void | audioDeviceIOCallbackWithContext (const float *const *inputChannelData, int totalNumInputChannels, float *const *outputChannelData, int totalNumOutputChannels, int numSamples, const AudioIODeviceCallbackContext &context) override |
| Implementation of the AudioIODeviceCallbackWithContext method. | |
| void | audioDeviceAboutToStart (AudioIODevice *device) override |
| Implementation of the AudioIODeviceCallback method. | |
| void | audioDeviceStopped () override |
| Implementation of the AudioIODeviceCallback method. | |
| void | prepareToPlay (double sampleRate, int blockSize) |
| An alternative method for initialising the source without an AudioIODevice. | |
Public Member Functions inherited from juce::AudioIODeviceCallback | |
| virtual | ~AudioIODeviceCallback ()=default |
| Destructor. | |
| virtual void | audioDeviceError (const String &errorMessage) |
| This can be overridden to be told if the device generates an error while operating. | |
Wrapper class to continuously stream audio from an audio source to an AudioIODevice.
This object acts as an AudioIODeviceCallback, so can be attached to an output device, and will stream audio from an AudioSource.
@tags{Audio}
Definition at line 36 of file juce_AudioSourcePlayer.h.
| juce::AudioSourcePlayer::AudioSourcePlayer | ( | ) |
Creates an empty AudioSourcePlayer.
Definition at line 26 of file juce_AudioSourcePlayer.cpp.
|
override |
Destructor.
Make sure this object isn't still being used by an AudioIODevice before deleting it!
Definition at line 30 of file juce_AudioSourcePlayer.cpp.
|
overridevirtual |
Implementation of the AudioIODeviceCallback method.
Implements juce::AudioIODeviceCallback.
Definition at line 154 of file juce_AudioSourcePlayer.cpp.
|
overridevirtual |
Implementation of the AudioIODeviceCallbackWithContext method.
Reimplemented from juce::AudioIODeviceCallback.
Definition at line 59 of file juce_AudioSourcePlayer.cpp.
|
overridevirtual |
Implementation of the AudioIODeviceCallback method.
Implements juce::AudioIODeviceCallback.
Definition at line 170 of file juce_AudioSourcePlayer.cpp.
|
noexcept |
Returns the source that's playing.
May return nullptr if there's no source.
Definition at line 69 of file juce_AudioSourcePlayer.h.
|
noexcept |
An alternative method for initialising the source without an AudioIODevice.
Definition at line 160 of file juce_AudioSourcePlayer.cpp.
Sets a gain to apply to the audio data.
Definition at line 54 of file juce_AudioSourcePlayer.cpp.
| void juce::AudioSourcePlayer::setSource | ( | AudioSource * | newSource | ) |
Changes the current audio source to play from.
If the source passed in is already being used, this method will do nothing. If the source is not null, its prepareToPlay() method will be called before it starts being used for playback.
If there's another source currently playing, its releaseResources() method will be called after it has been swapped for the new one.
| newSource | the new source to use - this will NOT be deleted by this object when no longer needed, so it's the caller's responsibility to manage it. |
Definition at line 35 of file juce_AudioSourcePlayer.cpp.