From a6e5a26be2259605317ec6a29ea217b5a1b95392 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 21 Mar 2013 18:17:40 +0100 Subject: [PATCH] fluidsynth: improve debug --- ext/fluidsynth/gstfluidsynth.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/ext/fluidsynth/gstfluidsynth.c b/ext/fluidsynth/gstfluidsynth.c index a62515c..3f6b0c1 100644 --- a/ext/fluidsynth/gstfluidsynth.c +++ b/ext/fluidsynth/gstfluidsynth.c @@ -275,23 +275,24 @@ static void handle_buffer (GstFluidsynth * fluidsynth, GstBuffer * buffer) { GstMapInfo info; - guint8 event, channel; + guint8 event; gst_buffer_map (buffer, &info, GST_MAP_READ); event = info.data[0]; - channel = event & 0x0f; - - GST_DEBUG_OBJECT (fluidsynth, "event 0x%02x channel %d", event, channel); switch (event & 0xf0) { case 0xf0: switch (event) { case 0xff: + GST_DEBUG_OBJECT (fluidsynth, "system reset"); fluid_synth_system_reset (fluidsynth->synth); break; case 0xf0: case 0xf7: + GST_DEBUG_OBJECT (fluidsynth, "sysex 0x%02x", event); + GST_MEMDUMP_OBJECT (fluidsynth, "bytes ", info.data + 1, + info.size - 1); fluid_synth_sysex (fluidsynth->synth, (char *) info.data + 1, info.size - 1, NULL, NULL, NULL, 0); @@ -303,11 +304,16 @@ handle_buffer (GstFluidsynth * fluidsynth, GstBuffer * buffer) break; default: { - guint8 p1, p2; + guint8 channel, p1, p2; + + channel = event & 0x0f; p1 = info.size > 1 ? info.data[1] & 0x7f : 0; p2 = info.size > 2 ? info.data[2] & 0x7f : 0; + GST_DEBUG_OBJECT (fluidsynth, "event 0x%02x channel %d, 0x%02x 0x%02x", + event, channel, p1, p2); + switch (event & 0xf0) { case 0x80: fluid_synth_noteoff (fluidsynth->synth, channel, p1); -- 2.7.4