state save/load working! signal pause/play button added, and speed control is now better.

This commit is contained in:
Sebastian
2024-11-04 01:00:59 +01:00
parent bfd8bb192e
commit 374efbe47c
10 changed files with 115 additions and 30 deletions
+7 -3
View File
@@ -12,7 +12,7 @@ namespace VISEQ::SIGNAL {
class Signal : public BASE::Movable{
public:
Signal();
Signal() {}
Signal(Vec2Df position, float r, float _speed, Color color) : Movable(position, Vec2Df(0,0), _speed), radius(r), color(color) {}
NODES::SPTR_Node next;
@@ -22,18 +22,22 @@ namespace VISEQ::SIGNAL {
NODES::SPTR_Node start;
bool at_target = false;
bool run = true;
float radius;
float radius = 8.0f;
float multiplier = 1.0f;
Color color;
int midi_note_offset = 0;
int midi_cc_offset = 0;
void update(double t_delta){
// 120px / 16th = 1920px / whole note
// whole note = 2s at 120bpm
// 960px / s
position += direction.norm() * speed * multiplier * (float)t_delta / 1000000.0f;
if(run) position += direction.norm() * speed * multiplier * (float)t_delta / 1000000.0f;
}
void draw(Vec2Df mouse, Camera2D cam) {