summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-03-28 23:24:41 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2015-03-30 09:19:00 -0500
commit546cd974ec2d90f64dcaae6f347e68c6682117b9 (patch)
tree883e20bf0b6b702bc8d4b37330cd981f32c22228 /gtk2_ardour
parent88146f0e3addca5ec6c434361a57eaff072122bb (diff)
Fix mute of MIDI tracks with channel forcing.
This moves MIDI channel filtering into a reusable class and moves filtering to the source, rather than modifying the buffer afterwards. This is necessary so that the playlist trackers reflect the emitted notes (and thus are able to stop them in situations like mute). As a perk, this is also faster because events are just dropped on read, rather than pushed into a buffer then later removed (which is very slow). Really hammering on mute or solo still seems to produce stuck notes occasionally (perhaps related to multiple-on warnings). I am not yet sure why, but occasional beats always.
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/midi_channel_selector.cc9
-rw-r--r--gtk2_ardour/midi_region_view.cc2
-rw-r--r--gtk2_ardour/midi_time_axis.cc28
3 files changed, 22 insertions, 17 deletions
diff --git a/gtk2_ardour/midi_channel_selector.cc b/gtk2_ardour/midi_channel_selector.cc
index 4884d72328..1895b5c52f 100644
--- a/gtk2_ardour/midi_channel_selector.cc
+++ b/gtk2_ardour/midi_channel_selector.cc
@@ -27,6 +27,7 @@
#include <gtkmm/table.h>
#include "pbd/compose.h"
+#include "pbd/ffs.h"
#include "gtkmm2ext/gtk_ui.h"
#include "gtkmm2ext/gui_thread.h"
@@ -343,10 +344,10 @@ MidiChannelSelectorWindow::MidiChannelSelectorWindow (boost::shared_ptr<MidiTrac
playback_mask_changed ();
capture_mask_changed ();
- track->PlaybackChannelMaskChanged.connect (*this, MISSING_INVALIDATOR, boost::bind (&MidiChannelSelectorWindow::playback_mask_changed, this), gui_context());
- track->PlaybackChannelModeChanged.connect (*this, MISSING_INVALIDATOR, boost::bind (&MidiChannelSelectorWindow::playback_mode_changed, this), gui_context());
- track->CaptureChannelMaskChanged.connect (*this, MISSING_INVALIDATOR, boost::bind (&MidiChannelSelectorWindow::capture_mask_changed, this), gui_context());
- track->CaptureChannelModeChanged.connect (*this, MISSING_INVALIDATOR, boost::bind (&MidiChannelSelectorWindow::capture_mode_changed, this), gui_context());
+ track->playback_filter().ChannelMaskChanged.connect (*this, MISSING_INVALIDATOR, boost::bind (&MidiChannelSelectorWindow::playback_mask_changed, this), gui_context());
+ track->playback_filter().ChannelModeChanged.connect (*this, MISSING_INVALIDATOR, boost::bind (&MidiChannelSelectorWindow::playback_mode_changed, this), gui_context());
+ track->capture_filter().ChannelMaskChanged.connect (*this, MISSING_INVALIDATOR, boost::bind (&MidiChannelSelectorWindow::capture_mask_changed, this), gui_context());
+ track->capture_filter().ChannelModeChanged.connect (*this, MISSING_INVALIDATOR, boost::bind (&MidiChannelSelectorWindow::capture_mode_changed, this), gui_context());
}
MidiChannelSelectorWindow::~MidiChannelSelectorWindow()
diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc
index 7bed675ac3..eed9017d0d 100644
--- a/gtk2_ardour/midi_region_view.cc
+++ b/gtk2_ardour/midi_region_view.cc
@@ -299,7 +299,7 @@ MidiRegionView::init (bool wfd)
group->raise_to_top();
- midi_view()->midi_track()->PlaybackChannelModeChanged.connect (_channel_mode_changed_connection, invalidator (*this),
+ midi_view()->midi_track()->playback_filter().ChannelModeChanged.connect (_channel_mode_changed_connection, invalidator (*this),
boost::bind (&MidiRegionView::midi_channel_mode_changed, this),
gui_context ());
diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc
index bbf0473ded..be475216c1 100644
--- a/gtk2_ardour/midi_time_axis.cc
+++ b/gtk2_ardour/midi_time_axis.cc
@@ -243,18 +243,22 @@ MidiTimeAxisView::set_route (boost::shared_ptr<Route> rt)
_view->RegionViewAdded.connect (
sigc::mem_fun(*this, &MidiTimeAxisView::region_view_added));
- midi_track()->PlaybackChannelModeChanged.connect (*this, invalidator (*this),
- boost::bind (&MidiTimeAxisView::playback_channel_mode_changed, this),
- gui_context());
- midi_track()->PlaybackChannelMaskChanged.connect (*this, invalidator (*this),
- boost::bind (&MidiTimeAxisView::playback_channel_mode_changed, this),
- gui_context());
- midi_track()->CaptureChannelModeChanged.connect (*this, invalidator (*this),
- boost::bind (&MidiTimeAxisView::capture_channel_mode_changed, this),
- gui_context());
- midi_track()->CaptureChannelMaskChanged.connect (*this, invalidator (*this),
- boost::bind (&MidiTimeAxisView::capture_channel_mode_changed, this),
- gui_context());
+ midi_track()->playback_filter().ChannelModeChanged.connect (
+ *this, invalidator (*this),
+ boost::bind (&MidiTimeAxisView::playback_channel_mode_changed, this),
+ gui_context());
+ midi_track()->playback_filter().ChannelMaskChanged.connect (
+ *this, invalidator (*this),
+ boost::bind (&MidiTimeAxisView::playback_channel_mode_changed, this),
+ gui_context());
+ midi_track()->capture_filter().ChannelModeChanged.connect (
+ *this, invalidator (*this),
+ boost::bind (&MidiTimeAxisView::capture_channel_mode_changed, this),
+ gui_context());
+ midi_track()->capture_filter().ChannelMaskChanged.connect (
+ *this, invalidator (*this),
+ boost::bind (&MidiTimeAxisView::capture_channel_mode_changed, this),
+ gui_context());
playback_channel_mode_changed ();
capture_channel_mode_changed ();