xoreos  0.0.5
xactwavebank_binary.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 SOUND_XACTWAVEBANK_BINARY_H
26 #define SOUND_XACTWAVEBANK_BINARY_H
27 
28 #include <vector>
29 
30 #include "src/common/scopedptr.h"
31 #include "src/common/ustring.h"
32 #include "src/common/readstream.h"
33 
34 #include "src/sound/xactwavebank.h"
35 
36 namespace Sound {
37 
59 public:
62 
64  const Common::UString &getName() const { return _name; }
66  bool isStreaming() const;
67 
69  size_t getWaveCount() const;
70 
72  RewindableAudioStream *getWave(size_t index) const;
73 
74 private:
76  enum Codec {
77  kCodecPCM = 0,
79  kCodecWMA = 2
80  };
81 
83  struct Wave {
84  size_t offset;
85  size_t size;
86 
88 
93 
95 
96  size_t loopOffset;
97  size_t loopLength;
98  };
99 
101 
104 
105  std::vector<Wave> _waves;
106 
107 
108  void load(Common::SeekableReadStream &xwb);
109 };
110 
111 } // End of namespace Sound
112 
113 #endif // SOUND_XACTWAVEBANK_BINARY_H
A class holding an UTF-8 string.
Definition: ustring.h:48
ASF container with a WMA stream.
uint8_t uint8
Definition: types.h:200
RewindableAudioStream * getWave(size_t index) const
Return the audio stream of a wave.
An abstract XACT WaveBank interface.
Definition: xactwavebank.h:46
uint8 bitRate
Number of bits per sample.
Common::UString _name
The internal name of this wavebank. */.
Codec codec
The codec the wave is in.
uint32 flags
Flags for this wave.
uint8 channels
Number of channels.
size_t loopLength
Length of the looping section.
uint32 samplingRate
Sampling frequency in Hz.
Common::ScopedPtr< Common::SeekableReadStream > _xwb
A simple scoped smart pointer template.
Definition: game.h:37
A rewindable audio stream.
Definition: audiostream.h:125
Codec
The codec of a wave within the wavebank.
XACTWaveBank_Binary(Common::SeekableReadStream *xwb)
A wave within the wavebank.
void load(Common::SeekableReadStream &xwb)
Basic reading stream interfaces.
size_t loopOffset
Start a loop from here.
Unicode string handling.
uint32_t uint32
Definition: types.h:204
const Common::UString & getName() const
Return the internal name of the WaveBank.
uint8 blockAlign
Size of a compressed block in bytes.
Containerless Xbox ADPCM stream.
bool isStreaming() const
Is this WaveBank rating for streaming, or in-memory play?
Class to hold audio resource data of an XWB wavebank file.
Interface for a seekable & readable data stream.
Definition: readstream.h:265
size_t offset
The offset of the wave within the wavebank. */.
size_t getWaveCount() const
Return the number of wave files.
An abstract XACT WaveBank, containing sound files.
size_t size
The size of the wave in bytes. */.