Fix the horrible mess that was anything related to sources and paths.
[ardour.git] / libs / ardour / ardour / region.h
index 32f47d42d7c39eeae36585291aac1729a84a223b..b55d77f4990ffed8e129d62f0c77fc197cf5747d 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;
@@ -90,6 +94,7 @@ class Region : public Automatable, public boost::enable_shared_from_this<Region>
        static Change HiddenChanged;
 
        sigc::signal<void,Change> StateChanged;
+       static sigc::signal<void,boost::shared_ptr<ARDOUR::Region> > RegionPropertyChanged;
 
        virtual ~Region();
 
@@ -127,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 */
 
@@ -219,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 ();
@@ -240,6 +254,11 @@ class Region : public Automatable, public boost::enable_shared_from_this<Region>
                // no transients, but its OK
                return 0;
        }
+       
+       virtual int separate_by_channel (ARDOUR::Session&,
+                       std::vector< boost::shared_ptr<Region> >&) const {
+               return 0;
+       }
 
        void invalidate_transients ();  
 
@@ -252,6 +271,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&);
@@ -259,6 +279,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);