MidiTracer::MidiTracer ()
: ArdourWindow (_("MIDI Tracer"))
- , parser (0)
, line_count_adjustment (200, 1, 2000, 1, 10)
, line_count_spinner (line_count_adjustment)
, line_count_label (_("Line history: "))
, autoscroll (true)
, show_hex (true)
- , collect (true)
, show_delta_time (false)
, _update_queued (0)
, fifo (1024)
if (mp) {
mp->self_parser().any.connect_same_thread (_parser_connection, boost::bind (&MidiTracer::tracer, this, _1, _2, _3));
+ mp->set_trace_on (true);
+ traced_port = mp;
}
} else {
MidiTracer::disconnect ()
{
_parser_connection.disconnect ();
+
+ if (traced_port) {
+ traced_port->set_trace_on (false);
+ traced_port.reset ();
+ }
}
void
case MIDI::pitchbend:
if (show_hex) {
- s += snprintf (&buf[s], bufsize, "%16s chn %2d %02x\n", "Pitch Bend", (msg[0]&0xf)+1, (int) msg[1]);
+ s += snprintf (&buf[s], bufsize, "%16s chn %2d %02x %02x\n", "Pitch Bend", (msg[0]&0xf)+1, (int) msg[1], (int) msg[2]);
} else {
- s += snprintf (&buf[s], bufsize, "%16s chn %2d %-3d\n", "Pitch Bend", (msg[0]&0xf)+1, (int) msg[1]);
+ s += snprintf (&buf[s], bufsize, "%16s chn %2d %-3d %-3d\n", "Pitch Bend", (msg[0]&0xf)+1, (int) msg[1], (int) msg[2]);
}
break;
// If you want to append more to the line, uncomment this first
// bufsize -= s;
+ assert(s <= buffer_size); // clang dead-assignment
+
fifo.write (&buf, 1);
if (g_atomic_int_get (const_cast<gint*> (&_update_queued)) == 0) {