summaryrefslogtreecommitdiff
path: root/libs/ardour/source.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-02-16 18:08:22 +0000
committerDavid Robillard <d@drobilla.net>2009-02-16 18:08:22 +0000
commit900309993c485527145be4265247bd521073ee61 (patch)
tree29360e453ffe3f7b4c099a199cb2d5d587d14580 /libs/ardour/source.cc
parent80e3845982659b796315a501268478c63ae2f21a (diff)
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
Diffstat (limited to 'libs/ardour/source.cc')
-rw-r--r--libs/ardour/source.cc19
1 files changed, 12 insertions, 7 deletions
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 <glibmm/fileutils.h>
#include <pbd/xml++.h>
#include <pbd/pthread_utils.h>
+#include <pbd/enumwriter.h>
-#include <ardour/source.h>
#include <ardour/playlist.h>
#include <ardour/session.h>
+#include <ardour/source.h>
#include <ardour/transient_detector.h>
#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;
}