diff options
author | David Robillard <d@drobilla.net> | 2008-12-02 05:49:41 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-12-02 05:49:41 +0000 |
commit | cb42d2cc4daa09c7d1db5515e39e94b9a5a43447 (patch) | |
tree | fa903dc4954836d0a3dbf4f6d43dc7c1b17784c4 /src/ingen/main.cpp | |
parent | 5c150e73611323d739cc4a29d7f6ba529f136f87 (diff) | |
download | ingen-cb42d2cc4daa09c7d1db5515e39e94b9a5a43447.tar.gz ingen-cb42d2cc4daa09c7d1db5515e39e94b9a5a43447.tar.bz2 ingen-cb42d2cc4daa09c7d1db5515e39e94b9a5a43447.zip |
Rewrite pretty much everything to do with paths in Serialiser to actually make an ounce of sense.
Fix various things with nested patches (fix tickets #286 #289).
Cascade successive pastes nicely.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1840 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/ingen/main.cpp')
-rw-r--r-- | src/ingen/main.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/ingen/main.cpp b/src/ingen/main.cpp index 51e98079..1861f212 100644 --- a/src/ingen/main.cpp +++ b/src/ingen/main.cpp @@ -242,9 +242,18 @@ main(int argc, char** argv) /* Load a patch */ if (args.load_given && engine_interface) { - Glib::ustring engine_base = "/"; - if (args.path_given) - engine_base = string(args.path_arg) + "/"; + boost::optional<Path> data_path; + boost::optional<Path> parent; + boost::optional<Symbol> symbol; + + const Glib::ustring path = (args.path_given ? args.path_arg : "/"); + if (Path::is_valid(path)) { + const Path p(path); + parent = p.parent(); + symbol = p.name(); + } else { + cerr << "Invalid path: '" << path << endl; + } bool found = false; if (!world->serialisation_module) @@ -269,7 +278,7 @@ main(int argc, char** argv) } engine_interface->load_plugins(); - parser->parse_document(world, engine_interface.get(), uri, engine_base, uri); + parser->parse_document(world, engine_interface.get(), uri, data_path, parent, symbol); } else { cerr << "Unable to load serialisation module, aborting." << endl; |