diff options
author | sletz <sletz@0c269be4-1314-0410-8aa9-9f06e86f4224> | 2008-08-28 09:40:25 +0000 |
---|---|---|
committer | sletz <sletz@0c269be4-1314-0410-8aa9-9f06e86f4224> | 2008-08-28 09:40:25 +0000 |
commit | 1b10f1876f37c3cc3e634014d5ac6b476b9686cf (patch) | |
tree | 0d86df2596a90d5e903687147a6aa694f6e0fa92 /tests | |
parent | 6c6264701c7974f0e786a6e19d13cb0df09fc0e8 (diff) | |
download | jack2-1b10f1876f37c3cc3e634014d5ac6b476b9686cf.tar.gz |
Improve jack_server_control.
git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2827 0c269be4-1314-0410-8aa9-9f06e86f4224
Diffstat (limited to 'tests')
-rw-r--r-- | tests/jack_server_control.cpp | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/tests/jack_server_control.cpp b/tests/jack_server_control.cpp index a624af95..754f0506 100644 --- a/tests/jack_server_control.cpp +++ b/tests/jack_server_control.cpp @@ -109,6 +109,15 @@ static void print_internal(jackctl_internal_t * internal) print_parameters(jackctl_internal_get_parameters(internal)); } +static void usage() +{ + fprintf (stderr, "\n" + "usage: jack_server_control \n" + " [ --driver OR -d driver_name ]\n" + " [ --client OR -c client_name ]\n" + ); +} + int main(int argc, char *argv[]) { jackctl_server_t * server; @@ -116,7 +125,30 @@ int main(int argc, char *argv[]) const JSList * internals; const JSList * node_ptr; sigset_t signals; - + int opt, option_index; + char* driver_name = "dummy"; + char* client_name = "audioadapter"; + + const char *options = "d:c:"; + struct option long_options[] = { + {"driver", 1, 0, 'd'}, + {"client", 1, 0, 'c'}, + }; + + while ((opt = getopt_long (argc, argv, options, long_options, &option_index)) != EOF) { + switch (opt) { + case 'd': + driver_name = optarg; + break; + case 'c': + client_name = optarg; + break; + default: + usage(); + exit(0); + } + } + server = jackctl_server_create(); printf("\n========================== \n"); @@ -141,8 +173,8 @@ int main(int argc, char *argv[]) node_ptr = jack_slist_next(node_ptr); } - jackctl_server_start(server, jackctl_server_get_driver(server, "dummy")); - jackctl_server_load_internal(server, jackctl_server_get_internal(server, "audioadapter")); + jackctl_server_start(server, jackctl_server_get_driver(server, driver_name)); + jackctl_server_load_internal(server, jackctl_server_get_internal(server, client_name)); signals = jackctl_setup_signals(0); jackctl_wait_signals(signals); |