summaryrefslogtreecommitdiff
path: root/gtk2_ardour/audio_time_axis.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-03-07 13:04:36 +0000
committerCarl Hetherington <carl@carlh.net>2011-03-07 13:04:36 +0000
commit92a5e4da48b85017647fb2c55d2d76fff47243e1 (patch)
tree0062d9d85e0d50e7c1adde227482253069cddd20 /gtk2_ardour/audio_time_axis.cc
parent965a9740835a77cc2bf9e6cea237e56ae41150d8 (diff)
Make stuff in the automation menu apply to the track selection.
git-svn-id: svn://localhost/ardour2/branches/3.0@9088 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/audio_time_axis.cc')
-rw-r--r--gtk2_ardour/audio_time_axis.cc67
1 files changed, 40 insertions, 27 deletions
diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc
index 5cfe3500db..79751145bf 100644
--- a/gtk2_ardour/audio_time_axis.cc
+++ b/gtk2_ardour/audio_time_axis.cc
@@ -311,38 +311,51 @@ AudioTimeAxisView::update_pan_track_visibility ()
}
void
-AudioTimeAxisView::show_all_automation ()
+AudioTimeAxisView::show_all_automation (bool apply_to_selection)
{
- no_redraw = true;
-
- RouteTimeAxisView::show_all_automation ();
-
- no_redraw = false;
-
- _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
+ if (apply_to_selection) {
+ _editor.get_selection().tracks.foreach_audio_time_axis (boost::bind (&AudioTimeAxisView::show_all_automation, _1, false));
+ } else {
+
+ no_redraw = true;
+
+ RouteTimeAxisView::show_all_automation ();
+
+ no_redraw = false;
+
+ _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
+ }
}
void
-AudioTimeAxisView::show_existing_automation ()
+AudioTimeAxisView::show_existing_automation (bool apply_to_selection)
{
- no_redraw = true;
-
- RouteTimeAxisView::show_existing_automation ();
-
- no_redraw = false;
-
- _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
+ if (apply_to_selection) {
+ _editor.get_selection().tracks.foreach_audio_time_axis (boost::bind (&AudioTimeAxisView::show_existing_automation, _1, false));
+ } else {
+ no_redraw = true;
+
+ RouteTimeAxisView::show_existing_automation ();
+
+ no_redraw = false;
+
+ _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
+ }
}
void
-AudioTimeAxisView::hide_all_automation ()
+AudioTimeAxisView::hide_all_automation (bool apply_to_selection)
{
- no_redraw = true;
-
- RouteTimeAxisView::hide_all_automation();
-
- no_redraw = false;
- _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
+ if (apply_to_selection) {
+ _editor.get_selection().tracks.foreach_audio_time_axis (boost::bind (&AudioTimeAxisView::hide_all_automation, _1, false));
+ } else {
+ no_redraw = true;
+
+ RouteTimeAxisView::hide_all_automation();
+
+ no_redraw = false;
+ _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
+ }
}
void
@@ -436,23 +449,23 @@ AudioTimeAxisView::update_control_names ()
}
void
-AudioTimeAxisView::build_automation_action_menu ()
+AudioTimeAxisView::build_automation_action_menu (bool for_selection)
{
using namespace Menu_Helpers;
- RouteTimeAxisView::build_automation_action_menu ();
+ RouteTimeAxisView::build_automation_action_menu (for_selection);
MenuList& automation_items = automation_action_menu->items ();
automation_items.push_back (CheckMenuElem (_("Fader"), sigc::mem_fun (*this, &AudioTimeAxisView::update_gain_track_visibility)));
gain_automation_item = dynamic_cast<CheckMenuItem*> (&automation_items.back ());
- gain_automation_item->set_active (gain_track->marked_for_display ());
+ gain_automation_item->set_active (gain_track->marked_for_display () && (!for_selection || _editor.get_selection().tracks.size() == 1));
_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<CheckMenuItem*> (&automation_items.back ());
- pan_automation_item->set_active (pan_tracks.front()->marked_for_display ());
+ pan_automation_item->set_active (pan_tracks.front()->marked_for_display () && (!for_selection || _editor.get_selection().tracks.size() == 1));
set<Evoral::Parameter> const & params = _route->pannable()->what_can_be_automated ();
for (set<Evoral::Parameter>::iterator p = params.begin(); p != params.end(); ++p) {