Files
viseq/src/signal.h
T
2026-01-12 00:16:36 +01:00

51 lines
1.0 KiB
C++

#pragma once
#include <raylib.h>
#include "moveable.h"
#include "node.h"
#include "edge.h"
using namespace VISEQ::GRAPH;
namespace VISEQ::SIGNAL {
class Signal : public BASE::Movable{
public:
Signal() {}
Signal(Vec2Df position, float r, float _speed, Color color) : Movable(position, Vec2Df(0,0), _speed), radius(r), color(color) {}
NODES::WPTR_Node next;
NODES::WPTR_Node last;
EDGES::WPTR_Edge edge;
NODES::WPTR_Node start;
bool at_target = false;
bool run = true;
float radius = 8.0f;
float multiplier = 1.0f;
Color color;
bool ui_edit_speed = false;
int midi_note_offset = 0;
int midi_cc_offset = 0;
void reset();
void toStart();
void update(double t_delta);
void draw(Vec2Df mouse, Camera2D cam);
friend void to_json(json& j, const Signal& S);
friend void from_json(const json& j, Signal& S);
friend void to_json(json& j, const std::shared_ptr<Signal>& S);
friend void from_json(const json& j, std::shared_ptr<Signal>& S);
};
}