void update (const CrossfadeListProperty::ChangeRecord &);
+ boost::shared_ptr<Crossfade> find_crossfade (const PBD::ID &) const;
+
protected:
/* playlist "callbacks" */
class Session;
class Region;
class Playlist;
+class Crossfade;
namespace Properties {
/* fake the type, since regions are handled by SequenceProperty which doesn't
void set_explicit_relayering (bool e);
+ virtual boost::shared_ptr<Crossfade> find_crossfade (const PBD::ID &) const {
+ return boost::shared_ptr<Crossfade> ();
+ }
+
protected:
friend class Session;
class Region;
class Source;
class Session;
+class Crossfade;
class SessionPlaylists : public PBD::ScopedConnectionList
{
void get (std::vector<boost::shared_ptr<Playlist> >&);
void unassigned (std::list<boost::shared_ptr<Playlist> > & list);
void destroy_region (boost::shared_ptr<Region>);
+ boost::shared_ptr<Crossfade> find_crossfade (const PBD::ID &);
private:
friend class Session;
/* don't remove crossfades here; they will be dealt with by the dependency code */
}
+
+boost::shared_ptr<Crossfade>
+AudioPlaylist::find_crossfade (const PBD::ID& id) const
+{
+ Crossfades::const_iterator i = _crossfades.begin ();
+ while (i != _crossfades.end() && (*i)->id() != id) {
+ ++i;
+ }
+
+ if (i == _crossfades.end()) {
+ return boost::shared_ptr<Crossfade> ();
+ }
+
+ return *i;
+}
char buf[64];
LocaleGuard lg (X_("POSIX"));
+ id().print (buf, sizeof (buf));
+ node->add_property ("id", buf);
_out->id().print (buf, sizeof (buf));
node->add_property ("out", buf);
_in->id().print (buf, sizeof (buf));
PropertyChange what_changed;
framepos_t val;
+ if ((prop = node.property (X_("id")))) {
+ _id = prop->value();
+ }
+
if ((prop = node.property ("position")) != 0) {
sscanf (prop->value().c_str(), "%" PRId64, &val);
if (val != _position) {
#include "ardour/session_playlists.h"
#include "ardour/region_factory.h"
#include "ardour/midi_automation_list_binder.h"
+#include "ardour/crossfade.h"
#include "pbd/error.h"
#include "pbd/id.h"
#include "pbd/statefuldestructible.h"
}
cerr << "Alist not found\n";
-
+
+ } else if (obj_T == "ARDOUR::Crossfade") {
+ boost::shared_ptr<Crossfade> c = playlists->find_crossfade (id);
+ if (c) {
+ return new MementoCommand<Crossfade> (*c.get(), before, after);
+ } else {
+ error << string_compose (X_("Crossfade %1 not found in session"), id) << endmsg;
+ }
+
} else if (registry.count(id)) { // For Editor and AutomationLine which are off-limits herea
return new MementoCommand<PBD::StatefulDestructible>(*registry[id], before, after);
}
}
}
+boost::shared_ptr<Crossfade>
+SessionPlaylists::find_crossfade (const PBD::ID& id)
+{
+ Glib::Mutex::Lock lm (lock);
+
+ boost::shared_ptr<Crossfade> c;
+
+ for (List::iterator i = playlists.begin(); i != playlists.end(); ++i) {
+ c = (*i)->find_crossfade (id);
+ if (c) {
+ return c;
+ }
+ }
+
+ for (List::iterator i = unused_playlists.begin(); i != unused_playlists.end(); ++i) {
+ c = (*i)->find_crossfade (id);
+ if (c) {
+ return c;
+ }
+ }
+
+ return boost::shared_ptr<Crossfade> ();
+}