From dfaf0bbab9e6d916fc5c79e3163446522df465f4 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sat, 14 Apr 2012 20:55:21 +0200 Subject: [PATCH] Added experimental utility for controlling jackd in the Ursarium --- Makefile | 10 ++++++ jt.c | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 Makefile create mode 100644 jt.c diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..110823b --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +JACK_CFLAGS:=$(shell pkg-config --cflags jack) +JACK_LIBS:=$(shell pkg-config --libs jack) + +CFLAGS=-O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -Wundef -Wredundant-decls -std=gnu99 $(JACK_CFLAGS) +LDLIBS=$(JACK_LIBS) + +all: jt + +clean: + rm -f `find . -name "*~" -or -name "*.[oa]" -or -name "\#*\#" -or -name TAGS -or -name core -or -name .depend -or -name .#*` diff --git a/jt.c b/jt.c new file mode 100644 index 0000000..3fa5558 --- /dev/null +++ b/jt.c @@ -0,0 +1,97 @@ +#include +#include +#include + +#include + +typedef jack_default_audio_sample_t sample_t; + +static jack_client_t *jc; +static jack_port_t *inport[2], *outport[4]; + +static int process_callback(jack_nframes_t nframes, void *arg __attribute__((unused))) +{ + for (int ch=0; ch<2; ch++) { + sample_t *in = jack_port_get_buffer(inport[ch], nframes); + sample_t *out = jack_port_get_buffer(outport[ch], nframes); + sample_t *out2 = jack_port_get_buffer(outport[2+ch], nframes); + for (jack_nframes_t i=0; i %s\n", a, b); + } + + puts("Running..."); + char xxx[16]; + read(0, xxx, sizeof(xxx)); + + puts("exiting"); + jack_client_close(jc); + return 0; +} -- 2.39.2