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

CascadeWAVPlayer Class Reference

a class for playing WAV and AIFF files More...

#include <cascade/av/CascadeWAVPlayer.h>

Inheritance diagram for CascadeWAVPlayer:

CascadeObject List of all members.

Public Types

enum  PlaybackError { kUnknown = 0, kUnsupportedSampleRate = 1, kUnsupportedBitsPerSample = 2, kUnsupportedNumChannels = 3 }

Public Member Functions

 CascadeWAVPlayer ()
virtual ~CascadeWAVPlayer ()
virtual bool Play (CascadeFile &file, CascadeAudioPlaybackDevice &device)
virtual bool Stop ()
virtual bool Pause ()
virtual bool ResumePlayback ()
virtual bool SetVolume (u16 nVolume)
virtual bool IsPlaying ()
virtual bool IsStopped ()
virtual bool IsPaused ()
virtual u32 GetDuration ()

Protected Member Functions

virtual void OnPlaybackBegin ()
virtual void OnPlaybackEnd ()
virtual void OnSecondTick (u32 nSecond)
virtual void OnPlaybackError (PlaybackError error, u32 nErrorData)

Friends

class CascadePrivate::WAVPlayer

Detailed Description

a class for playing WAV and AIFF files

Skip the description

CascadeWAVPlayer is a class that allows easy playback of WAV and AIFF files


class CascadeWAVPlayer


Member Enumeration Documentation

enum CascadeWAVPlayer::PlaybackError
 

represents a type of playback error

PlaybackError represents the types of playback errors that can occur. A variable of this type is provided to the virtual function OnPlaybackError to indicate the error that occurred during playback.

See also:
OnPlaybackError
Enumeration values:
kUnknown  indicates an unknown error occurred
kUnsupportedSampleRate  indicates an unsupported sample rate
kUnsupportedBitsPerSample  indicates an unsupported number of bits per sample
kUnsupportedNumChannels  indicates an unsupported number of channels


Constructor & Destructor Documentation

CascadeWAVPlayer::CascadeWAVPlayer  ) 
 

the default constructor - lightweight

This default constructor is lightweight.

virtual CascadeWAVPlayer::~CascadeWAVPlayer  )  [virtual]
 

destructor

The destructor.


Member Function Documentation

virtual u32 CascadeWAVPlayer::GetDuration  )  [virtual]
 

gets the duration of the wav or aiff file in milliseconds

GetDuration() gets the duration of the wav or aiff file in milliseconds.

Returns:
the duration of the wav or aiff file in milliseconds

virtual bool CascadeWAVPlayer::IsPaused  )  [virtual]
 

determines whether or not the file is paused

IsPaused() determines whether or not the wav or aiff file is paused.

Returns:
whether or not the file is paused

virtual bool CascadeWAVPlayer::IsPlaying  )  [virtual]
 

determines whether or not the file is playing

IsPlaying() determines whether or not the wav or aiff file is playing.

Returns:
whether or not the file is playing

virtual bool CascadeWAVPlayer::IsStopped  )  [virtual]
 

determines whether or not the file is stopped

IsStopped() determines whether or not the wav or aiff file is stopped.

Returns:
whether or not the file is stopped

virtual void CascadeWAVPlayer::OnPlaybackBegin  )  [protected, virtual]
 

notifies the client when playback begins

OnPlaybackBegin() is called in the context of a private playback thread when playback has begun.

virtual void CascadeWAVPlayer::OnPlaybackEnd  )  [protected, virtual]
 

notifies the client when playback ends

OnPlaybackEnd() is called in the context of a private playback thread when playback has ended.

virtual void CascadeWAVPlayer::OnPlaybackError PlaybackError  error,
u32  nErrorData
[protected, virtual]
 

notifies the client of an error that occurs during playback

OnPlaybackError() is called in the context of a private playback thread whenever a playback error occurs. The playback error is indicated by the parameter error, while the meaning of nErrorData depends upon the error as follows:

  • kUnknown - nErrorData is unused
  • kUnsupportedSampleRate - nErrorData is the sample rate that is unsupported
  • kUnsupportedBitsPerSample - nErrorData is the number of bits per sample that is unsupported
  • kUnsupportedNumChannels - nErrorData is the number of channels that is unsupported

Parameters:
error the error type
nErrorData error type specific error information
See also:
PlaybackError

virtual void CascadeWAVPlayer::OnSecondTick u32  nSecond  )  [protected, virtual]
 

notifies the client every second during playback

OnSecondTick() is called in the context of a private playback thread every second while the file is playing.

Parameters:
nSecond the duration in seconds of the playback point in the file

virtual bool CascadeWAVPlayer::Pause  )  [virtual]
 

pauses playback of the wav or aiff file

Pause() pauses playback of the wav or aiff file.

Returns:
whether pausing succeeded

virtual bool CascadeWAVPlayer::Play CascadeFile file,
CascadeAudioPlaybackDevice device
[virtual]
 

plays a wav or aiff file on a device

Play() starts playback of a wav or aiff file.

Parameters:
file the file to play
device the device to play the file on
Returns:
whether or not playback initiation succeeded

virtual bool CascadeWAVPlayer::ResumePlayback  )  [virtual]
 

resumes playback of a paused wav or aiff file

ResumePlayback() resumes playback of a previously paused wav or aiff file.

Returns:
whether playback resumption succeeded

virtual bool CascadeWAVPlayer::SetVolume u16  nVolume  )  [virtual]
 

sets the playback volume

SetVolume() sets the output volume of audio playback. Legal values for nVolume are 0 - 0xFFFF which is a linear range of volume where 0 is no volume and 0xFFFF is full volume.

Parameters:
nVolume the volume to set
Returns:
whether the volume change succeeded

virtual bool CascadeWAVPlayer::Stop  )  [virtual]
 

stops playback of the wav or aiff file

Stop() stops playback of the wav or aiff file.

Returns:
whether stopping succeeded


Friends And Related Function Documentation

friend class CascadePrivate::WAVPlayer [friend]
 


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