From 01f24aae07fe3cd006eca2c2870dc51649dec2d4 Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Sat, 27 Apr 2013 21:07:05 +0200 Subject: Don't use external players on Windows --- src/common/text.c | 51 ++++++++++----------------------------------------- 1 file changed, 10 insertions(+), 41 deletions(-) (limited to 'src/common') diff --git a/src/common/text.c b/src/common/text.c index 709e05ef..da677c88 100644 --- a/src/common/text.c +++ b/src/common/text.c @@ -2226,14 +2226,12 @@ sound_play (const char *file, gboolean quiet, gboolean hexchat_beep) char *buf; char *wavfile; char *cmd; -#if 0 - LPSTR lpRes; - HANDLE hResInfo, hRes; -#endif /* the pevents GUI editor triggers this after removing a soundfile */ if (!file[0]) + { return; + } #ifdef WIN32 /* check for fullpath; also use full path if hexchat_beep is TRUE, which should *only* happen when invoked by fe_beep() */ @@ -2251,48 +2249,19 @@ sound_play (const char *file, gboolean quiet, gboolean hexchat_beep) if (g_access (wavfile, R_OK) == 0) { +#ifdef WIN32 + PlaySound (wavfile, NULL, SND_NODEFAULT|SND_FILENAME|SND_ASYNC); +#else cmd = sound_find_command (); -#ifdef WIN32 - if (cmd == NULL || strcmp (cmd, "esdplay") == 0) + if (cmd) { - PlaySound (wavfile, NULL, SND_NODEFAULT|SND_FILENAME|SND_ASYNC); -#if 0 /* this would require the wav file to be added to the executable as resource */ - hResInfo = FindResource (NULL, file_fs, "WAVE"); - if (hResInfo != NULL) - { - /* load the WAVE resource */ - hRes = LoadResource (NULL, hResInfo); - if (hRes != NULL) - { - /* lock the WAVE resource and play it */ - lpRes = LockResource(hRes); - if (lpRes != NULL) - { - sndPlaySound (lpRes, SND_MEMORY | SND_NODEFAULT | SND_FILENAME | SND_ASYNC); - UnlockResource (hRes); - } - - /* free the WAVE resource */ - FreeResource (hRes); - } - } -#endif + buf = g_strdup_printf ("%s \"%s\"", cmd, wavfile); + hexchat_exec (buf); + g_free (buf); + g_free (cmd); } - else #endif - { - if (cmd) - { - buf = g_strdup_printf ("%s \"%s\"", cmd, wavfile); - hexchat_exec (buf); - g_free (buf); - } - } - - if (cmd) - g_free (cmd); - } else { -- cgit 1.4.1