forked from CleverRaven/Cataclysm-DDA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
music.h
36 lines (31 loc) · 1001 Bytes
/
music.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <map>
#include <string>
#include "enum_conversions.h"
#include "enum_traits.h"
namespace music
{
enum music_id {
mp3,
instrument,
sound,
title,
LAST
};
extern std::map<music_id, std::pair<bool, bool>> music_id_list;
bool is_active_music_id( music_id data );
music_id get_music_id();
std::string get_music_id_string();
void activate_music_id( music_id data );
void activate_music_id( std::string data );
void deactivate_music_id( music_id data );
void deactivate_music_id( std::string data );
void deactivate_music_id_all();
void update_music_id_is_empty_flag( music_id data, bool update );
void update_music_id_is_empty_flag( std::string data, bool update );
} // namespace music
// Use enum_traits for generic iteration over music_id, and string (de-)serialization.
// Use io::string_to_enum<music_id>( music_id ) to convert a string to music_id.
template<>
struct enum_traits<music::music_id> {
static constexpr music::music_id last = music::music_id::LAST;
};