AudioProcessorValueTreeState::ComboBoxAttachment::Pimpl


#1

What problem is the internal lock solving in this class?

It might be useful to expose the attachment base class so that things that aren’t Sliders/ComboBoxes or Buttons?

And in this comment:

/** The state of the whole processor.

    This must be initialised after all calls to createAndAddParameter().
    You can replace this with your own ValueTree object, and can add properties and
    children to the tree. This class will automatically add children for each of the
    parameter objects that are created by createParameter().
*/
ValueTree state;

What does ‘This must be initialised after all calls to createAndAddParameter().’ mean? It seems to work without initializing anything at al…


#2

Also, looking at the code for ComboBox attachment. https://github.com/WeAreROLI/JUCE/blob/master/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.cpp

Is there some reason that it uses the Id when getting the value and the Index when setting it?

combo.setSelectedItemIndex (roundToInt (newValue), sendNotificationSync);
vs. 
setNewUnnormalisedValue ((float) comboBox->getSelectedId() - 1.0f);

Surely:

 getSelectedItemIndex () 

?