dsd_xml_sound3.gau

This gauge uses multiple xml Lvars to accept commands to play sounds. The Lvars used, and the sounds to be played, can be specified in a text based initialization file. The path to and name of the initialization file can be specified as a paramter in the gauge's entry in panel.cfg - a different configuration is therefore possible for every panel the gauge is used in.

This gauge uses a separate Lvar for each sound to be controlled. Meaningful values for the Lvar are:
0 - stops the sound if it is currently playing.
1 - commands a 'play once' instance of the sound. The gauge will set the Lvar back to 0 when the sound finishes or is stopped.
2 - commands a 'looping' instance of the sound. The gauge will continue to loop the sound until your xml gauge sets the related Lvar to 0.

Default values
Initialization File: Located in the Gauges folder, named dsd_xml_sound.ini. Note that the use of an initialization file is not required. In the absence of such a file, the gauge will use default values for Lvars and sound file locations and names. These defaults are:

Lvars: dsd_xml_sound_id_xx, where xx is a two digit number between 00 and 99

File names: dsd_xml_xx.wav, where xx represents the same two digit number as above, from 00 to 99

File locations: \Sound\dsd (Folder 'dsd' contained in the main FS 'Sound' folder)

The default values tend to imply that there is a numbering requirement in the Lvar names and sound file names. This is not the case. You are free to choose any Lvar names and sound file names you wish. The relationship between the Lvar and the sound file is established by the values to the left of the equal sign in the .ini file. Two sample .ini file extracts should help clarify this:

[LVars]
Lvar00=dsd_xml_sound_id_00
Lvar01=dsd_xml_sound_id_01
Lvar02=dsd_xml_sound_id_02

[Sounds]
Sound00=./Sound/dsd/dsd_xml_00.wav
Sound01=./Sound/dsd/dsd_xml_01.wav
Sound02=./Sound/dsd/dsd_xml_02.wav

The above, using default values establishes that dsd_xml_sound_id_00 will control dsd_xml_00.wav; dsd_xml_sound_id_01 will control dsd_xml_01.wav; and that dsd_xml_sound_id_02 will control dsd_xml_02.wav. Referring to the values on the left of the equal signs, Lvar00 controls Sound00; Lvar01 controls Sound01, and Lvar02 controls Sound02.
If you customize the .ini file, it might look like this:

[LVars]
Lvar00=Ignition_Switch
Lvar01=landing_gear_up
Lvar02=landing_gear_down

[Sounds]
Sound00=./Sound/click.wav
Sound01=./Sound/new_l1011/gear_up.wav
Sound02=./Sound/new_l1011/gear_down.wav

In this example, the Lvar L:Ignition_Switch will control the sound file 'click.wav', located in the main Sound folder.
L:landing_gear_up will control the sound file 'gear_up.wav', located in a folder called new_l1011, contained in the main sound folder
L:landing_gear_down will control the sound file 'gear_down.wav', located in the same new_l1011 folder.

{Config}
This section of the .ini file can have two values that dsd_xml_sound3.gau can use. They are:

MaxSounds - this parameter can reduce the number of sounds the gauge will control. The gauge has a hard coded maximum of 100 sounds, but you can reduce the value to a lower limit if you wish to save a few cpu cycles. The gauge scans each Lvar on each gauge update. There certainly isn't anything to be gained by having the gauge scan a bunch of Lvars that are not going to be used to control sounds. When I tested the gauge, there really didn't seem to a noticeable hit on framerates (1.4 Gz TBird), but the limiter is there if you wish to use it.

LvarStop - The Lvar specified here will stop all currently playing sounds if set to a value greater than zero. The gauge will reset the value to zero if the command is executed.

Lvar - This entry in the {Config} section is not used by dsd_xml_sound3.gau, but rather only by dsd_xml_sound2.gau. If you are not using dsd_xml_sound2.gau, you can remove, or simply ignore, this entry.

Syntax examples:
gauge03=dsd_xml_sound3!dsd_xml_sound3, 2,2,5, 5, Default setting. Gauge will look in 'Gauges' folder for dsd_xml_sound.ini, and will read that file if found. If not, default values will be used for Lvar and sound file names.

gauge03=dsd_xml_sound3!dsd_xml_sound3, 2,2,5, 5, .\Gauges\jet_sounds.cfg Gauge will load the values from the file 'jet_sounds.cfg' if found in the Gauges folder. Defaults loaded otherwise.

gauge03=dsd_xml_sound3!dsd_xml_sound3, 2,2,5, 5, .\Aircraft\b737_400\boeing_sounds.dat Gauge will look in the main folder for the default 737, for a file called boeing_sounds.dat. Again, if the file isn't found, default values will be used.

The gauge checks for the existence of a sound file before attempting to play it. If the file is not found, the gauge will take no further action, but it won't crash the sim!