From d2760bc7ec7845b4e11966d035a91e863efc21e8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 30 May 2015 18:15:59 +0000 Subject: Preliminary server-side save support. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5690 a436a847-0d15-0410-975c-d299462d15a1 --- src/ingen/ingen.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/ingen/ingen.cpp') 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(); + 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); -- cgit v1.2.1