MCPcopy Create free account
hub / github.com/andrewreeman/SpectralSuite / copyState

Method copyState

Morph/Source/MorphPluginParameters.cpp:56–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56ValueTree MorphPluginParameters::copyState() {
57 ValueTree tree = PluginParameters::copyState();
58
59 if (tree.getChildWithName("pointTree").isValid()) {
60 tree.removeChild(tree.getChildWithName("pointTree"), nullptr);
61 }
62
63 ValueTree pointTree("pointTree");
64
65 auto points = lastPointsV2.points;
66 if(points.isEmpty()) {
67 return tree;
68 }
69
70 pointTree.setProperty("ylimit", lastPointsV2.yScale, nullptr);
71
72 for(auto& point : points) {
73 ValueTree valuePoint ("point");
74 valuePoint.setProperty("x", point.x, nullptr);
75 valuePoint.setProperty("y", point.y, nullptr);
76 pointTree.appendChild(valuePoint, nullptr);
77 }
78
79 tree.addChild(pointTree, -1, nullptr);
80
81 return tree;
82}
83
84void MorphPluginParameters::setControlPointComponent(ControlPointComponent* component) {
85 component->setListener(this);

Callers

nothing calls this directly

Calls 1

isEmptyMethod · 0.45

Tested by

no test coverage detected