Do not try to restore Route solo state after clearing all solo state
[ardour.git] / cfgtool / cfgtool.cc
1 #include <stdio.h>
2 #include <glib.h>
3
4 #include "pbd/xml++.h"
5 #include "ardour/rc_configuration.h"
6
7 using namespace ARDOUR;
8 using namespace std;
9
10 int main (int argc, char **argv) {
11         if (argc < 2) {
12                 fprintf(stderr, "Usage: %s [-h] <file-name>\n", argv[0]);
13                 return -1;
14         }
15
16         if (!strcmp (argv[1], "-h") || !strcmp (argv[1], "--help")) {
17                 fprintf(stdout, "Usage: %s <file-name>\n\n", argv[0]);
18                 fprintf(stdout, "Writes the default Ardour config to the given file\n");
19                 return 0;
20         }
21
22         g_setenv ("ARDOUR_DLL_PATH", "/xxx", 1);
23         g_setenv ("ARDOUR_CONFIG_PATH", "/xxx", 1);
24
25         if (!ARDOUR::init (false, true, "/xxx")) {
26                 fprintf(stderr, "Failed to initialize libardour\n");
27                 return -1;
28         }
29
30         RCConfiguration * rc = new RCConfiguration;
31         XMLNode& state = rc->get_state();
32
33         XMLNode* cfg = state.child ("Config");
34         cfg->remove_nodes_and_delete ("name", "donate-url");
35         cfg->remove_nodes_and_delete ("name", "osx_pingback-url");
36         cfg->remove_nodes_and_delete ("name", "linux-pingback-url");
37         cfg->remove_nodes_and_delete ("name", "updates-url");
38         cfg->remove_nodes_and_delete ("name", "freesound-download-dir"); // user specific
39
40         XMLNode* meta = state.child ("Metadata");
41         meta->remove_nodes ("user_name");
42
43         XMLTree tree;
44         tree.set_root (&state);
45
46         if (!tree.write (argv[1])) {
47                 fprintf(stderr, "Error saving config file '%s'\n", argv[1]);
48                 return -1;
49         }
50
51         return 0;
52 }
53
54
55 #include "ardour/vst_types.h"
56 int vstfx_init (void*) { return 0; }
57 void vstfx_exit () {}
58 void vstfx_destroy_editor (VSTState*) {}
59
60 #ifdef WINDOWS_VST_SUPPORT
61 extern "C" {
62 int        fst_init (void* possible_hmodule) { return -1;}
63 void       fst_exit (void) {}
64 VSTHandle* fst_load (const char*) { return 0; }
65 int        fst_unload (VSTHandle**) { return -1; }
66 VSTState * fst_instantiate (VSTHandle *, audioMasterCallback amc, void* userptr) { return 0; }
67 void       fst_close (VSTState *) {}
68 void       fst_audio_master_idle(void) {}
69 };
70 #endif