update to allow selection of a new sound device
This commit is contained in:
parent
223281b242
commit
7cfe6a2476
1 changed files with 21 additions and 4 deletions
|
@ -14,6 +14,11 @@
|
|||
|
||||
<hrule/>
|
||||
|
||||
<text>
|
||||
<halign>fill</halign>
|
||||
<label>Sound Device:</label>
|
||||
</text>
|
||||
|
||||
<combo>
|
||||
<name>source-selection</name>
|
||||
<halign>fill</halign>
|
||||
|
@ -29,8 +34,6 @@
|
|||
</binding>
|
||||
</combo>
|
||||
|
||||
<hrule/>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<halign>left</halign>
|
||||
|
@ -142,9 +145,13 @@
|
|||
<layout>hbox</layout>
|
||||
<default-padding>10</default-padding>
|
||||
<button>
|
||||
<legend>Close</legend>
|
||||
<legend>Apply</legend>
|
||||
<default>true</default>
|
||||
<key>Esc</key>
|
||||
<key>Enter</key>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>apply()</script>
|
||||
</binding>
|
||||
<binding>
|
||||
<command>dialog-close</command>
|
||||
</binding>
|
||||
|
@ -174,6 +181,16 @@
|
|||
forindex (var i; devices )
|
||||
combo.getChild("value", i, 1).setValue(devices[i].getValue());
|
||||
}
|
||||
|
||||
var apply = func {
|
||||
var device = getprop("sim/gui/dialogs/sound-dialog/source-selection");
|
||||
setprop( "/sim/sound/device", device);
|
||||
}
|
||||
|
||||
# initialization
|
||||
var default_device = getprop("/sim/sound/device");
|
||||
setprop( "sim/gui/dialogs/sound-dialog/source-selection", default_device);
|
||||
|
||||
]]></open>
|
||||
</nasal>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue