13
0

update pan automation-track display

This commit is contained in:
Robin Gareus 2014-01-15 11:23:38 +01:00
parent abb75d4a2e
commit b73b2ceecd

View File

@ -216,6 +216,16 @@ AudioTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool
void void
AudioTimeAxisView::ensure_pan_views (bool show) AudioTimeAxisView::ensure_pan_views (bool show)
{ {
bool changed = false;
for (list<boost::shared_ptr<AutomationTimeAxisView> >::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()) { if (!_route->panner()) {
return; return;
} }
@ -252,6 +262,8 @@ AudioTimeAxisView::ensure_pan_views (bool show)
pan_tracks.push_back (t); pan_tracks.push_back (t);
add_automation_child (*p, t, show); add_automation_child (*p, t, show);
} else {
pan_tracks.push_back (automation_child (pan_control->parameter ()));
} }
} }
} }
@ -393,6 +405,7 @@ AudioTimeAxisView::build_automation_action_menu (bool for_selection)
_main_automation_menu_map[Evoral::Parameter(GainAutomation)] = gain_automation_item; _main_automation_menu_map[Evoral::Parameter(GainAutomation)] = gain_automation_item;
if (!pan_tracks.empty()) {
automation_items.push_back (CheckMenuElem (_("Pan"), sigc::mem_fun (*this, &AudioTimeAxisView::update_pan_track_visibility))); automation_items.push_back (CheckMenuElem (_("Pan"), sigc::mem_fun (*this, &AudioTimeAxisView::update_pan_track_visibility)));
pan_automation_item = dynamic_cast<CheckMenuItem*> (&automation_items.back ()); pan_automation_item = dynamic_cast<CheckMenuItem*> (&automation_items.back ());
pan_automation_item->set_active ((!for_selection || _editor.get_selection().tracks.size() == 1) && pan_automation_item->set_active ((!for_selection || _editor.get_selection().tracks.size() == 1) &&
@ -402,6 +415,7 @@ AudioTimeAxisView::build_automation_action_menu (bool for_selection)
for (set<Evoral::Parameter>::iterator p = params.begin(); p != params.end(); ++p) { for (set<Evoral::Parameter>::iterator p = params.begin(); p != params.end(); ++p) {
_main_automation_menu_map[*p] = pan_automation_item; _main_automation_menu_map[*p] = pan_automation_item;
} }
}
} }
void void