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/sound/sample_group.hxx>
37 * FlightGear sample queue class
39 * This modules maintains a queue of 'message' audio files. These
40 * are played sequentially with no overlap until the queue is finished.
41 * This second mechanims is useful for things like tutorial messages or
42 * background atc chatter.
44 class FGSampleQueue : public SGSampleGroup
49 FGSampleQueue ( SGSoundMgr *smgr, const string &refname );
50 virtual ~FGSampleQueue ();
52 virtual void update (double dt);
54 inline void add (SGSharedPtr<SGSoundSample> msg) { _messages.push(msg); }
58 std::queue< SGSharedPtr<SGSoundSample> > _messages;
63 SGPropertyNode_ptr _enabled;
64 SGPropertyNode_ptr _volume;