xoreos  0.0.5
fevfile.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #ifndef AURORA_FEVFILE_H
26 #define AURORA_FEVFILE_H
27 
28 #include <map>
29 
30 #include <boost/variant.hpp>
31 
32 #include "src/common/readstream.h"
33 #include "src/common/ustring.h"
34 
35 namespace Aurora {
36 
43 class FEVFile {
44 public:
50  };
51 
53  enum PlayMode {
60  };
61 
63  enum PropertyType {
67  };
68 
70  struct Property {
72  boost::variant<int32, float, Common::UString> value;
73  };
74 
76  struct WaveBank {
80  };
81 
83  struct Category {
87  };
88 
90  struct EventCategory {
92  };
93 
101  struct Event {
103 
104  float volume;
105  float pitch;
111 
112  float Speaker2DL;
113  float Speaker2DR;
114  float Speaker2DC;
115 
116  float SpeakerLFE;
117 
118  float Speaker2DLR;
119  float Speaker2DRR;
120  float Speaker2DLS;
121  float Speaker2DRS;
122 
125 
128 
131 
132  std::map<Common::UString, Property> userProperties;
134  };
135 
139 
141 
145  float volume;
147  float pitch;
150  };
151 
152  FEVFile(const Common::UString &resRef);
154 
155  const Common::UString &getBankName();
156 
157  const std::vector<WaveBank> &getWaveBanks();
158  const std::vector<Category> &getCategories();
159 
160 private:
161  void load(Common::SeekableReadStream &fev);
162 
169 
171  std::map<Common::UString, Property> readProperties(Common::SeekableReadStream &fev);
174 
176 
177  std::vector<WaveBank> _waveBanks;
178  std::vector<Category> _categories;
179  std::vector<Event> _events;
180  std::vector<SoundDefinition> _definitions;
181 };
182 
183 } // End of namespace Aurora
184 
185 #endif // AURORA_FEVFILE_H
PropertyType
Possible Property types.
Definition: fevfile.h:63
void readEventCategory(Common::SeekableReadStream &fev)
Read a category for events.
Definition: fevfile.cpp:153
PropertyType type
Definition: fevfile.h:71
const std::vector< Category > & getCategories()
Definition: fevfile.cpp:55
Common::UString name
Definition: fevfile.h:91
A class holding an UTF-8 string.
Definition: ustring.h:48
Common::UString category
Definition: fevfile.h:133
Common::UString name
Definition: fevfile.h:102
Some objects in FMOD can have generic properties.
Definition: fevfile.h:70
An FMOD event.
Definition: fevfile.h:101
std::vector< SoundDefinition > _definitions
Definition: fevfile.h:180
Common::UString _bankName
Definition: fevfile.h:175
Common::UString name
Definition: fevfile.h:79
A sound definition.
Definition: fevfile.h:137
A category which is organized hierarchically.
Definition: fevfile.h:83
An FEV file is used to define events for the FMOD system and categorize them.
Definition: fevfile.h:43
boost::variant< int32, float, Common::UString > value
Definition: fevfile.h:72
StreamingType streamingType
Definition: fevfile.h:78
Common::UString name
Definition: fevfile.h:84
Reference to an external wave bank.
Definition: fevfile.h:76
An event category for storing events.
Definition: fevfile.h:90
std::map< Common::UString, Property > readProperties(Common::SeekableReadStream &fev)
Read properties.
Definition: fevfile.cpp:223
Basic reading stream interfaces.
std::vector< Category > _categories
Definition: fevfile.h:178
FEVFile(const Common::UString &resRef)
Definition: fevfile.cpp:34
std::vector< Event > _events
Definition: fevfile.h:179
std::vector< WaveBank > _waveBanks
Definition: fevfile.h:177
Unicode string handling.
Common::UString readLengthPrefixedString(Common::SeekableReadStream &fev)
Read an FEV length prefixed string.
Definition: fevfile.cpp:250
uint32_t uint32
Definition: types.h:204
void load(Common::SeekableReadStream &fev)
Definition: fevfile.cpp:59
const std::vector< WaveBank > & getWaveBanks()
Definition: fevfile.cpp:51
void readCategory(Common::SeekableReadStream &fev)
Read a general category.
Definition: fevfile.cpp:136
PlayMode
Possible Play modes.
Definition: fevfile.h:53
std::map< Common::UString, Property > userProperties
Definition: fevfile.h:132
StreamingType
Possible types of streaming for FMOD.
Definition: fevfile.h:46
Interface for a seekable & readable data stream.
Definition: readstream.h:265
const Common::UString & getBankName()
Definition: fevfile.cpp:47
void readEvent(Common::SeekableReadStream &fev)
Read an event.
Definition: fevfile.cpp:171
float spawnIntensityRandomization
Definition: fevfile.h:130