introduction of config nodes
This commit is contained in:
@@ -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;}
|
||||
|
||||
};
|
||||
}
|
||||
+37
-1
@@ -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;
|
||||
|
||||
@@ -15,6 +15,8 @@ namespace VISEQ::GRAPH::EDGES {
|
||||
|
||||
std::shared_ptr<NODES::Node> start;
|
||||
std::shared_ptr<NODES::Node> 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;
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace VISEQ::SIGNAL {
|
||||
}
|
||||
mutex->unlock();
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
inline void to_json(json& j, const SignalManager& G){
|
||||
|
||||
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user