blob: 9bd8545dc1a5175d381a4b25f6ac5322805c163d (
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
|
#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;
Knob* m_activeKnob{ nullptr };
int m_dragStart{ 0 };
};
|