summaryrefslogtreecommitdiffhomepage
path: root/MIDI.h
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2025-01-03 15:36:22 +0100
committerRoland Reichwein <mail@reichwein.it>2025-01-03 15:36:22 +0100
commit9de0b7f8937b7f6ce990132609f0b26851b31f2b (patch)
treea69f73358c9b75e5a11c9ed18d934964461360bf /MIDI.h
parent05895c86bddf50aacb3bb5e6a6bcc073965341ef (diff)
Monitor CPU
Diffstat (limited to 'MIDI.h')
-rw-r--r--MIDI.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/MIDI.h b/MIDI.h
index f0175bc..5ce050e 100644
--- a/MIDI.h
+++ b/MIDI.h
@@ -1,9 +1,12 @@
#pragma once
#include "config.h"
+#include "debug.h"
#include <boost/signals2.hpp>
+#include <fmt/format.h>
+
#include <iostream>
class MIDI
@@ -119,7 +122,7 @@ public:
if((ev->type == SND_SEQ_EVENT_NOTEON)
||(ev->type == SND_SEQ_EVENT_NOTEOFF)) {
const char *type = (ev->type == SND_SEQ_EVENT_NOTEON) ? "on " : "off";
- printf("[%d] Note %s: %2x vel(%2x), ch %2x\n", ((ev->flags & SND_SEQ_TIME_STAMP_MASK) == SND_SEQ_TIME_STAMP_REAL) ? ev->time.time.tv_sec : ev->time.tick,
+ debug_cout << fmt::format("[{}] Note {}: {:2x} vel({:2x}), ch {:2x}\n", ((ev->flags & SND_SEQ_TIME_STAMP_MASK) == SND_SEQ_TIME_STAMP_REAL) ? ev->time.time.tv_sec : ev->time.tick,
type,
ev->data.note.note,
ev->data.note.velocity,
@@ -132,17 +135,17 @@ public:
}
else if(ev->type == SND_SEQ_EVENT_CONTROLLER)
{
- printf("[%d] Control: %2x val(%2x)\n", ((ev->flags & SND_SEQ_TIME_STAMP_MASK) == SND_SEQ_TIME_STAMP_REAL) ? ev->time.time.tv_sec : ev->time.tick,
+ debug_cout << fmt::format("[{}] Control: {:2x} val({:2x})\n", ((ev->flags & SND_SEQ_TIME_STAMP_MASK) == SND_SEQ_TIME_STAMP_REAL) ? ev->time.time.tv_sec : ev->time.tick,
ev->data.control.param,
ev->data.control.value);
}
else if(ev->type == SND_SEQ_EVENT_CLOCK)
{
- printf("[%d] Clock\n", ((ev->flags & SND_SEQ_TIME_STAMP_MASK) == SND_SEQ_TIME_STAMP_REAL) ? ev->time.time.tv_sec : ev->time.tick);
+ debug_cout << fmt::format("[{}] Clock\n", ((ev->flags & SND_SEQ_TIME_STAMP_MASK) == SND_SEQ_TIME_STAMP_REAL) ? ev->time.time.tv_sec : ev->time.tick) << std::endl;;
}
else
{
- printf("[%d] Unknown: Unhandled Event Received\n", ev->time.tick);
+ debug_cout << fmt::format("[{}] Unknown: Unhandled Event Received\n", ev->time.tick) << std::endl;;
}
}