Make hide/show all crossfades apply to the selection.

git-svn-id: svn://localhost/ardour2/branches/3.0@8939 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2011-02-23 02:08:46 +00:00
parent 8b1203dc33
commit ed93d47e7c
3 changed files with 29 additions and 14 deletions

View File

@ -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 ();
}
}
}

View File

@ -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&);

View File

@ -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;