AudioPlaySource Class Reference

#include <AudioPlaySource.h>

Inherited by AudioCallbackPlaySource.

Inheritance diagram for AudioPlaySource:

Inheritance graph
[legend]
List of all members.

Detailed Description

Simple interface for audio playback.

This should be all that the ViewManager needs to know about to synchronise with playback by sample frame, but it doesn't provide enough to determine what is actually being played or how. See the audioio directory for a concrete subclass.

Definition at line 27 of file AudioPlaySource.h.

Public Member Functions

virtual ~AudioPlaySource ()
virtual void play (size_t startFrame)=0
 Start playing from the given frame.
virtual void stop ()=0
 Stop playback.
virtual bool isPlaying () const=0
 Return whether playback is currently supposed to be happening.
virtual size_t getCurrentPlayingFrame ()=0
 Return the frame number that is currently expected to be coming out of the speakers.
virtual bool getOutputLevels (float &left, float &right)=0
 Return the current (or thereabouts) output levels in the range 0.0 -> 1.0, for metering purposes.
virtual size_t getSourceSampleRate () const=0
 Return the sample rate of the source material -- any material that wants to play at a different rate will sound wrong.
virtual size_t getTargetSampleRate () const=0
 Return the sample rate set by the target audio device (or the source sample rate if the target hasn't set one).


Constructor & Destructor Documentation

virtual AudioPlaySource::~AudioPlaySource (  )  [inline, virtual]

Definition at line 30 of file AudioPlaySource.h.


Member Function Documentation

virtual void AudioPlaySource::play ( size_t  startFrame  )  [pure virtual]

Start playing from the given frame.

If playback is already under way, reseek to the given frame and continue.

Implemented in AudioCallbackPlaySource.

Referenced by ViewManager::seek(), and ViewManager::setPlaybackFrame().

virtual void AudioPlaySource::stop (  )  [pure virtual]

Stop playback.

Implemented in AudioCallbackPlaySource.

virtual bool AudioPlaySource::isPlaying (  )  const [pure virtual]

Return whether playback is currently supposed to be happening.

Implemented in AudioCallbackPlaySource.

Referenced by ViewManager::checkPlayStatus(), ViewManager::getPlaybackFrame(), ViewManager::isPlaying(), ViewManager::seek(), and ViewManager::setPlaybackFrame().

virtual size_t AudioPlaySource::getCurrentPlayingFrame (  )  [pure virtual]

Return the frame number that is currently expected to be coming out of the speakers.

(i.e. compensating for playback latency.)

Implemented in AudioCallbackPlaySource.

Referenced by ViewManager::checkPlayStatus(), ViewManager::getPlaybackFrame(), and ViewManager::seek().

virtual bool AudioPlaySource::getOutputLevels ( float &  left,
float &  right 
) [pure virtual]

Return the current (or thereabouts) output levels in the range 0.0 -> 1.0, for metering purposes.

Implemented in AudioCallbackPlaySource.

Referenced by ViewManager::checkPlayStatus().

virtual size_t AudioPlaySource::getSourceSampleRate (  )  const [pure virtual]

Return the sample rate of the source material -- any material that wants to play at a different rate will sound wrong.

Implemented in AudioCallbackPlaySource.

Referenced by ViewManager::getPlaybackSampleRate().

virtual size_t AudioPlaySource::getTargetSampleRate (  )  const [pure virtual]

Return the sample rate set by the target audio device (or the source sample rate if the target hasn't set one).

If the source and target sample rates differ, resampling will occur.

Implemented in AudioCallbackPlaySource.

Referenced by ViewManager::getOutputSampleRate().


The documentation for this class was generated from the following file:
Generated on Wed Feb 20 15:45:32 2008 for SonicVisualiser by  doxygen 1.5.1