diff options
author | Berke Viktor <bviktor@hexchat.org> | 2013-04-27 21:07:05 +0200 |
---|---|---|
committer | Berke Viktor <bviktor@hexchat.org> | 2013-04-27 21:07:34 +0200 |
commit | 01f24aae07fe3cd006eca2c2870dc51649dec2d4 (patch) | |
tree | 6327f4bf03cd613c4339eba4a21896314b851432 /src/common/text.c | |
parent | 584dc6a626642cfbbd4b9a1c879f95d43704f048 (diff) |
Don't use external players on Windows
Diffstat (limited to 'src/common/text.c')
-rw-r--r-- | src/common/text.c | 51 |
1 files changed, 10 insertions, 41 deletions
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 { |