summaryrefslogtreecommitdiff
path: root/gtk2_ardour/route_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/route_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/route_time_axis.cc')
-rw-r--r--gtk2_ardour/route_time_axis.cc47
1 files changed, 26 insertions, 21 deletions
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index 826afc511c..e0b75b3d0a 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -857,7 +857,7 @@ RouteTimeAxisView::set_height (uint32_t h)
name_label.set_text (_route->name());
}
- if (height_changed) {
+ if (height_changed && !no_redraw) {
/* only emit the signal if the height really changed */
_route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
}
@@ -1623,15 +1623,17 @@ void
RouteTimeAxisView::toggle_automation_track (const Evoral::Parameter& param)
{
RouteAutomationNode* node = automation_track(param);
-
+
if (!node) {
- /* add it */
+ /* it doesn't exist yet, so we don't care about the button state: just add it */
create_automation_child (param, true);
} else {
-
- if (node->track->set_visibility (node->menu_item->get_active())) {
+ bool yn = node->menu_item->get_active();
+ if (node->track->set_visibility (node->menu_item->get_active()) && yn) {
- /* we changed the visibility, now trigger a redisplay */
+ /* we made it visible, now trigger a redisplay. if it was hidden, then automation_track_hidden()
+ will have done that for us.
+ */
if (!no_redraw) {
_route->gui_changed (X_("track_height"), (void *) 0); /* EMIT_SIGNAL */
@@ -1644,20 +1646,23 @@ void
RouteTimeAxisView::automation_track_hidden (Evoral::Parameter param)
{
RouteAutomationNode* ran = automation_track(param);
+
if (!ran) {
return;
}
// if Evoral::Parameter::operator< doesn't obey strict weak ordering, we may crash here....
- _show_automation.erase(param);
+ _show_automation.erase (param);
ran->track->get_state_node()->add_property (X_("shown"), X_("no"));
if (ran->menu_item && !_hidden) {
+ ignore_toggle = true;
ran->menu_item->set_active (false);
+ ignore_toggle = false;
}
- if (_route) {
- _route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
+ if (_route && !no_redraw) {
+ _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
}
}
@@ -1694,7 +1699,7 @@ RouteTimeAxisView::show_all_automation ()
/* Redraw */
- _route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
+ _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
}
void
@@ -1727,7 +1732,7 @@ RouteTimeAxisView::show_existing_automation ()
no_redraw = false;
- _route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
+ _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
}
void
@@ -1755,7 +1760,7 @@ RouteTimeAxisView::hide_all_automation ()
_show_automation.clear();
no_redraw = false;
- _route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
+ _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
}
@@ -1897,7 +1902,9 @@ RouteTimeAxisView::processor_automation_track_hidden (RouteTimeAxisView::Process
i->mark_automation_visible (pan->what, false);
- _route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
+ if (!no_redraw) {
+ _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
+ }
}
void
@@ -1953,7 +1960,9 @@ RouteTimeAxisView::add_automation_child (Evoral::Parameter param, boost::shared_
_show_automation.insert (param);
}
- _route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
+ if (!no_redraw) {
+ _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
+ }
if (!EventTypeMap::instance().is_midi_parameter(param)) {
/* MIDI-related parameters are always in the menu, there's no
@@ -1966,7 +1975,6 @@ RouteTimeAxisView::add_automation_child (Evoral::Parameter param, boost::shared_
}
}
-
void
RouteTimeAxisView::add_processor_to_subplugin_menu (boost::weak_ptr<Processor> p)
{
@@ -2086,10 +2094,7 @@ RouteTimeAxisView::processor_menu_item_toggled (RouteTimeAxisView::ProcessorAuto
}
if (redraw && !no_redraw) {
-
- /* now trigger a redisplay */
-
- _route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
+ _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
}
}
@@ -2133,8 +2138,8 @@ RouteTimeAxisView::processors_changed (RouteProcessorChange c)
i = tmp;
}
- if (deleted_processor_automation) {
- _route->gui_changed ("visible_tracks", this);
+ if (deleted_processor_automation && !no_redraw) {
+ _route->gui_changed ("track_height", this);
}
}