summaryrefslogtreecommitdiff
path: root/gtk2_ardour/midi_time_axis.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-01-10 18:11:02 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-01-10 18:11:02 +0000
commitdbff8105ab7fd67d9e458f7e87620b9151fa1ba8 (patch)
tree24182cc6949b3adb169b1bbfedf473004267cc0a /gtk2_ardour/midi_time_axis.cc
parent935eba7979e05a4ec811ad082b3298ac87c919d2 (diff)
mo' better fixes for managing MIDI CC/automation lanes
git-svn-id: svn://localhost/ardour2/branches/3.0@6473 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/midi_time_axis.cc')
-rw-r--r--gtk2_ardour/midi_time_axis.cc38
1 files changed, 38 insertions, 0 deletions
diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc
index 0c8997059c..d1a60ce04a 100644
--- a/gtk2_ardour/midi_time_axis.cc
+++ b/gtk2_ardour/midi_time_axis.cc
@@ -1060,7 +1060,45 @@ MidiTimeAxisView::toggle_note_selection_region_view (RegionView* rv, uint8_t not
void
MidiTimeAxisView::set_channel_mode (ChannelMode, uint16_t)
{
+ /* hide all automation tracks that use the wrong channel(s) and show all those that use
+ the right ones.
+ */
+
+ uint16_t selected_channels = _channel_selector.get_selected_channels();
+ bool changed = false;
+
+ no_redraw = true;
+
+ for (uint32_t ctl = 0; ctl < 127; ++ctl) {
+
+ for (uint32_t chn = 0; chn < 16; ++chn) {
+ Evoral::Parameter fully_qualified_param (MidiCCAutomation, chn, ctl);
+ RouteAutomationNode* node = automation_track (fully_qualified_param);
+
+ if (!node) {
+ continue;
+ }
+
+ if ((selected_channels & (0x0001 << chn)) == 0) {
+ /* channel not in use. hiding it will trigger RouteTimeAxisView::automation_track_hidden()
+ which will cause a redraw. We don't want one per channel, so block that with no_redraw.
+ */
+ changed = node->track->set_visibility (false) || changed;
+ } else {
+ changed = node->track->set_visibility (true) || changed;
+ }
+ }
+ }
+
+ no_redraw = false;
+
+ /* TODO: Bender, PgmChange, Pressure */
+
/* invalidate the controller menu, so that we rebuilt it next time */
delete controller_menu;
controller_menu = 0;
+
+ if (changed) {
+ _route->gui_changed ("track_height", this);
+ }
}