Update recorded MIDI regions as notes arrive. Fixes one cause of infinite note-lengt...
[ardour.git] / libs / ardour / ardour / region.h
index 3dbcc5557097fba2e451be7d667432fec1d54319..ef86dce4b2c3984d6d9923920f07042c4e107c10 100644 (file)
 #include "ardour/ardour.h"
 #include "ardour/data_type.h"
 #include "ardour/automatable.h"
+#include "ardour/movable.h"
 #include "ardour/readable.h"
 #include "ardour/session_object.h"
+#include "ardour/trimmable.h"
 
 class XMLNode;
 
@@ -68,6 +70,7 @@ namespace Properties {
 class Playlist;
 class Filter;
 class ExportSpecification;
+class Progress;        
 
 enum RegionEditState {
        EditChangesNothing = 0,
@@ -80,6 +83,8 @@ class Region
        : public SessionObject
        , public boost::enable_shared_from_this<Region>
        , public Readable
+        , public Trimmable
+        , public Movable
 {
   public:
        typedef std::vector<boost::shared_ptr<Source> > SourceList;
@@ -103,8 +108,8 @@ class Region
         * START:    first frame of the region within its source(s)
         * LENGTH:   number of frames the region represents
         */
-       sframes_t  position () const { return _position; }
-       sframes_t  start ()    const { return _start; }
+       framepos_t  position () const { return _position; }
+       framepos_t  start ()    const { return _start; }
        framecnt_t length()    const { return _length; }
        layer_t    layer ()    const { return _layer; }
 
@@ -112,15 +117,15 @@ class Region
 
        /* these two are valid ONLY during a StateChanged signal handler */
 
-       sframes_t  last_position() const { return _last_position; }
+       framepos_t  last_position() const { return _last_position; }
        framecnt_t last_length() const { return _last_length; }
 
-       sframes_t ancestral_start () const { return _ancestral_start; }
+       framepos_t ancestral_start () const { return _ancestral_start; }
        framecnt_t ancestral_length () const { return _ancestral_length; }
        float stretch() const { return _stretch; }
        float shift() const { return _shift; }
 
-       void set_ancestral_data (nframes64_t start, nframes64_t length, float stretch, float shift);
+       void set_ancestral_data (framepos_t start, framepos_t length, float stretch, float shift);
 
        frameoffset_t sync_offset(int& dir) const;
        framepos_t sync_position() const;
@@ -146,6 +151,8 @@ class Region
        bool sync_marked() const { return _sync_marked; }
        bool external() const    { return _external; }
        bool import() const      { return _import; }
+        
+        Trimmable::CanTrim can_trim() const;
 
        PositionLockStyle position_lock_style() const { return _position_lock_style; }
        void set_position_lock_style (PositionLockStyle ps);
@@ -205,7 +212,7 @@ class Region
        void set_locked (bool yn);
        void set_position_locked (bool yn);
 
-       int apply (Filter&);
+       int apply (Filter &, Progress* progress = 0);
 
        virtual uint64_t read_data_count() const { return _read_data_count; }
 
@@ -247,16 +254,16 @@ class Region
 
        virtual int exportme (ARDOUR::Session&, ARDOUR::ExportSpecification&) = 0;
 
-       virtual void add_transient (nframes64_t where) {
+       virtual void add_transient (framepos_t) {
                // no transients, but its OK
        }
 
-       virtual int update_transient (nframes64_t old_position, nframes64_t new_position) {
+       virtual int update_transient (framepos_t /* old_position */, framepos_t /* new_position */) {
                // no transients, but its OK
                return 0;
        }
 
-       virtual void remove_transient (nframes64_t where) {
+       virtual void remove_transient (framepos_t /* where */) {
                // no transients, but its OK
        }
 
@@ -271,7 +278,7 @@ class Region
                return 0;
        }
 
-       virtual int adjust_transients (nframes64_t delta) {
+       virtual int adjust_transients (framepos_t /*delta*/) {
                // no transients, but its OK
                return 0;
        }