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

Method getModulatorValuesAsData

Source/Lua/CtrlrLuaManager.cpp:771–798  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

769}
770
771LMemoryBlock CtrlrPanel::getModulatorValuesAsData(const String &propertyToIndexBy, const CtrlrByteEncoding byteEncoding, const int bytesPerValue, const bool useMappedValues)
772{
773 MemoryBlock modulatorData (getNumModulators() * bytesPerValue, true);
774 uint32 truncateTo = getNumModulators() * bytesPerValue;
775 uint32 modulatorValue;
776
777 for (int i = 0; i<getNumModulators(); i++)
778 {
779 const int index = getModulatorByIndex(i)->getProperty(propertyToIndexBy);
780
781 if (index >= 0)
782 {
783 if (useMappedValues)
784 modulatorValue = getModulatorByIndex(i)->getValueMapped();
785 else
786 modulatorValue = getModulatorByIndex(i)->getValueNonMapped();
787
788 modulatorData.setBitRange (index * (bytesPerValue * 8), bytesPerValue * 8, modulatorValue);
789 }
790 else
791 {
792 truncateTo--;
793 }
794 }
795
796 modulatorData.setSize (truncateTo, false);
797 return (modulatorData);
798}
799
800LMemoryBlock CtrlrPanel::getModulatorValuesAsData(const String &propertyToIndexBy,
801 const CtrlrByteEncoding byteEncoding,

Callers

nothing calls this directly

Calls 5

getValueNonMappedMethod · 0.80
getPropertyMethod · 0.45
getValueMappedMethod · 0.45
setBitRangeMethod · 0.45
setSizeMethod · 0.45

Tested by

no test coverage detected