t"Play" button for testing sounds in the Options dialog now works regardless of whether sounds have been globally enabled or not. - vaccinewars - be a doctor and try to vaccinate the world (HTM) git clone git://src.adamsgaard.dk/vaccinewars (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- (DIR) commit 23802bbd37099ff665e63db4f12b9b154846cf26 (DIR) parent b52aa4f79ec0edf736a7114b22296cf46f62a99a (HTM) Author: Ben Webb <ben@salilab.org> Date: Mon, 26 Aug 2002 12:25:55 +0000 "Play" button for testing sounds in the Options dialog now works regardless of whether sounds have been globally enabled or not. Diffstat: M src/gui_client/optdialog.c | 4 ++++ M src/sound.c | 5 +++++ M src/sound.h | 1 + 3 files changed, 10 insertions(+), 0 deletions(-) --- (DIR) diff --git a/src/gui_client/optdialog.c b/src/gui_client/optdialog.c t@@ -544,9 +544,13 @@ static void BrowseSound(GtkWidget *entry) static void TestPlaySound(GtkWidget *entry) { gchar *text; + gboolean sound_enabled; text = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1); + sound_enabled = IsSoundEnabled(); + SoundEnable(TRUE); SoundPlay(text); + SoundEnable(sound_enabled); g_free(text); } (DIR) diff --git a/src/sound.c b/src/sound.c t@@ -232,3 +232,8 @@ void SoundEnable(gboolean enable) { sound_enabled = enable; } + +gboolean IsSoundEnabled(void) +{ + return sound_enabled; +} (DIR) diff --git a/src/sound.h b/src/sound.h t@@ -43,5 +43,6 @@ void SoundOpen(gchar *drivername); void SoundClose(void); void SoundPlay(const gchar *snd); void SoundEnable(gboolean enable); +gboolean IsSoundEnabled(void); #endif /* __DP_SOUND_H__ */