Added volume control to the atc-chatter
This commit is contained in:
parent
7420f9fe65
commit
bafa93e8fd
3 changed files with 70 additions and 57 deletions
|
@ -53,13 +53,15 @@ chatter_update = func {
|
|||
|
||||
if ( substr(chatter_list[chatter_index],
|
||||
size(chatter_list[chatter_index]) - 4) == ".wav" )
|
||||
{
|
||||
tmpl = { path : chatter_dir, file : chatter_list[chatter_index] };
|
||||
{
|
||||
var vol =getprop("/sim/sound/atc-chatter-volume");
|
||||
if(vol == nil){vol = 0.5;}
|
||||
tmpl = { path : chatter_dir, file : chatter_list[chatter_index] , volume : vol};
|
||||
if ( getprop("/sim/sound/atc-chatter") ) {
|
||||
# go through the motions, but only schedule the message to play
|
||||
# if atc-chatter is enabled.
|
||||
printlog("info", "update atc chatter ", chatter_list[chatter_index] );
|
||||
fgcommand("play-audio-message", props.Node.new(tmpl) );
|
||||
fgcommand("play-audio-message", props.Node.new(tmpl) );
|
||||
}
|
||||
} else {
|
||||
# skip non-wav file found in directory
|
||||
|
|
|
@ -3,67 +3,77 @@
|
|||
<!-- Sound control dialog -->
|
||||
|
||||
<PropertyList>
|
||||
<name>sound-dialog</name>
|
||||
<layout>vbox</layout>
|
||||
<name>sound-dialog</name>
|
||||
<layout>vbox</layout>
|
||||
|
||||
<text>
|
||||
<label>Sound Configuration</label>
|
||||
</text>
|
||||
<text>
|
||||
<label>Sound Configuration</label>
|
||||
</text>
|
||||
|
||||
<hrule/>
|
||||
<hrule/>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<empty><dummy/></empty>
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<empty><dummy/></empty>
|
||||
|
||||
<group>
|
||||
<layout>vbox</layout>
|
||||
<group>
|
||||
<layout>vbox</layout>
|
||||
|
||||
<checkbox>
|
||||
<label>Mute Sound</label>
|
||||
<halign>left</halign>
|
||||
<property>/sim/sound/pause</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</checkbox>
|
||||
<checkbox>
|
||||
<label>Mute Sound</label>
|
||||
<halign>left</halign>
|
||||
<property>/sim/sound/pause</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</checkbox>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<text><label>Volume:</label></text>
|
||||
<slider>
|
||||
<property>/sim/sound/volume</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</slider>
|
||||
</group>
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<text><label>Volume:</label></text>
|
||||
<slider>
|
||||
<property>/sim/sound/volume</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</slider>
|
||||
</group>
|
||||
|
||||
<checkbox>
|
||||
<label>ATC Chatter</label>
|
||||
<halign>left</halign>
|
||||
<property>/sim/sound/atc-chatter</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</checkbox>
|
||||
</group>
|
||||
<checkbox>
|
||||
<label>ATC Chatter</label>
|
||||
<halign>left</halign>
|
||||
<property>/sim/sound/atc-chatter</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</checkbox>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<text><label>ATC Volume:</label></text>
|
||||
<slider>
|
||||
<property>/sim/sound/atc-chatter-volume</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
</binding>
|
||||
</slider>
|
||||
</group>
|
||||
|
||||
</group>
|
||||
<empty><dummy/></empty>
|
||||
</group>
|
||||
|
||||
<empty><dummy/></empty>
|
||||
</group>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<default-padding>10</default-padding>
|
||||
|
||||
<button>
|
||||
<legend>Close</legend>
|
||||
<default>true</default>
|
||||
<key>Esc</key>
|
||||
<binding>
|
||||
<command>dialog-close</command>
|
||||
</binding>
|
||||
</button>
|
||||
</group>
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<default-padding>10</default-padding>
|
||||
<button>
|
||||
<legend>Close</legend>
|
||||
<default>true</default>
|
||||
<key>Esc</key>
|
||||
<binding>
|
||||
<command>dialog-close</command>
|
||||
</binding>
|
||||
</button>
|
||||
</group>
|
||||
|
||||
</PropertyList>
|
||||
|
|
|
@ -113,6 +113,7 @@ Started September 2000 by David Megginson, david@megginson.com
|
|||
<volume type="float" userarchive="y">0.8</volume>
|
||||
<pause type="bool">false</pause>
|
||||
<atc-chatter type="bool" userarchive="y">false</atc-chatter>
|
||||
<atc-chatter-volume type="double" userarchive="y">0.5</atc-chatter-volume>
|
||||
<voice type="bool">true</voice>
|
||||
<voices>
|
||||
<host type="string" write="n">localhost</host>
|
||||
|
|
Loading…
Add table
Reference in a new issue