I have a question about getting current value from a dropdown in the exporter UI. Currently I have a custom drop down which I populate with UTF16 strings. I set it up as follows:
// Field order
1) exNewParamInfo ParamName ;
2) exParamValues ParamValues;
3) ParamName.structVersion = 1;
4) safeStrCpy(ParamName.identifier, 256, ADBEVideoFieldType); //fieldtype is taken as an example from existing code
5) ParamName.paramType = exParamType_int;
6) ParamName.flags = exParamFlag_none;
7) ParamValues.structVersion = 1;
8) ParamValues.disabled = kPrFalse;
9) ParamValues.hidden = kPrFalse;
10) fieldOrderParam.paramValues = ParamValues;
I'm then able to load my dynamically generated strings into the drop down (during ProstProcessParams) and they are displayed correctly.
Then, during Export I call
exportParamSuite->GetParamValue(exID, 0, ADBEBasicVideoGroup, &ParamValueToBeReturned);
to get current value .
However, I don't get UTF16 string back. My guess is it's happening because the value of this field is UTF16 and not int (as I set up on line 5). I've tried using exParamType_string, but that gives me an editable text field.
So, how do I set up a custom drop down correctly to get current string values from it?
During exSelPostProcessParams, in your calls to AddConstrainedValuePair(), you have defined a one-to-one mapping of integer values to strings. You can use the same mapping to determine which string was selected in the drop-down from the integer value passed back from GetParamValue(). The integer values can actually be more specific, since due to localization, the strings may differ.
Looking at the code, you can't do constrained value pairs with parameters of type exParamType_string.