From: Keith F. <ven...@us...> - 2003-01-17 08:23:47
|
Update of /cvsroot/planeshift/planeshift/src/client/sound In directory sc8-pr-cvs1:/tmp/cvs-serv7760 Modified Files: pssoundmngr.h pssoundmngr.cpp Log Message: PlaySound now has loop flag, like bg music, and returns an iSoundSource. If looping is enabled, the caller is responsible for saving this ref and stopping the sound when required. Index: pssoundmngr.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/sound/pssoundmngr.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** pssoundmngr.h 26 Dec 2002 01:15:42 -0000 1.9 --- pssoundmngr.h 17 Jan 2003 08:21:38 -0000 1.10 *************** *** 52,59 **** virtual ~psSoundManager(); virtual bool Setup(); virtual bool Initialize(iObjectRegistry* object_reg); virtual float GetVolume(); virtual void SetVolume(float vol); ! virtual bool PlaySound(const char* name); virtual void StopBGSong(); virtual bool ChangeBGSong(const char* name, bool loop); --- 52,60 ---- virtual ~psSoundManager(); virtual bool Setup(); + virtual bool Initialize(iObjectRegistry* object_reg); virtual float GetVolume(); virtual void SetVolume(float vol); ! virtual csPtr<iSoundSource> PlaySound(const char* name,bool loop); virtual void StopBGSong(); virtual bool ChangeBGSong(const char* name, bool loop); Index: pssoundmngr.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/sound/pssoundmngr.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** pssoundmngr.cpp 26 Dec 2002 01:15:42 -0000 1.25 --- pssoundmngr.cpp 17 Jan 2003 08:21:38 -0000 1.26 *************** *** 112,116 **** } ! bool psSoundManager::PlaySound(const char* name) { if (!snd) --- 112,116 ---- } ! csPtr<iSoundSource> psSoundManager::PlaySound(const char* name,bool loop) { if (!snd) *************** *** 124,130 **** return false; ! csRef<iSoundSource> sndhandle = handle->src->Play(); ! return true; } --- 124,130 ---- return false; ! csRef<iSoundSource> sndhandle = handle->src->Play(loop); ! return csPtr<iSoundSource> (sndhandle); } *************** *** 187,191 **** // Disable Music ! } else { // stop background music if(backsound) --- 187,193 ---- // Disable Music ! } ! else ! { // stop background music if(backsound) |