X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fsound%2Fxmlsound.hxx;h=f3635b08a705393d2c8180bc2a71aeeb9681904e;hb=a7697f6095eca0a2b8e1129d8430aebb62138509;hp=99bd9b268d6ccefb54bd3494725d9bb6c108cfd2;hpb=dcb95d131bc6aef1abe25d1f415e309f06e52436;p=simgear.git diff --git a/simgear/sound/xmlsound.hxx b/simgear/sound/xmlsound.hxx index 99bd9b26..f3635b08 100644 --- a/simgear/sound/xmlsound.hxx +++ b/simgear/sound/xmlsound.hxx @@ -33,11 +33,13 @@ # error This library requires C++ #endif +#include + #include #include +#include "sample_group.hxx" #include "sample_openal.hxx" -#include "soundmgr_openal.hxx" static const double MAX_TRANSIT_TIME = 0.1; // 100 ms. @@ -61,14 +63,14 @@ public: /** * Initialize the sound event. * - * Prior to initialization of the sound event the propgrams property root + * Prior to initialization of the sound event the program's property root * has to be defined, the sound configuration XML tree has to be loaded * and a sound manager class has to be defined. * * A sound configuration file would look like this: * * - * Define the name of the event. For refference only. + * Define the name of the event. For reference only. * Either: * looped: play this sound looped. * in-transit: play looped while the event is happening. @@ -76,8 +78,9 @@ public: * The relative path to the audio file. * Take action if this property becomes true. * Take action if this condition becomes true. + * Time after which the sound should be played. * or Define volume or pitch settings. - * Take the value of this property as a refference for the + * Take the value of this property as a reference for the * result. * Either: * dt_start: the time elapsed since this sound is playing. @@ -96,14 +99,15 @@ public: * @param root The root node of the programs property tree. * @param child A pointer to the location of the current event as defined * in the configuration file. - * @param sndmgr A pointer to a pre-initialized sound manager class. + * @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 *, SGSoundMgr *, - const string &); + virtual void init (SGPropertyNode *, SGPropertyNode *, SGSampleGroup *, + SGSampleGroup *, const SGPath& currentDir); /** - * Check wheter an event has happened and if action has to be taken. + * Check whether an event has happened and if action has to be taken. */ virtual void update (double dt); @@ -132,10 +136,10 @@ protected: private: - SGSoundMgr * _mgr; + SGSampleGroup * _sgrp; SGSharedPtr _sample; - SGCondition * _condition; + SGSharedPtr _condition; SGPropertyNode_ptr _property; bool _active; @@ -144,11 +148,12 @@ private: double _prev_value; double _dt_play; double _dt_stop; + double _delay; // time after which the sound should be started (default: 0) double _stopping; // time after the sound should have stopped. - // This is usefull for lost packets in in-trasit mode. + // This is useful for lost packets in in-transit mode. - vector<_snd_prop> _volume; - vector<_snd_prop> _pitch; + std::vector<_snd_prop> _volume; + std::vector<_snd_prop> _pitch; };