scaffold new classes
This commit is contained in:
35
src/synth/Synth.hpp
Normal file
35
src/synth/Synth.hpp
Normal file
@@ -0,0 +1,35 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ConfigService.hpp"
|
||||
#include "LoggerService.hpp"
|
||||
#include "NoteQueue.hpp"
|
||||
#include "Voice.hpp"
|
||||
#include "Scope.hpp"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class Synth {
|
||||
|
||||
public:
|
||||
|
||||
Synth(ConfigService* config, LoggerService* logger, ScopeBuffer* scope);
|
||||
~Synth();
|
||||
|
||||
void process(float* out, size_t nFrames, uint32_t sampleRate);
|
||||
void handleNoteEvent(const NoteEvent& event);
|
||||
|
||||
private:
|
||||
|
||||
Voice* findFreeVoice();
|
||||
Voice* findVoiceByNote(uint8_t note);
|
||||
|
||||
std::vector<uint8_t> sustainedNotes_;
|
||||
|
||||
// voices
|
||||
static constexpr size_t MAX_VOICES = 32;
|
||||
std::array<Voice, MAX_VOICES> voices_;
|
||||
|
||||
ScopeBuffer* scope_ = nullptr;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user