give each RageSound instance a unique ID

This commit is contained in:
Glenn Maynard
2004-03-18 01:31:34 +00:00
parent 7c001d6370
commit 6ea531d584
4 changed files with 31 additions and 8 deletions
+17
View File
@@ -88,6 +88,23 @@ void RageSoundManager::Update(float delta)
driver->Update(delta);
}
/* Register the given sound, and return a unique ID. */
int RageSoundManager::RegisterSound( RageSound *p )
{
LockMut(lock);
all_sounds.insert( p );
static int iID = 0;
return ++iID;
}
void RageSoundManager::UnregisterSound( RageSound *p )
{
LockMut(lock);
all_sounds.erase( p );
}
float RageSoundManager::GetPlayLatency() const
{
return driver->GetPlayLatency();