Mute button + RT shows up immediately now in Windows Mixer

see issue 803
This commit is contained in:
Oliver Duis
2011-06-28 19:44:22 +02:00
parent 47cd6fc04e
commit 58efd5c861
8 changed files with 41 additions and 2 deletions

View File

@@ -19,23 +19,33 @@
*/
#include <soundman.h>
#include <options.h>
#ifdef WIN32
#include <windows.h>
#include <mmsystem.h>
#endif
void SoundManager::init()
{
#ifdef WIN32
// TODO: On Windows Vista/7 RT should register with the OS sound system, so it can enjoy application specific
// volume, safed, process independent etc. from the start.
// Function call is IAudioClient::Initialize
// Unfortunately MinGW does not support this yet. If audioclient.h is available, add an Init
// called once on program start.
//
// This mitigation plays an empty file on start, so RT is immidiately avaible in the Windows mixer at least
playSoundAsync(Glib::ustring("sounds\\Empty.wav"));
#endif
}
// Plays a sound in async mode to not block the main thread
// param is either file name or name of the system event on Windows (e.g. "SystemAsterisk" or "SystemDefault").
void SoundManager::playSoundAsync(const Glib::ustring &sound)
{
if (sound.empty()) return;
if (sound.empty() || !options.sndEnable) return;
#ifdef WIN32
DWORD sndParam=SND_ASYNC | SND_NODEFAULT;