Remove empty MIDI regions which result from recordings made when no MIDI data is...
[ardour.git] / libs / ardour / ardour / region.h
index 60ccf6698465fed03fdb5b70f1e0d527022d95a6..2cf9bab97b6905c93cde04707811389b75efac2b 100644 (file)
@@ -89,20 +89,10 @@ class Region
                MusicTime
        };
 
-       static PBD::PropertyChange FadeChanged;
-       static PBD::PropertyChange SyncOffsetChanged;
-       static PBD::PropertyChange MuteChanged;
-       static PBD::PropertyChange OpacityChanged;
-       static PBD::PropertyChange LockChanged;
-       static PBD::PropertyChange LayerChanged;
-       static PBD::PropertyChange HiddenChanged;
-
-       PBD::Signal1<void,PBD::PropertyChange> StateChanged;
-       static PBD::Signal1<void,boost::shared_ptr<ARDOUR::Region> > RegionPropertyChanged;
-
-       void unlock_property_changes () { _no_property_changes = false; }
-       void block_property_changes () { _no_property_changes = true; }
-       
+       static PBD::Signal2<void,boost::shared_ptr<ARDOUR::Region>, const PBD::PropertyChange&> RegionPropertyChanged;
+
+        PBD::PropertyList* property_factory (const XMLNode&) const;
+
        virtual ~Region();
        
        /** Note: changing the name of a Region does not constitute an edit */
@@ -163,8 +153,7 @@ class Region
        void set_position_lock_style (PositionLockStyle ps);
        void recompute_position_from_lock_style ();
 
-       void freeze ();
-       void thaw ();
+       void suspend_property_changes ();
 
        bool covers (framepos_t frame) const {
                return first_frame() <= frame && frame <= last_frame();
@@ -199,6 +188,9 @@ class Region
        void trim_end (framepos_t new_position, void *src);
        void trim_to (framepos_t position, framecnt_t length, void *src);
 
+        void cut_front (nframes_t new_position, void *src);
+        void cut_end (nframes_t new_position, void *src);
+
        void set_layer (layer_t l); /* ONLY Playlist can call this */
        void raise ();
        void lower ();
@@ -281,8 +273,6 @@ class Region
   protected:
        friend class RegionFactory;
 
-       /** Construct a region from a single source */
-       Region (boost::shared_ptr<Source> src);
        /** Construct a region from multiple sources*/
        Region (const SourceList& srcs);
        /** Construct a region from another region, at an offset within that region */
@@ -292,19 +282,17 @@ class Region
        /** normal Region copy constructor */
        Region (boost::shared_ptr<const Region>);
 
-       /** Construct a region from 1 source and XML state */
-       Region (boost::shared_ptr<Source> src, const XMLNode&);
-       /** Construct a region from multiple sources and XML state */
-       Region (const SourceList& srcs, const XMLNode&);
-
        /** Constructor for derived types only */
        Region (Session& s, framepos_t start, framecnt_t length, const std::string& name, DataType);
 
   protected:
-       void send_change (PBD::PropertyChange);
+       void send_change (const PBD::PropertyChange&);
+        void mid_thaw (const PBD::PropertyChange&);
 
        void trim_to_internal (framepos_t position, framecnt_t length, void *src);
        virtual void set_position_internal (framepos_t pos, bool allow_bbt_recompute);
+        void modify_front (nframes_t new_position, bool reset_fade, void* src);
+        void modify_end (nframes_t new_position, bool reset_fade, void* src);
 
        void maybe_uncopy ();
        void first_edit ();
@@ -318,7 +306,6 @@ class Region
        virtual void recompute_at_end () = 0;
        
        DataType                _type;
-       bool                    _no_property_changes;
 
        PBD::Property<bool>        _muted;
        PBD::Property<bool>        _opaque;
@@ -346,14 +333,11 @@ class Region
        framepos_t              _last_position;
        PositionLockStyle       _positional_lock_style;
        mutable RegionEditState _first_edit;
-       int                     _frozen;
        BBT_Time                _bbt_time;
        AnalysisFeatureList     _transients;
        bool                    _valid_transients;
        mutable uint64_t        _read_data_count;  ///< modified in read()
-       PBD::PropertyChange             _pending_changed;
        uint64_t                _last_layer_op;  ///< timestamp
-       Glib::Mutex             _lock;
        SourceList              _sources;
        /** Used when timefx are applied, so we can always use the original source */
        SourceList              _master_sources;
@@ -365,7 +349,6 @@ class Region
 
        virtual int _set_state (const XMLNode&, int version, PBD::PropertyChange& what_changed, bool send_signal);
 
-       PBD::PropertyChange set_property (const PBD::PropertyBase&);
        void register_properties ();
 
 private: