diff --git a/src/config-node.h b/src/config-node.h new file mode 100644 index 0000000..62b35c2 --- /dev/null +++ b/src/config-node.h @@ -0,0 +1,19 @@ +#pragma once + +#include "datatypes.h" +#include "node.h" + +namespace VISEQ::GRAPH::NODES { + + class ConfigNode : public Node{ + + public: + NodeType nodeType = NodeType::CONFIGNODE; + + MIDI::MidiNote midiNote; + + + virtual NodeType getNodeType() const override {return nodeType;} + + }; +} diff --git a/src/datatypes.h b/src/datatypes.h index f708a10..71db971 100644 --- a/src/datatypes.h +++ b/src/datatypes.h @@ -49,11 +49,47 @@ namespace VISEQ::APP{ namespace VISEQ::GRAPH{ enum GraphItemType {NODE, EDGE}; - enum NodeType {OSCNODE, MIDINODE}; + enum NodeType {OSCNODE, MIDINODE, CONFIGNODE}; + enum EdgeType {MIDIEDGE, CONFIGEDGE}; } namespace VISEQ::MIDI{ + struct MidiNote{ + int channel = 1; + int note = 48; + int velocity = 60; + int gate = 10; // gate time in milliseconds + }; + + struct MidiCC{ + int channel = 0; + int control = 0; + int value = 0; + }; + + struct MidiPC{ + int channel = 0; + int program = 0; + int value = 0; + }; + + struct MidiPitchBend{ + int channel = 0; + int value = 0; + }; + + struct MidiAftertouch{ + int channel = 0; + int value = 0; + }; + + struct MidiPolyPressure{ + int channel = 0; + int note = 0; + int value = 0; + }; + struct MidiOutPort{ libremidi::output_port port; int number; diff --git a/src/edge.h b/src/edge.h index 82c05f8..87315aa 100644 --- a/src/edge.h +++ b/src/edge.h @@ -15,6 +15,8 @@ namespace VISEQ::GRAPH::EDGES { std::shared_ptr start; std::shared_ptr end; + + EdgeType edgeType; bool pass_forward = true; bool pass_backward = true; @@ -22,6 +24,9 @@ namespace VISEQ::GRAPH::EDGES { bool active = false; bool config = false; bool split = false; + + float speed = 0; + float bpm = 120.0f; float connector_offset = 8.0f; float switches_offset = 25.0f; diff --git a/src/signal-manager.h b/src/signal-manager.h index 33427c5..f4fb5d1 100644 --- a/src/signal-manager.h +++ b/src/signal-manager.h @@ -128,7 +128,7 @@ namespace VISEQ::SIGNAL { } mutex->unlock(); } - + }; inline void to_json(json& j, const SignalManager& G){ diff --git a/src/ui.h b/src/ui.h index 3651812..bbacbb9 100644 --- a/src/ui.h +++ b/src/ui.h @@ -98,14 +98,10 @@ namespace VISEQ::APP::UI{ DrawText(std::format("{}", gm->nodes.size()).c_str(), 20, settings->height - 70, 15, VS_COLOR_WHITE); DrawFPS(20, settings->height - 30); } - - void drawPropertiesBar(){ - - float left = settings->width - 280.f; - - GuiPanel((Rectangle){left,-30,280,(float)settings->height + 31}, ""); - const int s_controls = 25; - + + void DrawCenteredText(std::string text, Vec2Df position, int size, Color color){ + float offset = MeasureText(text.c_str(), size); + DrawText(text.c_str(), position.x-offset/2.0f, position.y-(float)size/2.0f+1, size, color ); } void drawPerNodeConfig(Camera2D *camera){