From 452672f78f5f0f9195bfd48398e29b18a8fb1df7 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 1 Feb 2012 01:07:52 +0000 Subject: Make crossfade convert-to-full and activate/deactivate work across edit groups (#4658). git-svn-id: svn://localhost/ardour2/branches/3.0@11413 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_selection.cc | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'gtk2_ardour/editor_selection.cc') diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index 010984c26e..b99aa67ea5 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -27,6 +27,7 @@ #include "ardour/route_group.h" #include "ardour/profile.h" #include "ardour/midi_region.h" +#include "ardour/audioplaylist.h" #include "editor.h" #include "actions.h" @@ -35,6 +36,7 @@ #include "audio_streamview.h" #include "automation_line.h" #include "control_point.h" +#include "crossfade_view.h" #include "editor_regions.h" #include "editor_cursors.h" #include "midi_region_view.h" @@ -474,6 +476,32 @@ Editor::mapped_get_equivalent_regions (RouteTimeAxisView& tv, uint32_t, RegionVi } } +void +Editor::mapped_get_equivalent_crossfades ( + RouteTimeAxisView& tv, uint32_t, boost::shared_ptr basis, vector >* equivs + ) const +{ + boost::shared_ptr pl; + vector > results; + boost::shared_ptr tr; + + if ((tr = tv.track()) == 0) { + /* bus */ + return; + } + + if ((pl = tr->playlist()) != 0) { + boost::shared_ptr apl = boost::dynamic_pointer_cast (pl); + if (apl) { + apl->get_equivalent_crossfades (basis, *equivs); + } + } + + /* We might have just checked basis for equivalency with itself, so we need to remove dupes */ + sort (equivs->begin (), equivs->end ()); + unique (equivs->begin (), equivs->end ()); +} + void Editor::get_equivalent_regions (RegionView* basis, vector& equivalent_regions, PBD::PropertyID property) const { @@ -507,6 +535,18 @@ Editor::get_equivalent_regions (RegionSelection & basis, PBD::PropertyID prop) c return equivalent; } +vector > +Editor::get_equivalent_crossfades (RouteTimeAxisView& v, boost::shared_ptr c, PBD::PropertyID prop) const +{ + vector > e; + mapover_tracks_with_unique_playlists ( + sigc::bind (sigc::mem_fun (*this, &Editor::mapped_get_equivalent_crossfades), c, &e), + &v, + prop + ); + + return e; +} int Editor::get_regionview_count_from_region_list (boost::shared_ptr region) -- cgit v1.2.3