aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2012-11-13 04:07:47 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2012-11-13 04:07:47 +0000
commitbc634b8addc8752cca467846b07c177d9dea9337 (patch)
tree4e18165fcd12cf60057a7e25a1f8a33b4ccadfa7
parent3923990e6200aeddcd55c48833d72af9d5b1628f (diff)
make compatible with Pd < 0.43
svn path=/trunk/externals/jackx/; revision=16543
-rw-r--r--jack-connect.c40
-rw-r--r--libjackx.c2
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);
}