diff --git a/Devices/es3c28p/device.properties b/Devices/es3c28p/device.properties index cb3d83f7..45d5721b 100644 --- a/Devices/es3c28p/device.properties +++ b/Devices/es3c28p/device.properties @@ -23,3 +23,4 @@ storage.userDataLocation=SD # Launcher clock and full-screen wallpaper sdkconfig.CONFIG_LV_FONT_MONTSERRAT_48=y sdkconfig.CONFIG_LV_CACHE_DEF_SIZE=1048576 +sdkconfig.CONFIG_LV_IMAGE_HEADER_CACHE_DEF_CNT=16 diff --git a/Tactility/Private/Tactility/app/files/SupportedFiles.h b/Tactility/Private/Tactility/app/files/SupportedFiles.h index b62dde77..4f46eb9f 100644 --- a/Tactility/Private/Tactility/app/files/SupportedFiles.h +++ b/Tactility/Private/Tactility/app/files/SupportedFiles.h @@ -7,5 +7,6 @@ namespace tt::app::files { bool isSupportedAppFile(const std::string& filename); bool isSupportedImageFile(const std::string& filename); bool isSupportedTextFile(const std::string& filename); +bool isSupportedAudioFile(const std::string& filename); } // namespace diff --git a/Tactility/Source/app/files/SupportedFiles.cpp b/Tactility/Source/app/files/SupportedFiles.cpp index 9d914e24..1a0a3ec5 100644 --- a/Tactility/Source/app/files/SupportedFiles.cpp +++ b/Tactility/Source/app/files/SupportedFiles.cpp @@ -26,4 +26,12 @@ bool isSupportedTextFile(const std::string& filename) { filename_lower.ends_with(".properties"); } +bool isSupportedAudioFile(const std::string& filename) { + std::string filename_lower = string::lowercase(filename); + return filename_lower.ends_with(".mp3") || + filename_lower.ends_with(".wav") || + filename_lower.ends_with(".ogg") || + filename_lower.ends_with(".flac"); +} + } // namespace tt::app::filebrowser diff --git a/Tactility/Source/app/files/View.cpp b/Tactility/Source/app/files/View.cpp index dd4c30c7..7d142583 100644 --- a/Tactility/Source/app/files/View.cpp +++ b/Tactility/Source/app/files/View.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include @@ -204,6 +205,15 @@ void View::viewFile(const std::string& path, const std::string& filename) { // Remove forward slash, because we need a relative path notes::start(file_path.substr(1)); } + } else if (isSupportedAudioFile(filename)) { + // External MP3 player reads argv as key=value pairs (see + // CurrentAppCompat tt_app_start_with_bundle): file= + std::string file_arg = "file=" + file_path; + const char* argv[] = { file_arg.c_str() }; + uint32_t instance_id = 0; + if (app_start("one.tactility.mp3player", 1, argv, &instance_id) != ERROR_NONE) { + LOG_W(TAG, "Failed to start MP3 player for %s", file_path.c_str()); + } } else if (isExecutablePath(file_path)) { runFile(file_path); } else {