diff options
Diffstat (limited to 'gtk2_ardour/midi_region_view.cc')
-rw-r--r-- | gtk2_ardour/midi_region_view.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 5d972fa85e..ac982a3040 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -116,6 +116,13 @@ MidiRegionView::MidiRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView & _note_group->raise_to_top(); PublicEditor::DropDownKeys.connect (sigc::mem_fun (*this, &MidiRegionView::drop_down_keys)); + + MidiTimeAxisView *time_axis = dynamic_cast<MidiTimeAxisView *>(&tv); + if (time_axis) { + _last_channel_mode = time_axis->channel_selector().get_channel_mode(); + _last_channel_selection = time_axis->channel_selector().get_selected_channels(); + } + Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&MidiRegionView::parameter_changed, this, _1), gui_context()); connect_to_diskstream (); @@ -153,6 +160,12 @@ MidiRegionView::MidiRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView & _note_group->raise_to_top(); PublicEditor::DropDownKeys.connect (sigc::mem_fun (*this, &MidiRegionView::drop_down_keys)); + MidiTimeAxisView *time_axis = dynamic_cast<MidiTimeAxisView *>(&tv); + if (time_axis) { + _last_channel_mode = time_axis->channel_selector().get_channel_mode(); + _last_channel_selection = time_axis->channel_selector().get_selected_channels(); + } + connect_to_diskstream (); SelectionCleared.connect (_selection_cleared_connection, invalidator (*this), boost::bind (&MidiRegionView::selection_cleared, this, _1), gui_context ()); @@ -3247,6 +3260,7 @@ MidiRegionView::midi_channel_mode_changed(ChannelMode mode, uint16_t mask) } _last_channel_selection = mask; + _last_channel_mode = mode; _patch_changes.clear (); display_patch_changes (); @@ -3701,6 +3715,14 @@ MidiRegionView::data_recorded (boost::weak_ptr<MidiSource> w) Evoral::MIDIEvent<MidiBuffer::TimeType> const ev (*i, false); assert (ev.buffer ()); + if(ev.is_channel_event()) { + if (_last_channel_mode == FilterChannels) { + if(((uint16_t(1) << ev.channel()) & _last_channel_selection) == 0) { + continue; + } + } + } + /* ev.time() is in session frames, so (ev.time() - converter.origin_b()) is frames from the start of the source, and so time_beats is in terms of the source. |