blob: b510c7edbe6d88094f887e63360ff34642e09531 (
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 Slider {
public:
Slider(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<Slider> m_sliders;
Sequence& m_sequence;
Slider* m_activeSlider{ nullptr };
int m_dragStart{ 0 };
};
|