-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFmSynth.h
44 lines (39 loc) · 1.32 KB
/
FmSynth.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#pragma once
#include "audioeffectx.h"
#include "FmVoice.h"
#include "common.h"
#include "Parameter.h"
#include "PresetManager.h"
#include "Settings.h"
#include <memory>
#include <mutex>
class FmSynth : public AudioEffectX
{
private:
char *chunk = nullptr;
std::vector<Parameter> parameters;
std::mutex voicesLock;
std::vector<FmVoice> voices;
PresetManager presetManager;
Settings settings;
int oversamplingFactor;
bool validParameter(int idx) { return idx >= 0 && idx < parameters.size(); }
public:
FmSynth(audioMasterCallback audioMaster);
~FmSynth();
VstInt32 getChunk(void **data, bool isPreset);
VstInt32 setChunk(void *data, VstInt32 byteSize, bool isPreset);
void processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames);
float getParameter(VstInt32 index);
void setParameter(VstInt32 index, float value);
void getParameterName(VstInt32 index, char *label);
void getParameterDisplay(VstInt32 index, char *text);
void getParameterLabel(VstInt32 index, char *label);
bool getEffectName(char *name);
bool getProductString(char *text);
bool getVendorString(char *text);
VstInt32 processEvents(VstEvents *events);
void open();
PresetManager *getPresetManager() { return &presetManager; }
void updateParameters(int num = -1);
};