diff --git a/example-clients/Makefile.am b/example-clients/Makefile.am index d859395..dd64852 100644 --- a/example-clients/Makefile.am +++ b/example-clients/Makefile.am @@ -20,6 +20,7 @@ bin_PROGRAMS = jack_simple_client \ jack_showtime \ jack_midisine \ jack_midiseq \ + jack_latent_client \ $(JACKREC) if HAVE_SNDFILE @@ -62,6 +63,10 @@ jack_midisine_SOURCES = midisine.c jack_midisine_LDFLAGS = @OS_LDFLAGS@ jack_midisine_LDADD = $(top_builddir)/libjack/libjack.la +jack_latent_client_SOURCES = latent_client.c +jack_latent_client_LDFLAGS = @OS_LDFLAGS@ +jack_latent_client_LDADD = $(top_builddir)/libjack/libjack.la + if HAVE_SNDFILE jack_rec_SOURCES = capture_client.c jack_rec_LDFLAGS = @SNDFILE_LIBS@ @OS_LDFLAGS@ diff --git a/example-clients/latent_client.c b/example-clients/latent_client.c new file mode 100644 index 0000000..908ca29 --- /dev/null +++ b/example-clients/latent_client.c @@ -0,0 +1,209 @@ +/** @file simple_client.c + * + * @brief This simple client demonstrates the most basic features of JACK + * as they would be used by many applications. + */ + +#include +#include +#include +#include +#include + +#include + +jack_port_t *input_port; +jack_port_t *output_port; +jack_client_t *client; + +jack_default_audio_sample_t *delay_line; +jack_nframes_t delay_index; +jack_nframes_t latency = 1024; + +/** + * The process callback for this JACK application is called in a + * special realtime thread once for each audio cycle. + * + * This client does nothing more than copy data from its input + * port to its output port. It will exit when stopped by + * the user (e.g. using Ctrl-C on a unix-ish operating system) + */ +int +process (jack_nframes_t nframes, void *arg) +{ + jack_default_audio_sample_t *in, *out; + int k; + + in = jack_port_get_buffer (input_port, nframes); + out = jack_port_get_buffer (output_port, nframes); + + for (k=0; k