Loading [MathJax]/extensions/MathMenu.js
Cytopia  0.3
A city building simulation game
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Soundtrack.hxx
Go to the documentation of this file.
1 #ifndef SOUNDTRACK_HXX_
2 #define SOUNDTRACK_HXX_
3 
4 #include <memory>
5 #include <string>
6 
7 #include "../../util/Meta.hxx"
8 
9 #include "AL/al.h"
10 #include "AL/alc.h"
11 
12 #include <vector>
13 
14 using std::string;
18 
26 {
27  std::vector<char> char_data_vec;
28  long nBytes;
30 };
31 
32 struct Soundtrack
33 {
35 
40 
47 
51  bool isMusic : 1;
52 
56  bool isPlaying : 1;
57 
61  bool isTriggerable : 1;
62 
66  bool isPlayable : 1;
67 
73  ALuint source[2];
74 
80  ALuint buffer;
81 
87  ALuint effect_slot;
88 
93 
94  Soundtrack(SoundtrackID, ChannelID, DecodedAudioData *, RepeatCount, bool, bool, bool, bool);
95  ~Soundtrack();
96 };
97 
98 using SoundtrackUPtr = std::unique_ptr<Soundtrack>;
99 
100 #endif
Soundtrack::effect_slot
ALuint effect_slot
The OpenAL effect slot of the sound track.
Definition: Soundtrack.hxx:87
StrongType< int, struct ChannelIDTag >
Soundtrack::source
ALuint source[2]
The OpenAL sources of the sound track.
Definition: Soundtrack.hxx:73
DecodedAudioData::data_sample_rate
int data_sample_rate
Definition: Soundtrack.hxx:29
SoundtrackUPtr
std::unique_ptr< Soundtrack > SoundtrackUPtr
Definition: Soundtrack.hxx:98
Soundtrack::Soundtrack
Soundtrack(SoundtrackID, ChannelID, DecodedAudioData *, RepeatCount, bool, bool, bool, bool)
Definition: Soundtrack.cxx:6
Soundtrack::isPlayable
bool isPlayable
true if the Soundtrack can be played by SoundtrackID
Definition: Soundtrack.hxx:66
DecodedAudioData::char_data_vec
std::vector< char > char_data_vec
pcm audio data
Definition: Soundtrack.hxx:27
Soundtrack::ID
SoundtrackID ID
Definition: Soundtrack.hxx:34
DecodedAudioData
Container for raw pcm data that read from .ogg sound file.
Definition: Soundtrack.hxx:25
Soundtrack::~Soundtrack
~Soundtrack()
Definition: Soundtrack.cxx:40
Soundtrack::isMusic
bool isMusic
true if the Soundtrack is Music, false if it's a Sound
Definition: Soundtrack.hxx:51
Soundtrack::Loop
RepeatCount Loop
The number of times this track should be repeated.
Definition: Soundtrack.hxx:46
Soundtrack::buffer
ALuint buffer
The OpenAL buffer of the sound track.
Definition: Soundtrack.hxx:80
DecodedAudioData::nBytes
long nBytes
number of bytes in decoded audio data
Definition: Soundtrack.hxx:28
Soundtrack::Channel
ChannelID Channel
The ChannelID.
Definition: Soundtrack.hxx:39
Soundtrack::isTriggerable
bool isTriggerable
true if the Soundtrack can be played by AudioTrigger
Definition: Soundtrack.hxx:61
Soundtrack
Definition: Soundtrack.hxx:32
string
std::string string
Definition: AudioConfig.hxx:14
Soundtrack::dAudioDataBuffer
DecodedAudioData dAudioDataBuffer
The audio data of the Soundtrack.
Definition: Soundtrack.hxx:92
Soundtrack::isPlaying
bool isPlaying
true if the Soundtrack is currently playing
Definition: Soundtrack.hxx:56