1 // sample_queue.hxx -- sample queue management class
3 // Started by David Megginson, October 2001
4 // (Reuses some code from main.cxx, probably by Curtis Olson)
6 // Copyright (C) 2001 Curtis L. Olson - http://www.flightgear.org/~curt
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as
10 // published by the Free Software Foundation; either version 2 of the
11 // License, or (at your option) any later version.
13 // This program is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 #ifndef __FGSAMPLE_QUEUE_HXX
25 #define __FGSAMPLE_QUEUE_HXX 1
27 #include <simgear/compiler.h>
31 #include <simgear/structure/subsystem_mgr.hxx>
32 #include <simgear/props/props.hxx>
33 #include <simgear/sound/sample_group.hxx>
38 * FlightGear sample queue class
40 * This modules maintains a queue of 'message' audio files. These
41 * are played sequentially with no overlap until the queue is finished.
42 * This second mechanisms is useful for things like tutorial messages or
43 * background ATC chatter.
45 class FGSampleQueue : public SGSampleGroup
50 FGSampleQueue ( SGSoundMgr *smgr, const string &refname );
51 virtual ~FGSampleQueue ();
53 virtual void update (double dt);
55 inline void add (SGSharedPtr<SGSoundSample> msg) { _messages.push(msg); }
59 std::queue< SGSharedPtr<SGSoundSample> > _messages;
64 SGPropertyNode_ptr _enabled;
65 SGPropertyNode_ptr _volume;