Workaround for vector_shared_ptr_templated serialization mess.
This commit is contained in:
+7
-2
@@ -6,7 +6,6 @@
|
||||
#include "node-handle.h"
|
||||
#include "node.h"
|
||||
#include "raylib.h"
|
||||
#include "raymath.h"
|
||||
#include "state.h"
|
||||
#include <map>
|
||||
#include <memory>
|
||||
@@ -404,6 +403,12 @@ namespace VISEQ::GRAPH::NODES {
|
||||
friend void to_json(json& j, const MidiNode& N){
|
||||
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::map<std::string, Vec2Df> noteHandles;
|
||||
//std::ranges::transform(N.midiNoteHandles.begin(), N.midiNoteHandles.end(), std::back_inserter(noteHandles), [](std::shared_ptr<NodeHandle<int>> n){ return n->position;});
|
||||
for(auto i : N.midiNoteHandles){
|
||||
noteHandles.insert(std::make_pair(i->name, i->position));
|
||||
}
|
||||
|
||||
j = json{
|
||||
{"id", N.id},
|
||||
{"position", N.position},
|
||||
@@ -415,7 +420,7 @@ namespace VISEQ::GRAPH::NODES {
|
||||
{"midiPitchBend", N.midiPitchBend},
|
||||
{"midiAftertouch", N.midiAftertouch},
|
||||
{"midiPolyPressure", N.midiPolyPressure},
|
||||
//{"midiNoteHandle", N.midiNoteHandles},
|
||||
{"midiNoteHandle", noteHandles},
|
||||
/*{"midiCCHandle", N.midiCCHandles},*/
|
||||
/*{"midiPCHandle", N.midiPCHandles},*/
|
||||
/*{"midiPitchBendHandle", N.midiPitchBendHandles},*/
|
||||
|
||||
Reference in New Issue
Block a user