-
Notifications
You must be signed in to change notification settings - Fork 0
/
KnobLineCoronaControl.h
53 lines (41 loc) · 1.53 KB
/
KnobLineCoronaControl.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
#pragma once
#include "IControl.h"
#include "IGraphicsConstants.h"
#include "MidiMapper.h"
using namespace iplug;
using namespace igraphics;
class KnobLineCoronaControl : public IKnobControlBase
{
public:
KnobLineCoronaControl(IRECT pR, int paramIdx,
const IColor& lineColor, const IColor& coronaColor,
float lineThickness = 1.0f, double innerRadius = 0.0, double outerRadius = 0.0,
double minAngle = -0.75 * PI, double maxAngle = 0.75 * PI,
EDirection direction = EDirection::Vertical, double gearing = DEFAULT_GEARING);
void Draw(IGraphics& pGraphics) override;
void OnMouseDown(float x, float y, const IMouseMod& pMod) override;
void OnMouseDrag(float x, float y, float dX, float dY, const IMouseMod& pMod) override;
void OnMouseUp(float x, float y, const IMouseMod& pMod) override;
void OnMouseOver(float x, float y, const IMouseMod& pMod) override;
void OnMouseOut() override;
void SetLabelControl(ITextControl* control, const char * label, bool bShared = false);
void CreateContextMenu(IPopupMenu& contextMenu) override;
void OnContextSelection(int itemSelected) override;
void SetDirty(bool triggerAction = true, int valIdx = kNoValIdx) override;
private:
void ShowLabel();
void HideLabel();
void UpdateLabel();
float mCX, mCY;
bool mHasMouse;
IColor mColor;
IColor mCoronaColor;
float mLineThickness;
ITextControl* mLabelControl;
WDL_String mLabelString;
bool mSharedLabel;
double mInnerRadius;
double mOuterRadius;
double mMinAngle;
double mMaxAngle;
};