diff options
author | David Robillard <d@drobilla.net> | 2009-02-17 02:11:49 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-02-17 02:11:49 +0000 |
commit | 022818b4a796f52c0a91eea42e65aec0bc7bed43 (patch) | |
tree | f82bde33d44c7b3e16af7e837536665e17fe0189 /libs/ardour/ardour/source.h | |
parent | 4565b73a3993b0cb5ccb9170e276180f2b5c1372 (diff) |
Fix the horrible mess that was anything related to sources and paths.
Most significant changes:
- Factor out FileSource from AudioFileSource, use for SMFSource too
- Explicitly pass embedded rather than mysterious name mangling or whatever
- Destroy a ton of duplicated or very-nearly-duplicated code
- Clean up and document all that weird source stuff in session.cc
git-svn-id: svn://localhost/ardour2/branches/3.0@4609 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/source.h')
-rw-r--r-- | libs/ardour/ardour/source.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/libs/ardour/ardour/source.h b/libs/ardour/ardour/source.h index 137aad5fbe..7b5fc43659 100644 --- a/libs/ardour/ardour/source.h +++ b/libs/ardour/ardour/source.h @@ -51,7 +51,7 @@ class Source : public SessionObject, public ARDOUR::Readable Destructive = 0x80 }; - Source (Session&, const std::string& name, DataType type, Flag flags=Flag(0)); + Source (Session&, DataType type, const std::string& name, Flag flags=Flag(0)); Source (Session&, const XMLNode&); virtual ~Source (); @@ -63,11 +63,12 @@ class Source : public SessionObject, public ARDOUR::Readable nframes_t length() const { return _length; } - virtual Glib::ustring path() const = 0; + virtual const Glib::ustring& path() const = 0; virtual nframes_t natural_position() const { return 0; } - virtual void mark_for_remove() = 0; + void mark_for_remove(); + virtual void mark_streaming_write_started () {} virtual void mark_streaming_write_completed () = 0; @@ -76,8 +77,10 @@ class Source : public SessionObject, public ARDOUR::Readable XMLNode& get_state (); int set_state (const XMLNode&); - virtual bool destructive() const { return false; } - virtual bool length_mutable() const { return false; } + bool destructive() const { return (_flags & Destructive); } + bool writable () const { return _flags & Writable; } + virtual bool set_destructive (bool yn) { return false; } + virtual bool length_mutable() const { return false; } void use () { _in_use++; } void disuse () { if (_in_use) { _in_use--; } } @@ -103,6 +106,11 @@ class Source : public SessionObject, public ARDOUR::Readable void update_length (nframes_t pos, nframes_t cnt); + int64_t timeline_position() const { return _timeline_position; } + virtual void set_timeline_position (int64_t pos); + + void set_allow_remove_if_empty (bool yn); + virtual const Evoral::TimeConverter<double, nframes_t>& time_converter() const { return Evoral::IdentityConverter<double, nframes_t>(); } @@ -114,7 +122,9 @@ class Source : public SessionObject, public ARDOUR::Readable Flag _flags; time_t _timestamp; nframes_t _length; + int64_t _timeline_position; bool _analysed; + mutable Glib::Mutex _lock; mutable Glib::Mutex _analysis_lock; Glib::Mutex _playlist_lock; |