-// MIDIMapper is a class that listens for incoming MIDI messages from
-// mixer controllers (ie., it is not meant to be used with regular
-// instruments), interprets them according to a device-specific, user-defined
+// MIDIMapper is a class that gets incoming MIDI messages from mixer
+// controllers (ie., it is not meant to be used with regular instruments)
+// via MIDIDevice, interprets them according to a device-specific, user-defined
// mapping, and calls back into a receiver (typically the MainWindow).
// This way, it is possible to control audio functionality using physical
// pots and faders instead of the mouse.
// mapping, and calls back into a receiver (typically the MainWindow).
// This way, it is possible to control audio functionality using physical
// pots and faders instead of the mouse.
+ // Non-audio events.
+ virtual void switch_video_channel(int channel_number) = 0;
+ virtual void apply_transition(int transition_number) = 0;
+ virtual void prev_audio_view() = 0;
+ virtual void next_audio_view() = 0;
+ virtual void begin_new_segment() = 0;
+ virtual void exit() = 0;
+
// Signals to highlight controls to mark them to the user
// as MIDI-controllable (or not).
virtual void clear_all_highlights() = 0;
// Signals to highlight controls to mark them to the user
// as MIDI-controllable (or not).
virtual void clear_all_highlights() = 0;
void match_controller(int controller, int field_number, int bank_field_number, float value, std::function<void(unsigned, float)> func);
void match_button(int note, int field_number, int bank_field_number, std::function<void(unsigned)> func);
bool has_active_controller(unsigned bus_idx, int field_number, int bank_field_number); // Also works for buttons.
void match_controller(int controller, int field_number, int bank_field_number, float value, std::function<void(unsigned, float)> func);
void match_button(int note, int field_number, int bank_field_number, std::function<void(unsigned)> func);
bool has_active_controller(unsigned bus_idx, int field_number, int bank_field_number); // Also works for buttons.
- void activate_lights(unsigned bus_idx, int field_number, std::set<unsigned> *active_lights);
- void activate_lights_all_buses(int field_number, std::set<unsigned> *active_lights);
+ void activate_lights_all_buses(int field_number, std::map<MIDIDevice::LightKey, uint8_t> *active_lights);
- std::thread midi_thread;
- std::map<unsigned, bool> current_light_status; // Keyed by note number. Under <mu>.
- snd_seq_t *alsa_seq{nullptr}; // Under <mu>.
- int alsa_queue_id{-1}; // Under <mu>.
+ MIDIDevice midi_device;