2004-05-14 16:21:11 +00:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
<!-- Sound control dialog -->
|
|
|
|
|
|
|
|
<PropertyList>
|
2009-11-30 12:06:02 +00:00
|
|
|
<name>sound-dialog</name>
|
|
|
|
<modal>false</modal>
|
|
|
|
<width>400</width>
|
|
|
|
<layout>vbox</layout>
|
|
|
|
|
|
|
|
<text>
|
|
|
|
<label>Sound Configuration</label>
|
|
|
|
</text>
|
|
|
|
|
|
|
|
<hrule/>
|
|
|
|
|
2009-11-30 14:24:04 +00:00
|
|
|
<text>
|
|
|
|
<halign>fill</halign>
|
|
|
|
<label>Sound Device:</label>
|
|
|
|
</text>
|
|
|
|
|
2009-11-30 12:06:02 +00:00
|
|
|
<combo>
|
|
|
|
<name>source-selection</name>
|
|
|
|
<halign>fill</halign>
|
|
|
|
<stretch>true</stretch>
|
|
|
|
<property>sim/gui/dialogs/sound-dialog/source-selection</property>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-apply</command>
|
|
|
|
<object-name>source-selection</object-name>
|
|
|
|
</binding>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-update</command>
|
|
|
|
<object-name>metar</object-name>
|
|
|
|
</binding>
|
|
|
|
</combo>
|
|
|
|
|
|
|
|
<group>
|
|
|
|
<layout>hbox</layout>
|
|
|
|
<halign>left</halign>
|
|
|
|
|
|
|
|
<empty><width>10</width></empty>
|
|
|
|
|
|
|
|
<text>
|
|
|
|
<label>Enabled</label>
|
|
|
|
</text>
|
|
|
|
|
|
|
|
<text>
|
|
|
|
<label>Volume</label>
|
|
|
|
</text>
|
|
|
|
</group>
|
|
|
|
|
|
|
|
<group>
|
|
|
|
<layout>hbox</layout>
|
|
|
|
<halign>left</halign>
|
|
|
|
|
|
|
|
<empty><width>10</width></empty>
|
|
|
|
|
|
|
|
<checkbox>
|
|
|
|
<property>/sim/sound/enabled</property>
|
|
|
|
<label>Master</label>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-apply</command>
|
|
|
|
</binding>
|
|
|
|
</checkbox>
|
|
|
|
|
|
|
|
<slider>
|
|
|
|
<height>25</height>
|
|
|
|
<property>/sim/sound/volume</property>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-apply</command>
|
|
|
|
</binding>
|
|
|
|
</slider>
|
|
|
|
</group>
|
|
|
|
|
|
|
|
<group>
|
|
|
|
<layout>hbox</layout>
|
|
|
|
<halign>left</halign>
|
|
|
|
|
|
|
|
<empty><width>10</width></empty>
|
|
|
|
|
|
|
|
<checkbox>
|
|
|
|
<property>/sim/sound/effects/enabled</property>
|
|
|
|
<label>Effects</label>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-apply</command>
|
|
|
|
</binding>
|
|
|
|
</checkbox>
|
|
|
|
|
|
|
|
<slider>
|
|
|
|
<height>25</height>
|
|
|
|
<property>/sim/sound/effects/volume</property>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-apply</command>
|
|
|
|
</binding>
|
|
|
|
</slider>
|
|
|
|
</group>
|
|
|
|
|
|
|
|
<group>
|
|
|
|
<layout>hbox</layout>
|
|
|
|
<halign>left</halign>
|
|
|
|
|
|
|
|
<empty><width>10</width></empty>
|
|
|
|
|
|
|
|
<checkbox>
|
|
|
|
<property>/sim/sound/avionics/enabled</property>
|
|
|
|
<label>Avionics</label>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-apply</command>
|
|
|
|
</binding>
|
|
|
|
</checkbox>
|
|
|
|
|
|
|
|
<slider>
|
|
|
|
<height>25</height>
|
|
|
|
<property>/sim/sound/avionics/volume</property>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-apply</command>
|
|
|
|
</binding>
|
|
|
|
</slider>
|
|
|
|
</group>
|
|
|
|
|
|
|
|
<group>
|
|
|
|
<layout>hbox</layout>
|
|
|
|
<halign>left</halign>
|
|
|
|
|
|
|
|
<empty><width>10</width></empty>
|
|
|
|
|
|
|
|
<checkbox>
|
|
|
|
<property>/sim/sound/chatter/enabled</property>
|
|
|
|
<label>Chatter</label>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-apply</command>
|
|
|
|
</binding>
|
|
|
|
</checkbox>
|
|
|
|
|
|
|
|
<slider>
|
|
|
|
<height>25</height>
|
|
|
|
<property>/sim/sound/chatter/volume</property>
|
|
|
|
<binding>
|
|
|
|
<command>dialog-apply</command>
|
|
|
|
</binding>
|
|
|
|
</slider>
|
|
|
|
</group>
|
|
|
|
|
|
|
|
<group>
|
|
|
|
<layout>hbox</layout>
|
|
|
|
<default-padding>10</default-padding>
|
|
|
|
<button>
|
2009-11-30 14:24:04 +00:00
|
|
|
<legend>Apply</legend>
|
2009-11-30 12:06:02 +00:00
|
|
|
<default>true</default>
|
2009-11-30 14:24:04 +00:00
|
|
|
<key>Enter</key>
|
|
|
|
<binding>
|
|
|
|
<command>nasal</command>
|
|
|
|
<script>apply()</script>
|
|
|
|
</binding>
|
2009-11-30 12:06:02 +00:00
|
|
|
<binding>
|
|
|
|
<command>dialog-close</command>
|
|
|
|
</binding>
|
|
|
|
</button>
|
|
|
|
</group>
|
|
|
|
|
|
|
|
<nasal>
|
|
|
|
<open><![CDATA[
|
|
|
|
var dlg_root = cmdarg();
|
|
|
|
|
|
|
|
var findElementByName = func(rootN, name) {
|
|
|
|
foreach( var child; rootN.getChildren() ) {
|
|
|
|
var n = child.getNode( "name" );
|
|
|
|
if( n != nil and n.getValue() == name )
|
|
|
|
return child;
|
|
|
|
var f = findElementByName(child,name);
|
|
|
|
if( f != nil ) return f;
|
|
|
|
}
|
|
|
|
return nil;
|
|
|
|
};
|
|
|
|
|
|
|
|
# fill the sounde device combo box
|
|
|
|
var combo = findElementByName( dlg_root, "source-selection" );
|
|
|
|
var wsn = props.globals.getNode( "/sim/sound/devices" );
|
|
|
|
if( wsn != nil ) {
|
|
|
|
var devices = wsn.getChildren("device");
|
|
|
|
forindex (var i; devices )
|
|
|
|
combo.getChild("value", i, 1).setValue(devices[i].getValue());
|
|
|
|
}
|
2009-11-30 14:24:04 +00:00
|
|
|
|
|
|
|
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);
|
|
|
|
|
2009-11-30 12:06:02 +00:00
|
|
|
]]></open>
|
|
|
|
</nasal>
|
2004-05-14 16:21:11 +00:00
|
|
|
|
|
|
|
</PropertyList>
|