remove getter for Amp::_apply_automation_gain; reset member to false after use, and...
[ardour.git] / libs / ardour / ardour / source.h
index 5e851702d4114944e6a1ee40b80c873933575eeb..b269f6976d7a8aba9b08b0cb01a1953cf062dd1f 100644 (file)
@@ -36,7 +36,7 @@ namespace ARDOUR {
 
 class Session;
 
-class Source : public SessionObject
+class LIBARDOUR_API Source : public SessionObject
 {
   public:
        enum Flag {
@@ -47,9 +47,13 @@ class Source : public SessionObject
                RemovableIfEmpty = 0x10,
                RemoveAtDestroy = 0x20,
                NoPeakFile = 0x40,
-               Destructive = 0x80
+               Destructive = 0x80,
+               Empty = 0x100, /* used for MIDI only */
+               RF64_RIFF = 0x200,
        };
 
+       typedef Glib::Threads::Mutex::Lock Lock;
+
        Source (Session&, DataType type, const std::string& name, Flag flags=Flag(0));
        Source (Session&, const XMLNode&);
 
@@ -61,15 +65,15 @@ class Source : public SessionObject
        void stamp (time_t when) { _timestamp = when; }
 
        virtual bool       empty () const = 0;
-       virtual framecnt_t length (framepos_t pos) const = 0;
-       virtual void       update_length (framecnt_t cnt) = 0;
+       virtual samplecnt_t length (samplepos_t pos) const = 0;
+       virtual void       update_length (samplecnt_t cnt) = 0;
 
-       virtual framepos_t natural_position() const { return 0; }
+       virtual samplepos_t natural_position() const { return 0; }
 
        void mark_for_remove();
 
-       virtual void mark_streaming_write_started () {}
-       virtual void mark_streaming_write_completed () = 0;
+       virtual void mark_streaming_write_started (const Lock& lock) {}
+       virtual void mark_streaming_write_completed (const Lock& lock) = 0;
 
        virtual void session_saved() {}
 
@@ -78,7 +82,7 @@ class Source : public SessionObject
 
        bool         destructive() const       { return (_flags & Destructive); }
        bool         writable () const;
-       virtual bool set_destructive (bool /*yn*/) { return false; }
+
        virtual bool length_mutable() const    { return false; }
 
        static PBD::Signal1<void,Source*>             SourceCreated;
@@ -94,8 +98,8 @@ class Source : public SessionObject
        std::string get_transients_path() const;
        int load_transients (const std::string&);
 
-       framepos_t    timeline_position() const { return _timeline_position; }
-       virtual void set_timeline_position (framepos_t pos);
+       samplepos_t    timeline_position() const { return _timeline_position; }
+       virtual void set_timeline_position (samplepos_t pos);
 
        void set_allow_remove_if_empty (bool yn);
 
@@ -108,16 +112,20 @@ class Source : public SessionObject
        bool used() const { return use_count() > 0; }
        uint32_t level() const { return _level; }
 
+       std::string ancestor_name() { return _ancestor_name.empty() ? name() : _ancestor_name; }
+       void set_ancestor_name(const std::string& name) { _ancestor_name = name; }
+
   protected:
        DataType            _type;
        Flag                _flags;
        time_t              _timestamp;
-       framepos_t          _timeline_position;
+       samplepos_t          _timeline_position;
        bool                _analysed;
         mutable Glib::Threads::Mutex _lock;
         mutable Glib::Threads::Mutex _analysis_lock;
        gint                _use_count; /* atomic */
        uint32_t            _level; /* how deeply nested is this source w.r.t a disk file */
+       std::string         _ancestor_name;
 
   private:
        void fix_writable_flags ();