Commit 8dea08d2 authored by Stephane Letz's avatar Stephane Letz
Browse files

Tim Mayberry : Changes to get example-clients to build using MinGW compiler.

parent 2aa5773f
......@@ -95,9 +95,11 @@ int main(int argc, char *argv[])
exit(1);
}
#ifndef WIN32
signal(SIGQUIT, signal_handler);
signal(SIGTERM, signal_handler);
signal(SIGHUP, signal_handler);
#endif
signal(SIGTERM, signal_handler);
signal(SIGINT, signal_handler);
jack_on_shutdown(client, jack_shutdown, 0);
......
......@@ -29,6 +29,8 @@
#include <pthread.h>
#include <signal.h>
#include <getopt.h>
#include <inttypes.h>
#include <jack/jack.h>
#include <jack/ringbuffer.h>
......@@ -334,9 +336,11 @@ main (int argc, char *argv[])
setup_ports (argc - optind, &argv[optind], &thread_info);
/* install a signal handler to properly quits jack client */
signal(SIGQUIT, signal_handler);
signal(SIGTERM, signal_handler);
#ifndef WIN32
signal(SIGQUIT, signal_handler);
signal(SIGHUP, signal_handler);
#endif
signal(SIGTERM, signal_handler);
signal(SIGINT, signal_handler);
run_disk_thread (&thread_info);
......
......@@ -97,18 +97,19 @@ main (int argc, char *argv[])
return 1;
}
#ifdef WIN32
#ifndef WIN32
signal(SIGINT, signal_handler);
signal(SIGABRT, signal_handler);
signal(SIGTERM, signal_handler);
#else
signal(SIGQUIT, signal_handler);
signal(SIGTERM, signal_handler);
signal(SIGHUP, signal_handler);
signal(SIGINT, signal_handler);
#endif
signal(SIGABRT, signal_handler);
signal(SIGTERM, signal_handler);
#ifdef WIN32
Sleep(INFINITE);
#else
sleep (-1);
#endif
exit (0);
}
......@@ -69,9 +69,11 @@ main (int argc, char *argv[])
exit(1);
}
#ifndef WIN32
signal (SIGQUIT, signal_handler);
signal (SIGTERM, signal_handler);
signal (SIGHUP, signal_handler);
#endif
signal (SIGTERM, signal_handler);
signal (SIGINT, signal_handler);
jack_on_shutdown (client, jack_shutdown, 0);
......
......@@ -118,15 +118,21 @@ int main(int narg, char **args)
return 1;
}
/* install a signal handler to properly quits jack client */
signal(SIGQUIT, signal_handler);
signal(SIGTERM, signal_handler);
/* install a signal handler to properly quits jack client */
#ifndef WIN32
signal(SIGQUIT, signal_handler);
signal(SIGHUP, signal_handler);
#endif
signal(SIGTERM, signal_handler);
signal(SIGINT, signal_handler);
/* run until interrupted */
/* run until interrupted */
while (1) {
#ifdef WIN32
Sleep(1*1000);
#else
sleep(1);
#endif
};
jack_client_close(client);
......
......@@ -23,6 +23,7 @@
#include <string.h>
#include <signal.h>
#include <math.h>
#include <inttypes.h>
#include <jack/jack.h>
#include <jack/midiport.h>
......@@ -140,15 +141,21 @@ int main(int narg, char **args)
return 1;
}
/* install a signal handler to properly quits jack client */
signal(SIGQUIT, signal_handler);
signal(SIGTERM, signal_handler);
/* install a signal handler to properly quits jack client */
#ifndef WIN32
signal(SIGQUIT, signal_handler);
signal(SIGHUP, signal_handler);
#endif
signal(SIGTERM, signal_handler);
signal(SIGINT, signal_handler);
/* run until interrupted */
while(1) {
#ifdef WIN32
Sleep(1*1000);
#else
sleep(1);
#endif
}
jack_client_close(client);
exit (0);
......
......@@ -51,7 +51,12 @@ main (int argc, char *argv[])
jack_client_close (client);
return 1;
}
#ifdef WIN32
Sleep (30*1000);
#else
sleep (30);
#endif
if (jack_port_request_monitor_by_name (client, argv[1], FALSE)) {
fprintf (stderr, "could not disable monitoring for %s\n", argv[1]);
}
......
......@@ -70,9 +70,11 @@ int main(int argc, char *argv[])
exit(1);
}
#ifndef WIN32
signal(SIGQUIT, signal_handler);
signal(SIGTERM, signal_handler);
signal(SIGHUP, signal_handler);
#endif
signal(SIGTERM, signal_handler);
signal(SIGINT, signal_handler);
jack_on_shutdown(client, jack_shutdown, 0);
......
......@@ -130,9 +130,12 @@ int main(int argc, char *argv[])
exit(1);
}
#ifndef WIN32
signal(SIGQUIT, signal_handler);
signal(SIGTERM, signal_handler);
signal(SIGHUP, signal_handler);
#endif
signal(SIGTERM, signal_handler);
signal(SIGINT, signal_handler);
jack_on_shutdown(client, jack_shutdown, 0);
......
......@@ -19,6 +19,7 @@
#include <unistd.h>
#include <signal.h>
#include <stdlib.h>
#include <inttypes.h>
#include <jack/jack.h>
#include <jack/transport.h>
......@@ -86,9 +87,12 @@ main (int argc, char *argv[])
return 1;
}
#ifndef WIN32
signal (SIGQUIT, signal_handler);
signal (SIGTERM, signal_handler);
signal (SIGHUP, signal_handler);
#endif
signal (SIGTERM, signal_handler);
signal (SIGINT, signal_handler);
/* tell the JACK server to call `jack_shutdown()' if
......
......@@ -10,6 +10,7 @@
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include <jack/jack.h>
#include <jack/types.h>
......@@ -194,8 +195,11 @@ main (int argc, char *argv[])
/* keep running until until we get a quit event */
while (!simple_quit)
#ifdef WIN32
Sleep(1*1000);
#else
sleep(1);
#endif
jack_client_close (client);
exit (0);
......
......@@ -129,7 +129,11 @@ main(int argc, char *argv[])
}
// Wait a second, and repeat
#ifdef WIN32
Sleep(1*1000);
#else
sleep(1);
#endif
}
exit(0);
......
......@@ -63,6 +63,8 @@ def build(bld):
os_incdir = ['../macosx', '../posix']
if bld.env['IS_SUN']:
os_incdir = ['../solaris', '../posix']
if bld.env['IS_WINDOWS']:
os_incdir = ['../windows']
for example_program, example_program_source in list(example_programs.items()):
if example_program == 'jack_server_control':
use = ['serverlib', 'STDC++']
......@@ -121,6 +123,8 @@ def build(bld):
prog.use += ['RT', 'SNDFILE']
if bld.env['IS_SUN']:
prog.use += ['RT', 'SNDFILE']
if bld.env['IS_WINDOWS']:
prog.uselib = ['SNDFILE']
prog.target = 'jack_rec'
if bld.env['IS_LINUX'] or bld.env['IS_MACOSX']:
......@@ -149,7 +153,8 @@ def build(bld):
for example_lib, example_lib_source in list(example_libs.items()):
lib = bld(features = 'c cshlib')
lib.env['cshlib_PATTERN'] = '%s.so'
if not bld.env['IS_WINDOWS']:
lib.env['cshlib_PATTERN'] = '%s.so'
lib.includes = os_incdir + ['../common/jack', '../common']
lib.target = example_lib
lib.source = example_lib_source
......@@ -162,6 +167,6 @@ def build(bld):
lib.use = 'serverlib'
lib.install_path = '${ADDON_DIR}/'
bld.symlink_as('${PREFIX}/bin/jack_disconnect', 'jack_connect')
bld.install_files('${PREFIX}/bin', 'jack_control', chmod=0o755)
if not bld.env['IS_WINDOWS']:
bld.symlink_as('${PREFIX}/bin/jack_disconnect', 'jack_connect')
bld.install_files('${PREFIX}/bin', 'jack_control', chmod=0o755)
......@@ -35,14 +35,18 @@ process(jack_nframes_t nframes, void* arg)
if (count++ == 1000) {
printf("process block\n");
//while (1) {}
sleep(1);
#if WIN32
Sleep(1*1000);
#else
sleep(1);
#endif
}
return 0;
}
static void
shutdown (void *arg)
shutdown_handler (void *arg)
{
printf("shutdown \n");
running = 0;
......@@ -59,7 +63,7 @@ main (int argc, char *argv[])
}
jack_set_process_callback (client, process, NULL);
jack_on_shutdown(client, shutdown, NULL);
jack_on_shutdown(client, shutdown_handler, NULL);
output_port = jack_port_register (client, "port1", JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0);
/* tell the JACK server that we are ready to roll */
......@@ -71,7 +75,11 @@ main (int argc, char *argv[])
jack_connect(client, jack_port_name(output_port), "coreaudio:Built-in Audio:in2");
while (running) {
#if WIN32
Sleep(1*1000);
#else
sleep(1);
#endif
printf ("run\n");
}
......
......@@ -395,7 +395,7 @@ def build(bld):
if bld.env['IS_WINDOWS']:
bld.add_subdirs('windows')
#bld.add_subdirs('example-clients')
bld.add_subdirs('example-clients')
#bld.add_subdirs('tests')
if bld.env['BUILD_DOXYGEN_DOCS'] == True:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment