LMMS
Loading...
Searching...
No Matches
juce::MemoryAudioSource Class Reference

#include <juce_MemoryAudioSource.h>

Inheritance diagram for juce::MemoryAudioSource:
juce::PositionableAudioSource juce::AudioSource

Public Member Functions

 MemoryAudioSource (AudioBuffer< float > &audioBuffer, bool copyMemory, bool shouldLoop=false)
void prepareToPlay (int samplesPerBlockExpected, double sampleRate) override
void releaseResources () override
void getNextAudioBlock (const AudioSourceChannelInfo &bufferToFill) override
void setNextReadPosition (int64 newPosition) override
int64 getNextReadPosition () const override
int64 getTotalLength () const override
bool isLooping () const override
void setLooping (bool shouldLoop) override
Public Member Functions inherited from juce::PositionableAudioSource
 ~PositionableAudioSource () override=default
Public Member Functions inherited from juce::AudioSource
virtual ~AudioSource ()=default

Private Attributes

AudioBuffer< float > buffer
int position = 0
bool isCurrentlyLooping

Additional Inherited Members

Protected Member Functions inherited from juce::PositionableAudioSource
 PositionableAudioSource ()=default
Protected Member Functions inherited from juce::AudioSource
 AudioSource ()=default

Detailed Description

An AudioSource which takes some float audio data as an input.

@tags{Audio}

Constructor & Destructor Documentation

◆ MemoryAudioSource()

juce::MemoryAudioSource::MemoryAudioSource ( AudioBuffer< float > & audioBuffer,
bool copyMemory,
bool shouldLoop = false )

Creates a MemoryAudioSource by providing an audio buffer.

If copyMemory is true then the buffer will be copied into an internal buffer which will be owned by the MemoryAudioSource. If copyMemory is false, then you must ensure that the lifetime of the audio buffer is at least as long as the MemoryAudioSource.

Member Function Documentation

◆ getNextAudioBlock()

void juce::MemoryAudioSource::getNextAudioBlock ( const AudioSourceChannelInfo & bufferToFill)
overridevirtual

Implementation of the AudioSource method.

Implements juce::AudioSource.

◆ getNextReadPosition()

int64 juce::MemoryAudioSource::getNextReadPosition ( ) const
overridevirtual

Implementation of the PositionableAudioSource method.

Implements juce::PositionableAudioSource.

◆ getTotalLength()

int64 juce::MemoryAudioSource::getTotalLength ( ) const
overridevirtual

Implementation of the PositionableAudioSource method.

Implements juce::PositionableAudioSource.

◆ isLooping()

bool juce::MemoryAudioSource::isLooping ( ) const
overridevirtual

Implementation of the PositionableAudioSource method.

Implements juce::PositionableAudioSource.

◆ prepareToPlay()

void juce::MemoryAudioSource::prepareToPlay ( int samplesPerBlockExpected,
double sampleRate )
overridevirtual

Implementation of the AudioSource method.

Implements juce::AudioSource.

◆ releaseResources()

void juce::MemoryAudioSource::releaseResources ( )
overridevirtual

Implementation of the AudioSource method.

Implements juce::AudioSource.

◆ setLooping()

void juce::MemoryAudioSource::setLooping ( bool shouldLoop)
overridevirtual

Implementation of the PositionableAudioSource method.

Reimplemented from juce::PositionableAudioSource.

◆ setNextReadPosition()

void juce::MemoryAudioSource::setNextReadPosition ( int64 newPosition)
overridevirtual

Implementation of the PositionableAudioSource method.

Implements juce::PositionableAudioSource.

Member Data Documentation

◆ buffer

AudioBuffer<float> juce::MemoryAudioSource::buffer
private

◆ isCurrentlyLooping

bool juce::MemoryAudioSource::isCurrentlyLooping
private

◆ position

int juce::MemoryAudioSource::position = 0
private

The documentation for this class was generated from the following files: