| 1 |
<?xml version="1.0"?> |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
<PropertyList> |
| 6 |
<name>sound-dialog</name> |
| 7 |
<modal>false</modal> |
| 8 |
<width>400</width> |
| 9 |
<layout>vbox</layout> |
| 10 |
|
| 11 |
<group> |
| 12 |
<layout>hbox</layout> |
| 13 |
|
| 14 |
<text> |
| 15 |
<label>Sound Configuration</label> |
| 16 |
</text> |
| 17 |
|
| 18 |
<empty><stretch>1</stretch></empty> |
| 19 |
|
| 20 |
<button> |
| 21 |
<legend>X</legend> |
| 22 |
<key>Esc</key> |
| 23 |
<pref-width>20</pref-width> |
| 24 |
<pref-height>20</pref-height> |
| 25 |
<binding> |
| 26 |
<command>dialog-close</command> |
| 27 |
</binding> |
| 28 |
</button> |
| 29 |
</group> |
| 30 |
|
| 31 |
<hrule/> |
| 32 |
|
| 33 |
<group> |
| 34 |
<layout>hbox</layout> |
| 35 |
|
| 36 |
|
| 37 |
<text> |
| 38 |
<label></label> |
| 39 |
</text> |
| 40 |
|
| 41 |
<text> |
| 42 |
<halign>right</halign> |
| 43 |
<label>Sound Device:</label> |
| 44 |
</text> |
| 45 |
|
| 46 |
<combo> |
| 47 |
<name>source-selection</name> |
| 48 |
<halign>fill</halign> |
| 49 |
<stretch>true</stretch> |
| 50 |
<property>sim/gui/dialogs/sound-dialog/source-selection</property> |
| 51 |
<binding> |
| 52 |
<command>dialog-apply</command> |
| 53 |
<object-name>source-selection</object-name> |
| 54 |
</binding> |
| 55 |
<binding> |
| 56 |
<command>dialog-update</command> |
| 57 |
<object-name>sound-dialog</object-name> |
| 58 |
</binding> |
| 59 |
</combo> |
| 60 |
|
| 61 |
|
| 62 |
<text> |
| 63 |
<label></label> |
| 64 |
</text> |
| 65 |
|
| 66 |
</group> |
| 67 |
|
| 68 |
<hrule/> |
| 69 |
|
| 70 |
<group> |
| 71 |
<layout>table</layout> |
| 72 |
<halign>center</halign> |
| 73 |
|
| 74 |
<text> |
| 75 |
<row>0</row> |
| 76 |
<col>0</col> |
| 77 |
<label>Channel</label> |
| 78 |
<padding>10</padding> |
| 79 |
</text> |
| 80 |
|
| 81 |
<text> |
| 82 |
<row>0</row> |
| 83 |
<col>1</col> |
| 84 |
<label>Enabled</label> |
| 85 |
<padding>10</padding> |
| 86 |
</text> |
| 87 |
|
| 88 |
<text> |
| 89 |
<row>0</row> |
| 90 |
<col>2</col> |
| 91 |
<label>Volume</label> |
| 92 |
<padding>10</padding> |
| 93 |
</text> |
| 94 |
|
| 95 |
<text> |
| 96 |
<row>0</row> |
| 97 |
<col>3</col> |
| 98 |
<label>External</label> |
| 99 |
<padding>10</padding> |
| 100 |
</text> |
| 101 |
|
| 102 |
<text> |
| 103 |
<row>1</row> |
| 104 |
<col>0</col> |
| 105 |
<label>Master</label> |
| 106 |
<halign>left</halign> |
| 107 |
</text> |
| 108 |
|
| 109 |
<checkbox> |
| 110 |
<row>1</row> |
| 111 |
<col>1</col> |
| 112 |
<property>/sim/sound/enabled</property> |
| 113 |
<binding> |
| 114 |
<command>dialog-apply</command> |
| 115 |
</binding> |
| 116 |
</checkbox> |
| 117 |
|
| 118 |
<slider> |
| 119 |
<row>1</row> |
| 120 |
<col>2</col> |
| 121 |
<property>/sim/sound/volume</property> |
| 122 |
<binding> |
| 123 |
<command>dialog-apply</command> |
| 124 |
</binding> |
| 125 |
</slider> |
| 126 |
|
| 127 |
<text> |
| 128 |
<row>2</row> |
| 129 |
<col>0</col> |
| 130 |
<label>Effects</label> |
| 131 |
<halign>left</halign> |
| 132 |
<enable> |
| 133 |
<property>/sim/sound/enabled</property> |
| 134 |
</enable> |
| 135 |
</text> |
| 136 |
|
| 137 |
<checkbox> |
| 138 |
<row>2</row> |
| 139 |
<col>1</col> |
| 140 |
<property>/sim/sound/effects/enabled</property> |
| 141 |
<binding> |
| 142 |
<command>dialog-apply</command> |
| 143 |
</binding> |
| 144 |
<enable> |
| 145 |
<property>/sim/sound/enabled</property> |
| 146 |
</enable> |
| 147 |
</checkbox> |
| 148 |
|
| 149 |
<slider> |
| 150 |
<row>2</row> |
| 151 |
<col>2</col> |
| 152 |
<property>/sim/sound/effects/volume</property> |
| 153 |
<binding> |
| 154 |
<command>dialog-apply</command> |
| 155 |
</binding> |
| 156 |
<enable> |
| 157 |
<property>/sim/sound/enabled</property> |
| 158 |
</enable> |
| 159 |
</slider> |
| 160 |
|
| 161 |
<text> |
| 162 |
<row>3</row> |
| 163 |
<col>0</col> |
| 164 |
<label>Avionics</label> |
| 165 |
<halign>left</halign> |
| 166 |
<enable> |
| 167 |
<property>/sim/sound/enabled</property> |
| 168 |
</enable> |
| 169 |
</text> |
| 170 |
|
| 171 |
<checkbox> |
| 172 |
<row>3</row> |
| 173 |
<col>1</col> |
| 174 |
<property>/sim/sound/avionics/enabled</property> |
| 175 |
<binding> |
| 176 |
<command>dialog-apply</command> |
| 177 |
</binding> |
| 178 |
<enable> |
| 179 |
<property>/sim/sound/enabled</property> |
| 180 |
</enable> |
| 181 |
</checkbox> |
| 182 |
|
| 183 |
<slider> |
| 184 |
<row>3</row> |
| 185 |
<col>2</col> |
| 186 |
<property>/sim/sound/avionics/volume</property> |
| 187 |
<binding> |
| 188 |
<command>dialog-apply</command> |
| 189 |
</binding> |
| 190 |
<enable> |
| 191 |
<property>/sim/sound/enabled</property> |
| 192 |
</enable> |
| 193 |
</slider> |
| 194 |
|
| 195 |
<checkbox> |
| 196 |
<row>3</row> |
| 197 |
<col>3</col> |
| 198 |
<property>/sim/sound/avionics/external-view</property> |
| 199 |
<binding> |
| 200 |
<command>dialog-apply</command> |
| 201 |
</binding> |
| 202 |
<enable> |
| 203 |
<property>/sim/sound/enabled</property> |
| 204 |
</enable> |
| 205 |
</checkbox> |
| 206 |
|
| 207 |
<text> |
| 208 |
<row>4</row> |
| 209 |
<col>0</col> |
| 210 |
<label>ATC</label> |
| 211 |
<halign>left</halign> |
| 212 |
<enable> |
| 213 |
<property>/sim/sound/enabled</property> |
| 214 |
</enable> |
| 215 |
</text> |
| 216 |
|
| 217 |
<checkbox> |
| 218 |
<row>4</row> |
| 219 |
<col>1</col> |
| 220 |
<property>/sim/sound/atc/enabled</property> |
| 221 |
<binding> |
| 222 |
<command>dialog-apply</command> |
| 223 |
</binding> |
| 224 |
<enable> |
| 225 |
<property>/sim/sound/enabled</property> |
| 226 |
</enable> |
| 227 |
</checkbox> |
| 228 |
|
| 229 |
<slider> |
| 230 |
<row>4</row> |
| 231 |
<col>2</col> |
| 232 |
<property>/sim/sound/atc/volume</property> |
| 233 |
<binding> |
| 234 |
<command>dialog-apply</command> |
| 235 |
</binding> |
| 236 |
<enable> |
| 237 |
<property>/sim/sound/enabled</property> |
| 238 |
</enable> |
| 239 |
</slider> |
| 240 |
|
| 241 |
<checkbox> |
| 242 |
<row>4</row> |
| 243 |
<col>3</col> |
| 244 |
<property>/sim/sound/atc/external-view</property> |
| 245 |
<binding> |
| 246 |
<command>dialog-apply</command> |
| 247 |
</binding> |
| 248 |
<enable> |
| 249 |
<property>/sim/sound/enabled</property> |
| 250 |
</enable> |
| 251 |
</checkbox> |
| 252 |
|
| 253 |
<text> |
| 254 |
<row>5</row> |
| 255 |
<col>0</col> |
| 256 |
<label>AI/MP</label> |
| 257 |
<halign>left</halign> |
| 258 |
<enable> |
| 259 |
<property>/sim/sound/enabled</property> |
| 260 |
</enable> |
| 261 |
</text> |
| 262 |
|
| 263 |
<checkbox> |
| 264 |
<row>5</row> |
| 265 |
<col>1</col> |
| 266 |
<property>/sim/sound/aimodels/enabled</property> |
| 267 |
<binding> |
| 268 |
<command>dialog-apply</command> |
| 269 |
</binding> |
| 270 |
<enable> |
| 271 |
<property>/sim/sound/enabled</property> |
| 272 |
</enable> |
| 273 |
</checkbox> |
| 274 |
|
| 275 |
<slider> |
| 276 |
<row>5</row> |
| 277 |
<col>2</col> |
| 278 |
<property>/sim/sound/aimodels/volume</property> |
| 279 |
<binding> |
| 280 |
<command>dialog-apply</command> |
| 281 |
</binding> |
| 282 |
<enable> |
| 283 |
<property>/sim/sound/enabled</property> |
| 284 |
</enable> |
| 285 |
</slider> |
| 286 |
</group> |
| 287 |
|
| 288 |
<hrule/> |
| 289 |
|
| 290 |
<group> |
| 291 |
<layout>hbox</layout> |
| 292 |
|
| 293 |
|
| 294 |
<text> |
| 295 |
<label></label> |
| 296 |
</text> |
| 297 |
|
| 298 |
<text> |
| 299 |
<halign>right</halign> |
| 300 |
<label>Use voice synthesis for tutorials and comms (requires restart)</label> |
| 301 |
</text> |
| 302 |
|
| 303 |
<checkbox> |
| 304 |
<property>/sim/sound/voices/enabled</property> |
| 305 |
<binding> |
| 306 |
<command>dialog-apply</command> |
| 307 |
</binding> |
| 308 |
<enable> |
| 309 |
<property>/sim/sound/enabled</property> |
| 310 |
</enable> |
| 311 |
</checkbox> |
| 312 |
|
| 313 |
|
| 314 |
<text> |
| 315 |
<label></label> |
| 316 |
</text> |
| 317 |
|
| 318 |
</group> |
| 319 |
|
| 320 |
<hrule/> |
| 321 |
|
| 322 |
<group> |
| 323 |
<layout>hbox</layout> |
| 324 |
<default-padding>10</default-padding> |
| 325 |
|
| 326 |
<button> |
| 327 |
<legend>Apply</legend> |
| 328 |
<key>Enter</key> |
| 329 |
<binding> |
| 330 |
<command>nasal</command> |
| 331 |
<script>apply()</script> |
| 332 |
</binding> |
| 333 |
<binding> |
| 334 |
<command>dialog-apply</command> |
| 335 |
</binding> |
| 336 |
</button> |
| 337 |
|
| 338 |
<button> |
| 339 |
<legend>Close</legend> |
| 340 |
<default>true</default> |
| 341 |
<key>Esc</key> |
| 342 |
<binding> |
| 343 |
<command>dialog-close</command> |
| 344 |
</binding> |
| 345 |
</button> |
| 346 |
</group> |
| 347 |
|
| 348 |
<nasal> |
| 349 |
<open><![CDATA[ |
| 350 |
var dlg_root = cmdarg(); |
| 351 |
|
| 352 |
# Fill the sound device combo box |
| 353 |
var combo = gui.findElementByName( dlg_root, "source-selection" ); |
| 354 |
var wsn = props.globals.getNode( "sim/sound/devices" ); |
| 355 |
if( wsn != nil ) { |
| 356 |
var devices = wsn.getChildren("device"); |
| 357 |
forindex (var i; devices ) |
| 358 |
combo.getChild("value", i, 1).setValue(devices[i].getValue()); |
| 359 |
} |
| 360 |
|
| 361 |
var apply = func { |
| 362 |
var new = getprop("sim/gui/dialogs/sound-dialog/source-selection"); |
| 363 |
var current = getprop("sim/sound/device-name"); |
| 364 |
if (cmp(current, new) != 0) { |
| 365 |
setprop("sim/sound/devices/name", new); |
| 366 |
setprop("sim/sound/device-name", new); |
| 367 |
if(getprop("/sim/fgcom/enabled")) { |
| 368 |
setprop("/sim/fgcom/enabled", 0); |
| 369 |
settimer( func { fgcommand("reinit", props.Node.new({ "subsystem" : "sound" })); }, 0.5 ); |
| 370 |
settimer( func { setprop("/sim/fgcom/enabled", 1); }, 1 ); |
| 371 |
} else { |
| 372 |
fgcommand("reinit", props.Node.new({ "subsystem" : "sound" })); |
| 373 |
} |
| 374 |
} |
| 375 |
} |
| 376 |
|
| 377 |
# initialization |
| 378 |
var default_device = getprop("sim/sound/device-name"); |
| 379 |
setprop( "sim/gui/dialogs/sound-dialog/source-selection", default_device); |
| 380 |
|
| 381 |
]]></open> |
| 382 |
</nasal> |
| 383 |
|
| 384 |
</PropertyList> |