Tidy.
[ardour.git] / libs / ardour / ardour / region.h
index dc81de6374884b08580200347d6a22b13eb1bb94..a84057a909d62790dc48de99f0b83fb04291e2ba 100644 (file)
@@ -30,6 +30,7 @@
 #include <ardour/data_type.h>
 #include <ardour/automatable.h>
 #include <ardour/readable.h>
+#include <ardour/session_object.h>
 
 class XMLNode;
 
@@ -45,7 +46,10 @@ enum RegionEditState {
        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;
@@ -128,8 +132,9 @@ class Region : public Automatable, public boost::enable_shared_from_this<Region>
 
        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 */
 
@@ -220,6 +225,14 @@ class Region : public Automatable, public boost::enable_shared_from_this<Region>
        std::vector<string> master_source_names();
        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 */
        
        XMLNode&         get_state ();
@@ -253,6 +266,7 @@ class Region : public Automatable, public boost::enable_shared_from_this<Region>
                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&);
@@ -260,6 +274,8 @@ class Region : public Automatable, public boost::enable_shared_from_this<Region>
        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);