xoreos  0.0.5
xactwavebank_ascii.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_ASCII_H
26 #define SOUND_XACTWAVEBANK_ASCII_H
27 
28 #include "src/common/ustring.h"
29 
30 #include "src/sound/xactwavebank.h"
31 
32 namespace Common {
33  class SeekableReadStream;
34 }
35 
36 namespace Sound {
37 
54 public:
57 
59  const Common::UString &getName() const { return _name; }
61  bool isStreaming() const { return _streaming; }
62 
64  size_t getWaveCount() const;
65 
67  RewindableAudioStream *getWave(size_t index) const;
68 
69 private:
70  struct Wave {
73 
77 
78  size_t size;
79 
80  size_t loopOffset;
81  size_t loopLength;
82  };
83 
85  bool _streaming;
86 
87  std::vector<Wave> _waves;
88 
89 
91 };
92 
93 } // End of namespace Sound
94 
95 #endif // SOUND_XACTWAVEBANK_ASCII_H
std::vector< Wave > _waves
XACTWaveBank_ASCII(Common::SeekableReadStream *xwb)
size_t getWaveCount() const
Return the number of wave files.
const Common::UString & getName() const
Return the internal name of the WaveBank.
Definition: 2dafile.h:39
A class holding an UTF-8 string.
Definition: ustring.h:48
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
Common::UString type
Type of the wave resource.
size_t loopLength
Length of the looping section.
uint8 bitRate
Number of bits per sample.
void load(Common::SeekableReadStream &xwb)
Definition: game.h:37
uint8 channels
Number of channels.
Class to hold audio resource data of an ASCII representation of an XWB wavebank file.
A rewindable audio stream.
Definition: audiostream.h:125
size_t loopOffset
Start a loop from here.
Common::UString name
Name of the wave resource.
Unicode string handling.
uint32_t uint32
Definition: types.h:204
bool isStreaming() const
Is this WaveBank rating for streaming, or in-memory play?
uint32 samplingRate
Sampling frequency in Hz.
Interface for a seekable & readable data stream.
Definition: readstream.h:265
An abstract XACT WaveBank, containing sound files.
size_t size
Size of the wave in bytes.