along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id$
*/
#include <algorithm>
#include <ardour/crossfade.h>
#include <ardour/crossfade_compare.h>
#include <ardour/session.h>
+#include <pbd/enumwriter.h>
#include "i18n.h"
skip_frames = 0;
_read_data_count = 0;
+ RegionList* rlist = regions_to_read (start, start+cnt);
+
+ if (rlist->empty()) {
+ delete rlist;
+ return cnt;
+ }
+
map<uint32_t,vector<boost::shared_ptr<Region> > > relevant_regions;
map<uint32_t,vector<boost::shared_ptr<Crossfade> > > relevant_xfades;
vector<uint32_t> relevant_layers;
- for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
+ for (RegionList::iterator i = rlist->begin(); i != rlist->end(); ++i) {
if ((*i)->coverage (start, end) != OverlapNone) {
relevant_regions[(*i)->layer()].push_back (*i);
relevant_layers.push_back ((*i)->layer());
}
}
+ delete rlist;
return ret;
}
if ((*x)->involves (ar)) {
- if (find (updated.begin(), updated.end(), *x) == updated.end()) {
+ pair<set<boost::shared_ptr<Crossfade> >::iterator, bool> const u = updated.insert (*x);
+
+ if (u.second) {
+ /* x was succesfully inserted into the set, so it has not already been updated */
try {
- if ((*x)->refresh ()) {
- updated.insert (*x);
- }
+ (*x)->refresh ();
}
catch (Crossfade::NoCrossfadeHere& err) {
top = other;
bottom = region;
}
+
+ if (!(top->opaque())) {
+ continue;
+ }
+
OverlapType c = top->coverage (bottom->position(), bottom->last_frame());
-
+
try {
switch (c) {
case OverlapNone:
xfade = boost::shared_ptr<Crossfade> (new Crossfade (top, bottom, xfade_length, top->first_frame(), StartOfIn));
add_crossfade (xfade);
-
+
if (top_region_at (top->last_frame() - 1) == top) {
/*
only add a fade out if there is no region on top of the end of 'top' (which