From ecbce19b471b9815421eb7f9f033ce130f52147a Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Fri, 21 Sep 2012 13:30:31 +0200 Subject: [PATCH] Sound: trigger subsystem reinit instead of relying on property listener. Disable sound dialog when sound system is globally disabled (command-line/ compile-time). --- Nasal/gui.nas | 1 + gui/dialogs/sound.xml | 1 + gui/menubar.xml | 1 + 3 files changed, 3 insertions(+) diff --git a/Nasal/gui.nas b/Nasal/gui.nas index 6c4c7e95f..c4fd177b5 100644 --- a/Nasal/gui.nas +++ b/Nasal/gui.nas @@ -159,6 +159,7 @@ _setlistener("/sim/signals/nasal-dir-initialized", func { menuEnable("rendering-buffers", getprop("/sim/rendering/rembrandt/enabled")); menuEnable("rembrandt-buffers-choice", getprop("/sim/rendering/rembrandt/enabled")); menuEnable("stereoscopic-options", !getprop("/sim/rendering/rembrandt/enabled")); + menuEnable("sound-config", getprop("/sim/sound/working")); # frame-per-second display var fps = props.globals.getNode("/sim/rendering/fps-display", 1); diff --git a/gui/dialogs/sound.xml b/gui/dialogs/sound.xml index 606267355..400e16dd2 100644 --- a/gui/dialogs/sound.xml +++ b/gui/dialogs/sound.xml @@ -356,6 +356,7 @@ if (cmp(current, new) != 0) { setprop("sim/sound/devices/name", new); setprop("sim/sound/device-name", new); + fgcommand("reinit", props.Node.new({ "subsystem" : "sound" })); } } diff --git a/gui/menubar.xml b/gui/menubar.xml index 8432d39cb..3316872ec 100644 --- a/gui/menubar.xml +++ b/gui/menubar.xml @@ -64,6 +64,7 @@ dialog-show sound-dialog + false