-
Notifications
You must be signed in to change notification settings - Fork 6
/
guitard.h
61 lines (52 loc) · 1.98 KB
/
guitard.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
#pragma once
const int kNumPrograms = 2;
#define SOUNDWOOFER_IMPL
#include "./thirdparty/soundwoofer/soundwoofer.h" // since winsocks does some weird stuff when being included after windows.h it needs to be included here though it's not used here
#include "IPlug_include_in_plug_hdr.h"
#include "./src/main/Graph.h"
#include "./src/ui/elements/GraphUi.h"
#include "./src/main/parameter/ParameterManager.h"
class GuitarD : public iplug::Plugin
{
// Each instance of a plugin has to have its own MessageBus
guitard::MessageBus::Bus mBus;
/** Is true when the plugin is ready to process samples (Knows the sample rate and in out channel count) */
bool mReady = false;
guitard::Graph* mGraph = nullptr;
guitard::GraphUi* mGraphUi = nullptr;
guitard::ParameterManager* mParamManager = nullptr;
public:
GuitarD(const iplug::InstanceInfo& info);
/**
* Called when the window closes to free all the resources allocated by the GUI
* The gui open function will be defined as a lambda inside the constructor of this class
* by setting mMakeGraphicsFunc
*/
void OnUIClose() override;
/**
* Called from the outside on a transport
* At least I think it will?
*/
void OnReset() override;
/**
* Called from outside when activated or deactivated
* This doesn't work the same on all DAWs
*/
void OnActivate(bool active) override;
/**
* Called from outside when a state needs to be saved
*/
bool SerializeState(iplug::IByteChunk& chunk) const override;
/**
* Called from outside with a byte chunk to load
*/
int UnserializeState(const iplug::IByteChunk& chunk, int startPos) override;
/**
* All DSP methods and member variables should be within an IPLUG_DSP guard, should you want distributed UI
* However this isn't really an option for this plugin in the current state since a lot of the UI relies on
* shared memory with the DSP
*/
#if IPLUG_DSP
void ProcessBlock(iplug::sample** inputs, iplug::sample** outputs, int nFrames) override;
#endif
};