36 lines
801 B
C++
36 lines
801 B
C++
|
|
#pragma once
|
|
|
|
#include "config/ConfigService.hpp"
|
|
#include "config/AudioConfig.hpp"
|
|
#include "LoggerService.hpp"
|
|
#include "Instruments/Instrument.hpp"
|
|
#include "WavetableLoader.hpp"
|
|
|
|
class InstrumentFactory {
|
|
|
|
public:
|
|
|
|
InstrumentFactory(ConfigService* config, LoggerService* logger);
|
|
~InstrumentFactory() = default;
|
|
|
|
int32_t createInstruments(std::vector<Instrument*>* instruments, size_t voiceCount, float sampleRate, AudioParams* params);
|
|
|
|
enum class InstrumentType {
|
|
Default,
|
|
PianoString,
|
|
WavetableOscillator
|
|
};
|
|
|
|
private:
|
|
|
|
Instrument* createInstrument(InstrumentType type, float sampleRate, AudioParams* params);
|
|
|
|
ConfigService* config_;
|
|
LoggerService* logger_;
|
|
|
|
// optional creators
|
|
WavetableLoader* wavetableLoader_ = nullptr;
|
|
|
|
};
|