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

Function getPanningValueForText

JUCE/examples/Plugins/DSPModulePluginDemo.h:960–980  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

958 }
959
960 static float getPanningValueForText (String strText)
961 {
962 if (strText.compareIgnoreCase ("center") == 0 || strText.compareIgnoreCase ("c") == 0)
963 return 0.5f;
964
965 strText = strText.trim();
966
967 if (strText.indexOfIgnoreCase ("%L") != -1)
968 {
969 auto percentage = (float) strText.substring (0, strText.indexOf ("%")).getDoubleValue();
970 return (100.0f - percentage) / 100.0f * 0.5f;
971 }
972
973 if (strText.indexOfIgnoreCase ("%R") != -1)
974 {
975 auto percentage = (float) strText.substring (0, strText.indexOf ("%")).getDoubleValue();
976 return percentage / 100.0f * 0.5f + 0.5f;
977 }
978
979 return 0.5f;
980 }
981
982 //==============================================================================
983 struct DistortionProcessor

Callers 1

Calls 6

indexOfIgnoreCaseMethod · 0.80
compareIgnoreCaseMethod · 0.45
trimMethod · 0.45
getDoubleValueMethod · 0.45
substringMethod · 0.45
indexOfMethod · 0.45

Tested by

no test coverage detected