void
SGXmlSound::init(SGPropertyNode *root, SGPropertyNode *node,
- SGSampleGroup *sgrp, const string &path)
+ SGSampleGroup *sgrp, SGSampleGroup *avionics,
+ const string &path)
{
//
_mode = SGXmlSound::ONCE;
}
+ bool is_avionics = false;
+ const char *type_str = node->getStringValue("type", "fx");
+ if ( !strcmp(type_str, "avionics") )
+ is_avionics = true;
+
_property = root->getNode(node->getStringValue("property", ""), true);
SGPropertyNode *condition = node->getChild("condition");
if (condition != NULL)
//
// Initialize the sample
//
- _sgrp = sgrp;
+ if (is_avionics) {
+ _sgrp = avionics;
+ } else {
+ _sgrp = sgrp;
+ }
_sample = new SGSoundSample( path.c_str(), node->getStringValue("path", ""));
_sample->set_relative_position( offset_pos );
_sample->set_direction( dir );
* @param child A pointer to the location of the current event as defined
* in the configuration file.
* @param sgrp A pointer to a pre-initialized sample group class.
+ * @param avionics A pointer to the pre-initialized avionics sample group.
* @param path The path where the audio files remain.
*/
virtual void init (SGPropertyNode *, SGPropertyNode *, SGSampleGroup *,
- const string &);
+ SGSampleGroup *, const string &);
/**
* Check whether an event has happened and if action has to be taken.