Apply velocity change before looking up velocity value for the verbose cursor. Shoul...
[ardour.git] / libs / ardour / ardour / region.h
index 2cf9bab97b6905c93cde04707811389b75efac2b..3dab0f46def994e0b20e081dbc1c9a13786ef87b 100644 (file)
@@ -52,6 +52,7 @@ namespace Properties {
        extern PBD::PropertyDescriptor<bool> right_of_split;
        extern PBD::PropertyDescriptor<bool> hidden;
        extern PBD::PropertyDescriptor<bool> position_locked;
+       extern PBD::PropertyDescriptor<bool> valid_transients;
        extern PBD::PropertyDescriptor<framepos_t> start;
        extern PBD::PropertyDescriptor<framecnt_t> length;
        extern PBD::PropertyDescriptor<framepos_t> position;
@@ -61,6 +62,7 @@ namespace Properties {
        extern PBD::PropertyDescriptor<framecnt_t> ancestral_length;
        extern PBD::PropertyDescriptor<float> stretch;
        extern PBD::PropertyDescriptor<float> shift;
+       extern PBD::PropertyDescriptor<PositionLockStyle> position_lock_style;
 };
 
 class Playlist;
@@ -84,11 +86,6 @@ class Region
 
        static void make_property_quarks ();
        
-       enum PositionLockStyle {
-               AudioTime,
-               MusicTime
-       };
-
        static PBD::Signal2<void,boost::shared_ptr<ARDOUR::Region>, const PBD::PropertyChange&> RegionPropertyChanged;
 
         PBD::PropertyList* property_factory (const XMLNode&) const;
@@ -99,6 +96,8 @@ class Region
        bool set_name (const std::string& str);
 
        const DataType& data_type() const { return _type; }
+       
+       AnalysisFeatureList transients () { return _transients; };
 
        /** How the region parameters play together:
         *   
@@ -141,6 +140,7 @@ class Region
        bool opaque ()    const  { return _opaque; }
        bool locked()     const  { return _locked; }
        bool position_locked() const { return _position_locked; }
+       bool valid_transients() const { return _valid_transients; }
        bool automatic()  const  { return _automatic; }
        bool whole_file() const  { return _whole_file; }
        bool captured()   const  { return !(_import || _external); }
@@ -149,7 +149,7 @@ class Region
        bool external() const    { return _external; }
        bool import() const      { return _import; }
 
-       PositionLockStyle positional_lock_style() const { return _positional_lock_style; }
+       PositionLockStyle position_lock_style() const { return _position_lock_style; }
        void set_position_lock_style (PositionLockStyle ps);
        void recompute_position_from_lock_style ();
 
@@ -249,12 +249,35 @@ class Region
 
        virtual int exportme (ARDOUR::Session&, ARDOUR::ExportSpecification&) = 0;
 
+       virtual void add_transient (nframes64_t where) {
+               // no transients, but its OK
+       }
+
+       virtual int update_transient (nframes64_t old_position, nframes64_t new_position) {
+               // no transients, but its OK
+               return 0;
+       }
+
+       virtual void remove_transient (nframes64_t where) {
+               // no transients, but its OK
+       }
+
+       virtual int set_transients (AnalysisFeatureList&) {
+               // no transients, but its OK
+               return 0;
+       }
+
        virtual int get_transients (AnalysisFeatureList&, bool force_new = false) {
                (void) force_new;
                // no transients, but its OK
                return 0;
        }
 
+       virtual int adjust_transients (nframes64_t delta) {
+               // no transients, but its OK
+               return 0;
+       }
+
        virtual int separate_by_channel (ARDOUR::Session&,
                        std::vector< boost::shared_ptr<Region> >&) const {
                return 0;
@@ -270,6 +293,8 @@ class Region
                return _pending_explicit_relayer;
        }
 
+        void drop_sources ();
+
   protected:
        friend class RegionFactory;
 
@@ -319,6 +344,7 @@ class Region
        PBD::Property<bool>        _right_of_split;
        PBD::Property<bool>        _hidden;
        PBD::Property<bool>        _position_locked;
+       PBD::Property<bool>        _valid_transients;
        PBD::Property<framepos_t>  _start;
        PBD::Property<framecnt_t>  _length;
        PBD::Property<framepos_t>  _position;
@@ -328,14 +354,14 @@ class Region
        PBD::Property<framecnt_t>  _ancestral_length;
        PBD::Property<float>       _stretch;
        PBD::Property<float>       _shift;
+       PBD::EnumProperty<PositionLockStyle> _position_lock_style;
 
        framecnt_t              _last_length;
        framepos_t              _last_position;
-       PositionLockStyle       _positional_lock_style;
        mutable RegionEditState _first_edit;
        BBT_Time                _bbt_time;
        AnalysisFeatureList     _transients;
-       bool                    _valid_transients;
+       
        mutable uint64_t        _read_data_count;  ///< modified in read()
        uint64_t                _last_layer_op;  ///< timestamp
        SourceList              _sources;
@@ -351,7 +377,7 @@ class Region
 
        void register_properties ();
 
-private:
+protected:
        void use_sources (SourceList const &);
 };