OpenShot Library | OpenShotAudio  0.2.1
juce::PositionableAudioSource Class Referenceabstract

A type of AudioSource which can be repositioned. More...

#include <juce_PositionableAudioSource.h>

+ Inheritance diagram for juce::PositionableAudioSource:

Public Member Functions

 ~PositionableAudioSource () override=default
 Destructor.
 
virtual void setNextReadPosition (int64 newPosition)=0
 Tells the stream to move to a new position. More...
 
virtual int64 getNextReadPosition () const =0
 Returns the position from which the next block will be returned. More...
 
virtual int64 getTotalLength () const =0
 Returns the total length of the stream (in samples). More...
 
virtual bool isLooping () const =0
 Returns true if this source is actually playing in a loop. More...
 
virtual void setLooping (bool shouldLoop)
 Tells the source whether you'd like it to play in a loop. More...
 
- Public Member Functions inherited from juce::AudioSource
virtual ~AudioSource ()=default
 Destructor. More...
 
virtual void prepareToPlay (int samplesPerBlockExpected, double sampleRate)=0
 Tells the source to prepare for playing. More...
 
virtual void releaseResources ()=0
 Allows the source to release anything it no longer needs after playback has stopped. More...
 
virtual void getNextAudioBlock (const AudioSourceChannelInfo &bufferToFill)=0
 Called repeatedly to fetch subsequent blocks of audio data. More...
 

Protected Member Functions

 PositionableAudioSource ()=default
 Creates the PositionableAudioSource. More...
 
- Protected Member Functions inherited from juce::AudioSource
 AudioSource ()=default
 Creates an AudioSource. More...
 

Detailed Description

A type of AudioSource which can be repositioned.

The basic AudioSource just streams continuously with no idea of a current time or length, so the PositionableAudioSource is used for a finite stream that has a current read position.

See also
AudioSource, AudioTransportSource

Definition at line 42 of file juce_PositionableAudioSource.h.

Constructor & Destructor Documentation

◆ PositionableAudioSource()

juce::PositionableAudioSource::PositionableAudioSource ( )
protecteddefault

Member Function Documentation

◆ setNextReadPosition()

virtual void juce::PositionableAudioSource::setNextReadPosition ( int64  newPosition)
pure virtual

Tells the stream to move to a new position.

Calling this indicates that the next call to AudioSource::getNextAudioBlock() should return samples from this position.

Note that this may be called on a different thread to getNextAudioBlock(), so the subclass should make sure it's synchronised.

Implemented in juce::AudioTransportSource, juce::AudioFormatReaderSource, and juce::BufferingAudioSource.

Referenced by juce::AudioTransportSource::setNextReadPosition(), and juce::AudioTransportSource::setSource().

◆ getNextReadPosition()

virtual int64 juce::PositionableAudioSource::getNextReadPosition ( ) const
pure virtual

◆ getTotalLength()

virtual int64 juce::PositionableAudioSource::getTotalLength ( ) const
pure virtual

◆ isLooping()

virtual bool juce::PositionableAudioSource::isLooping ( ) const
pure virtual

◆ setLooping()

virtual void juce::PositionableAudioSource::setLooping ( bool  shouldLoop)
inlinevirtual

Tells the source whether you'd like it to play in a loop.

Reimplemented in juce::AudioFormatReaderSource.

Definition at line 77 of file juce_PositionableAudioSource.h.


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