More complete (but still incomplete) LV2 persist implementation.
[ardour.git] / libs / ardour / file_source.cc
index 7eac1a23ea2a10fa52845b109ad99536154f6aa2..84d4f3043fb7f4ffa7a2d935baed1c7d8fcd1b64 100644 (file)
@@ -54,11 +54,12 @@ using namespace Glib;
 
 PBD::Signal3<int,std::string,std::string,std::vector<std::string> > FileSource::AmbiguousFileName;
 
-FileSource::FileSource (Session& session, DataType type, const string& path, Source::Flag flag)
+FileSource::FileSource (Session& session, DataType type, const string& path, const string& origin, Source::Flag flag)
        : Source(session, type, path, flag)
        , _path(path)
        , _file_is_new(true)
        , _channel (0)
+        , _origin (origin)
 {
        set_within_session_from_path (path);
 }
@@ -102,13 +103,13 @@ FileSource::init (const string& pathstr, bool must_exist)
                 }
         }
 
-       set_within_session_from_path (pathstr);
+       set_within_session_from_path (_path);
 
         if (!within_session()) {
-                _session.ensure_search_path_includes (Glib::path_get_dirname (pathstr), _type);
+                _session.ensure_search_path_includes (Glib::path_get_dirname (_path), _type);
         }
 
-        _name = Glib::path_get_basename (pathstr);
+        _name = Glib::path_get_basename (_path);
 
        if (_file_is_new && must_exist) {
                return -1;
@@ -128,6 +129,10 @@ FileSource::set_state (const XMLNode& node, int /*version*/)
                _channel = 0;
        }
 
+        if ((prop = node.property (X_("origin"))) != 0) {
+                _origin = prop->value();
+        }
+
        return 0;
 }