diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-06-11 15:35:34 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-06-11 15:35:34 +0000 |
commit | 106024330230fca331e2f611fec42ec1f4f43e5a (patch) | |
tree | 56342e0e544be5223d2fa360caaec80ac0fe6fa4 /gtk2_ardour/audio_time_axis.cc | |
parent | 7468fdb9ca9892cec9b298690bf0edf3655d6453 (diff) |
major, substantive reworking of how we store GUI information (visibility, height) for automation data. old design stored (insufficient) identifying information plus actual data in a GUI-only XML node; new scheme adds GUI data via extra_xml node to each AutomationControl object. reworked public/private methods for showing/hiding TimeAxisView objects; changed labelling of automation tracks to just show the name of the controlled parameter - more info can be viewed in the tooltip for the track headers. NOTE: Session file format ALTERED. No data loss but track visibility may be different than previous ardour3 versions
git-svn-id: svn://localhost/ardour2/branches/3.0@9703 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/audio_time_axis.cc')
-rw-r--r-- | gtk2_ardour/audio_time_axis.cc | 64 |
1 files changed, 25 insertions, 39 deletions
diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc index 763c9a5575..4cf127042d 100644 --- a/gtk2_ardour/audio_time_axis.cc +++ b/gtk2_ardour/audio_time_axis.cc @@ -190,6 +190,29 @@ AudioTimeAxisView::append_extra_display_menu_items () void AudioTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool show) { + if (param.type() == NullAutomation) { + cerr << "WARNING: Attempt to create NullAutomation child, ignoring" << endl; + return; + } + + AutomationTracks::iterator existing = _automation_tracks.find (param); + + if (existing != _automation_tracks.end()) { + + /* automation track created because we had existing data for + * the processor, but visibility may need to be controlled + * since it will have been set visible by default. + */ + + existing->second->set_visibility (show); + + if (!no_redraw) { + _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */ + } + + return; + } + if (param.type() == GainAutomation) { create_gain_automation_child (param, show); @@ -264,16 +287,7 @@ AudioTimeAxisView::update_gain_track_visibility () bool const showit = gain_automation_item->get_active(); if (showit != gain_track->marked_for_display()) { - if (showit) { - gain_track->set_marked_for_display (true); - gain_track->canvas_display()->show(); - gain_track->canvas_background()->show(); - gain_track->get_state_node()->add_property ("shown", X_("yes")); - } else { - gain_track->set_marked_for_display (false); - gain_track->hide (); - gain_track->get_state_node()->add_property ("shown", X_("no")); - } + gain_track->set_visibility (showit); /* now trigger a redisplay */ @@ -291,17 +305,7 @@ AudioTimeAxisView::update_pan_track_visibility () for (list<boost::shared_ptr<AutomationTimeAxisView> >::iterator i = pan_tracks.begin(); i != pan_tracks.end(); ++i) { if (showit != (*i)->marked_for_display()) { - if (showit) { - (*i)->set_marked_for_display (true); - (*i)->canvas_display()->show(); - (*i)->canvas_background()->show(); - (*i)->get_state_node()->add_property ("shown", X_("yes")); - } else { - (*i)->set_marked_for_display (false); - (*i)->hide (); - (*i)->get_state_node()->add_property ("shown", X_("no")); - } - + (*i)->set_visibility (showit); /* now trigger a redisplay */ if (!no_redraw) { _route->gui_changed (X_("visible_tracks"), (void *) 0); /* EMIT_SIGNAL */ @@ -473,24 +477,6 @@ AudioTimeAxisView::build_automation_action_menu (bool for_selection) } void -AudioTimeAxisView::add_processor_to_subplugin_menu (boost::weak_ptr<Processor> wp) -{ - /* we use this override to veto the Amp processor from the plugin menu, - as its automation lane can be accessed using the special "Fader" menu - option - */ - - boost::shared_ptr<Processor> p = wp.lock (); - if (!p) { - return; - } - - if (boost::dynamic_pointer_cast<Amp> (p) == 0) { - RouteTimeAxisView::add_processor_to_subplugin_menu (wp); - } -} - -void AudioTimeAxisView::enter_internal_edit_mode () { if (audio_view()) { |