Clipboard introduced, but not incorporated yet. Some defines for convenience and better readability.
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
#pragma once
|
||||
|
||||
#include "midi-node.h"
|
||||
#include "node.h"
|
||||
|
||||
namespace VISEQ::APP {
|
||||
class Clipboard {
|
||||
public:
|
||||
Clipboard() {}
|
||||
|
||||
GRAPH::NODES::VEC_SPTR_Node clipboard;
|
||||
|
||||
GRAPH::NODES::VEC_SPTR_Node pasteNodes(){
|
||||
return clipboard;
|
||||
}
|
||||
|
||||
void copyNodes(GRAPH::NODES::VEC_SPTR_Node _nodes, Vec2Df position){
|
||||
for(auto n: _nodes){
|
||||
copyNode(n, position + n->drag_offset);
|
||||
}
|
||||
}
|
||||
|
||||
void copyNodes(std::vector<std::shared_ptr<GRAPH::NODES::MidiNode>> _nodes, Vec2Df position){
|
||||
for(auto n: _nodes){
|
||||
copyNode(n, position + n->drag_offset);
|
||||
}
|
||||
}
|
||||
|
||||
GRAPH::NODES::SPTR_Node copyNode(GRAPH::NODES::SPTR_Node n, Vec2Df position){
|
||||
std::cout << "copy basenode" << std::endl;
|
||||
clipboard.insert(clipboard.end(), std::make_shared<GRAPH::NODES::Node>(*n));
|
||||
clipboard.back()->setPosition(position);
|
||||
return clipboard.back();
|
||||
}
|
||||
|
||||
GRAPH::NODES::SPTR_Node copyNode(std::shared_ptr<GRAPH::NODES::MidiNode> n, Vec2Df position){
|
||||
std::cout << "copy midinode" << std::endl;
|
||||
clipboard.insert(clipboard.end(), std::make_shared<GRAPH::NODES::MidiNode>(*n));
|
||||
clipboard.back()->setPosition(position);
|
||||
return clipboard.back();
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user