commit d508c8badd0740247f7c9ba1d70d2d31bd8b702a
parent d1a70468d7c1991bd459cfecbfb3087861f23b51
Author: fundamental <mark.d.mccurry@gmail.com>
Date: Fri, 6 Nov 2015 18:05:47 -0500
Ext-GUI: Add Basic Command Line Args
Resolves https://sourceforge.net/p/zynaddsubfx/feature-requests/54/
Diffstat:
1 file changed, 28 insertions(+), 1 deletion(-)
diff --git a/src/UI/guimain.cpp b/src/UI/guimain.cpp
@@ -542,11 +542,38 @@ void watch_lo(void)
lo_server_recv_noblock(server, 100);
}
+const char *help_message =
+"zynaddsubfx-ext-gui [options] uri - Connect to remote ZynAddSubFX\n"
+" --help print this help message\n"
+" --no-uri run without a remote ZynAddSubFX\n"
+"\n"
+" example: zynaddsubfx-ext-gui osc.udp://localhost:1234/\n"
+" use the -P option for zynaddsubfx to specify the port of the backend\n";
+
#ifndef CARLA_VERSION_STRING
int main(int argc, char *argv[])
{
+ const char *uri = NULL;
+ bool help = false;
+ bool no_uri = false;
+ for(int i=1; i<argc; ++i) {
+ if(!strcmp("--help", argv[i]))
+ help = true;
+ else if(!strcmp("--no-uri", argv[i]))
+ no_uri = true;
+ else
+ uri = argv[i];
+ }
+ if(uri == NULL && no_uri == false)
+ help = true;
+
+ if(help) {
+ printf(help_message);
+ return 1;
+ }
+
//Startup Liblo Link
- if(argc == 2) {
+ if(uri) {
server = lo_server_new_with_proto(NULL, LO_UDP, liblo_error_cb);
lo_server_add_method(server, NULL, NULL, handler_function, 0);
sendtourl = argv[1];