From bc634b8addc8752cca467846b07c177d9dea9337 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 13 Nov 2012 04:07:47 +0000 Subject: make compatible with Pd < 0.43 svn path=/trunk/externals/jackx/; revision=16543 --- jack-connect.c | 40 +++++++++++++++++++++++++++++++++++----- libjackx.c | 2 +- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/jack-connect.c b/jack-connect.c index 689367d..aac72ad 100644 --- a/jack-connect.c +++ b/jack-connect.c @@ -62,7 +62,13 @@ static void jackconnect_connect(t_jackconnect *x) if (jc) { jackconnect_getnames(x); - logpost(x, 3, "connecting %s with %s", x->source, x->destination); +#if PD_MAJOR_VERSION == 0 && PD_MINOR_VERSION < 43 + // Pd < 0.43 doesn't have logpost() + post( +#else + logpost(x, 3, +#endif + "connecting %s with %s", x->source, x->destination); if (!jack_connect(jc, x->source, x->destination)) { x->connected = 1; @@ -81,7 +87,13 @@ static void jackconnect_disconnect(t_jackconnect *x) x->connected = 0; outlet_float(x->x_obj.ob_outlet, x->connected); } - logpost(x, 3, "disconnecting %s with %s", x->source, x->destination); +#if PD_MAJOR_VERSION == 0 && PD_MINOR_VERSION < 43 + // Pd < 0.43 doesn't have logpost() + post( +#else + logpost(x, 3, +#endif + "disconnecting %s with %s", x->source, x->destination); } } @@ -90,7 +102,13 @@ static void jackconnect_toggle(t_jackconnect *x) if (jc) { jackconnect_getnames(x); - logpost(x, 3, "toggling connection %s with %s", x->source, x->destination); +#if PD_MAJOR_VERSION == 0 && PD_MINOR_VERSION < 43 + // Pd < 0.43 doesn't have logpost() + post( +#else + logpost(x, 3, +#endif + "toggling connection %s with %s", x->source, x->destination); if (jack_disconnect(jc, x->source, x->destination)) { jack_connect(jc, x->source, x->destination); @@ -111,7 +129,13 @@ static void jackconnect_query(t_jackconnect *x) const char **ports; int n=0; jackconnect_getnames(x); - logpost(x, 3, "querying connection %s with %s", x->source, x->destination); +#if PD_MAJOR_VERSION == 0 && PD_MINOR_VERSION < 43 + // Pd < 0.43 doesn't have logpost() + post( +#else + logpost(x, 3, +#endif + "querying connection %s with %s", x->source, x->destination); ports = jack_port_get_all_connections(jc,(jack_port_t *)jack_port_by_name(jc, x->source)); x->connected = 0; @@ -120,7 +144,13 @@ static void jackconnect_query(t_jackconnect *x) { while (ports[n]) { - logpost(x, 4, "n = %i", n); +#if PD_MAJOR_VERSION == 0 && PD_MINOR_VERSION < 43 + // Pd < 0.43 doesn't have logpost() + post( +#else + logpost(x, 4, +#endif + "n = %i", n); if (!strcmp(ports[n], x->destination)) { x->connected = 1; diff --git a/libjackx.c b/libjackx.c index f576e83..3f86f20 100644 --- a/libjackx.c +++ b/libjackx.c @@ -35,7 +35,7 @@ jack_client_t * jackx_get_jack_client() } if (status) { if (status & JackServerStarted) { - logpost(NULL, 4, "jackx: started server"); + verbose(1, "jackx: started server"); } else { error("jackx: server returned status %d", status); } -- cgit v1.2.1