From 900309993c485527145be4265247bd521073ee61 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 16 Feb 2009 18:08:22 +0000 Subject: Move duplicated AudioFileSource::Flags and SMFSource::Flags into Source. Clean up source stuff. git-svn-id: svn://localhost/ardour2/branches/3.0@4605 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/source.cc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'libs/ardour/source.cc') diff --git a/libs/ardour/source.cc b/libs/ardour/source.cc index f08d08b86e..aaae432570 100644 --- a/libs/ardour/source.cc +++ b/libs/ardour/source.cc @@ -34,10 +34,11 @@ #include #include #include +#include -#include #include #include +#include #include #include "i18n.h" @@ -45,13 +46,11 @@ using namespace std; using namespace ARDOUR; -Source::Source (Session& s, const string& name, DataType type) +Source::Source (Session& s, const string& name, DataType type, Flag flags) : SessionObject(s, name) , _type(type) + , _flags(flags) { - // not true.. is this supposed to be an assertion? - //assert(_name.find("/") == string::npos); - _analysed = false; _timestamp = 0; _length = 0; @@ -61,6 +60,7 @@ Source::Source (Session& s, const string& name, DataType type) Source::Source (Session& s, const XMLNode& node) : SessionObject(s, "unnamed source") , _type(DataType::AUDIO) + , _flags (Flag (Writable|CanRename)) { _timestamp = 0; _length = 0; @@ -85,6 +85,7 @@ Source::get_state () node->add_property ("name", _name); node->add_property ("type", _type.to_string()); + node->add_property (X_("flags"), enum_2_string (_flags)); _id.print (buf, sizeof (buf)); node->add_property ("id", buf); @@ -121,8 +122,12 @@ Source::set_state (const XMLNode& node) sscanf (prop->value().c_str(), "%ld", &_timestamp); } - // Don't think this is valid, absolute paths fail - //assert(_name.find("/") == string::npos); + if ((prop = node.property (X_("flags"))) != 0) { + _flags = Flag (string_2_enum (prop->value(), _flags)); + } else { + _flags = Flag (0); + + } return 0; } -- cgit v1.2.3