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..dcc10094 100644 --- a/Tactility/Source/app/files/SupportedFiles.cpp +++ b/Tactility/Source/app/files/SupportedFiles.cpp @@ -26,4 +26,9 @@ 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"); +} + } // namespace tt::app::filebrowser diff --git a/Tactility/Source/app/files/View.cpp b/Tactility/Source/app/files/View.cpp index 37f87444..f0a1781d 100644 --- a/Tactility/Source/app/files/View.cpp +++ b/Tactility/Source/app/files/View.cpp @@ -10,6 +10,8 @@ #include #include #include +#include +#include #include #include #include @@ -233,6 +235,10 @@ void View::viewFile(const std::string& path, const std::string& filename) { // Remove forward slash, because we need a relative path notes::start(processed_filepath.substr(1)); } + } else if (isSupportedAudioFile(filename)) { + auto parameters = std::make_shared(); + parameters->putString("file", processed_filepath); + app::start("one.tactility.mp3player", parameters); } else { LOGGER.warn("Opening files of this type is not supported"); }