Public Member Functions | Protected Member Functions

PositionableAudioSource Class Reference

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

Inherits AudioSource.

Inherited by AudioFormatReaderSource, AudioTransportSource, and BufferingAudioSource.

List of all members.

Public Member Functions

 ~PositionableAudioSource ()
 Destructor.
virtual void setNextReadPosition (int64 newPosition)=0
 Tells the stream to move to a new position.
virtual int64 getNextReadPosition () const =0
 Returns the position from which the next block will be returned.
virtual int64 getTotalLength () const =0
 Returns the total length of the stream (in samples).
virtual bool isLooping () const =0
 Returns true if this source is actually playing in a loop.
virtual void setLooping (bool shouldLoop)
 Tells the source whether you'd like it to play in a loop.

Protected Member Functions

 PositionableAudioSource () noexcept
 Creates the PositionableAudioSource.

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

Constructor & Destructor Documentation

PositionableAudioSource::PositionableAudioSource (  ) [protected]
PositionableAudioSource::~PositionableAudioSource (  )

Destructor.


Member Function Documentation

virtual void 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 AudioFormatReaderSource, AudioTransportSource, and BufferingAudioSource.

virtual int64 PositionableAudioSource::getNextReadPosition (  ) const [pure virtual]

Returns the position from which the next block will be returned.

See also:
setNextReadPosition

Implemented in AudioFormatReaderSource, AudioTransportSource, and BufferingAudioSource.

virtual int64 PositionableAudioSource::getTotalLength (  ) const [pure virtual]

Returns the total length of the stream (in samples).

Implemented in AudioFormatReaderSource, AudioTransportSource, and BufferingAudioSource.

Referenced by BufferingAudioSource::getTotalLength().

virtual bool PositionableAudioSource::isLooping (  ) const [pure virtual]

Returns true if this source is actually playing in a loop.

Implemented in AudioFormatReaderSource, AudioTransportSource, and BufferingAudioSource.

Referenced by BufferingAudioSource::isLooping().

virtual void PositionableAudioSource::setLooping ( bool  shouldLoop ) [virtual]

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

Reimplemented in AudioFormatReaderSource.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines