summaryrefslogtreecommitdiff
path: root/gtk2_ardour/midi_channel_selector.cc
diff options
context:
space:
mode:
authorHans Baier <hansfbaier@googlemail.com>2008-04-21 15:10:13 +0000
committerHans Baier <hansfbaier@googlemail.com>2008-04-21 15:10:13 +0000
commitc72bf18bf472e665a51a8383b00eb21b40805d39 (patch)
tree78b30ca967d0f7bd9b1e0de79658da2e221de7ba /gtk2_ardour/midi_channel_selector.cc
parent9c4cc26d775549e2815b184aed4c4948a9f69b53 (diff)
* persisting/restoring track channel settings works now
git-svn-id: svn://localhost/ardour2/branches/3.0@3276 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/midi_channel_selector.cc')
-rw-r--r--gtk2_ardour/midi_channel_selector.cc20
1 files changed, 19 insertions, 1 deletions
diff --git a/gtk2_ardour/midi_channel_selector.cc b/gtk2_ardour/midi_channel_selector.cc
index b810268633..1b0e9ecfbb 100644
--- a/gtk2_ardour/midi_channel_selector.cc
+++ b/gtk2_ardour/midi_channel_selector.cc
@@ -75,7 +75,7 @@ SingleMidiChannelSelector::button_toggled(ToggleButton *button, uint8_t channel)
--_recursion_counter;
}
-MidiMultipleChannelSelector::MidiMultipleChannelSelector(uint16_t initial_selection)
+MidiMultipleChannelSelector::MidiMultipleChannelSelector(uint16_t initial_selection, int8_t force_channel)
: MidiChannelSelector(4, 6, 0, 0), _mode(FILTERING_MULTIPLE_CHANNELS)
{
_select_all.add(*manage(new Label(_("All"))));
@@ -129,6 +129,24 @@ MidiMultipleChannelSelector::get_force_channel() const
return -1;
}
+void
+MidiMultipleChannelSelector::set_force_channel(int8_t channel)
+{
+ if(channel < 0) {
+ // if forcing is already activated, deactivate
+ if(_mode == FORCING_SINGLE_CHANNEL) {
+ _force_channel.toggled();
+ }
+ // if not, nothing to do
+ } else {
+ // otherwise simulate activating force channels by pressing the
+ // two buttons the user would press
+ _force_channel.toggled();
+ _buttons[channel / 4][channel % 4].toggled();
+ }
+}
+
+
const uint16_t
MidiMultipleChannelSelector::get_selected_channels() const
{