openshot-audio
0.1.6
|
#include <juce_AudioSourcePlayer.h>
Public Member Functions | |
AudioSourcePlayer () | |
virtual | ~AudioSourcePlayer () |
void | setSource (AudioSource *newSource) |
AudioSource * | getCurrentSource () const noexcept |
void | setGain (float newGain) noexcept |
float | getGain () const noexcept |
void | audioDeviceIOCallback (const float **inputChannelData, int totalNumInputChannels, float **outputChannelData, int totalNumOutputChannels, int numSamples) override |
void | audioDeviceAboutToStart (AudioIODevice *device) override |
void | audioDeviceStopped () override |
void | prepareToPlay (double sampleRate, int blockSize) |
![]() | |
virtual | ~AudioIODeviceCallback () |
virtual void | audioDeviceError (const String &errorMessage) |
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.
AudioSourcePlayer::AudioSourcePlayer | ( | ) |
Creates an empty AudioSourcePlayer.
|
virtual |
Destructor.
Make sure this object isn't still being used by an AudioIODevice before deleting it!
|
overridevirtual |
Implementation of the AudioIODeviceCallback method.
Implements AudioIODeviceCallback.
|
overridevirtual |
Implementation of the AudioIODeviceCallback method.
Implements AudioIODeviceCallback.
|
overridevirtual |
Implementation of the AudioIODeviceCallback method.
Implements AudioIODeviceCallback.
|
inlinenoexcept |
Returns the source that's playing. May return nullptr if there's no source.
|
inlinenoexcept |
Returns the current gain.
void AudioSourcePlayer::prepareToPlay | ( | double | sampleRate, |
int | blockSize | ||
) |
An alternative method for initialising the source without an AudioIODevice.
|
noexcept |
Sets a gain to apply to the audio data.
void 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. |