From acdc88f279760443dc7397290e9c4752af5b23c9 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 30 Nov 2009 13:16:38 +0000 Subject: attempt to remove confusion and errors caused by unclear semantics of _is_embedded for FileSources; member renamed _within_session, and is now ALWAYS determined by the _path of the FileSource, never by the creator git-svn-id: svn://localhost/ardour2/branches/3.0@6213 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/audiofilesource.h | 4 ++-- libs/ardour/ardour/coreaudiosource.h | 2 +- libs/ardour/ardour/file_source.h | 13 ++++++------- libs/ardour/ardour/session.h | 1 + libs/ardour/ardour/smf_source.h | 2 +- libs/ardour/ardour/sndfilesource.h | 4 ++-- libs/ardour/ardour/source_factory.h | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) (limited to 'libs/ardour/ardour') diff --git a/libs/ardour/ardour/audiofilesource.h b/libs/ardour/ardour/audiofilesource.h index 95c7db4385..6c04ebffb1 100644 --- a/libs/ardour/ardour/audiofilesource.h +++ b/libs/ardour/ardour/audiofilesource.h @@ -88,10 +88,10 @@ public: protected: /** Constructor to be called for existing external-to-session files */ - AudioFileSource (Session&, const Glib::ustring& path, bool embedded, Source::Flag flags); + AudioFileSource (Session&, const Glib::ustring& path, Source::Flag flags); /** Constructor to be called for new in-session files */ - AudioFileSource (Session&, const Glib::ustring& path, bool embedded, Source::Flag flags, + AudioFileSource (Session&, const Glib::ustring& path, Source::Flag flags, SampleFormat samp_format, HeaderFormat hdr_format); /** Constructor to be called for existing in-session files */ diff --git a/libs/ardour/ardour/coreaudiosource.h b/libs/ardour/ardour/coreaudiosource.h index 7720ca7395..c8de8304c2 100644 --- a/libs/ardour/ardour/coreaudiosource.h +++ b/libs/ardour/ardour/coreaudiosource.h @@ -50,7 +50,7 @@ class CoreAudioSource : public AudioFileSource { mutable CAAudioFile af; uint16_t n_channels; - void init (); + void init_cafile (); int safe_read (Sample*, nframes_t start, nframes_t cnt, AudioBufferList&) const; }; diff --git a/libs/ardour/ardour/file_source.h b/libs/ardour/ardour/file_source.h index 4b17881a0b..76c3c57e36 100644 --- a/libs/ardour/ardour/file_source.h +++ b/libs/ardour/ardour/file_source.h @@ -42,9 +42,9 @@ public: void mark_take (const Glib::ustring& id); void mark_immutable (); - const Glib::ustring& take_id () const { return _take_id; } - bool is_embedded () const { return _is_embedded; } - uint16_t channel() const { return _channel; } + const Glib::ustring& take_id () const { return _take_id; } + bool within_session () const { return _within_session; } + uint16_t channel() const { return _channel; } int set_state (const XMLNode&, int version); @@ -58,7 +58,7 @@ public: protected: FileSource (Session& session, DataType type, - const Glib::ustring& path, bool embedded, + const Glib::ustring& path, Source::Flag flags = Source::Flag(0)); FileSource (Session& session, const XMLNode& node, bool must_exist); @@ -66,8 +66,7 @@ protected: virtual int init (const Glib::ustring& idstr, bool must_exist); virtual int move_dependents_to_trash() { return 0; } - - void set_embedded_from_name(); + void set_within_session_from_path (const std::string&); bool removable () const; @@ -75,7 +74,7 @@ protected: Glib::ustring _take_id; bool _file_is_new; uint16_t _channel; - bool _is_embedded; + bool _within_session; static std::map search_paths; }; diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index bfbbabe877..da985d2ce7 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -252,6 +252,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable std::string name() const { return _name; } std::string snap_name() const { return _current_snapshot_name; } std::string raid_path () const; + bool path_is_within_session (const std::string&); void set_snap_name (); diff --git a/libs/ardour/ardour/smf_source.h b/libs/ardour/ardour/smf_source.h index 5ded3537e9..44080a8cff 100644 --- a/libs/ardour/ardour/smf_source.h +++ b/libs/ardour/ardour/smf_source.h @@ -37,7 +37,7 @@ template class MidiRingBuffer; class SMFSource : public MidiSource, public FileSource, public Evoral::SMF { public: /** Constructor for existing external-to-session files */ - SMFSource (Session& session, const Glib::ustring& path, bool embedded, + SMFSource (Session& session, const Glib::ustring& path, Source::Flag flags = Source::Flag(0)); /** Constructor for existing in-session files */ diff --git a/libs/ardour/ardour/sndfilesource.h b/libs/ardour/ardour/sndfilesource.h index 7983b2e340..45d535e916 100644 --- a/libs/ardour/ardour/sndfilesource.h +++ b/libs/ardour/ardour/sndfilesource.h @@ -30,10 +30,10 @@ namespace ARDOUR { class SndFileSource : public AudioFileSource { public: /** Constructor to be called for existing external-to-session files */ - SndFileSource (Session&, const Glib::ustring& path, bool embedded, int chn, Flag flags); + SndFileSource (Session&, const Glib::ustring& path, int chn, Flag flags); /* Constructor to be called for new in-session files */ - SndFileSource (Session&, const Glib::ustring& path, bool embedded, + SndFileSource (Session&, const Glib::ustring& path, SampleFormat samp_format, HeaderFormat hdr_format, nframes_t rate, Flag flags = SndFileSource::default_writable_flags); diff --git a/libs/ardour/ardour/source_factory.h b/libs/ardour/ardour/source_factory.h index 8d53a3c865..21af4ece75 100644 --- a/libs/ardour/ardour/source_factory.h +++ b/libs/ardour/ardour/source_factory.h @@ -45,11 +45,11 @@ class SourceFactory { nframes_t nframes, float sample_rate); static boost::shared_ptr createReadable (DataType type, Session&, - const std::string& path, bool embedded, + const std::string& path, int chn, Source::Flag flags, bool announce = true, bool async = false); static boost::shared_ptr createWritable (DataType type, Session&, - const std::string& path, bool embedded, + const std::string& path, bool destructive, nframes_t rate, bool announce = true, bool async = false); static Glib::Cond* PeaksToBuild; -- cgit v1.2.3