"forward" port IO::ensure_* changes from 2.X for correctness and consistency
[ardour.git] / libs / ardour / ardour / source.h
index cb46e90085ad4abe4bf19225f6c35f9075034cd4..1dde32d7ef91c2bd65f6753f2b89085246436cdb 100644 (file)
@@ -64,8 +64,6 @@ class Source : public SessionObject
        virtual framecnt_t length (framepos_t pos) const = 0;
        virtual void       update_length (framepos_t pos, framecnt_t cnt) = 0;
 
-       virtual const Glib::ustring& path() const = 0;
-
        virtual framepos_t natural_position() const { return 0; }
 
        void mark_for_remove();
@@ -79,12 +77,11 @@ class Source : public SessionObject
        int set_state (const XMLNode&, int version);
 
        bool         destructive() const       { return (_flags & Destructive); }
-       bool         writable () const         { return (_flags & Writable); }
+       bool         writable () const;
        virtual bool set_destructive (bool /*yn*/) { return false; }
        virtual bool length_mutable() const    { return false; }
 
        static PBD::Signal1<void,Source*>             SourceCreated;
-       PBD::Signal1<void,boost::shared_ptr<Source> > Switched;
 
        bool has_been_analysed() const;
        virtual bool can_be_analysed() const { return false; }
@@ -97,29 +94,30 @@ class Source : public SessionObject
        std::string get_transients_path() const;
        int load_transients (const std::string&);
 
-       sframes_t    timeline_position() const { return _timeline_position; }
-       virtual void set_timeline_position (sframes_t pos);
+       framepos_t    timeline_position() const { return _timeline_position; }
+       virtual void set_timeline_position (framepos_t pos);
 
        void set_allow_remove_if_empty (bool yn);
 
        Glib::Mutex& mutex()       { return _lock; }
        Flag         flags() const { return _flags; }
 
-        virtual void inc_use_count ();
-        virtual void dec_use_count ();
-        int  use_count() const { return g_atomic_int_get (&_use_count); }
-        bool used() const { return use_count() > 0; }
+       virtual void inc_use_count ();
+       virtual void dec_use_count ();
+       int  use_count() const { return g_atomic_int_get (&_use_count); }
+       bool used() const { return use_count() > 0; }
+       uint32_t level() const { return _level; }
 
   protected:
        DataType            _type;
        Flag                _flags;
        time_t              _timestamp;
-       sframes_t           _timeline_position;
+       framepos_t          _timeline_position;
        bool                _analysed;
        mutable Glib::Mutex _lock;
        mutable Glib::Mutex _analysis_lock;
-       Glib::Mutex         _playlist_lock;
-        gint                _use_count; /* atomic */
+       gint                _use_count; /* atomic */
+       uint32_t            _level; /* how deeply nested is this source w.r.t a disk file */
 
   private:
        void fix_writable_flags ();