ControlNodes init. Feels like a good idea!
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
#pragma once
|
||||
|
||||
#include "node.h"
|
||||
|
||||
namespace VISEQ::GRAPH::NODES{
|
||||
|
||||
class ControlNode: public Node{
|
||||
public:
|
||||
ControlNode(){}
|
||||
|
||||
float radius = 6;
|
||||
|
||||
NodeType nodeType = NodeType::CONTROLNODE;
|
||||
|
||||
Vec2Df center;
|
||||
|
||||
std::shared_ptr<ControlNode> getPtr(){
|
||||
return std::static_pointer_cast<ControlNode>(shared_from_this());
|
||||
}
|
||||
|
||||
virtual GRAPH::GraphItemType getType() override {
|
||||
return GraphItemType::NODE;
|
||||
}
|
||||
|
||||
virtual NodeType getNodeType() const override {return nodeType;}
|
||||
|
||||
virtual bool hovering() override {
|
||||
return CheckCollisionPointCircle(SCREEN_MOUSE, position, radius);
|
||||
}
|
||||
|
||||
virtual void update() override {
|
||||
Node::update();
|
||||
}
|
||||
|
||||
virtual void draw() override {
|
||||
DrawCircleV(position, radius, VS_COLOR_SUN);
|
||||
}
|
||||
|
||||
virtual bool select() override {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
+1
-1
@@ -35,7 +35,7 @@ namespace VISEQ::GRAPH::NODES {
|
||||
|
||||
namespace VISEQ::GRAPH{
|
||||
enum GraphItemType {NODE, EDGE, CONNECTOR, CANVAS, HANDLE, VS_BUTTON};
|
||||
enum NodeType {OSCNODE, MIDINODE, CONFIGNODE};
|
||||
enum NodeType {OSCNODE, MIDINODE, CONFIGNODE, CONTROLNODE};
|
||||
enum EdgeType {MIDIEDGE, CONFIGEDGE};
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "button.h"
|
||||
#include "config-node.h"
|
||||
#include "control-node.h"
|
||||
#include "datatypes.h"
|
||||
#include "edge.h"
|
||||
#include "node.h"
|
||||
@@ -9,6 +10,7 @@
|
||||
#include "raymath.h"
|
||||
#include "state.h"
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <random>
|
||||
|
||||
namespace VISEQ::APP::UI{
|
||||
@@ -42,6 +44,8 @@ namespace VISEQ::GRAPH::NODES {
|
||||
MidiNode(Vec2Df position) : Node(position) {init();}
|
||||
|
||||
NodeType nodeType = NodeType::MIDINODE;
|
||||
|
||||
//std::vector<std::shared_ptr<ControlNode>> controlNodes;
|
||||
|
||||
bool send_note = true;
|
||||
bool send_cc = false;
|
||||
|
||||
Reference in New Issue
Block a user