diff options
author | Roland Reichwein <mail@reichwein.it> | 2025-01-17 21:02:51 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2025-01-17 21:02:51 +0100 |
commit | bb56941f6b61529dd770475296d093727c68fdc6 (patch) | |
tree | 065c61ef71a00d0759afcdc0316150db278a7efd /MIDIPlayer.cpp | |
parent | 22ed919b2fffa933c8a72763fda2b603a92a18cf (diff) |
Automatically use correct files path (executable path or /media/usb)
Diffstat (limited to 'MIDIPlayer.cpp')
-rw-r--r-- | MIDIPlayer.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/MIDIPlayer.cpp b/MIDIPlayer.cpp index 2c0bc6a..8202850 100644 --- a/MIDIPlayer.cpp +++ b/MIDIPlayer.cpp @@ -1,5 +1,7 @@ #include "MIDIPlayer.h" +#include "config.h" + #include <signal.h> #include <fmt/format.h> @@ -16,12 +18,13 @@ namespace fs = std::filesystem; using namespace std::chrono_literals; namespace { - std::unordered_set<std::string> supported_devices{"AudioBox 22 VSL", "CH345"}; + std::unordered_set<std::string> supported_devices{"AudioBox 22 VSL", "CH345", "M2"}; } -MIDIPlayer::MIDIPlayer(const std::filesystem::path& path): +MIDIPlayer::MIDIPlayer(Config& config): + m_config(config), m_child{}, - m_dir{path}, + m_dir{m_config.get_file_path()}, m_file{} { std::vector<std::string> list = get_filelist(); |