OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
SoundSet.h
1 /*
2  * Copyright 2010-2014 OpenXcom Developers.
3  *
4  * This file is part of OpenXcom.
5  *
6  * OpenXcom is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * OpenXcom is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef OPENXCOM_SOUNDSET_H
20 #define OPENXCOM_SOUNDSET_H
21 
22 #include <map>
23 #include <string>
24 
25 namespace OpenXcom
26 {
27 
28 class Sound;
29 
35 class SoundSet
36 {
37 private:
38  std::map<int, Sound*> _sounds;
39 public:
41  SoundSet();
43  ~SoundSet();
45  void loadCat(const std::string &filename, bool wav = true);
47  Sound *getSound(unsigned int i);
49  Sound *addSound(unsigned int i);
51  size_t getTotalSounds() const;
52 };
53 
54 }
55 
56 #endif
Sound * getSound(unsigned int i)
Gets a particular sound from the set.
Definition: SoundSet.cpp:163
size_t getTotalSounds() const
Gets the total sounds in the set.
Definition: SoundSet.cpp:189
void loadCat(const std::string &filename, bool wav=true)
Loads an X-Com CAT set of sound files.
Definition: SoundSet.cpp:55
Container of a set of sounds.
Definition: SoundSet.h:35
Container for sound effects.
Definition: Sound.h:32
~SoundSet()
Cleans up the sound set.
Definition: SoundSet.cpp:38
SoundSet()
Crates a sound set.
Definition: SoundSet.cpp:30
Sound * addSound(unsigned int i)
Creates a new sound and returns a pointer to it.
Definition: SoundSet.cpp:178