add nxmp and switch wave file assoc, remove old sphaira file assoc, replace ext/db assoc parse code with views::split

This commit is contained in:
ITotalJustice
2025-05-26 17:42:32 +01:00
parent a9931a975d
commit 7c45d60e60
4 changed files with 17 additions and 21 deletions

View File

@@ -0,0 +1,2 @@
[config]
supported_extensions=mp3|ogg|flac|wav|aac|ac3|aif|asf|mp4|mkv|m3u|m3u8|hls|vob|avi|dv|flv|m2ts|m2v|m4a|mov|mpeg|mpg|mts|swf|ts|vob|wma|wmv|png|jpg|jpeg|bmp|gif

View File

@@ -0,0 +1,2 @@
[config]
supported_extensions=mp3|ogg|flac|wav|aac|ac3|aif|asf|mp4|mkv|m3u|m3u8|hls|vob|avi|dv|flv|m2ts|m2v|m4a|mov|mpeg|mpg|mts|swf|ts|vob|wma|wmv|png|jpg|jpeg|bmp|gif

View File

@@ -1,2 +0,0 @@
[config]
ext=nro

View File

@@ -2011,30 +2011,24 @@ void Menu::LoadAssocEntriesPath(const fs::FsPath& path) {
ini_browse([](const mTCHAR *Section, const mTCHAR *Key, const mTCHAR *Value, void *UserData) {
auto assoc = static_cast<FileAssocEntry*>(UserData);
if (!strcmp(Key, "path")) {
if (!std::strcmp(Key, "path")) {
assoc->path = Value;
} else if (!strcmp(Key, "supported_extensions")) {
for (int i = 0; Value[i]; i++) {
for (int j = i; ; j++) {
if (Value[j] == '|' || Value[j] == '\0') {
assoc->ext.emplace_back(Value + i, j - i);
i += j - i;
break;
} else if (!std::strcmp(Key, "supported_extensions")) {
for (const auto& p : std::views::split(std::string_view{Value}, '|')) {
if (p.empty()) {
continue;
}
assoc->ext.emplace_back(p.data(), p.size());
}
} else if (!std::strcmp(Key, "database")) {
for (const auto& p : std::views::split(std::string_view{Value}, '|')) {
if (p.empty()) {
continue;
}
} else if (!strcmp(Key, "database")) {
for (int i = 0; Value[i]; i++) {
for (int j = i; ; j++) {
if (Value[j] == '|' || Value[j] == '\0') {
assoc->database.emplace_back(Value + i, j - i);
i += j - i;
break;
assoc->database.emplace_back(p.data(), p.size());
}
}
}
} else if (!strcmp(Key, "use_base_name")) {
if (!strcmp(Value, "true") || !strcmp(Value, "1")) {
} else if (!std::strcmp(Key, "use_base_name")) {
if (!std::strcmp(Value, "true") || !std::strcmp(Value, "1")) {
assoc->use_base_name = true;
}
}