|
@@ -21,7 +21,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|
|
#include <iostream> |
|
|
#include <iostream> |
|
|
#include <assert.h> |
|
|
#include <assert.h> |
|
|
#include <process.h> |
|
|
#include <process.h> |
|
|
#include <getopt.h> |
|
|
|
|
|
|
|
|
#include <getopt.h>
|
|
|
|
|
|
#include <signal.h> |
|
|
|
|
|
|
|
|
#include "JackServer.h" |
|
|
#include "JackServer.h" |
|
|
#include "JackConstants.h" |
|
|
#include "JackConstants.h" |
|
@@ -46,7 +47,9 @@ static int sync = 0; |
|
|
static int xverbose = 0; |
|
|
static int xverbose = 0; |
|
|
|
|
|
|
|
|
#define DEFAULT_TMP_DIR "/tmp" |
|
|
#define DEFAULT_TMP_DIR "/tmp" |
|
|
char *jack_tmpdir = DEFAULT_TMP_DIR; |
|
|
|
|
|
|
|
|
char *jack_tmpdir = DEFAULT_TMP_DIR;
|
|
|
|
|
|
|
|
|
|
|
|
HANDLE waitEvent; |
|
|
|
|
|
|
|
|
void jack_print_driver_options (jack_driver_desc_t * desc, FILE *file); |
|
|
void jack_print_driver_options (jack_driver_desc_t * desc, FILE *file); |
|
|
void jack_print_driver_param_usage (jack_driver_desc_t * desc, unsigned long param, FILE *file); |
|
|
void jack_print_driver_param_usage (jack_driver_desc_t * desc, unsigned long param, FILE *file); |
|
@@ -108,6 +111,13 @@ static int JackDelete() |
|
|
delete fServer; |
|
|
delete fServer; |
|
|
printf("Jackdmp: delete server\n"); |
|
|
printf("Jackdmp: delete server\n"); |
|
|
return 0; |
|
|
return 0; |
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void intrpt(int signum)
|
|
|
|
|
|
{
|
|
|
|
|
|
printf("jack main caught signal %d\n", signum);
|
|
|
|
|
|
(void) signal(SIGINT, SIG_DFL);
|
|
|
|
|
|
SetEvent(waitEvent);
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/* |
|
|
/* |
|
@@ -230,7 +240,13 @@ int main(int argc, char* argv[]) |
|
|
int sync = 0; |
|
|
int sync = 0; |
|
|
int i; |
|
|
int i; |
|
|
int rc; |
|
|
int rc; |
|
|
char c; |
|
|
|
|
|
|
|
|
char c;
|
|
|
|
|
|
|
|
|
|
|
|
// Creates wait event
|
|
|
|
|
|
if ((waitEvent = CreateEvent(NULL, FALSE, FALSE, NULL)) == NULL) {
|
|
|
|
|
|
printf("CreateEvent fails err = %ld", GetLastError());
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
opterr = 0; |
|
|
opterr = 0; |
|
|
while (!seen_driver && |
|
|
while (!seen_driver && |
|
@@ -383,18 +399,27 @@ int main(int argc, char* argv[]) |
|
|
printf("Cannot start server... exit\n"); |
|
|
printf("Cannot start server... exit\n"); |
|
|
JackDelete(); |
|
|
JackDelete(); |
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(void) signal(SIGINT, intrpt);
|
|
|
|
|
|
|
|
|
|
|
|
if ((res = WaitForSingleObject(waitEvent, INFINITE)) != WAIT_OBJECT_0) {
|
|
|
|
|
|
printf("WaitForSingleObject fails err = %ld", GetLastError());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
printf("Type 'q' to quit\n"); |
|
|
printf("Type 'q' to quit\n"); |
|
|
|
|
|
|
|
|
while ((c = getchar()) != 'q') {} |
|
|
|
|
|
|
|
|
while ((c = getchar()) != 'q') {}
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
JackStop(); |
|
|
JackStop(); |
|
|
|
|
|
|
|
|
jack_cleanup_shm(); |
|
|
jack_cleanup_shm(); |
|
|
// jack_cleanup_files(server_name); |
|
|
// jack_cleanup_files(server_name); |
|
|
jack_unregister_server(server_name); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jack_unregister_server(server_name);
|
|
|
|
|
|
|
|
|
|
|
|
CloseHandle(waitEvent); |
|
|
return 1; |
|
|
return 1; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|