-
Notifications
You must be signed in to change notification settings - Fork 3
/
Evaluator.h
68 lines (55 loc) · 1.79 KB
/
Evaluator.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//
// Evaluator.h
// Evaluator
//
// Originally created from an IPlug example project, modified by Damien Quartz.
//
#ifndef __EVALUATOR__
#define __EVALUATOR__
#include "IPlug_include_in_plug_hdr.h"
#include "Params.h"
#include "Program.h"
#include "Presets.h"
#include "IMidiQueue.h"
#include <vector>
class Interface;
class Evaluator : public IPlug
{
public:
Evaluator(IPlugInstanceInfo instanceInfo);
~Evaluator();
void Reset() override;
void OnParamChange(int paramIdx) override;
void ProcessDoubleReplacing(double** inputs, double** outputs, int nFrames) override;
void ProcessMidiMsg(IMidiMsg* pMsg) override;
// have to hook into the chunks so that we can include the contents of our text-entry boxes
bool SerializeState(ByteChunk* pChunk) override;
int UnserializeState(ByteChunk* pChunk, int startPos) override;
bool CompareState(const unsigned char* incomingState, int startPos) override;
// catch the About menu item to display what we wants in a box
bool HostRequestingAboutBox() override;
// get a string that represents the internal state of the program we want to display in the UI
const char * GetProgramState() const;
void SetWatchText(Interface* forInterface) const;
private:
void MakePresetFromData(const Presets::Data& data);
void SerializeOurState(ByteChunk* pChunk);
// the UI
Interface* mInterface;
// plug state
Program* mProgram;
int mProgramMemorySize;
// will be false if user input produced a compilation error.
// we want to keep track of this so we don't update the UI in ProcessDoubleReplacing.
bool mProgramIsValid;
TransportState mTransport;
double mGain;
int mBitDepth;
int mScopeUpdate;
RunMode mRunMode;
bool mMidiNoteResetsTick;
Program::Value mTick;
IMidiQueue mMidiQueue;
std::vector<IMidiMsg> mNotes;
};
#endif