-
Notifications
You must be signed in to change notification settings - Fork 0
/
Interface.h
56 lines (41 loc) · 1.46 KB
/
Interface.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
#pragma once
#include "config.h"
#include "IGraphicsStructs.h"
#include "Params.h"
class PLUG_CLASS_NAME;
class KnobLineCoronaControl;
class PeaksControl;
class SnapshotControl;
namespace Minim
{
class MultiChannelBuffer;
}
namespace iplug
{
class IEditorDelegate;
}
using namespace iplug;
using namespace igraphics;
class Interface
{
public:
Interface(PLUG_CLASS_NAME* inPlug);
~Interface();
void CreateControls(IGraphics* pGraphics);
// called by the plug when a preset is loaded or saved
void OnPresetChanged();
// called by the plug when HandleAction is called with a snapshot index
void UpdateSnapshot(const int idx);
// called when the plug loads a new audio file
void RebuildPeaks(const Minim::MultiChannelBuffer& forSamples);
// used by Controls to initiate MIDILearn functionality in the Standalone
static void BeginMIDILearn(IEditorDelegate* plug, const int paramIdx1, const int paramIdx2, const int x, const int y);
private:
IControl* AttachEnum(IGraphics* pGraphics, IRECT rect, const int paramIdx, const char * label = nullptr);
IControl* AttachTextBox(IGraphics* pGraphics, IRECT rect, const int paramIdx, const float scrollSpeed, const char * maxValue, const char * label = nullptr);
KnobLineCoronaControl* AttachKnob(IGraphics* pGraphics, IRECT rect, const int paramIdx, const char * label = nullptr);
PLUG_CLASS_NAME* mPlug;
IControl* mPresetControl;
PeaksControl* mPeaksControl;
SnapshotControl* mSnapshotControls[kNoiseSnapshotCount];
};