View Single Post
Old 02-20-2010, 06:04 AM   #38
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,812
Default

I replied at http://www.voxengo.com/forum/ar/1926/?offset=30:

Quote:
For a more complete example, say the plugin parameter number 7 has two formatted values that the plugin displays: "mono" which maps to parameter value 0.0f, and "stereo" which maps to parameter value 1.0f.

The host has some interface where the user can type in the value they want to set for the parameter, say the user types in "mono." The host then calls the plugin:

opcode: effVendorSpecific
index: effString2Parameter
value: 7
ptr: "mono"

The plugin would return
ptr: "1.0"

by doing something like this:
if (!stricmp(ptr, "mono")) { strcpy(ptr, "0.0"); return 0xbeef; }
if (!stricmp(ptr, "stereo")) { strcpy(ptr, "1.0"); return 0xbeef; }
return 0;

That's what we have implemented. But, if you have a better suggestion for how to implement this (converting the user's string to a parameter value without changing the current value of the parameter), that would be fine too, we can change the implementation.
schwa is offline   Reply With Quote