#include <simgear/sound/soundmgr_openal.hxx>
#include <simgear/sound/sample_openal.hxx>
-FGSampleQueue::FGSampleQueue ( SGSoundMgr *smgr, const string &refname ) :
+FGSampleQueue::FGSampleQueue ( SGSoundMgr *smgr, const std::string &refname ) :
last_enabled( true ),
last_volume( 0.0 ),
_enabled( fgGetNode("/sim/sound/chatter/enabled", true) ),
SGSampleGroup::_smgr = smgr;
SGSampleGroup::_smgr->add(this, refname);
SGSampleGroup::_refname = refname;
- _enabled->setBoolValue(true);
- _volume->setFloatValue(1.0);
}
FGSampleQueue::~FGSampleQueue ()
{
- while ( _messages.size() > 0 ) {
- delete _messages.front();
- _messages.pop();
- }
}
}
// process message queue
- const string msgid = "Sequential Audio Message";
+ const std::string msgid = "Sequential Audio Message";
bool now_playing = false;
if ( exists( msgid ) ) {
now_playing = is_playing( msgid );
if ( !now_playing ) {
// message queue idle, add next sound if we have one
- if ( _messages.size() > 0 ) {
+ if ( ! _messages.empty() ) {
SGSampleGroup::add( _messages.front(), msgid );
_messages.pop();
play_once( msgid );