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

CascadeMP3Player Class Reference

a class for playing MP3 files More...

#include <cascade/av/CascadeMP3Player.h>

Inheritance diagram for CascadeMP3Player:

CascadeObject List of all members.

Public Types

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

Public Member Functions

 CascadeMP3Player ()
virtual ~CascadeMP3Player ()
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::MP3Player

Detailed Description

a class for playing MP3 files

Skip the description

CascadeMP3Player is a class that allows easy playback of MP3 files


class CascadeMP3Player


Member Enumeration Documentation

enum CascadeMP3Player::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

CascadeMP3Player::CascadeMP3Player  ) 
 

the default constructor - lightweight

This default constructor is lightweight.

virtual CascadeMP3Player::~CascadeMP3Player  )  [virtual]
 

destructor

The destructor.


Member Function Documentation

virtual u32 CascadeMP3Player::GetDuration  )  [virtual]
 

gets the duration of the mp3 file in milliseconds

GetDuration() gets the duration of the mp3 file in milliseconds.

Returns:
the duration of the mp3 file in milliseconds

virtual bool CascadeMP3Player::IsPaused  )  [virtual]
 

determines whether or not the file is paused

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

Returns:
whether or not the file is paused

virtual bool CascadeMP3Player::IsPlaying  )  [virtual]
 

determines whether or not the file is playing

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

Returns:
whether or not the file is playing

virtual bool CascadeMP3Player::IsStopped  )  [virtual]
 

determines whether or not the file is stopped

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

Returns:
whether or not the file is stopped

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

notifies the client when playback begins

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

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

notifies the client when playback ends

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

virtual void CascadeMP3Player::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 CascadeMP3Player::OnSecondTick u32  nSecond  )  [protected, virtual]
 

notifies the client every second during playback

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

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

virtual bool CascadeMP3Player::Pause  )  [virtual]
 

pauses playback of the mp3 file

Pause() pauses playback of the mp3 file.

Returns:
whether pausing succeeded

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

plays an mp3 file on a device

Play() starts playback of an mp3 file.

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

virtual bool CascadeMP3Player::ResumePlayback  )  [virtual]
 

resumes playback of a paused mp3 file

ResumePlayback() resumes playback of a previously paused mp3 file.

Returns:
whether playback resumption succeeded

virtual bool CascadeMP3Player::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 CascadeMP3Player::Stop  )  [virtual]
 

stops playback of the mp3 file

Stop() stops playback of the mp3 file.

Returns:
whether stopping succeeded


Friends And Related Function Documentation

friend class CascadePrivate::MP3Player [friend]
 


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