From b73b2ceecd21cfc64ee7aa21fc731e41264217dd Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 15 Jan 2014 11:23:38 +0100 Subject: update pan automation-track display --- gtk2_ardour/audio_time_axis.cc | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'gtk2_ardour/audio_time_axis.cc') diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc index bf980690aa..675136b860 100644 --- a/gtk2_ardour/audio_time_axis.cc +++ b/gtk2_ardour/audio_time_axis.cc @@ -216,6 +216,16 @@ AudioTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool void AudioTimeAxisView::ensure_pan_views (bool show) { + bool changed = false; + for (list >::iterator i = pan_tracks.begin(); i != pan_tracks.end(); ++i) { + changed = true; + (*i)->set_marked_for_display (false); + } + if (changed) { + _route->gui_changed (X_("visible_tracks"), (void *) 0); /* EMIT_SIGNAL */ + } + pan_tracks.clear(); + if (!_route->panner()) { return; } @@ -252,6 +262,8 @@ AudioTimeAxisView::ensure_pan_views (bool show) pan_tracks.push_back (t); add_automation_child (*p, t, show); + } else { + pan_tracks.push_back (automation_child (pan_control->parameter ())); } } } @@ -393,14 +405,16 @@ AudioTimeAxisView::build_automation_action_menu (bool for_selection) _main_automation_menu_map[Evoral::Parameter(GainAutomation)] = gain_automation_item; - automation_items.push_back (CheckMenuElem (_("Pan"), sigc::mem_fun (*this, &AudioTimeAxisView::update_pan_track_visibility))); - pan_automation_item = dynamic_cast (&automation_items.back ()); - pan_automation_item->set_active ((!for_selection || _editor.get_selection().tracks.size() == 1) && - (!pan_tracks.empty() && string_is_affirmative (pan_tracks.front()->gui_property ("visible")))); + if (!pan_tracks.empty()) { + automation_items.push_back (CheckMenuElem (_("Pan"), sigc::mem_fun (*this, &AudioTimeAxisView::update_pan_track_visibility))); + pan_automation_item = dynamic_cast (&automation_items.back ()); + pan_automation_item->set_active ((!for_selection || _editor.get_selection().tracks.size() == 1) && + (!pan_tracks.empty() && string_is_affirmative (pan_tracks.front()->gui_property ("visible")))); - set const & params = _route->pannable()->what_can_be_automated (); - for (set::iterator p = params.begin(); p != params.end(); ++p) { - _main_automation_menu_map[*p] = pan_automation_item; + set const & params = _route->pannable()->what_can_be_automated (); + for (set::iterator p = params.begin(); p != params.end(); ++p) { + _main_automation_menu_map[*p] = pan_automation_item; + } } } -- cgit v1.2.3