Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

CascadeAudioPlayer::Client Class Reference

#include <CascadeAudioPlayer.h>

List of all members.

Public Member Functions

virtual void OnAudioDecodeBegin (u32 nStreamID, CascadeStream *pStream, u32 nDurationInMilliseconds)
virtual void OnAudioBuffering (u32 nStreamID, u32 nBuffersFilled, u32 nBuffersToFill)
virtual void OnAudioPlaybackBegin (u32 nStreamID)
virtual void OnAudioDecodeEnd (u32 nStreamID, CascadeStream *pStream, PlaybackResult result, u32 nPlaybackResultData)
virtual void OnAudioPlaybackEnd (u32 nStreamID, PlaybackResult result)
virtual void OnVisualizePrepare (u32 nStreamID, const SampleSet &samples)
virtual void OnVisualizeExecute (u32 nStreamID, u32 nSequenceNumber, u32 nTimestampMilliseconds, u32 nBuffersQueued, u32 nTotalBuffers)
virtual void OnPlaybackPause ()
virtual void OnPlaybackResume ()
virtual void OnPlaybackStop ()


Member Function Documentation

virtual void CascadeAudioPlayer::Client::OnAudioBuffering u32  nStreamID,
u32  nBuffersFilled,
u32  nBuffersToFill
[virtual]
 

virtual void CascadeAudioPlayer::Client::OnAudioDecodeBegin u32  nStreamID,
CascadeStream pStream,
u32  nDurationInMilliseconds
[virtual]
 

virtual void CascadeAudioPlayer::Client::OnAudioDecodeEnd u32  nStreamID,
CascadeStream pStream,
PlaybackResult  result,
u32  nPlaybackResultData
[virtual]
 

virtual void CascadeAudioPlayer::Client::OnAudioPlaybackBegin u32  nStreamID  )  [virtual]
 

virtual void CascadeAudioPlayer::Client::OnAudioPlaybackEnd u32  nStreamID,
PlaybackResult  result
[virtual]
 

virtual void CascadeAudioPlayer::Client::OnPlaybackPause  )  [virtual]
 

virtual void CascadeAudioPlayer::Client::OnPlaybackResume  )  [virtual]
 

virtual void CascadeAudioPlayer::Client::OnPlaybackStop  )  [virtual]
 

virtual void CascadeAudioPlayer::Client::OnVisualizeExecute u32  nStreamID,
u32  nSequenceNumber,
u32  nTimestampMilliseconds,
u32  nBuffersQueued,
u32  nTotalBuffers
[virtual]
 

called in the context of a distinct thread to notify clients when data should be visualized

OnVisualizeExecute() is called in the context of a distnct thread at the moment the audio device actually plays the first sample of a sample set previously passed in to OnVisualizePrepare(). The sample set the notification applies to is the set that had the same sequence number and timestamp as those passed in. In addition, the state of buffer fullness is given in terms of the number of buffers filled and queued in the driver out of a number of total buffers in the driver chain. So if nBuffersQueued == 4, and nTotalBuffers == 8, then the driver has 50% buffer fullness.

You should perform the actual visualization of the data you previously prepared, either in the context of this distinct thread, or by signalling your own thread to do so.

Parameters:
nStreamUniqueID the unique stream ID of the sample set the notification applies to
nTimestampMilliseconds the timestamp of the sample set the notification applies to
nBuffersQueued the current number of buffers in the driver chain queued
nTotalBuffers the total number of buffers in the driver chain
Note:
Like OnVisualizePrepare(), any processing you do in this function will add delay to the decoding cycle. If too much delay is introduced, the audio device will underflow with data.

It is possible that more than one driver buffer will have played between invocations of this function (because decoding took longer than 1 buffer took to play). In this event, you will only be called back with the most recently started timestamp, i.e. notifications can be lost.

virtual void CascadeAudioPlayer::Client::OnVisualizePrepare u32  nStreamID,
const SampleSet samples
[virtual]
 

called in the context of a distinct thread to allow clients to generate visualization data

OnVisualizePrepare() is called in the context of a distinct thread as soon as a set of samples is ready, before the samples are queued to the device for playback. Use this function to generate visualization data, but don't visualize it until OnVisualizeExecute() is called later.

You should do all of your visualization data preparation in this function. After this function returns the sample data in the sample set passed in is invalid.

Parameters:
samples the sample set just decoded
Note:
Any processing you do in this function will add delay to the decoding cycle. Normally this will not pose a problem as the buffer sizes selected internally are tailored to allow for visualization generation to occur in-step with the decoding process. Note, however that if you introduce too much delay, the audio device will underflow with data.


The documentation for this class was generated from the following file:
Generated on Sun Jul 24 14:27:18 2005 for Cascade Library by  doxygen 1.4.1