diff options
author | Robin Gareus <robin@gareus.org> | 2015-03-22 22:15:37 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-03-22 22:15:37 +0100 |
commit | c7216e03f1fadfee66f5b378fcbe2be345831666 (patch) | |
tree | 65f478f01876e6b10d2c7ee11233d5757495f3ed /cfgtool/cfgtool.cc | |
parent | fd7f16ff7bc6f3d5ed5ba9131a880dc217ccd239 (diff) |
small tool to dump default config.
Diffstat (limited to 'cfgtool/cfgtool.cc')
-rw-r--r-- | cfgtool/cfgtool.cc | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/cfgtool/cfgtool.cc b/cfgtool/cfgtool.cc new file mode 100644 index 0000000000..5f39bd58b0 --- /dev/null +++ b/cfgtool/cfgtool.cc @@ -0,0 +1,39 @@ +#include <stdio.h> + +#include "pbd/pbd.h" +#include "pbd/xml++.h" +#include "ardour/rc_configuration.h" +#include "pbd/enumwriter.h" + +using namespace ARDOUR; +using namespace std; + +int main (int argc, char **argv) { + if (argc < 2) { + fprintf(stderr, "usage %s <file-name>\n", argv[0]); + return -1; + } + + setenv ("ARDOUR_DLL_PATH", "/xxx", 1); + setenv ("ARDOUR_CONFIG_PATH", "/xxx", 1); + + if (!ARDOUR::init (false, true, "/xxx")) { + fprintf(stderr, "Failed to initialize libardour\n"); + return -1; + } + + RCConfiguration * rc = new RCConfiguration; + XMLNode& state = rc->get_state(); + + // TODO strip some nodes here ? + + XMLTree tree; + tree.set_root (&state); + + if (!tree.write (argv[1])) { + fprintf(stderr, "Error saving config file '%s'\n", argv[1]); + return -1; + } + + return 0; +} |