feat(files+gb): file browser launches .gb via GameBoy, preserve mDNS
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include <Tactility/app/files/SupportedFiles.h>
|
||||
#include <Tactility/Bundle.h>
|
||||
#include <Tactility/app/files/View.h>
|
||||
|
||||
#include <Tactility/Platform.h>
|
||||
@@ -228,9 +229,26 @@ void View::viewFile(const std::string& path, const std::string& filename) {
|
||||
if (kernel::getPlatform() == kernel::PlatformEsp) {
|
||||
notes::start(processed_filepath);
|
||||
} else {
|
||||
// Remove forward slash, because we need a relative path
|
||||
notes::start(processed_filepath.substr(1));
|
||||
}
|
||||
} else if (isSupportedAudioFile(filename)) {
|
||||
#ifdef ESP_PLATFORM
|
||||
auto bundle = std::make_shared<Bundle>();
|
||||
bundle->putString("file", processed_filepath);
|
||||
auto loader = service::loader::findLoaderService();
|
||||
if (loader) {
|
||||
loader->start("one.tactility.mp3player", bundle);
|
||||
}
|
||||
#endif
|
||||
} else if (isSupportedGameBoyFile(filename)) {
|
||||
#ifdef ESP_PLATFORM
|
||||
auto bundle = std::make_shared<Bundle>();
|
||||
bundle->putString("file", processed_filepath);
|
||||
auto loader = service::loader::findLoaderService();
|
||||
if (loader) {
|
||||
loader->start("one.tactility.gameboy", bundle);
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
LOG_W(TAG, "Opening files of this type is not supported");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user