|
|
@ -125,6 +125,7 @@ bool MusicSet::FillSetDetails(IniFile *ini, const char *path, const char *full_f
|
|
|
|
this->num_available = 0;
|
|
|
|
this->num_available = 0;
|
|
|
|
IniGroup *names = ini->GetGroup("names");
|
|
|
|
IniGroup *names = ini->GetGroup("names");
|
|
|
|
IniGroup *catindex = ini->GetGroup("catindex");
|
|
|
|
IniGroup *catindex = ini->GetGroup("catindex");
|
|
|
|
|
|
|
|
IniGroup *timingtrim = ini->GetGroup("timingtrim");
|
|
|
|
for (uint i = 0, j = 1; i < lengthof(this->songinfo); i++) {
|
|
|
|
for (uint i = 0, j = 1; i < lengthof(this->songinfo); i++) {
|
|
|
|
const char *filename = this->files[i].filename;
|
|
|
|
const char *filename = this->files[i].filename;
|
|
|
|
if (names == NULL || StrEmpty(filename)) {
|
|
|
|
if (names == NULL || StrEmpty(filename)) {
|
|
|
@ -150,15 +151,16 @@ bool MusicSet::FillSetDetails(IniFile *ini, const char *path, const char *full_f
|
|
|
|
this->songinfo[i].filetype = MTT_STANDARDMIDI;
|
|
|
|
this->songinfo[i].filetype = MTT_STANDARDMIDI;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const char *trimmed_filename = filename;
|
|
|
|
/* As we possibly add a path to the filename and we compare
|
|
|
|
/* As we possibly add a path to the filename and we compare
|
|
|
|
* on the filename with the path as in the .obm, we need to
|
|
|
|
* on the filename with the path as in the .obm, we need to
|
|
|
|
* keep stripping path elements until we find a match. */
|
|
|
|
* keep stripping path elements until we find a match. */
|
|
|
|
for (const char *p = filename; p != NULL; p = strchr(p, PATHSEPCHAR)) {
|
|
|
|
for (; trimmed_filename != NULL; trimmed_filename = strchr(trimmed_filename, PATHSEPCHAR)) {
|
|
|
|
/* Remove possible double path separator characters from
|
|
|
|
/* Remove possible double path separator characters from
|
|
|
|
* the beginning, so we don't start reading e.g. root. */
|
|
|
|
* the beginning, so we don't start reading e.g. root. */
|
|
|
|
while (*p == PATHSEPCHAR) p++;
|
|
|
|
while (*trimmed_filename == PATHSEPCHAR) trimmed_filename++;
|
|
|
|
|
|
|
|
|
|
|
|
item = names->GetItem(p, false);
|
|
|
|
item = names->GetItem(trimmed_filename, false);
|
|
|
|
if (item != NULL && !StrEmpty(item->value)) break;
|
|
|
|
if (item != NULL && !StrEmpty(item->value)) break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -173,6 +175,15 @@ bool MusicSet::FillSetDetails(IniFile *ini, const char *path, const char *full_f
|
|
|
|
this->num_available++;
|
|
|
|
this->num_available++;
|
|
|
|
|
|
|
|
|
|
|
|
this->songinfo[i].tracknr = j++;
|
|
|
|
this->songinfo[i].tracknr = j++;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
item = timingtrim->GetItem(trimmed_filename, false);
|
|
|
|
|
|
|
|
if (item != NULL && !StrEmpty(item->value)) {
|
|
|
|
|
|
|
|
const char *endpos = strchr(item->value, ':');
|
|
|
|
|
|
|
|
if (endpos != NULL) {
|
|
|
|
|
|
|
|
this->songinfo[i].override_start = atoi(item->value);
|
|
|
|
|
|
|
|
this->songinfo[i].override_end = atoi(endpos + 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
return ret;
|
|
|
|