Second (and last) stage of adding sound notifications on Linux (see issue 469)

This commit is contained in:
Philip Rinn
2013-02-02 19:07:07 +01:00
parent a08e04626b
commit a112890cb9
4 changed files with 16 additions and 17 deletions

View File

@@ -49,10 +49,9 @@ void SoundManager::init()
// 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 (!options.sndEnable) return;
if (sound.empty() || !options.sndEnable) return;
#ifdef WIN32
if (sound.empty()) return;
DWORD sndParam=SND_ASYNC | SND_NODEFAULT;
if (sound.find('.')!=Glib::ustring::npos) {
@@ -67,6 +66,6 @@ void SoundManager::playSoundAsync(const Glib::ustring &sound)
PlaySoundW(wfilename, NULL, sndParam);
g_free( wfilename );
#elif defined(__linux__)
ca_context_play(ca_gtk_context_get(), 0, CA_PROP_EVENT_ID, "complete", NULL);
ca_context_play(ca_gtk_context_get(), 0, CA_PROP_EVENT_ID, sound.c_str(), CA_PROP_MEDIA_FILENAME, sound.c_str(), NULL);
#endif
}