| 718 | } |
| 719 | |
| 720 | const 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 | |
| 750 | void CtrlrPanel::changeListenerCallback (ChangeBroadcaster* source) |
| 751 | { |
no test coverage detected