signal ui is next!
This commit is contained in:
+4
-4
@@ -232,10 +232,10 @@ int main(){
|
|||||||
if(x < corner_tl.x && y < corner_tl.y) node_tl = n;
|
if(x < corner_tl.x && y < corner_tl.y) node_tl = n;
|
||||||
if(x > corner_br.x && y > corner_br.y) node_br = n;
|
if(x > corner_br.x && y > corner_br.y) node_br = n;
|
||||||
|
|
||||||
if(x < corner_tl.x) corner_tl.x = x;
|
if(x <= corner_tl.x) corner_tl.x = x;
|
||||||
if(x > corner_br.x) corner_br.x = x;
|
if(x >= corner_br.x) corner_br.x = x;
|
||||||
if(y < corner_tl.y) corner_tl.y = y;
|
if(y <= corner_tl.y) corner_tl.y = y;
|
||||||
if(y > corner_br.y) corner_br.y = y;
|
if(y >= corner_br.y) corner_br.y = y;
|
||||||
}
|
}
|
||||||
corner_tl -= Vec2Df(offset, offset);
|
corner_tl -= Vec2Df(offset, offset);
|
||||||
corner_br += Vec2Df(offset, offset);
|
corner_br += Vec2Df(offset, offset);
|
||||||
|
|||||||
+1
-1
@@ -45,7 +45,7 @@ namespace VISEQ::GRAPH::NODES {
|
|||||||
int midi_note_channel = 1;
|
int midi_note_channel = 1;
|
||||||
int midi_note = 48;
|
int midi_note = 48;
|
||||||
int midi_velocity = 60;
|
int midi_velocity = 60;
|
||||||
int midi_gate = 25; // gate time in milliseconds
|
int midi_gate = 10; // gate time in milliseconds
|
||||||
|
|
||||||
int midi_cc_channel = 0;
|
int midi_cc_channel = 0;
|
||||||
int midi_cc = 0;
|
int midi_cc = 0;
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ namespace VISEQ::BASE {
|
|||||||
Movable(Vec2Df p, Vec2Df d, float s) : speed(s), position(p), direction(d) {}
|
Movable(Vec2Df p, Vec2Df d, float s) : speed(s), position(p), direction(d) {}
|
||||||
Movable(Vec2Df p, float s) : speed(s), position(p) {}
|
Movable(Vec2Df p, float s) : speed(s), position(p) {}
|
||||||
|
|
||||||
float speed = 1.0f;
|
float speed = 960.0f;
|
||||||
|
|
||||||
Vec2Df position;
|
Vec2Df position;
|
||||||
Vec2Df direction;
|
Vec2Df direction;
|
||||||
|
|||||||
+2
-2
@@ -17,8 +17,8 @@ namespace VISEQ::GRAPH::NODES {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
Node() {}
|
Node() {}
|
||||||
Node(float x, float y) : Movable(Vec2Df(x, y), 0.0f) {}
|
Node(float x, float y) : Movable(Vec2Df(x, y), 960.0f) {}
|
||||||
Node(Vec2Df p) : Movable(p, 0.0f) {}
|
Node(Vec2Df p) : Movable(p, 960.0f) {}
|
||||||
|
|
||||||
NodeType nodeType;
|
NodeType nodeType;
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ namespace VISEQ::SIGNAL {
|
|||||||
|
|
||||||
Color color;
|
Color color;
|
||||||
|
|
||||||
|
bool ui_edit_speed = false;
|
||||||
|
|
||||||
int midi_note_offset = 0;
|
int midi_note_offset = 0;
|
||||||
int midi_cc_offset = 0;
|
int midi_cc_offset = 0;
|
||||||
|
|
||||||
|
|||||||
+1
-3
@@ -49,13 +49,11 @@ namespace VISEQ::APP {
|
|||||||
void copyNodesAndConnections(VEC_SPTR_Node nodes, Vec2Df position){
|
void copyNodesAndConnections(VEC_SPTR_Node nodes, Vec2Df position){
|
||||||
|
|
||||||
VEC_SPTR_Edge copy_connections;
|
VEC_SPTR_Edge copy_connections;
|
||||||
for(auto n : nodes){
|
for(auto c : gm.edges){
|
||||||
for(auto c : n->connections){
|
|
||||||
if(std::ranges::contains(nodes, c->start) && std::ranges::contains(nodes, c->end)) {
|
if(std::ranges::contains(nodes, c->start) && std::ranges::contains(nodes, c->end)) {
|
||||||
copy_connections.push_back(std::make_shared<Edge>(*c));
|
copy_connections.push_back(std::make_shared<Edge>(*c));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
std::cout << copy_connections.size() << std::endl;
|
std::cout << copy_connections.size() << std::endl;
|
||||||
|
|
||||||
for(auto old_node : nodes){
|
for(auto old_node : nodes){
|
||||||
|
|||||||
@@ -77,10 +77,13 @@ namespace VISEQ::APP::UI{
|
|||||||
for(auto &s : sm->signals){
|
for(auto &s : sm->signals){
|
||||||
if(GuiButton((Rectangle){20,(float)s_signal+70 + signal_configs*20, 20, 20},"X")) sm->removeSignal(s);
|
if(GuiButton((Rectangle){20,(float)s_signal+70 + signal_configs*20, 20, 20},"X")) sm->removeSignal(s);
|
||||||
DrawCircle(55, s_signal+80 + signal_configs*20, 6.0F, s->color);
|
DrawCircle(55, s_signal+80 + signal_configs*20, 6.0F, s->color);
|
||||||
float s_speed = round(s->speed);
|
|
||||||
|
int s_speed = round(s->speed);
|
||||||
s->multiplier = settings->bpm / 120.0f;
|
s->multiplier = settings->bpm / 120.0f;
|
||||||
float signal_bpm = round(settings->bpm * s->multiplier * (s->speed / settings->speed));
|
float signal_bpm = round(settings->bpm * s->multiplier * (s->speed / settings->speed));
|
||||||
GuiSlider((Rectangle){70, (float)s_signal+70 + signal_configs*20, 120, 20}, "", "", &s_speed, 1.0f, 16.0f * settings->grid * 4);
|
if(GuiSpinner((Rectangle){70, (float)s_signal+70 + signal_configs*20, 100, 20}, "", &s_speed, 1, 16 * settings->grid * 4, s->ui_edit_speed)) s->ui_edit_speed = !s->ui_edit_speed;
|
||||||
|
if(GuiButton((Rectangle){200,(float)s_signal+70 + signal_configs*20, 30, 20}, "1/2")) s_speed = settings->speed / 2;
|
||||||
|
//if(GuiButton((Rectangle){200,(float)s_signal+70 + signal_configs*20, 30, 20},"1/4")) s_speed = settings->speed / 4;
|
||||||
GuiLabel((Rectangle){195, (float)s_signal+70 + signal_configs*20, 30, 20}, std::format("{}",signal_bpm).c_str());
|
GuiLabel((Rectangle){195, (float)s_signal+70 + signal_configs*20, 30, 20}, std::format("{}",signal_bpm).c_str());
|
||||||
GuiToggle((Rectangle){240, (float)s_signal+70 + signal_configs*20, 20, 20},"P", &s->run);
|
GuiToggle((Rectangle){240, (float)s_signal+70 + signal_configs*20, 20, 20},"P", &s->run);
|
||||||
s->speed = s_speed;
|
s->speed = s_speed;
|
||||||
|
|||||||
Reference in New Issue
Block a user