Planeshift
queue.h
Go to the documentation of this file.
1 /*
2  * queue.h
3  *
4  * Copyright (C) 2001-2010 Atomic Blue (info@planeshift.it, http://www.planeshift.it)
5  *
6  * Credits : Saul Leite <leite@engineer.com>
7  * Mathias 'AgY' Voeroes <agy@operswithoutlife.net>
8  * and all past and present planeshift coders
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation (version 2 of the License.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21  *
22  */
23 
24 #ifndef _SOUND_QUEUE_H_
25 #define _SOUND_QUEUE_H_
26 
27 #include <csutil/csstring.h>
28 #include <csutil/array.h>
29 
30 class SoundHandle;
31 class SoundControl;
32 
39 class SoundQueueItem
40 {
41 public:
42  csString filename;
44 
49  SoundQueueItem(const char* file);
54 };
55 
56 
61 class SoundQueue
62 {
63 private:
64  csArray<SoundQueueItem*> queue;
65  float volume;
66  SoundControl* sndCtrl;
67 
68 public:
74  SoundQueue(SoundControl* &ctrl, float vol);
78  ~SoundQueue();
84  void AddItem(const char* filename);
90  void DeleteItem(SoundQueueItem* &item);
96  void Work();
98  void Purge();
99 
103  size_t GetSize();
104 };
105 
106 #endif /*_SOUND_QUEUE_H_*/
Queue object for.
Definition: queue.h:39
Used to put Sounds in a Queue and play them in the order they have been added.
Definition: queue.h:61
A Volume and Sound control class.
Definition: control.h:40
SoundQueueItem(const char *file)
Constructor.
SoundHandle * handle
pointer to its SoundHandle - not guaranteed to be valid */
Definition: queue.h:43
csString filename
a filename of a file which may exist within our vfs */
Definition: queue.h:42
~SoundQueueItem()
Destructor.