* first working version of editing MIDI channels of individual notes, see: http:...
[ardour.git] / gtk2_ardour / midi_channel_selector.h
1 #ifndef __ardour_ui_midi_channel_selector_h__
2 #define __ardour_ui_midi_channel_selector_h__
3
4 #include "gtkmm/table.h"
5 #include "sigc++/trackable.h"
6 #include "gtkmm/togglebutton.h"
7 #include "gtkmm/label.h"
8 #include <set>
9
10 class MidiChannelSelector : public Gtk::Table
11 {
12 public:
13         MidiChannelSelector();
14         virtual ~MidiChannelSelector() = 0;
15         
16 protected:
17         virtual void button_toggled(Gtk::ToggleButton *button, uint8_t button_nr) = 0;
18         Gtk::Label        _button_labels[4][4];
19         Gtk::ToggleButton _buttons[4][4];
20 };
21
22 class SingleMidiChannelSelector : public MidiChannelSelector
23 {
24 public:
25         SingleMidiChannelSelector(uint8_t active_channel = 0);
26         
27         const uint8_t get_active_channel() const { return _active_channel; }
28         
29         sigc::signal<void, uint8_t> channel_selected;
30         
31 protected:
32         virtual void button_toggled(Gtk::ToggleButton *button, uint8_t button_nr);
33
34         Gtk::ToggleButton *_active_button;
35         uint8_t _active_channel;
36 };
37
38 class MidiMultipleChannelSelector : public MidiChannelSelector
39 {
40 public:
41         const std::set<uint8_t>& get_selected_channels() const { return _selected_channels; }
42
43 protected:
44         virtual void button_toggled(Gtk::ToggleButton *button, uint8_t button_nr);
45         
46         std::set<uint8_t> _selected_channels;
47 };
48
49 #endif /*__ardour_ui_midi_channel_selector_h__*/