diff options
author | Roland Reichwein <mail@reichwein.it> | 2025-01-05 22:32:01 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2025-01-05 22:32:01 +0100 |
commit | 03b28f03c38b35bcc1bbd1ec28a7be17affd3d28 (patch) | |
tree | ec70d62bb681b34b7afe50d292fd138e8bc0ff49 /config.h | |
parent | 88ab4cec9636a3e7b43906e5e7d0f67ac77eb2d6 (diff) |
Automatically access click sound file
Diffstat (limited to 'config.h')
-rw-r--r-- | config.h | 25 |
1 files changed, 18 insertions, 7 deletions
@@ -3,6 +3,10 @@ #include <boost/signals2.hpp> #include <alsa/asoundlib.h> +#include <filesystem> +#include <string> +#include <vector> + // Defaults static const int CLICK_NOTE = 37; static const int CLICK_CHANNEL = 4; @@ -15,11 +19,12 @@ const int pcm_latency_us = 100000; const int click_latency_frames = 10000; const int default_mode = 0; // 0 = note, 1 = clock, 2 = internal const int default_output = 1; // 0 = off, 1 = on +extern std::filesystem::path click_data_filename; class Config { public: - Config(); + Config(int argc, char** argv); ~Config(); // signals @@ -29,26 +34,32 @@ public: boost::signals2::signal<void(int)> signal_bpm; boost::signals2::signal<void(int)> signal_output; - int get_midi_channel(); + int get_midi_channel() const; void set_midi_channel(int channel); - int get_midi_note(); + int get_midi_note() const; void set_midi_note(int note); - int get_bpm(); + int get_bpm() const; void set_bpm(int bpm); - int get_mode(); + int get_mode() const; void set_mode(int mode); - int get_output(); + int get_output() const; void set_output(int output); void recover(); void persist(); + std::string get_argv(int i) const; + + std::filesystem::path get_click_data_filename() const; + private: - std::string get_config_filename(); + std::string get_config_filename() const; + + std::vector<std::string> m_argv; int m_midi_channel; int m_midi_note; |