diff options
-rw-r--r-- | gtk2_ardour/audio_time_axis.cc | 30 | ||||
-rw-r--r-- | gtk2_ardour/audio_time_axis.h | 4 | ||||
-rw-r--r-- | gtk2_ardour/track_selection.h | 9 |
3 files changed, 29 insertions, 14 deletions
diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc index f43d3739cc..35033c3991 100644 --- a/gtk2_ardour/audio_time_axis.cc +++ b/gtk2_ardour/audio_time_axis.cc @@ -181,8 +181,8 @@ AudioTimeAxisView::append_extra_display_menu_items () // crossfade stuff if (!Profile->get_sae() && is_track ()) { - items.push_back (MenuElem (_("Hide All Crossfades"), sigc::mem_fun(*this, &AudioTimeAxisView::hide_all_xfades))); - items.push_back (MenuElem (_("Show All Crossfades"), sigc::mem_fun(*this, &AudioTimeAxisView::show_all_xfades))); + items.push_back (MenuElem (_("Hide All Crossfades"), sigc::bind (sigc::mem_fun(*this, &AudioTimeAxisView::hide_all_xfades), true))); + items.push_back (MenuElem (_("Show All Crossfades"), sigc::bind (sigc::mem_fun(*this, &AudioTimeAxisView::show_all_xfades), true))); items.push_back (SeparatorElem ()); } } @@ -346,22 +346,28 @@ AudioTimeAxisView::hide_all_automation () } void -AudioTimeAxisView::show_all_xfades () +AudioTimeAxisView::show_all_xfades (bool apply_to_selection) { - AudioStreamView* asv = audio_view(); - - if (asv) { - asv->show_all_xfades (); + if (apply_to_selection) { + _editor.get_selection().tracks.foreach_audio_time_axis (boost::bind (&AudioTimeAxisView::show_all_xfades, _1, false)); + } else { + AudioStreamView* asv = audio_view (); + if (asv) { + asv->show_all_xfades (); + } } } void -AudioTimeAxisView::hide_all_xfades () +AudioTimeAxisView::hide_all_xfades (bool apply_to_selection) { - AudioStreamView* asv = audio_view(); - - if (asv) { - asv->hide_all_xfades (); + if (apply_to_selection) { + _editor.get_selection().tracks.foreach_audio_time_axis (boost::bind (&AudioTimeAxisView::hide_all_xfades, _1, false)); + } else { + AudioStreamView* asv = audio_view (); + if (asv) { + asv->hide_all_xfades (); + } } } diff --git a/gtk2_ardour/audio_time_axis.h b/gtk2_ardour/audio_time_axis.h index 29e8682d19..4841fcda81 100644 --- a/gtk2_ardour/audio_time_axis.h +++ b/gtk2_ardour/audio_time_axis.h @@ -71,8 +71,8 @@ class AudioTimeAxisView : public RouteTimeAxisView AudioStreamView* audio_view(); void set_show_waveforms_recording (bool yn); - void show_all_xfades (); - void hide_all_xfades (); + void show_all_xfades (bool apply_to_selection = false); + void hide_all_xfades (bool apply_to_selection = false); void hide_dependent_views (TimeAxisViewItem&); void reveal_dependent_views (TimeAxisViewItem&); diff --git a/gtk2_ardour/track_selection.h b/gtk2_ardour/track_selection.h index 68ec3b7bd6..0c4f364c4e 100644 --- a/gtk2_ardour/track_selection.h +++ b/gtk2_ardour/track_selection.h @@ -22,6 +22,7 @@ #include "track_view_list.h" #include "route_ui.h" +#include "audio_time_axis.h" class PublicEditor; @@ -49,6 +50,14 @@ public: f (t); } } + + template <typename Function> + void foreach_audio_time_axis (Function f) { + for (iterator i = begin(); i != end(); ++i) { + AudioTimeAxisView* t = dynamic_cast<AudioTimeAxisView*> (*i); + f (t); + } + } private: PublicEditor const * _editor; |