More UI tweaks and some refactoring. Nice!
This commit is contained in:
+89
-166
@@ -1,5 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "button.h"
|
||||||
#include "config-node.h"
|
#include "config-node.h"
|
||||||
#include "datatypes.h"
|
#include "datatypes.h"
|
||||||
#include "edge.h"
|
#include "edge.h"
|
||||||
@@ -31,13 +32,6 @@ namespace VISEQ::GRAPH::NODES {
|
|||||||
|
|
||||||
std::map<Handles, std::vector<std::shared_ptr<NodeHandle<int>>>> midiHandles;
|
std::map<Handles, std::vector<std::shared_ptr<NodeHandle<int>>>> midiHandles;
|
||||||
|
|
||||||
std::vector<std::shared_ptr<NodeHandle<int>>> midiNoteHandles;
|
|
||||||
std::vector<std::shared_ptr<NodeHandle<int>>> midiCCHandles;
|
|
||||||
std::vector<std::shared_ptr<NodeHandle<int>>> midiPCHandles;
|
|
||||||
std::vector<std::shared_ptr<NodeHandle<int>>> midiPitchBendHandles;
|
|
||||||
std::vector<std::shared_ptr<NodeHandle<int>>> midiAftertouchHandles;
|
|
||||||
std::vector<std::shared_ptr<NodeHandle<int>>> midiPolyPressureHandles;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
struct NodeMidiOut{
|
struct NodeMidiOut{
|
||||||
@@ -79,31 +73,29 @@ namespace VISEQ::GRAPH::NODES {
|
|||||||
float orbit_4 = orbit_3 + 20.0f;
|
float orbit_4 = orbit_3 + 20.0f;
|
||||||
float orbit_5 = orbit_4 + 30.0f;
|
float orbit_5 = orbit_4 + 30.0f;
|
||||||
|
|
||||||
//midiHandles[NOTE].emplace_back(std::make_shared<NodeHandle<int>>(midiNote.note, position, VS_COLOR_GREEN, "NOTE", orbit_5, 12));
|
midiHandles[NOTE].emplace_back(std::make_shared<NodeHandle<int>>(midiNote.note, position, VS_COLOR_GREEN, "NOTE", orbit_5, 12));
|
||||||
|
midiHandles[NOTE].emplace_back(std::make_shared<NodeHandle<int>>(midiNote.channel, position, VS_COLOR_PINK, "CHANNEL", orbit_1, 16, 1, 16, 40, 150));
|
||||||
|
midiHandles[NOTE].emplace_back(std::make_shared<NodeHandle<int>>(midiNote.gate, position, VS_COLOR_RED, "GATE", orbit_3, 30, 10, 30000, 40, 300));
|
||||||
|
midiHandles[NOTE].back()->logScale = true;
|
||||||
|
midiHandles[NOTE].emplace_back(std::make_shared<NodeHandle<int>>(midiNote.velocity, position, VS_COLOR_PURPLE, "VELOCITY", orbit_4, 32));
|
||||||
|
|
||||||
|
midiHandles[CC].emplace_back(std::make_shared<NodeHandle<int>>(midiCC.control, position, VS_COLOR_SUN, "CONTROL", orbit_3, 32));
|
||||||
|
midiHandles[CC].emplace_back(std::make_shared<NodeHandle<int>>(midiCC.channel, position, VS_COLOR_PINK, "CHANNEL", orbit_1, 1, 1, 16, 40, 150));
|
||||||
|
midiHandles[CC].emplace_back(std::make_shared<NodeHandle<int>>(midiCC.value, position, VS_COLOR_GREEN, "VALUE", orbit_4, 32));
|
||||||
|
|
||||||
|
midiHandles[PC].emplace_back(std::make_shared<NodeHandle<int>>(midiPC.program, position, VS_COLOR_SUN, "PROGRAM", orbit_3, 32));
|
||||||
|
midiHandles[PC].emplace_back(std::make_shared<NodeHandle<int>>(midiPC.channel, position, VS_COLOR_PINK, "CHANNEL", orbit_1, 1, 1, 16, 40, 150));
|
||||||
|
midiHandles[PC].emplace_back(std::make_shared<NodeHandle<int>>(midiPC.value, position, VS_COLOR_GREEN, "VALUE", orbit_4, 32));
|
||||||
|
|
||||||
midiNoteHandles.emplace_back(std::make_shared<NodeHandle<int>>(midiNote.note, position, VS_COLOR_GREEN, "NOTE", orbit_5, 12));
|
midiHandles[PB].emplace_back(std::make_shared<NodeHandle<int>>(midiPitchBend.channel, position, VS_COLOR_PINK, "CHANNEL", orbit_1, 1, 1, 16, 40, 150));
|
||||||
midiNoteHandles.emplace_back(std::make_shared<NodeHandle<int>>(midiNote.channel, position, VS_COLOR_PINK, "CHANNEL", orbit_1, 16, 1, 16, 40, 150));
|
midiHandles[PB].emplace_back(std::make_shared<NodeHandle<int>>(midiPitchBend.value, position, VS_COLOR_GREEN, "VALUE", orbit_3, 256, -8192, 8192, 40, 300));
|
||||||
midiNoteHandles.emplace_back(std::make_shared<NodeHandle<int>>(midiNote.gate, position, VS_COLOR_RED, "GATE", orbit_3, 30, 10, 30000, 40, 300));
|
|
||||||
midiNoteHandles.back()->logScale = true;
|
|
||||||
midiNoteHandles.emplace_back(std::make_shared<NodeHandle<int>>(midiNote.velocity, position, VS_COLOR_PURPLE, "VELOCITY", orbit_4, 32));
|
|
||||||
|
|
||||||
midiCCHandles.emplace_back(std::make_shared<NodeHandle<int>>(midiCC.control, position, VS_COLOR_SUN, "CONTROL", orbit_3, 32));
|
midiHandles[AT].emplace_back(std::make_shared<NodeHandle<int>>(midiAftertouch.channel, position, VS_COLOR_PINK, "CHANNEL", orbit_1, 1, 1, 16, 40, 150));
|
||||||
midiCCHandles.emplace_back(std::make_shared<NodeHandle<int>>(midiCC.channel, position, VS_COLOR_PINK, "CHANNEL", orbit_1, 1, 1, 16, 40, 150));
|
midiHandles[AT].emplace_back(std::make_shared<NodeHandle<int>>(midiAftertouch.value, position, VS_COLOR_GREEN, "VALUE", orbit_3, 32));
|
||||||
midiCCHandles.emplace_back(std::make_shared<NodeHandle<int>>(midiCC.value, position, VS_COLOR_GREEN, "VALUE", orbit_4, 32));
|
|
||||||
|
|
||||||
midiPCHandles.emplace_back(std::make_shared<NodeHandle<int>>(midiPC.program, position, VS_COLOR_SUN, "PROGRAM", orbit_3, 32));
|
midiHandles[PP].emplace_back(std::make_shared<NodeHandle<int>>(midiPolyPressure.channel, position, VS_COLOR_PINK, "CHANNEL", orbit_1, 1, 1, 16, 40, 150));
|
||||||
midiPCHandles.emplace_back(std::make_shared<NodeHandle<int>>(midiPC.channel, position, VS_COLOR_PINK, "CHANNEL", orbit_1, 1, 1, 16, 40, 150));
|
midiHandles[PP].emplace_back(std::make_shared<NodeHandle<int>>(midiPolyPressure.value, position, VS_COLOR_GREEN, "VALUE", orbit_4, 32));
|
||||||
midiPCHandles.emplace_back(std::make_shared<NodeHandle<int>>(midiPC.value, position, VS_COLOR_GREEN, "VALUE", orbit_4, 32));
|
midiHandles[PP].emplace_back(std::make_shared<NodeHandle<int>>(midiPolyPressure.note, position, VS_COLOR_SUN, "NOTE", orbit_5, 12));
|
||||||
|
|
||||||
midiPitchBendHandles.emplace_back(std::make_shared<NodeHandle<int>>(midiPitchBend.channel, position, VS_COLOR_PINK, "CHANNEL", orbit_1, 1, 1, 16, 40, 150));
|
|
||||||
midiPitchBendHandles.emplace_back(std::make_shared<NodeHandle<int>>(midiPitchBend.value, position, VS_COLOR_GREEN, "VALUE", orbit_3, 256, -8192, 8192, 40, 300));
|
|
||||||
|
|
||||||
midiAftertouchHandles.emplace_back(std::make_shared<NodeHandle<int>>(midiAftertouch.channel, position, VS_COLOR_PINK, "CHANNEL", orbit_1, 1, 1, 16, 40, 150));
|
|
||||||
midiAftertouchHandles.emplace_back(std::make_shared<NodeHandle<int>>(midiAftertouch.value, position, VS_COLOR_GREEN, "VALUE", orbit_3, 32));
|
|
||||||
|
|
||||||
midiPolyPressureHandles.emplace_back(std::make_shared<NodeHandle<int>>(midiPolyPressure.channel, position, VS_COLOR_PINK, "CHANNEL", orbit_1, 1, 1, 16, 40, 150));
|
|
||||||
midiPolyPressureHandles.emplace_back(std::make_shared<NodeHandle<int>>(midiPolyPressure.value, position, VS_COLOR_GREEN, "VALUE", orbit_4, 32));
|
|
||||||
midiPolyPressureHandles.emplace_back(std::make_shared<NodeHandle<int>>(midiPolyPressure.note, position, VS_COLOR_SUN, "NOTE", orbit_5, 12));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<MidiNode> getPtr(){
|
std::shared_ptr<MidiNode> getPtr(){
|
||||||
@@ -188,22 +180,22 @@ namespace VISEQ::GRAPH::NODES {
|
|||||||
void update() override {
|
void update() override {
|
||||||
Node::update();
|
Node::update();
|
||||||
mode = state->node_mode;
|
mode = state->node_mode;
|
||||||
for(auto mh : midiNoteHandles){
|
for(auto mh : midiHandles[NOTE]){
|
||||||
mh->update(position);
|
mh->update(position);
|
||||||
}
|
}
|
||||||
for(auto mh : midiCCHandles){
|
for(auto mh : midiHandles[CC]){
|
||||||
mh->update(position);
|
mh->update(position);
|
||||||
}
|
}
|
||||||
for(auto mh : midiPCHandles){
|
for(auto mh : midiHandles[PC]){
|
||||||
mh->update(position);
|
mh->update(position);
|
||||||
}
|
}
|
||||||
for(auto mh : midiPitchBendHandles){
|
for(auto mh : midiHandles[PB]){
|
||||||
mh->update(position);
|
mh->update(position);
|
||||||
}
|
}
|
||||||
for(auto mh : midiAftertouchHandles){
|
for(auto mh : midiHandles[AT]){
|
||||||
mh->update(position);
|
mh->update(position);
|
||||||
}
|
}
|
||||||
for(auto mh : midiPolyPressureHandles){
|
for(auto mh : midiHandles[PP]){
|
||||||
mh->update(position);
|
mh->update(position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -313,35 +305,11 @@ namespace VISEQ::GRAPH::NODES {
|
|||||||
|
|
||||||
void draw(Vec2Df mouse, Camera2D cam) override {
|
void draw(Vec2Df mouse, Camera2D cam) override {
|
||||||
Node::draw();
|
Node::draw();
|
||||||
for(auto mh : midiNoteHandles){
|
|
||||||
if(mode == 0) mh->unlock();
|
for(int i = 0; i < 6; ++i){
|
||||||
else mh->lock();
|
for(auto mh : midiHandles[(Handles)i]){
|
||||||
mh->draw();
|
mh->lock();
|
||||||
}
|
}
|
||||||
for(auto mh : midiCCHandles){
|
|
||||||
if(mode == 1) mh->unlock();
|
|
||||||
else mh->lock();
|
|
||||||
mh->draw();
|
|
||||||
}
|
|
||||||
for(auto mh : midiPCHandles){
|
|
||||||
if(mode == 2) mh->unlock();
|
|
||||||
else mh->lock();
|
|
||||||
mh->draw();
|
|
||||||
}
|
|
||||||
for(auto mh : midiPitchBendHandles){
|
|
||||||
if(mode == 3) mh->unlock();
|
|
||||||
else mh->lock();
|
|
||||||
mh->draw();
|
|
||||||
}
|
|
||||||
for(auto mh : midiAftertouchHandles){
|
|
||||||
if(mode == 4) mh->unlock();
|
|
||||||
else mh->lock();
|
|
||||||
mh->draw();
|
|
||||||
}
|
|
||||||
for(auto mh : midiPolyPressureHandles){
|
|
||||||
if(mode == 5) mh->unlock();
|
|
||||||
else mh->lock();
|
|
||||||
mh->draw();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(hovering() || selected) interact();
|
if(hovering() || selected) interact();
|
||||||
@@ -369,77 +337,61 @@ namespace VISEQ::GRAPH::NODES {
|
|||||||
if(distributionMode == Distribution::ROUNDROBIN) DrawCircle(position.x, position.y, radius/2.0f, VS_COLOR_YELLOW);
|
if(distributionMode == Distribution::ROUNDROBIN) DrawCircle(position.x, position.y, radius/2.0f, VS_COLOR_YELLOW);
|
||||||
|
|
||||||
if(selected) DrawCircleLinesV(position, radius+8, (Color){158, 255, 210, 255});
|
if(selected) DrawCircleLinesV(position, radius+8, (Color){158, 255, 210, 255});
|
||||||
|
bool modified = false;
|
||||||
/*if(fade > 0) DrawCircle(position.x, position.y, radius, ColorAlpha(VS_COLOR_RED, trigger_alpha));*/
|
if(mode >= 0 && mode < 6){
|
||||||
|
for(auto mh : midiHandles[(Handles)mode]){
|
||||||
if(KEYS_DOWN.alt){
|
mh->unlock();
|
||||||
float value = 0;
|
mh->draw();
|
||||||
int offset_gate = 0;
|
std::string text = "";
|
||||||
switch(mode){
|
if(mh->hovering() || mh->picked_up){
|
||||||
case 0:
|
text = std::format("{}", mh->assignedValueRef);
|
||||||
value = (float)getNotes().gate/1000.0f;
|
if(mh->name == "NOTE") text = MIDI::Notes[mh->assignedValueRef];
|
||||||
offset_gate = MeasureText(std::format("{:.2f}", value).c_str(), 12);
|
if(mh->name == "GATE") text = std::format("{:.2f}", mh->assignedValueRef / 1000.0f);
|
||||||
DrawText(std::format("{:.2f}",value).c_str(), position.x-offset_gate/2.0f, position.y-5, 12, WHITE );
|
if(mh->name == "VALUE" && (Handles)mode == PB) text = std::format("{}", round(((float)mh->assignedValueRef / 8192.0f) * 100));
|
||||||
break;
|
DrawCenteredText(text, position, 12, WHITE);
|
||||||
case 1:
|
modified = true;
|
||||||
value = (float)getCC().value;
|
}
|
||||||
offset_gate = MeasureText(std::format("{}", value).c_str(), 12);
|
|
||||||
DrawText(std::format("{}",value).c_str(), position.x-offset_gate/2.0f, position.y-5, 12, WHITE );
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
value = (float)getPitchBend().value;
|
|
||||||
offset_gate = MeasureText(std::format("{}", value).c_str(), 12);
|
|
||||||
DrawText(std::format("{}",value).c_str(), position.x-offset_gate/2.0f, position.y-5, 12, WHITE );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
switch(mode){
|
|
||||||
case 0:{
|
|
||||||
int offset = MeasureText(MIDI::Notes[(int)getNotes().note].c_str(), 12);
|
|
||||||
DrawText(MIDI::Notes[getNotes().note].c_str(), position.x-offset/2.0f, position.y-5, 12, WHITE );
|
|
||||||
break;}
|
|
||||||
case 1:{
|
|
||||||
int offset = MeasureText(std::format("{}", getCC().control).c_str(), 12);
|
|
||||||
DrawText(std::format("{}", getCC().control).c_str(), position.x-offset/2.0f, position.y-5, 12, WHITE );
|
|
||||||
break;}
|
|
||||||
case 2:{
|
|
||||||
int offset = MeasureText(std::format("{}", getPitchBend().value).c_str(), 12);
|
|
||||||
DrawText(std::format("{}", getPitchBend().value).c_str(), position.x-offset/2.0f, position.y-5, 12, WHITE );
|
|
||||||
break;}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!modified){
|
||||||
|
switch((Handles)mode){
|
||||||
|
case NOTE:{
|
||||||
|
DrawCenteredText(MIDI::Notes[getNotes().note], position, 12, WHITE);
|
||||||
|
break;}
|
||||||
|
case CC:{
|
||||||
|
DrawCenteredText(std::format("{}", getCC().value), position, 12, WHITE);
|
||||||
|
break;}
|
||||||
|
case PC:{
|
||||||
|
DrawCenteredText(std::format("{}", getPC().value), position, 12, WHITE);
|
||||||
|
break;}
|
||||||
|
case PB:{
|
||||||
|
DrawCenteredText(std::format("{}", round(((float)getPitchBend().value / 8192.0f) * 100)), position, 12, WHITE);
|
||||||
|
break;}
|
||||||
|
case AT:{
|
||||||
|
DrawCenteredText(std::format("{}", getAftertouch().value), position, 12, WHITE);
|
||||||
|
break;}
|
||||||
|
case PP:{
|
||||||
|
DrawCenteredText(std::format("{}", getPolyPressure().value), position, 12, WHITE);
|
||||||
|
break;}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if(highlighted) DrawCircleLinesV(position, radius+2, (Color){255, 0, 0, 200});
|
if(highlighted) DrawCircleLinesV(position, radius+2, (Color){255, 0, 0, 200});
|
||||||
//DrawText(std::format("{}", id).c_str(), position.x + 20.0f, position.y + 20.0f, 10, WHITE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
friend void to_json(json& j, const MidiNode& N){
|
friend void to_json(json& j, const MidiNode& N){
|
||||||
std::vector<int> conns;
|
std::vector<int> conns;
|
||||||
std::ranges::transform(N.connections.begin(), N.connections.end(), std::back_inserter(conns), [](VISEQ::GRAPH::EDGES::SPTR_Edge e){ return e->id;});
|
std::ranges::transform(N.connections.begin(), N.connections.end(), std::back_inserter(conns), [](VISEQ::GRAPH::EDGES::SPTR_Edge e){ return e->id;});
|
||||||
std::map<std::string, Vec2Df> noteHandles;
|
|
||||||
std::map<std::string, Vec2Df> CCHandles;
|
std::vector<std::vector<Vec2Df>> handles;
|
||||||
std::map<std::string, Vec2Df> PCHandles;
|
|
||||||
std::map<std::string, Vec2Df> pitchBendHandles;
|
|
||||||
std::map<std::string, Vec2Df> aftertouchHandles;
|
|
||||||
std::map<std::string, Vec2Df> polyPressureHandles;
|
|
||||||
|
|
||||||
for(auto i : N.midiNoteHandles){
|
for(auto i : N.midiHandles){
|
||||||
noteHandles.insert(std::make_pair(i->name, i->position));
|
handles.emplace_back();
|
||||||
}
|
for(auto n : i.second){
|
||||||
for(auto i : N.midiCCHandles){
|
handles.at(i.first).push_back(n->position);
|
||||||
CCHandles.insert(std::make_pair(i->name, i->position));
|
}
|
||||||
}
|
|
||||||
for(auto i : N.midiPCHandles){
|
|
||||||
PCHandles.insert(std::make_pair(i->name, i->position));
|
|
||||||
}
|
|
||||||
for(auto i : N.midiPitchBendHandles){
|
|
||||||
pitchBendHandles.insert(std::make_pair(i->name, i->position));
|
|
||||||
}
|
|
||||||
for(auto i : N.midiAftertouchHandles){
|
|
||||||
pitchBendHandles.insert(std::make_pair(i->name, i->position));
|
|
||||||
}
|
|
||||||
for(auto i : N.midiPolyPressureHandles){
|
|
||||||
polyPressureHandles.insert(std::make_pair(i->name, i->position));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
j = json{
|
j = json{
|
||||||
@@ -453,12 +405,7 @@ namespace VISEQ::GRAPH::NODES {
|
|||||||
{"midiPitchBend", N.midiPitchBend},
|
{"midiPitchBend", N.midiPitchBend},
|
||||||
{"midiAftertouch", N.midiAftertouch},
|
{"midiAftertouch", N.midiAftertouch},
|
||||||
{"midiPolyPressure", N.midiPolyPressure},
|
{"midiPolyPressure", N.midiPolyPressure},
|
||||||
{"midiNoteHandle", noteHandles},
|
{"handles", handles},
|
||||||
{"midiCCHandle", CCHandles},
|
|
||||||
{"midiPCHandle", PCHandles},
|
|
||||||
{"midiPitchBendHandle", pitchBendHandles},
|
|
||||||
{"midiAftertouchHandle", aftertouchHandles},
|
|
||||||
{"midiPolyPressureHandle", polyPressureHandles},
|
|
||||||
{"connections",conns}};
|
{"connections",conns}};
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -477,43 +424,19 @@ namespace VISEQ::GRAPH::NODES {
|
|||||||
j.at("midiAftertouch").get_to(N.midiAftertouch);
|
j.at("midiAftertouch").get_to(N.midiAftertouch);
|
||||||
j.at("midiPolyPressure").get_to(N.midiPolyPressure);
|
j.at("midiPolyPressure").get_to(N.midiPolyPressure);
|
||||||
|
|
||||||
std::map<std::string, Vec2Df> noteHandles;
|
std::vector<std::vector<Vec2Df>> handles;
|
||||||
std::map<std::string, Vec2Df> CCHandles;
|
|
||||||
std::map<std::string, Vec2Df> PCHandles;
|
|
||||||
std::map<std::string, Vec2Df> pitchBendHandles;
|
|
||||||
std::map<std::string, Vec2Df> aftertouchHandles;
|
|
||||||
std::map<std::string, Vec2Df> polyPressureHandles;
|
|
||||||
|
|
||||||
j.at("midiNoteHandle").get_to(noteHandles);
|
j.at("handles").get_to(handles);
|
||||||
j.at("midiCCHandle").get_to(CCHandles);
|
|
||||||
j.at("midiPCHandle").get_to(PCHandles);
|
|
||||||
j.at("midiPitchBendHandle").get_to(pitchBendHandles);
|
|
||||||
j.at("midiAftertouchHandle").get_to(aftertouchHandles);
|
|
||||||
j.at("midiPolyPressureHandle").get_to(polyPressureHandles);
|
|
||||||
|
|
||||||
N.midiNoteHandles[0]->position = noteHandles["NOTE"];
|
|
||||||
N.midiNoteHandles[1]->position = noteHandles["CHANNEL"];
|
|
||||||
N.midiNoteHandles[2]->position = noteHandles["GATE"];
|
|
||||||
N.midiNoteHandles[3]->position = noteHandles["VELOCITY"];
|
|
||||||
|
|
||||||
N.midiCCHandles[0]->position = CCHandles["CONTROL"];
|
|
||||||
N.midiCCHandles[1]->position = CCHandles["CHANNEL"];
|
|
||||||
N.midiCCHandles[2]->position = CCHandles["VALUE"];
|
|
||||||
|
|
||||||
N.midiPCHandles[0]->position = PCHandles["PROGRAM"];
|
int i = 0;
|
||||||
N.midiPCHandles[1]->position = PCHandles["CHANNEL"];
|
for(auto n : handles){
|
||||||
N.midiPCHandles[2]->position = PCHandles["VALUE"];
|
int j = 0;
|
||||||
|
for(auto nn : n){
|
||||||
N.midiPitchBendHandles[0]->position = pitchBendHandles["CHANNEL"];
|
N.midiHandles[(Handles)i][j]->position = nn;
|
||||||
N.midiPitchBendHandles[1]->position = pitchBendHandles["VALUE"];
|
j++;
|
||||||
|
}
|
||||||
N.midiAftertouchHandles[0]->position = aftertouchHandles["CHANNEL"];
|
i++;
|
||||||
N.midiAftertouchHandles[1]->position = aftertouchHandles["VALUE"];
|
}
|
||||||
|
|
||||||
N.midiPolyPressureHandles[0]->position = polyPressureHandles["CHANNEL"];
|
|
||||||
N.midiPolyPressureHandles[1]->position = polyPressureHandles["VALUE"];
|
|
||||||
N.midiPolyPressureHandles[2]->position = polyPressureHandles["NOTE"];
|
|
||||||
//j.at("connections").get_to(N.connections);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-7
@@ -1,5 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "button.h"
|
||||||
#include "datatypes.h"
|
#include "datatypes.h"
|
||||||
#include "draggable.h"
|
#include "draggable.h"
|
||||||
#include "graph-item.h"
|
#include "graph-item.h"
|
||||||
@@ -141,14 +142,17 @@ namespace VISEQ::GRAPH::NODES{
|
|||||||
DrawLineV(pos, pos1, dynGrey);
|
DrawLineV(pos, pos1, dynGrey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//DrawCircleLinesV(parentPosition, (parentPosition + position).dist(parentPosition), dynGrey);
|
|
||||||
float r = (parentPosition + position).dist(parentPosition);
|
float r = (parentPosition + position).dist(parentPosition);
|
||||||
DrawRing(parentPosition, r - 5, r + 5, 0, 360, 90, ColorAlpha(dyncol, 0.1));
|
DrawRing(parentPosition, r - 5, r + 5, 0, 360, 90, ColorAlpha(dyncol, 0.1));
|
||||||
DrawRing(parentPosition, r - 5, r + 5, -90, angle_g - 90, 90, ColorAlpha(dyncol, 0.3));
|
DrawRing(parentPosition, r - 5, r + 5, -90, angle_g - 90, 90, ColorAlpha(dyncol, 0.3));
|
||||||
DrawCircleV(position + parentPosition, radius, dyncol);
|
DrawCircleV(position + parentPosition, radius, dyncol);
|
||||||
VISEQ::HELPER::DrawSuperText(std::format("{}", assignedValueRef), position + parentPosition, position + parentPosition + Vec2Df(50,0), 1, 0, 8, dyncol);
|
//VISEQ::HELPER::DrawSuperText(std::format("{}", assignedValueRef), position + parentPosition, position + parentPosition + Vec2Df(50,0), 1, 0, 8, dyncol);
|
||||||
|
|
||||||
//if(show) VISEQ::HELPER::DrawSuperText(name, minP, maxP, 0.5f, 8.0f, 10.0f, dyncol);
|
/*if(show) {*/
|
||||||
|
/* std::string text = std::format("{}", assignedValueRef);*/
|
||||||
|
/* DrawCenteredText(text, parentPosition, 12, ColorBrightness(dyncol, 0.75f));*/
|
||||||
|
/*}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,9 +160,6 @@ namespace VISEQ::GRAPH::NODES{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*friend void to_json(json& j, const NodeHandle<T>& N){*/
|
|
||||||
/* j = json{{"position",N.position}};*/
|
|
||||||
/*}*/
|
|
||||||
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(NodeHandle, position, name);
|
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(NodeHandle, position, name);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user