diff options
author | Roland Reichwein <mail@reichwein.it> | 2025-01-03 15:36:22 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2025-01-03 15:36:22 +0100 |
commit | 9de0b7f8937b7f6ce990132609f0b26851b31f2b (patch) | |
tree | a69f73358c9b75e5a11c9ed18d934964461360bf /MIDI.h | |
parent | 05895c86bddf50aacb3bb5e6a6bcc073965341ef (diff) |
Monitor CPU
Diffstat (limited to 'MIDI.h')
-rw-r--r-- | MIDI.h | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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;; } } |