line_count_box.show ();
get_action_area()->add (line_count_box);
- get_action_area()->add (base_button);
- get_action_area()->add(collect_button);
- get_action_area()->add (autoscroll_button);
+
+ HBox* bbox = manage (new HBox);
+ bbox->add (base_button);
+ bbox->add (collect_button);
+ bbox->add (autoscroll_button);
+ bbox->show ();
+
+ get_action_area()->add (*bbox);
base_button.signal_toggled().connect (sigc::mem_fun (*this, &MidiTracer::base_toggle));
collect_button.signal_toggled().connect (sigc::mem_fun (*this, &MidiTracer::collect_toggle));
s = strftime (buf, bufsize, "%H:%M:%S", &now);
bufsize -= s;
- s = snprintf (&buf[s], bufsize, ".%-9" PRId64, (int64_t) tv.tv_usec);
+ s += snprintf (&buf[s], bufsize, ".%-9" PRId64, (int64_t) tv.tv_usec);
bufsize -= s;
switch ((eventType) msg[0]&0xf0) {
s += snprintf (&buf[s], bufsize, "%16s %02x\n", "Sysex", (int) msg[1]);
break;
}
- bufsize -= s;
+
} else {
- s += snprintf (&buf[s], bufsize, " %16s (%d) = [", "Sysex", (int) len);
+
+ s += snprintf (&buf[s], bufsize, "%16s (%d) = [", "Sysex", (int) len);
bufsize -= s;
- for (unsigned int i = 0; i < len && s < sizeof (buf)-3; ++i) {
+ for (unsigned int i = 0; i < len && bufsize > 3; ++i) {
if (i > 0) {
s += snprintf (&buf[s], bufsize, " %02x", msg[i]);
} else {
s += snprintf (&buf[s], bufsize, "%02x", msg[i]);
}
- bufsize = sizeof (buf) - s;
+ bufsize -= s;
}
s += snprintf (&buf[s], bufsize, "]\n");
}
fifo.write (&buf, 1);
if (!update_queued) {
- gui_context()->call_slot (boost::bind (&MidiTracer::update, this));
+ gui_context()->call_slot (invalidator (*this), boost::bind (&MidiTracer::update, this));
update_queued = true;
}
}