blob: b8b1f2baf161e3ddf80a06b8c844c1bb3c03d52c (
plain)
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
|
#pragma once
#include <vector>
#include "sequence.h"
struct SDL_Renderer;
class Knob {
public:
Knob(int x, int y, float* valuePtr, float scaling = 1.f)
: m_x(x), m_y(y), value(valuePtr), valueScaling(scaling) {}
void Draw(SDL_Renderer*);
bool InBounds(int x, int y);
float* value;
float valueScaling;
private:
int m_x, m_y;
};
class GUI {
public:
GUI(Sequence&);
void OnMouseDown(int x, int y);
void OnMouseUp();
void OnMouseMove(int x, int y);
void Repaint(SDL_Renderer*, int currentStep);
private:
std::vector<Knob> m_knobs;
Sequence& m_sequence;
Knob* m_activeKnob{ nullptr };
int m_dragStart{ 0 };
};
|