summaryrefslogtreecommitdiffstats
path: root/src/ingen
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-05-30 18:15:59 +0000
committerDavid Robillard <d@drobilla.net>2015-05-30 18:15:59 +0000
commitd2760bc7ec7845b4e11966d035a91e863efc21e8 (patch)
tree7e4121e2d8335ea0a0714d2e2e1bf738ff163e75 /src/ingen
parentecdcc5f2c3d98a551ff8e5ae6b546704bf6aa881 (diff)
downloadingen-d2760bc7ec7845b4e11966d035a91e863efc21e8.tar.gz
ingen-d2760bc7ec7845b4e11966d035a91e863efc21e8.tar.bz2
ingen-d2760bc7ec7845b4e11966d035a91e863efc21e8.zip
Preliminary server-side save support.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5690 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/ingen')
-rw-r--r--src/ingen/ingen.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/ingen/ingen.cpp b/src/ingen/ingen.cpp
index 24cfb029..164eded5 100644
--- a/src/ingen/ingen.cpp
+++ b/src/ingen/ingen.cpp
@@ -183,6 +183,22 @@ main(int argc, char** argv)
world, engine_interface.get(), graph, parent, symbol);
}
+ // Save the currently loaded graph
+ if (conf.option("save").is_valid()) {
+ const char* path = conf.option("save").ptr<char>();
+ if (serd_uri_string_has_scheme((const uint8_t*)path)) {
+ std::cout << "Saving to " << path << std::endl;
+ engine_interface->copy(Raul::Path("/"), Raul::URI(path));
+ } else {
+ SerdNode uri = serd_node_new_file_uri(
+ (const uint8_t*)path, NULL, NULL, true);
+ std::cout << "Saving to " << (const char*)uri.buf << std::endl;
+ engine_interface->copy(Raul::Path("/"),
+ Raul::URI((const char*)uri.buf));
+ serd_node_free(&uri);
+ }
+ }
+
// Set up signal handlers that will set quit_flag on interrupt
signal(SIGINT, ingen_interrupt);
signal(SIGTERM, ingen_interrupt);