#include <ardour/data_type.h>
#include <ardour/automatable.h>
#include <ardour/readable.h>
+#include <ardour/session_object.h>
class XMLNode;
EditChangesID = 2
};
-class Region : public Automatable, public boost::enable_shared_from_this<Region>, public Readable
+class Region
+ : public SessionObject
+ , public boost::enable_shared_from_this<Region>
+ , public Readable
{
public:
typedef std::vector<boost::shared_ptr<Source> > SourceList;
static Change HiddenChanged;
sigc::signal<void,Change> StateChanged;
+ static sigc::signal<void,boost::shared_ptr<ARDOUR::Region> > RegionPropertyChanged;
virtual ~Region();
const DataType& data_type() const { return _type; }
+ /**
+ * Thats how the region parameters play together:
+ * <PRE>
+ * |------------------------------------------------------------------- track
+ * |..........[------------------].....| region
+ * |-----------------------------| _position
+ * |------------------| _length
+ * |----------| _start
+ * </PRE>
+ */
nframes_t position () const { return _position; }
nframes_t start () const { return _start; }
nframes_t length() const { return _length; }
nframes_t sync_offset(int& dir) const;
nframes_t sync_position() const;
+ nframes_t sync_point () const;
- nframes_t adjust_to_sync (nframes_t);
+ nframes_t adjust_to_sync (nframes_t) const;
/* first_frame() is an alias; last_frame() just hides some math */
const SourceList& master_sources() const { return _master_sources; }
std::vector<string> master_source_names();
- void set_master_sources (SourceList&);
+ void set_master_sources (const SourceList&);
+
+ /* automation */
+
+ virtual boost::shared_ptr<Evoral::Control>
+ control(const Evoral::Parameter& id, bool create=false) = 0;
+
+ virtual boost::shared_ptr<const Evoral::Control>
+ control(const Evoral::Parameter& id) const = 0;
/* serialization */
const string& name, DataType type, layer_t = 0, Flag flags = DefaultFlags);
Region (boost::shared_ptr<const Region>, nframes_t start, nframes_t length, const string& name, layer_t = 0, Flag flags = DefaultFlags);
+ Region (boost::shared_ptr<const Region>, nframes_t length, const string& name, layer_t = 0, Flag flags = DefaultFlags);
Region (boost::shared_ptr<const Region>);
Region (boost::shared_ptr<Source> src, const XMLNode&);
Region (const SourceList& srcs, const XMLNode&);
Region (Session& s, nframes_t start, nframes_t length, const string& name, DataType, layer_t = 0, Flag flags = DefaultFlags);
protected:
+ void copy_stuff (boost::shared_ptr<const Region>, nframes_t start, nframes_t length, const string& name, layer_t, Flag flags);
+
XMLNode& get_short_state (); /* used only by Session */
void send_change (Change);