void SimplePianoVisualizerAudioProcessorEditor::sliderValueChanged(juce::Slider *slider)
{
horizontalSliderValue = horizontalSlider.getValue();
verticalSliderValue = verticalSlider.getValue();
// making sure the resized() (UI changes) are made on the UI thread
(new SliderValueChangedCallback(this))->post();
}
void SimplePianoVisualizerAudioProcessorEditor::resized()
{
auto area = getLocalBounds();
auto verticalMargin = area.getHeight()/2.8;
auto keyboardArea = area.removeFromBottom(verticalMargin).reduced(30, 0);
keyWidth = 32 * (horizontalSliderValue/10);
keyboardComponent.setKeyWidth(keyWidth);keyboardComponent.setBounds(keyboardArea.getX(), keyboardArea.getY(), keyboardArea.getWidth(), keyboardArea.getHeight()*(verticalSliderValue/10));
}
auto param = valueTreeState.getParameterAsValue(ParamId);
// getting value
int paramValue = param.getValue();
// setting value
param.setValue(juce::var(newValue));
2. パラメターのリアルタイム値をゲットしたい場合
int value = (int)*valueTreeState.getRawParameterValue(ParamId);