Cytopia
0.3
A city building simulation game
AudioConfig.hxx
Go to the documentation of this file.
1
#ifndef AUDIO_CONFIG_HXX
2
#define AUDIO_CONFIG_HXX
3
4
#include "
Soundtrack.hxx
"
5
6
#include <unordered_map>
7
#include <vector>
8
#include <betterEnums.hxx>
9
#include <json.hxx>
10
11
using
nlohmann::json
;
12
13
template
<
typename
Key,
typename
Value>
using
Mapping
= std::unordered_map<Key, Value>;
14
using
string
=
std::string
;
15
template
<
typename
Type>
using
Vector
= std::vector<Type>;
16
20
BETTER_ENUM
(AudioTrigger,
int
, MainMenu, MainTheme, NatureSounds);
21
22
struct
AudioConfig
23
{
24
struct
SoundtrackConfiguration
25
{
26
string
stereoFilePath
;
27
string
monoFilePath
;
28
Vector<AudioTrigger>
triggers
;
29
};
30
Mapping<string, SoundtrackConfiguration>
Music
;
31
Mapping<string, SoundtrackConfiguration>
Sound
;
32
};
33
34
void
from_json
(
const
json
&j,
AudioConfig
&config);
35
void
from_json
(
const
json
&j,
AudioConfig::SoundtrackConfiguration
&config);
36
37
#endif
AudioConfig
Definition:
AudioConfig.hxx:22
BETTER_ENUM
BETTER_ENUM(AudioTrigger, int, MainMenu, MainTheme, NatureSounds)
the types of triggers
AudioConfig::SoundtrackConfiguration::stereoFilePath
string stereoFilePath
Definition:
AudioConfig.hxx:26
Vector
std::vector< Type > Vector
Definition:
AudioConfig.hxx:15
Soundtrack.hxx
Mapping
std::unordered_map< Key, Value > Mapping
Definition:
AudioConfig.hxx:13
AudioConfig::SoundtrackConfiguration::triggers
Vector< AudioTrigger > triggers
Definition:
AudioConfig.hxx:28
from_json
void from_json(const json &j, AudioConfig &config)
Definition:
AudioConfig.cxx:3
AudioConfig::SoundtrackConfiguration
Definition:
AudioConfig.hxx:24
AudioConfig::Sound
Mapping< string, SoundtrackConfiguration > Sound
Definition:
AudioConfig.hxx:31
json
nlohmann::json json
Definition:
Settings.hxx:12
string
std::string string
Definition:
AudioConfig.hxx:14
AudioConfig::Music
Mapping< string, SoundtrackConfiguration > Music
Definition:
AudioConfig.hxx:30
AudioConfig::SoundtrackConfiguration::monoFilePath
string monoFilePath
Definition:
AudioConfig.hxx:27
src
engine
audio
AudioConfig.hxx
Generated on Sun Nov 27 2022 09:50:52 for Cytopia by
1.8.17