-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSpectrumSelection.h
54 lines (42 loc) · 1.3 KB
/
SpectrumSelection.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
#pragma once
#include "IControl.h"
class SpectrumSelection : public IControl
{
public:
SpectrumSelection(IPlugBase* pPlug, IRECT rect, int bandLowParam, int bandHighParam, IColor back, IColor select, IColor handle);
~SpectrumSelection();
virtual void OnMouseDown(int x, int y, IMouseMod* pMod) override;
virtual void OnMouseDrag(int x, int y, int dX, int dY, IMouseMod* pMod) override;
virtual void OnMouseUp(int x, int y, IMouseMod* pMod) override;
virtual bool Draw(IGraphics* pGraphics) override;
void SetAuxParamValueFromPlug(int auxParamIdx, double value) override;
private:
void DrawHandle(IGraphics* pGraphics, const IRECT& handle);
void SetParamFromHandle(const int paramIdx);
void SetHandleFromParam(const int paramIdx);
IColor backgroundColor;
IColor selectedColor;
IColor handleColor;
IRECT handles[3];
const int handleWidth;
// the param whose value we should change
enum DragParam
{
kDragNone = -1,
kDragLeft,
kDragRight,
kDragBoth
} dragParam;
// the min x-coord we can drag to
int dragMinX;
// the max x-coord we can drag to
int dragMaxX;
};
class SpectrumArrows : public IControl
{
public:
SpectrumArrows(IPlugBase* pPlug, IRECT rect, IColor color) : IControl(pPlug, rect), mColor(color) {}
bool Draw(IGraphics* pGraphics) override;
private:
IColor mColor;
};