Set the revision mechanism independent from the VCS name
[ardour.git] / libs / ardour / ardour / region.h
index 788a8d90c914e586175e503d9fc9fa258f7c2ab3..eaa23cc8f6c014d792dcc48770b8c1c91a0adcc6 100644 (file)
@@ -45,6 +45,9 @@ namespace Properties {
        extern PBD::PropertyDescriptor<bool>              muted;
        extern PBD::PropertyDescriptor<bool>              opaque;
        extern PBD::PropertyDescriptor<bool>              locked;
+#ifdef WITH_VIDEOTIMELINE
+       extern PBD::PropertyDescriptor<bool>              video_locked;
+#endif
        extern PBD::PropertyDescriptor<bool>              automatic;
        extern PBD::PropertyDescriptor<bool>              whole_file;
        extern PBD::PropertyDescriptor<bool>              import;
@@ -141,6 +144,15 @@ class Region
        framepos_t first_frame () const { return _position; }
        framepos_t last_frame ()  const { return _position + _length - 1; }
 
+       /** Return the earliest possible value of _position given the
+        *  value of _start within the region's sources
+        */
+       framepos_t earliest_possible_position () const;
+       /** Return the last possible value of _last_frame given the
+        *  value of _startin the regions's sources
+        */
+       framepos_t latest_possible_frame () const;
+
        Evoral::Range<framepos_t> last_range () const {
                return Evoral::Range<framepos_t> (_last_position, _last_position + _last_length - 1);
        }
@@ -154,11 +166,14 @@ class Region
        bool opaque ()           const { return _opaque; }
        bool locked ()           const { return _locked; }
        bool position_locked ()  const { return _position_locked; }
+#ifdef WITH_VIDEOTIMELINE
+       bool video_locked ()     const { return _video_locked; }
+#endif
        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); }
-       bool can_move ()         const { return !_position_locked; }
+       bool can_move ()         const { return !_position_locked && !_locked; }
        bool sync_marked ()      const { return _sync_marked; }
        bool external ()         const { return _external; }
        bool import ()           const { return _import; }
@@ -191,6 +206,7 @@ class Region
        bool overlap_equivalent (boost::shared_ptr<const Region>) const;
        bool region_list_equivalent (boost::shared_ptr<const Region>) const;
        bool source_equivalent (boost::shared_ptr<const Region>) const;
+       bool any_source_equivalent (boost::shared_ptr<const Region>) const;
        bool uses_source (boost::shared_ptr<const Source>) const;
 
        std::string source_string () const;
@@ -230,6 +246,9 @@ class Region
        void set_automatic (bool yn);
        void set_opaque (bool yn);
        void set_locked (bool yn);
+#ifdef WITH_VIDEOTIMELINE
+       void set_video_locked (bool yn);
+#endif
        void set_position_locked (bool yn);
 
        int apply (Filter &, Progress* progress = 0);
@@ -382,6 +401,9 @@ class Region
        PBD::Property<bool>        _muted;
        PBD::Property<bool>        _opaque;
        PBD::Property<bool>        _locked;
+#ifdef WITH_VIDEOTIMELINE
+       PBD::Property<bool>        _video_locked;
+#endif
        PBD::Property<bool>        _automatic;
        PBD::Property<bool>        _whole_file;
        PBD::Property<bool>        _import;