Logo Search packages:      
Sourcecode: ardour version File versions  Download package

Float32 CAAUParameter::GetValueFromString ( CFStringRef  str  )  const

GetValueFromString

Definition at line 260 of file CAAUParameter.cpp.

References ValuesHaveStrings().

{
      if (ValuesHaveStrings()) 
      {
            AudioUnitParameterValueFromString valueString;
            valueString.inParamID = mParameterID;
            valueString.inString = str;
            UInt32 propertySize = sizeof(valueString);
            
            OSStatus err = AudioUnitGetProperty (mAudioUnit, 
                                                            kAudioUnitProperty_ParameterValueFromString,
                                                            mScope, 
                                                            mParameterID, 
                                                            &valueString, 
                                                            &propertySize);
                                                            
            if (err == noErr) {
                  return valueString.outValue;
            }
      }
      
      Float32 paramValue = mParamInfo.defaultValue;
      char valstr[32];
      CFStringGetCString(str, valstr, sizeof(valstr), kCFStringEncodingUTF8);
      sscanf(valstr, "%f", &paramValue);
      return paramValue;
}


Generated by  Doxygen 1.6.0   Back to index