summaryrefslogtreecommitdiff
path: root/example-clients/connect.c
diff options
context:
space:
mode:
authorsletz <sletz@0c269be4-1314-0410-8aa9-9f06e86f4224>2010-04-19 09:34:11 +0000
committersletz <sletz@0c269be4-1314-0410-8aa9-9f06e86f4224>2010-04-19 09:34:11 +0000
commit478a646bda7881c0426fd321434b6b481fe73cf4 (patch)
treec88944ce5c1ccb2a85ba49fdc5a9d1eed3f6e9d6 /example-clients/connect.c
parentc25bfd89210c5029c1e0e13cce194a067a072e59 (diff)
downloadjack2-478a646bda7881c0426fd321434b6b481fe73cf4.tar.gz
Compiles on Windows again.
git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3989 0c269be4-1314-0410-8aa9-9f06e86f4224
Diffstat (limited to 'example-clients/connect.c')
-rw-r--r--example-clients/connect.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/example-clients/connect.c b/example-clients/connect.c
index 9080d336..635b2361 100644
--- a/example-clients/connect.c
+++ b/example-clients/connect.c
@@ -1,6 +1,6 @@
/*
Copyright (C) 2002 Jeremy Hall
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
@@ -50,7 +50,7 @@ main (int argc, char *argv[])
} else {
my_name ++;
}
-
+
printf("name %s\n", my_name);
if (strstr(my_name, "jack_disconnect")) {
@@ -76,10 +76,10 @@ main (int argc, char *argv[])
fprintf (stderr, "jack server not running?\n");
return 1;
}
-
+
jack_set_port_connect_callback(client, port_connect_callback, NULL);
- /* display the current sample rate. once the client is activated
+ /* display the current sample rate. once the client is activated
(see below), you should rely on your own sample rate
callback (see above) for this value.
*/
@@ -94,7 +94,7 @@ main (int argc, char *argv[])
fprintf (stderr, "ERROR %s not a valid port\n", argv[2]);
goto error;
}
-
+
/* tell the JACK server that we are ready to roll */
if (jack_activate (client)) {
@@ -118,16 +118,22 @@ main (int argc, char *argv[])
goto error;
}
}
-
+
// Wait for connection/disconnection to be effective
- while(!done) {usleep(100);}
-
+ while(!done) {
+ #ifdef WIN32
+ Sleep(10);
+ #else
+ usleep(10000);
+ #endif
+ }
+
jack_deactivate (client);
jack_client_close (client);
return 0;
-
+
error:
- if (client)
+ if (client)
jack_client_close (client);
return 1;
}