Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

CSidPlayer Class Reference

contains one SID tune, and controls the playback of it More...

#include <sidplayer.h>

Collaboration diagram for CSidPlayer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual ~CSidPlayer ()
 D'tor.

void InitL ()
 initialise everything, but do not start playing (yet)

void Play ()
 start playing using the CIdle class

void Stop ()
 stop playing

void Pause ()
 pause the player

TBool IsPaused ()
 return ETrue if paused

void Thread ()
 wow.

sidTuneCurrentSidTune () const
TInt VolumeDelta (TInt aDelta)
 increase/decrease volume and return the new volume

TInt SongDelta (TInt aDelta)
 skip song up/down and return the new song numer

TInt SongSelect (TInt &aSong)
 select a new song to play

TInt NewTune (const TDesC &aTune)
 open a new SID tune, delete the old one


Static Public Member Functions

CSidPlayerNewL (const TDesC &aSong)

Public Attributes

emuEngineiEmuEngine
 pointer to the emulator engine

CIdle * iIdlePlay
 pointer to the CIdle playback object

TBuf< 128 > iSongName
 name of the song

audioDriveriAudio
 pointer to the audio driver


Protected Member Functions

void ConstructL ()
 safe constructor

 CSidPlayer (const TDesC &aSong)
 C'tor.


Private Attributes

sidTuneiTune
 pointer to the SID tune

ubyteiBuffer
 buffer used for sound

TInt iBufSize
 size of the sound buffer

TBool iIsReady
 ETrue if inited and ready to play.


Detailed Description

contains one SID tune, and controls the playback of it

Definition at line 31 of file sidplayer.h.


Constructor & Destructor Documentation

CSidPlayer::~CSidPlayer  )  [virtual]
 

D'tor.

Definition at line 65 of file sidplayer.cpp.

References DTOR, iAudio, iBuffer, iEmuEngine, iIdlePlay, and iTune.

CSidPlayer::CSidPlayer const TDesC &  aSong  )  [protected]
 

C'tor.

Definition at line 91 of file sidplayer.cpp.

References CTOR, and iSongName.

Referenced by NewL().


Member Function Documentation

void CSidPlayer::ConstructL  )  [protected]
 

safe constructor

Definition at line 82 of file sidplayer.cpp.

References InitL().

Referenced by NewL().

sidTune& CSidPlayer::CurrentSidTune  )  const [inline]
 

Definition at line 43 of file sidplayer.h.

References iTune.

Referenced by CSidPlayAppUi::HandleCommandL(), and CSidPlayAppUi::UpdateCbaL().

void CSidPlayer::InitL  ) 
 

initialise everything, but do not start playing (yet)

Definition at line 103 of file sidplayer.cpp.

References emuConfig::autoPanning, emuConfig::bitsPerSample, emuConfig::channels, audioDriver::ConstructL(), ELOG1, ERR_ENDIANESS, EXIT_ERROR_STATUS, fragments, fragSizeBase, emuConfig::frequency, audioDriver::GetBlockSize(), emuEngine::getConfig(), audioDriver::GetFrequency(), sidTune::getInfo(), audioDriver::GetSampleEncoding(), audioDriver::GetSamplePrecision(), iAudio, iBuffer, iBufSize, iEmuEngine, iIsReady, iSongName, audioDriver::IsThere(), iTune, audioDriver::Open(), SAMPLE_FREQ, emuConfig::sampleFormat, selectedSong, emuEngine::setConfig(), SIDEMU_16BIT, SIDEMU_8BIT, SIDEMU_FULLPANNING, SIDEMU_MONO, SIDEMU_NONE, SIDEMU_STEREO, sidEmuInitializeSong(), ubyte, uword, emuEngine::verifyEndianess(), and emuConfig::volumeControl.

Referenced by ConstructL(), and CSidPlayAppUi::ConstructL().

TBool CSidPlayer::IsPaused  ) 
 

return ETrue if paused

Todo:
implement

Definition at line 324 of file sidplayer.cpp.

Referenced by SidPlayerThread().

CSidPlayer * CSidPlayer::NewL const TDesC &  aSong  )  [static]
 

Definition at line 55 of file sidplayer.cpp.

References ConstructL(), and CSidPlayer().

Referenced by CSidPlayAppUi::ConstructL().

TInt CSidPlayer::NewTune const TDesC &  aTune  ) 
 

open a new SID tune, delete the old one

Definition at line 422 of file sidplayer.cpp.

References iEmuEngine, iSongName, iTune, and sidEmuInitializeSong().

Referenced by CSidPlayAppUi::DoBrowseFileL(), and CSidPlayAppUi::ProcessCommandParametersL().

void CSidPlayer::Pause  ) 
 

pause the player

Definition at line 304 of file sidplayer.cpp.

References ELOG1, iIdlePlay, and Play().

Referenced by CSidPlayAppUi::HandleCommandL().

void CSidPlayer::Play  ) 
 

start playing using the CIdle class

Definition at line 262 of file sidplayer.cpp.

References ELOG1, iIdlePlay, iIsReady, and SidPlayerThread().

Referenced by CSidPlayAppUi::DoBrowseFileL(), CSidPlayAppUi::HandleCommandL(), Pause(), CSidPlayAppUi::ProcessCommandParametersL(), SongDelta(), and SongSelect().

TInt CSidPlayer::SongDelta TInt  aDelta  ) 
 

skip song up/down and return the new song numer

Definition at line 371 of file sidplayer.cpp.

References sidTuneInfo::currentSong, ELOG1, sidTune::getInfo(), iAudio, iEmuEngine, iTune, Play(), sidEmuInitializeSong(), sidTuneInfo::songs, audioDriver::StopStream(), and uword.

Referenced by CSidPlayAppUi::HandleCommandL(), and CSidPlayAppUi::HandleKeyEventL().

TInt CSidPlayer::SongSelect TInt &  aSong  ) 
 

select a new song to play

Definition at line 401 of file sidplayer.cpp.

References sidTuneInfo::currentSong, sidTune::getInfo(), iAudio, iEmuEngine, iTune, Play(), sidEmuInitializeSong(), audioDriver::StopStream(), and uword.

Referenced by CSidPlayAppUi::HandleKeyEventL().

void CSidPlayer::Stop  ) 
 

stop playing

Definition at line 285 of file sidplayer.cpp.

References ELOG1, iAudio, iEmuEngine, iIdlePlay, iTune, sidEmuInitializeSong(), and audioDriver::StopStream().

Referenced by CSidPlayAppUi::DoBrowseFileL(), CSidPlayAppUi::HandleCommandL(), and CSidPlayAppUi::ProcessCommandParametersL().

void CSidPlayer::Thread  ) 
 

wow.

here is the actual core loop of the system; fill the buffer, then play it. repeat 1000 times.

Definition at line 333 of file sidplayer.cpp.

References emuEngine::FillBuffer(), iAudio, audioDriver::iBlocksInQueue, iBuffer, iBufSize, iEmuEngine, audioDriver::iIsReady, audioDriver::iPrefilled, iTune, audioDriver::Play(), and ubyte.

Referenced by SidPlayerThread().

TInt CSidPlayer::VolumeDelta TInt  aDelta  ) 
 

increase/decrease volume and return the new volume

Definition at line 362 of file sidplayer.cpp.

References iAudio, and audioDriver::VolumeDelta().

Referenced by CSidPlayAppView::ConstructL(), and CSidPlayAppUi::HandleKeyEventL().


Member Data Documentation

audioDriver* CSidPlayer::iAudio
 

pointer to the audio driver

Definition at line 55 of file sidplayer.h.

Referenced by CSidPlayAppUi::HandleCommandL(), InitL(), SongDelta(), SongSelect(), Stop(), Thread(), VolumeDelta(), and ~CSidPlayer().

ubyte* CSidPlayer::iBuffer [private]
 

buffer used for sound

Definition at line 58 of file sidplayer.h.

Referenced by InitL(), Thread(), and ~CSidPlayer().

TInt CSidPlayer::iBufSize [private]
 

size of the sound buffer

Definition at line 59 of file sidplayer.h.

Referenced by InitL(), and Thread().

emuEngine* CSidPlayer::iEmuEngine
 

pointer to the emulator engine

Definition at line 52 of file sidplayer.h.

Referenced by CSidPlayAppUi::HandleCommandL(), InitL(), NewTune(), SidPlayExceptionHandler(), SongDelta(), SongSelect(), Stop(), Thread(), and ~CSidPlayer().

CIdle* CSidPlayer::iIdlePlay
 

pointer to the CIdle playback object

Definition at line 53 of file sidplayer.h.

Referenced by Pause(), Play(), Stop(), CSidPlayAppUi::UpdateCbaL(), and ~CSidPlayer().

TBool CSidPlayer::iIsReady [private]
 

ETrue if inited and ready to play.

Definition at line 60 of file sidplayer.h.

Referenced by InitL(), and Play().

TBuf<128> CSidPlayer::iSongName
 

name of the song

Definition at line 54 of file sidplayer.h.

Referenced by CSidPlayer(), CSidPlayAppUi::HandleCommandL(), InitL(), and NewTune().

sidTune* CSidPlayer::iTune [private]
 

pointer to the SID tune

Definition at line 57 of file sidplayer.h.

Referenced by CurrentSidTune(), InitL(), NewTune(), SongDelta(), SongSelect(), Stop(), Thread(), and ~CSidPlayer().


The documentation for this class was generated from the following files:
Generated on Tue Feb 8 04:32:59 2005 for Esidplay by doxygen 1.3.3