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

Method getUniqueModulatorName

Source/Core/CtrlrPanel/CtrlrPanel.cpp:720–748  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

718}
719
720const String CtrlrPanel::getUniqueModulatorName(const String &proposedName)
721{
722 if (getRestoreState())
723 return (proposedName);
724
725 uint32 marker=0;
726 String basename="";
727 String nameToLookFor;
728
729 if (proposedName.fromLastOccurrenceOf("-", false, true) != "")
730 {
731 basename = proposedName.upToLastOccurrenceOf("-", false, true);
732 marker = proposedName.fromLastOccurrenceOf("-", false, true).getIntValue();
733 nameToLookFor = proposedName;
734 }
735 else
736 {
737 basename = proposedName;
738 marker = ctrlrModulators.size();
739 nameToLookFor = basename + "-" + String(marker);
740 }
741
742 while (getModulator(nameToLookFor))
743 {
744 nameToLookFor = basename + "-" + String(++marker);
745 }
746
747 return (nameToLookFor);
748}
749
750void CtrlrPanel::changeListenerCallback (ChangeBroadcaster* source)
751{

Callers 1

restoreStateMethod · 0.80

Calls 5

fromLastOccurrenceOfMethod · 0.80
upToLastOccurrenceOfMethod · 0.80
StringFunction · 0.50
getIntValueMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected