MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / getProgram

Method getProgram

Source/Core/CtrlrPanel/CtrlrPanel.cpp:789–824  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

787}
788
789ValueTree CtrlrPanel::getProgram(ValueTree treeToWriteTo)
790{
791 if (treeToWriteTo.isValid())
792 {
793 treeToWriteTo.removeAllChildren(0);
794 }
795
796 ValueTree program(Ids::panelState);
797 program.setProperty (Ids::panelVersionMajor, getProperty(Ids::panelVersionMajor), 0);
798 program.setProperty (Ids::panelVersionMinor, getProperty(Ids::panelVersionMinor), 0);
799 program.setProperty (Ids::time, Time::getCurrentTime().currentTimeMillis(), 0);
800
801 for (int i=0; i<ctrlrModulators.size(); i++)
802 {
803 CtrlrModulator *m = ctrlrModulators[i];
804
805 ValueTree v(Ids::value);
806
807 if ((bool)m->getProperty (Ids::modulatorIsStatic) == true)
808 continue;
809
810 v.setProperty(Ids::name, m->getName(),0);
811 v.setProperty(Ids::value, m->getModulatorValue(),0);
812
813 if (treeToWriteTo.isValid())
814 {
815 treeToWriteTo.addChild (v,-1,0);
816 }
817 else
818 {
819 program.addChild (v,-1,0);
820 }
821 }
822
823 return (program);
824}
825
826ValueTree CtrlrPanel::getCustomData()
827{

Callers 7

saveStateMethod · 0.45
loadProgramOntoBlockMethod · 0.45
flushMethod · 0.45
getCanvasProgramFunction · 0.45
getPaletteProgramFunction · 0.45
getGridProgramFunction · 0.45
getWaveshapeProgramFunction · 0.45

Calls 8

getModulatorValueMethod · 0.80
getNameMethod · 0.65
isValidMethod · 0.45
setPropertyMethod · 0.45
currentTimeMillisMethod · 0.45
sizeMethod · 0.45
getPropertyMethod · 0.45
addChildMethod · 0.45

Tested by

no test coverage detected