15 #define SET_TYPE "music" 25 "old_0",
"old_1",
"old_2",
"old_3",
"old_4",
"old_5",
"old_6",
"old_7",
"old_8",
"old_9",
26 "new_0",
"new_1",
"new_2",
"new_3",
"new_4",
"new_5",
"new_6",
"new_7",
"new_8",
"new_9",
27 "ezy_0",
"ezy_1",
"ezy_2",
"ezy_3",
"ezy_4",
"ezy_5",
"ezy_6",
"ezy_7",
"ezy_8",
"ezy_9",
32 template <
class T,
size_t Tnum_files,
bool Tsearch_in_tars>
35 template <
class Tbase_set>
41 template <
class Tbase_set>
46 const Tbase_set *best = NULL;
48 if (c->GetNumMissing() != 0)
continue;
51 (best->fallback && !c->fallback) ||
52 best->valid_files < c->valid_files ||
53 (best->valid_files == c->valid_files &&
54 (best->shortname == c->shortname && best->version < c->version))) {
63 bool MusicSet::FillSetDetails(
IniFile *ini,
const char *path,
const char *full_filename)
67 this->num_available = 0;
71 if (names == NULL ||
StrEmpty(filename)) {
80 for (
const char *p = filename; p != NULL; p = strchr(p, PATHSEPCHAR)) {
83 while (*p == PATHSEPCHAR) p++;
85 item = names->
GetItem(p,
false);
90 DEBUG(grf, 0,
"Base music set song name missing: %s", filename);
95 this->track_nr[i] = j++;
96 this->num_available++;
A group within an ini file.
static const char *const _music_file_names[]
Names corresponding to the music set's files.
#define lastof(x)
Get the last element of an fixed size array.
IniGroup * GetGroup(const char *name, size_t len=0, bool create_new=true)
Get the group with the given name.
MD5File files[NUM_FILES]
All files part of this set.
A single "line" in an ini file.
const char * filename
filename
Definition of base types and functions in a cross-platform compatible way.
assert_compile(lengthof(_music_file_names)==NUM_SONGS_AVAILABLE)
Make sure we aren't messing things up.
A number of safeguards to prevent using unsafe methods.
char * value
The value of this item.
#define lengthof(x)
Return the length of an fixed size array.
#define DEBUG(name, level,...)
Output a line of debugging information.
Ini file that supports both loading and saving.
static bool StrEmpty(const char *s)
Check if a string buffer is empty.
bool FillSetDetails(IniFile *ini, const char *path, const char *full_filename, bool allow_empty_filename=true)
Read the set information from a loaded ini.
IniItem * GetItem(const char *name, bool create)
Get the item with the given name, and if it doesn't exist and create is true it creates a new item...
char * strecpy(char *dst, const char *src, const char *last)
Copies characters from one buffer to another.
char song_name[NUM_SONGS_AVAILABLE][32]
The name of the different songs.
Information about a single base set.