feat(files+gb): file browser launches .gb via GameBoy, preserve mDNS

This commit is contained in:
Adolfo Reyna
2026-07-20 12:51:19 -04:00
parent 75178652e2
commit 68766cdbed
3 changed files with 38 additions and 2 deletions
+22 -1
View File
@@ -1,3 +1,24 @@
#include <Tactility/StringUtils.h>
#include <Tactility/TactilityCore.h>
namespace tt::app::files { constexpr auto* TAG = "Files"; bool isSupportedAppFile(const std::string& filename) { return filename.ends_with(".app"); } bool isSupportedImageFile(const std::string& filename) { return string::lowercase(filename).ends_with(".png"); } bool isSupportedTextFile(const std::string& filename) { std::string l=string::lowercase(filename); return l.ends_with(".txt")||l.ends_with(".ini")||l.ends_with(".json")||l.ends_with(".yaml")||l.ends_with(".yml")||l.ends_with(".lua")||l.ends_with(".js")||l.ends_with(".properties"); } bool isSupportedAudioFile(const std::string& filename) { std::string l=string::lowercase(filename); return l.ends_with(".mp3")||l.ends_with(".wav")||l.ends_with(".ogg")||l.ends_with(".flac"); } } // namespace
namespace tt::app::files {
constexpr auto* TAG = "Files";
bool isSupportedAppFile(const std::string& filename) {
return filename.ends_with(".app");
}
bool isSupportedImageFile(const std::string& filename) {
return string::lowercase(filename).ends_with(".png");
}
bool isSupportedTextFile(const std::string& filename) {
std::string l = string::lowercase(filename);
return l.ends_with(".txt") || l.ends_with(".ini") || l.ends_with(".json") || l.ends_with(".yaml") || l.ends_with(".yml") ||
l.ends_with(".lua") || l.ends_with(".js") || l.ends_with(".properties");
}
bool isSupportedAudioFile(const std::string& filename) {
std::string l = string::lowercase(filename);
return l.ends_with(".mp3") || l.ends_with(".wav") || l.ends_with(".ogg") || l.ends_with(".flac");
}
bool isSupportedGameBoyFile(const std::string& filename) {
std::string l = string::lowercase(filename);
return l.ends_with(".gb") || l.ends_with(".gbc") || l.ends_with(".sgb");
}
} // namespace