renaming RageSounds -> GameSoundManager; it's not low-level

This commit is contained in:
Glenn Maynard
2004-07-08 00:03:35 +00:00
parent f670274570
commit 1b3425ea94
3 changed files with 19 additions and 19 deletions
+13 -13
View File
@@ -11,7 +11,7 @@
#include "RageDisplay.h" #include "RageDisplay.h"
#include "AnnouncerManager.h" #include "AnnouncerManager.h"
RageSounds *SOUND = NULL; GameSoundManager *SOUND = NULL;
/* /*
* When playing music, automatically search for an SM file for timing data. If one is * When playing music, automatically search for an SM file for timing data. If one is
@@ -299,7 +299,7 @@ int MusicThread_start( void *p )
return 0; return 0;
} }
RageSounds::RageSounds() GameSoundManager::GameSoundManager()
{ {
/* Init RageSoundMan first: */ /* Init RageSoundMan first: */
ASSERT( SOUNDMAN ); ASSERT( SOUNDMAN );
@@ -309,7 +309,7 @@ RageSounds::RageSounds()
g_SoundsToPlayOnceFromAnnouncer.reserve( 16 ); g_SoundsToPlayOnceFromAnnouncer.reserve( 16 );
g_MusicsToPlay.reserve( 16 ); g_MusicsToPlay.reserve( 16 );
g_Mutex = new RageMutex("RageSounds"); g_Mutex = new RageMutex("GameSoundManager");
g_Playing = new MusicPlaying( new RageSound ); g_Playing = new MusicPlaying( new RageSound );
g_UpdatingTimer = false; g_UpdatingTimer = false;
@@ -322,7 +322,7 @@ RageSounds::RageSounds()
} }
} }
RageSounds::~RageSounds() GameSoundManager::~GameSoundManager()
{ {
if( g_ThreadedMusicStart ) if( g_ThreadedMusicStart )
{ {
@@ -351,7 +351,7 @@ RageSounds::~RageSounds()
delete pMusic; delete pMusic;
} }
float RageSounds::GetFrameTimingAdjustment( float fDeltaTime ) float GameSoundManager::GetFrameTimingAdjustment( float fDeltaTime )
{ {
/* /*
* We get one update per frame, and we're updated early, almost immediately after vsync, * We get one update per frame, and we're updated early, almost immediately after vsync,
@@ -386,7 +386,7 @@ float RageSounds::GetFrameTimingAdjustment( float fDeltaTime )
return min( -fExtraDelay, 0 ); return min( -fExtraDelay, 0 );
} }
void RageSounds::Update( float fDeltaTime ) void GameSoundManager::Update( float fDeltaTime )
{ {
LockMut( *g_Mutex ); LockMut( *g_Mutex );
@@ -450,14 +450,14 @@ void RageSounds::Update( float fDeltaTime )
} }
CString RageSounds::GetMusicPath() const CString GameSoundManager::GetMusicPath() const
{ {
LockMut( *g_Mutex ); LockMut( *g_Mutex );
return g_Playing->m_Music->GetLoadedFilePath(); return g_Playing->m_Music->GetLoadedFilePath();
} }
/* If g_ThreadedMusicStart, this function should not touch the disk at all. */ /* If g_ThreadedMusicStart, this function should not touch the disk at all. */
void RageSounds::PlayMusic( const CString &file, const CString &timing_file, bool force_loop, float start_sec, float length_sec, float fade_len, bool align_beat ) void GameSoundManager::PlayMusic( const CString &file, const CString &timing_file, bool force_loop, float start_sec, float length_sec, float fade_len, bool align_beat )
{ {
// LOG->Trace("play '%s' (current '%s')", file.c_str(), g_Playing->m_Music->GetLoadedFilePath().c_str()); // LOG->Trace("play '%s' (current '%s')", file.c_str(), g_Playing->m_Music->GetLoadedFilePath().c_str());
@@ -483,13 +483,13 @@ void RageSounds::PlayMusic( const CString &file, const CString &timing_file, boo
StartQueuedSounds(); StartQueuedSounds();
} }
void RageSounds::HandleSongTimer( bool on ) void GameSoundManager::HandleSongTimer( bool on )
{ {
LockMut( *g_Mutex ); LockMut( *g_Mutex );
g_UpdatingTimer = on; g_UpdatingTimer = on;
} }
void RageSounds::PlayOnce( CString sPath ) void GameSoundManager::PlayOnce( CString sPath )
{ {
/* Add the sound to the g_SoundsToPlayOnce queue. */ /* Add the sound to the g_SoundsToPlayOnce queue. */
CString *p = new CString( sPath ); CString *p = new CString( sPath );
@@ -500,7 +500,7 @@ void RageSounds::PlayOnce( CString sPath )
StartQueuedSounds(); StartQueuedSounds();
} }
void RageSounds::PlayOnceFromDir( CString PlayOnceFromDir ) void GameSoundManager::PlayOnceFromDir( CString PlayOnceFromDir )
{ {
/* Add the path to the g_SoundsToPlayOnceFromDir queue. */ /* Add the path to the g_SoundsToPlayOnceFromDir queue. */
CString *p = new CString( PlayOnceFromDir ); CString *p = new CString( PlayOnceFromDir );
@@ -511,7 +511,7 @@ void RageSounds::PlayOnceFromDir( CString PlayOnceFromDir )
StartQueuedSounds(); StartQueuedSounds();
} }
void RageSounds::PlayOnceFromAnnouncer( CString sFolderName ) void GameSoundManager::PlayOnceFromAnnouncer( CString sFolderName )
{ {
/* Add the path to the g_SoundsToPlayOnceFromDir queue. */ /* Add the path to the g_SoundsToPlayOnceFromDir queue. */
CString *p = new CString( sFolderName ); CString *p = new CString( sFolderName );
@@ -522,7 +522,7 @@ void RageSounds::PlayOnceFromAnnouncer( CString sFolderName )
StartQueuedSounds(); StartQueuedSounds();
} }
float RageSounds::GetPlayLatency() const float GameSoundManager::GetPlayLatency() const
{ {
return SOUNDMAN->GetPlayLatency(); return SOUNDMAN->GetPlayLatency();
} }
+5 -5
View File
@@ -1,15 +1,15 @@
/* RageSounds - High-level sound utilities. */ /* GameSoundManager - High-level sound utilities. */
#ifndef RAGE_SOUNDS_H #ifndef RAGE_SOUNDS_H
#define RAGE_SOUNDS_H #define RAGE_SOUNDS_H
class TimingData; class TimingData;
class RageSound; class RageSound;
class RageSounds class GameSoundManager
{ {
public: public:
RageSounds(); GameSoundManager();
~RageSounds(); ~GameSoundManager();
void Update( float fDeltaTime ); void Update( float fDeltaTime );
void PlayMusic( const CString &file, bool force_loop = false, float start_sec = 0, float length_sec = -1, float fade_len = 0, bool align_beat = true ) { PlayMusic( file, "", force_loop, start_sec, length_sec, fade_len, align_beat ); } void PlayMusic( const CString &file, bool force_loop = false, float start_sec = 0, float length_sec = -1, float fade_len = 0, bool align_beat = true ) { PlayMusic( file, "", force_loop, start_sec, length_sec, fade_len, align_beat ); }
@@ -26,7 +26,7 @@ public:
float GetFrameTimingAdjustment( float fDeltaTime ); float GetFrameTimingAdjustment( float fDeltaTime );
}; };
extern RageSounds *SOUND; extern GameSoundManager *SOUND;
#endif #endif
/* /*
+1 -1
View File
@@ -1015,7 +1015,7 @@ int main(int argc, char* argv[])
SOUNDMAN = new RageSoundManager; SOUNDMAN = new RageSoundManager;
SOUNDMAN->Init( PREFSMAN->m_sSoundDrivers ); SOUNDMAN->Init( PREFSMAN->m_sSoundDrivers );
SOUNDMAN->SetPrefs( PREFSMAN->m_fSoundVolume ); SOUNDMAN->SetPrefs( PREFSMAN->m_fSoundVolume );
SOUND = new RageSounds; SOUND = new GameSoundManager;
BOOKKEEPER = new Bookkeeper; BOOKKEEPER = new Bookkeeper;
LIGHTSMAN = new LightsManager(PREFSMAN->m_sLightsDriver); LIGHTSMAN = new LightsManager(PREFSMAN->m_sLightsDriver);
INPUTFILTER = new InputFilter; INPUTFILTER = new InputFilter;