1 #ifndef __ardour_ui_midi_channel_selector_h__
2 #define __ardour_ui_midi_channel_selector_h__
4 #include "boost/shared_ptr.hpp"
5 #include "gtkmm/table.h"
6 #include "sigc++/trackable.h"
7 #include "gtkmm/button.h"
8 #include "gtkmm/togglebutton.h"
9 #include "gtkmm/label.h"
12 class MidiChannelSelector : public Gtk::Table
15 MidiChannelSelector(int no_rows = 4, int no_columns = 4, int start_row = 0, int start_column = 0);
16 virtual ~MidiChannelSelector() = 0;
19 virtual void button_toggled(Gtk::ToggleButton *button, uint8_t button_nr) = 0;
20 Gtk::Label _button_labels[4][4];
21 Gtk::ToggleButton _buttons[4][4];
24 class SingleMidiChannelSelector : public MidiChannelSelector
27 SingleMidiChannelSelector(uint8_t active_channel = 0);
29 const uint8_t get_active_channel() const { return _active_channel; }
31 sigc::signal<void, uint8_t> channel_selected;
34 virtual void button_toggled(Gtk::ToggleButton *button, uint8_t button_nr);
36 Gtk::ToggleButton *_active_button;
37 uint8_t _active_channel;
40 class MidiMultipleChannelSelector : public MidiChannelSelector
43 MidiMultipleChannelSelector(uint16_t initial_selection = 1);
45 const uint16_t get_selected_channels() const { return _selected_channels; }
47 sigc::signal<void, uint16_t> selection_changed;
50 virtual void button_toggled(Gtk::ToggleButton *button, uint8_t button_nr);
52 void select_all(bool on);
53 void invert_selection(void);
55 Gtk::Button _select_all;
56 Gtk::Button _select_none;
57 Gtk::Button _invert_selection;
58 Gtk::ToggleButton _force_channel;
59 uint16_t _selected_channels;
62 #endif /*__ardour_ui_midi_channel_selector_h__*/