diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-05-31 21:15:28 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-05-31 21:15:28 +0000 |
commit | 52a8242a1158426caeed4757bbc3f7f71091e351 (patch) | |
tree | 43de2da9007dd8178162e80b778586f1b460eb12 /libs/ardour | |
parent | 539aa71d180d6b3d5c887707c356d3d00c0b37e8 (diff) |
fixup botched xfade-as-audioregion; apply work from 2.0-ongoing
git-svn-id: svn://localhost/ardour2/trunk@1933 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/ardour/audioplaylist.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/crossfade.h | 8 | ||||
-rw-r--r-- | libs/ardour/ardour/curve.h | 8 | ||||
-rw-r--r-- | libs/ardour/ardour/playlist.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/region.h | 4 | ||||
-rw-r--r-- | libs/ardour/ardour/types.h | 6 | ||||
-rw-r--r-- | libs/ardour/audio_playlist.cc | 195 | ||||
-rw-r--r-- | libs/ardour/crossfade.cc | 13 | ||||
-rw-r--r-- | libs/ardour/curve.cc | 22 | ||||
-rw-r--r-- | libs/ardour/playlist.cc | 55 | ||||
-rw-r--r-- | libs/ardour/region.cc | 5 | ||||
-rw-r--r-- | libs/ardour/region_factory.cc | 34 | ||||
-rw-r--r-- | libs/ardour/route.cc | 27 |
13 files changed, 146 insertions, 235 deletions
diff --git a/libs/ardour/ardour/audioplaylist.h b/libs/ardour/ardour/audioplaylist.h index e431759c99..4acbc9ad51 100644 --- a/libs/ardour/ardour/audioplaylist.h +++ b/libs/ardour/ardour/audioplaylist.h @@ -72,9 +72,11 @@ class AudioPlaylist : public ARDOUR::Playlist void remove_dependents (boost::shared_ptr<Region> region); private: + Crossfades _crossfades; Crossfades _pending_xfade_adds; void crossfade_invalidated (boost::shared_ptr<Region>); + XMLNode& state (bool full_state); void dump () const; bool region_changed (Change, boost::shared_ptr<Region>); diff --git a/libs/ardour/ardour/crossfade.h b/libs/ardour/ardour/crossfade.h index 74fcc6f2fc..61a30f1c0f 100644 --- a/libs/ardour/ardour/crossfade.h +++ b/libs/ardour/ardour/crossfade.h @@ -61,10 +61,10 @@ class Crossfade : public ARDOUR::AudioRegion Crossfade (boost::shared_ptr<ARDOUR::AudioRegion> in, boost::shared_ptr<ARDOUR::AudioRegion> out, CrossfadeModel, bool active); + /* copy constructor to copy a crossfade with new regions. used (for example) when a playlist copy is made */ - Crossfade (boost::shared_ptr<Crossfade>, boost::shared_ptr<ARDOUR::AudioRegion>, boost::shared_ptr<ARDOUR::AudioRegion>); /* the usual XML constructor */ @@ -77,8 +77,6 @@ class Crossfade : public ARDOUR::AudioRegion XMLNode& get_state (void); int set_state (const XMLNode&); - static std::string node_name(); - boost::shared_ptr<ARDOUR::AudioRegion> in() const { return _in; } boost::shared_ptr<ARDOUR::AudioRegion> out() const { return _out; } @@ -88,11 +86,11 @@ class Crossfade : public ARDOUR::AudioRegion bool refresh (); - layer_t upper_layer () const { + uint32_t upper_layer () const { return std::max (_in->layer(), _out->layer()); } - layer_t lower_layer () const { + uint32_t lower_layer () const { return std::min (_in->layer(), _out->layer()); } diff --git a/libs/ardour/ardour/curve.h b/libs/ardour/ardour/curve.h index 5b725f4720..dd63439f08 100644 --- a/libs/ardour/ardour/curve.h +++ b/libs/ardour/ardour/curve.h @@ -52,8 +52,8 @@ class Curve : public AutomationList Curve (const Curve& other, double start, double end); Curve (const XMLNode&); - bool rt_safe_get_vector (double x0, double x1, float *arg, int64_t veclen); - void get_vector (double x0, double x1, float *arg, int64_t veclen); + bool rt_safe_get_vector (double x0, double x1, float *arg, int32_t veclen); + void get_vector (double x0, double x1, float *arg, int32_t veclen); AutomationEventList::iterator closest_control_point_before (double xval); AutomationEventList::iterator closest_control_point_after (double xval); @@ -72,14 +72,14 @@ class Curve : public AutomationList double unlocked_eval (double where); double multipoint_eval (double x); - void _get_vector (double x0, double x1, float *arg, int64_t veclen); + void _get_vector (double x0, double x1, float *arg, int32_t veclen); }; } // namespace ARDOUR extern "C" { - void curve_get_vector_from_c (void *arg, double, double, float*, int64_t); + void curve_get_vector_from_c (void *arg, double, double, float*, int32_t); } #endif /* __ardour_curve_h__ */ diff --git a/libs/ardour/ardour/playlist.h b/libs/ardour/ardour/playlist.h index 00d81199a7..9eb66f66b6 100644 --- a/libs/ardour/ardour/playlist.h +++ b/libs/ardour/ardour/playlist.h @@ -253,7 +253,7 @@ class Playlist : public PBD::StatefulDestructible, public boost::enable_shared_f int remove_region_internal (boost::shared_ptr<Region>); RegionList *find_regions_at (nframes_t frame); - virtual void copy_regions (RegionList&) const; + void copy_regions (RegionList&) const; void partition_internal (nframes_t start, nframes_t end, bool cutting, RegionList& thawlist); nframes_t _get_maximum_extent() const; diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h index 006f15e7a4..c3aac3dfa8 100644 --- a/libs/ardour/ardour/region.h +++ b/libs/ardour/ardour/region.h @@ -96,8 +96,6 @@ class Region : public PBD::StatefulDestructible, public boost::enable_shared_fro nframes_t start () const { return _start; } nframes_t length() const { return _length; } layer_t layer () const { return _layer; } - virtual layer_t lower_layer () const { return _layer; } - virtual layer_t upper_layer () const { return _layer; } nframes_t sync_offset(int& dir) const; nframes_t sync_position() const; @@ -190,8 +188,6 @@ class Region : public PBD::StatefulDestructible, public boost::enable_shared_fro virtual int set_state (const XMLNode&); virtual int set_live_state (const XMLNode&, Change&, bool send); - static std::string node_name(); - virtual boost::shared_ptr<Region> get_parent() const; uint64_t last_layer_op() const { return _last_layer_op; } diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index b155965cab..766c3d4907 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -41,6 +41,12 @@ typedef int intptr_t; #endif +/* eventually, we'd like everything (including JACK) to + move to this. for now, its a dedicated type. +*/ + +typedef int64_t nframes64_t; + namespace ARDOUR { class Source; diff --git a/libs/ardour/audio_playlist.cc b/libs/ardour/audio_playlist.cc index 3eda5b57cf..246384689e 100644 --- a/libs/ardour/audio_playlist.cc +++ b/libs/ardour/audio_playlist.cc @@ -65,7 +65,6 @@ AudioPlaylist::AudioPlaylist (boost::shared_ptr<const AudioPlaylist> other, stri boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion>(*in_o); // We look only for crossfades which begin with the current region, so we don't get doubles - for (Crossfades::const_iterator xfades = other->_crossfades.begin(); xfades != other->_crossfades.end(); ++xfades) { if ((*xfades)->in() == ar) { // We found one! Now copy it! @@ -114,21 +113,6 @@ AudioPlaylist::~AudioPlaylist () _crossfades.clear (); } -void -AudioPlaylist::copy_regions (RegionList& newlist) const -{ - RegionLock rlock (const_cast<Playlist *> (this)); - - Playlist::copy_regions (newlist, false); - - for (RegionList::const_iterator i = regions.begin(); i != regions.end(); ++i) { - if (!(*i)->is_dependent()) { - newlist.push_back (RegionFactory::RegionFactory::create (*i)); - } - } -} - - struct RegionSortByLayer { bool operator() (boost::shared_ptr<Region> a, boost::shared_ptr<Region> b) { return a->layer() < b->layer(); @@ -234,11 +218,11 @@ AudioPlaylist::remove_dependents (boost::shared_ptr<Region> region) << endmsg; return; } - - for (RegionList::iterator i = regions.begin(); i != regions.end(); ) { + + for (Crossfades::iterator i = _crossfades.begin(); i != _crossfades.end(); ) { - if ((*i)->depends_on (r)) { - i = regions.erase (i); + if ((*i)->involves (r)) { + i = _crossfades.erase (i); } else { ++i; } @@ -277,16 +261,16 @@ AudioPlaylist::refresh_dependents (boost::shared_ptr<Region> r) return; } - for (RegionList::iterator x = regions.begin(); x != regions.end();) { - - RegionList::iterator tmp; + for (Crossfades::iterator x = _crossfades.begin(); x != _crossfades.end();) { + + Crossfades::iterator tmp; tmp = x; ++tmp; /* only update them once */ - if ((*x)->depends_on (ar)) { + if ((*x)->involves (ar)) { if (find (updated.begin(), updated.end(), *x) == updated.end()) { try { @@ -312,43 +296,35 @@ AudioPlaylist::finalize_split_region (boost::shared_ptr<Region> o, boost::shared boost::shared_ptr<AudioRegion> left = boost::dynamic_pointer_cast<AudioRegion>(l); boost::shared_ptr<AudioRegion> right = boost::dynamic_pointer_cast<AudioRegion>(r); - for (RegionList::iterator x = regions.begin(); x !=regions.end();) { + for (Crossfades::iterator x = _crossfades.begin(); x != _crossfades.end();) { Crossfades::iterator tmp; - boost::shared_ptr<Crossfade> xfade = boost::dynamic_pointer_cast<Crossfade>(*x); - - if (!xfade) { - ++x; - continue; - } - tmp = x; ++tmp; boost::shared_ptr<Crossfade> fade; - if (xfade->_in == orig) { - if (! xfade->covers(right->position())) { - fade = boost::shared_ptr<Crossfade> (new Crossfade (*xfade, left, xfade->_out)); + if ((*x)->_in == orig) { + if (! (*x)->covers(right->position())) { + fade = boost::shared_ptr<Crossfade> (new Crossfade (*x, left, (*x)->_out)); } else { // Overlap, the crossfade is copied on the left side of the right region instead - fade = boost::shared_ptr<Crossfade> (new Crossfade (*xfade, right, xfade->_out)); + fade = boost::shared_ptr<Crossfade> (new Crossfade (*x, right, (*x)->_out)); } } - if (xfade->_out == orig) { - if (! xfade->covers(right->position())) { - fade = boost::shared_ptr<Crossfade> (new Crossfade (*xfade, xfade->_in, right)); + if ((*x)->_out == orig) { + if (! (*x)->covers(right->position())) { + fade = boost::shared_ptr<Crossfade> (new Crossfade (*x, (*x)->_in, right)); } else { // Overlap, the crossfade is copied on the right side of the left region instead - fade = boost::shared_ptr<Crossfade> (new Crossfade (*xfade, xfade->_in, left)); + fade = boost::shared_ptr<Crossfade> (new Crossfade (*x, (*x)->_in, left)); } } if (fade) { - regions.erase (*x); + _crossfades.remove (*x); add_crossfade (fade); } - x = tmp; } } @@ -466,29 +442,25 @@ AudioPlaylist::check_dependents (boost::shared_ptr<Region> r, bool norefresh) } void -AudioPlaylist::add_crossfade (boost::shared_ptr<Crossfade> new_xfade) +AudioPlaylist::add_crossfade (boost::shared_ptr<Crossfade> xfade) { - RegionList::iterator r; - boost::shared_ptr<Crossfade> xfade; + Crossfades::iterator ci; - for (r = regions.begin(); r != regions.end(); ++r) { - - if ((xfade = boost::dynamic_pointer_cast<Crossfade>(*r))) { - if (*xfade == *new_xfade) { // Crossfade::operator==() - break; - } + for (ci = _crossfades.begin(); ci != _crossfades.end(); ++ci) { + if (*(*ci) == *xfade) { // Crossfade::operator==() + break; } } - if (r != regions.end()) { + if (ci != _crossfades.end()) { // it will just go away } else { - add_region_internal (new_xfade); + _crossfades.push_back (xfade); - new_xfade->Invalidated.connect (mem_fun (*this, &AudioPlaylist::crossfade_invalidated)); - new_xfade->StateChanged.connect (mem_fun (*this, &AudioPlaylist::crossfade_changed)); + xfade->Invalidated.connect (mem_fun (*this, &AudioPlaylist::crossfade_invalidated)); + xfade->StateChanged.connect (mem_fun (*this, &AudioPlaylist::crossfade_changed)); - notify_crossfade_added (new_xfade); + notify_crossfade_added (xfade); } } @@ -504,12 +476,15 @@ void AudioPlaylist::notify_crossfade_added (boost::shared_ptr<Crossfade> x) void AudioPlaylist::crossfade_invalidated (boost::shared_ptr<Region> r) { + Crossfades::iterator i; boost::shared_ptr<Crossfade> xfade = boost::dynamic_pointer_cast<Crossfade> (r); - + xfade->in()->resume_fade_in (); xfade->out()->resume_fade_out (); - remove_region_internal (r); + if ((i = find (_crossfades.begin(), _crossfades.end(), xfade)) != _crossfades.end()) { + _crossfades.erase (i); + } } int @@ -530,14 +505,13 @@ AudioPlaylist::set_state (const XMLNode& node) child = *niter; - if (child->name() != Crossfade::node_name()) { + if (child->name() != "Crossfade") { continue; } - + try { - boost::shared_ptr<Crossfade> xfade = boost::dynamic_pointer_cast<Crossfade> (RegionFactory::create (*((const Playlist *) this), *child)); - assert (xfade); - add_region_internal (xfade); + boost::shared_ptr<Crossfade> xfade = boost::shared_ptr<Crossfade> (new Crossfade (*((const Playlist *)this), *child)); + _crossfades.push_back (xfade); xfade->Invalidated.connect (mem_fun (*this, &AudioPlaylist::crossfade_invalidated)); xfade->StateChanged.connect (mem_fun (*this, &AudioPlaylist::crossfade_changed)); NewCrossfade(xfade); @@ -560,9 +534,24 @@ AudioPlaylist::set_state (const XMLNode& node) void AudioPlaylist::clear (bool with_signals) { + _crossfades.clear (); Playlist::clear (with_signals); } +XMLNode& +AudioPlaylist::state (bool full_state) +{ + XMLNode& node = Playlist::state (full_state); + + if (full_state) { + for (Crossfades::iterator i = _crossfades.begin(); i != _crossfades.end(); ++i) { + node.add_child_nocopy ((*i)->get_state()); + } + } + + return node; +} + void AudioPlaylist::dump () const { @@ -571,32 +560,33 @@ AudioPlaylist::dump () const cerr << "Playlist \"" << _name << "\" " << endl << regions.size() << " regions " + << _crossfades.size() << " crossfades" << endl; for (RegionList::const_iterator i = regions.begin(); i != regions.end(); ++i) { r = *i; + cerr << " " << r->name() << " @ " << r << " [" + << r->start() << "+" << r->length() + << "] at " + << r->position() + << " on layer " + << r->layer () + << endl; + } - if ((x = boost::dynamic_pointer_cast<Crossfade> (r))) { - cerr << " xfade [" - << x->out()->name() - << ',' - << x->in()->name() - << " @ " - << x->position() - << " length = " - << x->length () - << " active ? " - << (x->active() ? "yes" : "no") - << endl; - } else { - cerr << " " << r->name() << " @ " << r << " [" - << r->start() << "+" << r->length() - << "] at " - << r->position() - << " on layer " - << r->layer () - << endl; - } + for (Crossfades::const_iterator i = _crossfades.begin(); i != _crossfades.end(); ++i) { + x = *i; + cerr << " xfade [" + << x->out()->name() + << ',' + << x->in()->name() + << " @ " + << x->position() + << " length = " + << x->length () + << " active ? " + << (x->active() ? "yes" : "no") + << endl; } } @@ -605,6 +595,8 @@ AudioPlaylist::destroy_region (boost::shared_ptr<Region> region) { boost::shared_ptr<AudioRegion> r = boost::dynamic_pointer_cast<AudioRegion> (region); bool changed = false; + Crossfades::iterator c, ctmp; + set<boost::shared_ptr<Crossfade> > unique_xfades; if (r == 0) { fatal << _("programming error: non-audio Region passed to remove_overlap in audio playlist") @@ -624,9 +616,6 @@ AudioPlaylist::destroy_region (boost::shared_ptr<Region> region) if ((*i) == region) { regions.erase (i); changed = true; - } else if ((*i)->depends_on (region)) { - regions.erase (i); - changed = true; } i = tmp; @@ -640,9 +629,6 @@ AudioPlaylist::destroy_region (boost::shared_ptr<Region> region) if ((*x) == region) { all_regions.erase (x); changed = true; - } else if ((*x)->depends_on (region)) { - all_regions.erase (x); - changed = true; } x = xtmp; @@ -651,6 +637,18 @@ AudioPlaylist::destroy_region (boost::shared_ptr<Region> region) region->set_playlist (boost::shared_ptr<Playlist>()); } + for (c = _crossfades.begin(); c != _crossfades.end(); ) { + ctmp = c; + ++ctmp; + + if ((*c)->involves (r)) { + unique_xfades.insert (*c); + _crossfades.erase (c); + } + + c = ctmp; + } + if (changed) { /* overload this, it normally means "removed", not destroyed */ notify_region_removed (region); @@ -700,3 +698,20 @@ AudioPlaylist::region_changed (Change what_changed, boost::shared_ptr<Region> re return true; } +void +AudioPlaylist::crossfades_at (nframes_t frame, Crossfades& clist) +{ + RegionLock rlock (this); + + for (Crossfades::iterator i = _crossfades.begin(); i != _crossfades.end(); ++i) { + nframes_t start, end; + + start = (*i)->position(); + end = start + (*i)->overlap_length(); // not length(), important difference + + if (frame >= start && frame <= end) { + clist.push_back (*i); + } + } +} + diff --git a/libs/ardour/crossfade.cc b/libs/ardour/crossfade.cc index de91a53ab3..847741832d 100644 --- a/libs/ardour/crossfade.cc +++ b/libs/ardour/crossfade.cc @@ -194,11 +194,6 @@ Crossfade::Crossfade (boost::shared_ptr<Crossfade> orig, boost::shared_ptr<Audio set_length(_length); } -Crossfade::Crossfade (boost::shared_ptr<Playlist> pl, boost::shared_ptr<Crossfade> other) -{ - -} - Crossfade::~Crossfade () { @@ -629,7 +624,7 @@ Crossfade::compute (boost::shared_ptr<AudioRegion> a, boost::shared_ptr<AudioReg XMLNode& Crossfade::get_state () { - XMLNode* node = new XMLNode (node_name()); + XMLNode* node = new XMLNode (X_("Crossfade")); XMLNode* child; char buf[64]; LocaleGuard lg (X_("POSIX")); @@ -891,9 +886,3 @@ Crossfade::invalidate () { Invalidated (shared_from_this ()); /* EMIT SIGNAL */ } - -string -Crossfade::node_name () -{ - return X_("Crossfade"); -} diff --git a/libs/ardour/curve.cc b/libs/ardour/curve.cc index 249d84642b..5a1dc108f8 100644 --- a/libs/ardour/curve.cc +++ b/libs/ardour/curve.cc @@ -72,7 +72,7 @@ Curve::~Curve () void Curve::solve () { - uint64_t npoints; + uint32_t npoints; if (!_dirty) { return; @@ -87,7 +87,7 @@ Curve::solve () double x[npoints]; double y[npoints]; - uint64_t i; + uint32_t i; AutomationEventList::iterator xx; for (i = 0, xx = events.begin(); xx != events.end(); ++xx, ++i) { @@ -206,7 +206,7 @@ Curve::solve () } bool -Curve::rt_safe_get_vector (double x0, double x1, float *vec, int64_t veclen) +Curve::rt_safe_get_vector (double x0, double x1, float *vec, int32_t veclen) { Glib::Mutex::Lock lm (lock, Glib::TRY_LOCK); @@ -219,19 +219,19 @@ Curve::rt_safe_get_vector (double x0, double x1, float *vec, int64_t veclen) } void -Curve::get_vector (double x0, double x1, float *vec, int64_t veclen) +Curve::get_vector (double x0, double x1, float *vec, int32_t veclen) { Glib::Mutex::Lock lm (lock); _get_vector (x0, x1, vec, veclen); } void -Curve::_get_vector (double x0, double x1, float *vec, int64_t veclen) +Curve::_get_vector (double x0, double x1, float *vec, int32_t veclen) { double rx, dx, lx, hx, max_x, min_x; - int64_t i; - int64_t original_veclen; - int64_t npoints; + int32_t i; + int32_t original_veclen; + int32_t npoints; if ((npoints = events.size()) == 0) { for (i = 0; i < veclen; ++i) { @@ -262,7 +262,7 @@ Curve::_get_vector (double x0, double x1, float *vec, int64_t veclen) */ double frac = (min_x - x0) / (x1 - x0); - int64_t subveclen = (int64_t) floor (veclen * frac); + int32_t subveclen = (int32_t) floor (veclen * frac); subveclen = min (subveclen, veclen); @@ -280,7 +280,7 @@ Curve::_get_vector (double x0, double x1, float *vec, int64_t veclen) double frac = (x1 - max_x) / (x1 - x0); - int64_t subveclen = (int64_t) floor (original_veclen * frac); + int32_t subveclen = (int32_t) floor (original_veclen * frac); float val; @@ -437,7 +437,7 @@ Curve::point_factory (const ControlEvent& other) const extern "C" { void -curve_get_vector_from_c (void *arg, double x0, double x1, float* vec, int64_t vecsize) +curve_get_vector_from_c (void *arg, double x0, double x1, float* vec, int32_t vecsize) { static_cast<Curve*>(arg)->get_vector (x0, x1, vec, vecsize); } diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index eb36988d0e..92e0503bb4 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -217,9 +217,7 @@ Playlist::copy_regions (RegionList& newlist) const RegionLock rlock (const_cast<Playlist *> (this)); for (RegionList::const_iterator i = regions.begin(); i != regions.end(); ++i) { - if (!(*i)->is_dependent()) { - newlist.push_back (RegionFactory::RegionFactory::create (*i)); - } + newlist.push_back (RegionFactory::RegionFactory::create (*i)); } } @@ -1387,7 +1385,7 @@ Playlist::set_state (const XMLNode& node) child = *niter; - if (child->name() == Region::node_name()) { + if (child->name() == "Region") { if ((prop = child->property ("id")) == 0) { error << _("region state node has no ID, ignored") << endmsg; @@ -1613,11 +1611,6 @@ Playlist::relayer () for (RegionList::iterator i = copy.begin(); i != copy.end(); ++i) { - if ((*i)->is_dependent()) { - /* handle dependent regions in a later pass */ - continue; - } - /* find the lowest layer that this region can go on */ size_t j = layers.size(); while (j > 0) { @@ -1655,50 +1648,6 @@ Playlist::relayer () } } - /* second pass: set up layer numbers for all dependent regions */ - - for (RegionList::iterator i = copy.begin(); i != copy.end(); ++i) { - - cerr << "pass 2, looking at " << (*i)->name() << " dep? " << (*i)->is_dependent() << endl; - - if ((*i)->is_dependent()) { - - size_t one_higher = (*i)->upper_layer() + 1; - - cerr << "Setting xfade to " << one_higher << endl; - - (*i)->set_layer (one_higher); - - if (one_higher < layers.size()) { - - /* find the layer list representing the next higher layer */ - - vector<RegionList>::iterator x = layers.begin(); - for (size_t n = 0; n < one_higher; ++n) { - ++x; - } - - /* add a new layer list containing just the dependent region - we set the layer for - */ - - layers.insert (x, RegionList()); - layers[one_higher].push_back (*i); - - /* move everything on higher layers one layer higher */ - - for (size_t j = one_higher; j < layers.size(); ++j) { - for (RegionList::iterator i = layers[j].begin(); i != layers[j].end(); ++i) { - cerr << "Bumping " << (*i)->name() << " to " << j << endl; - (*i)->set_layer (j); - } - } - } - - - } - } - /* sending Modified means that various kinds of layering models operate correctly at the GUI level. slightly inefficient, but only slightly. diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index 9762ae3898..8ac101282d 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -1265,8 +1265,3 @@ Region::get_parent() const return boost::shared_ptr<Region>(); } -string -Region::node_name () -{ - return X_("Region"); -} diff --git a/libs/ardour/region_factory.cc b/libs/ardour/region_factory.cc index cc41405551..a0aa3be759 100644 --- a/libs/ardour/region_factory.cc +++ b/libs/ardour/region_factory.cc @@ -90,24 +90,6 @@ RegionFactory::create (boost::shared_ptr<Region> region) } boost::shared_ptr<Region> -RegionFactory::create (const Playlist& playlist, boost::shared_ptr<Region> region) -{ - boost::shared_ptr<Crossfade> xfade; - boost::shared_ptr<MidiRegion> mr; - - if ((xfade = boost::dynamic_pointer_cast<Crossfade>(region)) != 0) { - boost::shared_ptr<Region> ret (new Crossfade (playlist, xfade)); - /* pure copy constructor - no CheckNewRegion emitted */ - return ret; - } else { - fatal << _("programming error: RegionFactory::create(Playlist,Region) called with unknown Region type") - << endmsg; - /*NOTREACHED*/ - return boost::shared_ptr<Region>(); - } -} - -boost::shared_ptr<Region> RegionFactory::create (boost::shared_ptr<AudioRegion> region, nframes_t start, nframes_t length, std::string name, layer_t layer, Region::Flag flags, bool announce) @@ -156,22 +138,6 @@ RegionFactory::create (SourceList& srcs, nframes_t start, nframes_t length, cons } boost::shared_ptr<Region> -RegionFactory::create (const Playlist& playlist, const XMLNode& node) -{ - /* this is a constructor for "dependent" region types. - these objects require a playlist so that they can - look up the region instances that they depend upon. - */ - - if (node.name() == Crossfade::node_name()) { - boost::shared_ptr<Region> ret (new Crossfade (playlist, node)); - return ret; - } - - return boost::shared_ptr<Region> (); -} - -boost::shared_ptr<Region> RegionFactory::create (SourceList& srcs, const XMLNode& node) { if (srcs.empty()) { diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 76450c887a..17322229ed 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -1805,25 +1805,20 @@ Route::_set_state (const XMLNode& node, bool call_base) } } - if (ports_legal) { - - /* if ports are not legal, this will happen in set_deferred_state() */ - - XMLNodeList redirect_nodes; - - for (niter = nlist.begin(); niter != nlist.end(); ++niter){ - - child = *niter; + XMLNodeList redirect_nodes; - if (child->name() == X_("Send") || child->name() == X_("Insert")) { - redirect_nodes.push_back(child); - } + for (niter = nlist.begin(); niter != nlist.end(); ++niter){ + + child = *niter; + if (child->name() == X_("Send") || child->name() == X_("Insert")) { + redirect_nodes.push_back(child); } - - _set_redirect_states (redirect_nodes); + } + _set_redirect_states(redirect_nodes); + for (niter = nlist.begin(); niter != nlist.end(); ++niter){ child = *niter; @@ -1947,9 +1942,9 @@ Route::_set_redirect_states(const XMLNodeList &nlist) RedirectList::iterator last = _redirects.end(); --last; - + if (prev_last == last) { - warning << _name << ": could not fully restore state as some redirects were not possible to create" << endmsg; + cerr << "Could not fully restore state as some redirects were not possible to create" << endl; continue; } |