This commit is contained in:
2026-06-14 15:34:51 -05:00
parent cfc8cb2b51
commit f4d855b36b
10 changed files with 58 additions and 26 deletions

View File

@@ -7,6 +7,9 @@
#include <cstdint>
#include <chrono>
#include "ConfigService.hpp"
#include "LoggerService.hpp"
enum NoteEventType {
NoteOn = 0,
NoteOff
@@ -22,7 +25,8 @@ struct NoteEvent {
class NoteQueue {
public:
NoteQueue() = default;
NoteQueue();
NoteQueue(ConfigService* config, LoggerService* logger);
~NoteQueue() = default;
bool push(const NoteEvent& event);
@@ -30,7 +34,10 @@ public:
private:
static constexpr size_t SYNTH_NOTE_QUEUE_SIZE = 128;
ConfigService* config_;
LoggerService* logger_;
static constexpr size_t SYNTH_NOTE_QUEUE_SIZE = 128; // TODO: config
std::array<NoteEvent, SYNTH_NOTE_QUEUE_SIZE> buffer_;
std::atomic<size_t> head_{ 0 };