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&);
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() {}
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;
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);
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 ();