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{
|
namespace VISEQ::GRAPH{
|
||||||
enum GraphItemType {NODE, EDGE};
|
enum GraphItemType {NODE, EDGE};
|
||||||
enum NodeType {OSCNODE, MIDINODE};
|
enum NodeType {OSCNODE, MIDINODE, CONFIGNODE};
|
||||||
|
enum EdgeType {MIDIEDGE, CONFIGEDGE};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace VISEQ::MIDI{
|
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{
|
struct MidiOutPort{
|
||||||
libremidi::output_port port;
|
libremidi::output_port port;
|
||||||
int number;
|
int number;
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ namespace VISEQ::GRAPH::EDGES {
|
|||||||
std::shared_ptr<NODES::Node> start;
|
std::shared_ptr<NODES::Node> start;
|
||||||
std::shared_ptr<NODES::Node> end;
|
std::shared_ptr<NODES::Node> end;
|
||||||
|
|
||||||
|
EdgeType edgeType;
|
||||||
|
|
||||||
bool pass_forward = true;
|
bool pass_forward = true;
|
||||||
bool pass_backward = true;
|
bool pass_backward = true;
|
||||||
|
|
||||||
@@ -23,6 +25,9 @@ namespace VISEQ::GRAPH::EDGES {
|
|||||||
bool config = false;
|
bool config = false;
|
||||||
bool split = false;
|
bool split = false;
|
||||||
|
|
||||||
|
float speed = 0;
|
||||||
|
float bpm = 120.0f;
|
||||||
|
|
||||||
float connector_offset = 8.0f;
|
float connector_offset = 8.0f;
|
||||||
float switches_offset = 25.0f;
|
float switches_offset = 25.0f;
|
||||||
|
|
||||||
|
|||||||
@@ -99,13 +99,9 @@ namespace VISEQ::APP::UI{
|
|||||||
DrawFPS(20, settings->height - 30);
|
DrawFPS(20, settings->height - 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawPropertiesBar(){
|
void DrawCenteredText(std::string text, Vec2Df position, int size, Color color){
|
||||||
|
float offset = MeasureText(text.c_str(), size);
|
||||||
float left = settings->width - 280.f;
|
DrawText(text.c_str(), position.x-offset/2.0f, position.y-(float)size/2.0f+1, size, color );
|
||||||
|
|
||||||
GuiPanel((Rectangle){left,-30,280,(float)settings->height + 31}, "");
|
|
||||||
const int s_controls = 25;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawPerNodeConfig(Camera2D *camera){
|
void drawPerNodeConfig(Camera2D *camera){
|
||||||
|
|||||||
Reference in New Issue
Block a user