automatically [un]pause SDL audio from AV

git-svn-id: svn://anubis/anaglym/trunk@281 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
Josh Holtrop committed 2010-06-22 02:47:16 +00:00
1 parent d376d7a5b0
commit a7ce3ff6b9
2 files changed
+5 -3

No files matched your search

+5
View File
@@ -135,6 +135,7 @@ refptr<AV::Sound> AV::createSound()
void AV::playSound(AV::Sound * s)
{
m_active_sounds.insert(s);
SDL_PauseAudio(0);
}
void AV::playCallback(Uint8 * stream, int len)
@@ -149,6 +150,10 @@ void AV::playCallback(Uint8 * stream, int len)
m_active_sounds.erase(it);
}
}
if (m_active_sounds.size() == 0)
{
SDL_PauseAudio(1);
}
}
AV::Sound::Sound(AV & av)
-3
View File
@@ -928,9 +928,6 @@ void Engine::run()
case SDLK_F5:
reloadProgram();
break;
case SDLK_F6:
SDL_PauseAudio(0);
break;
default:
key_down_event(event.key.keysym.sym);
}