MCPcopy Create free account
hub / github.com/jerryuhoo/Fire / setDraggableButtonBounds

Method setDraggableButtonBounds

Source/Panels/SpectrogramPanel/FilterControl.cpp:288–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

286}
287
288void FilterControl::setDraggableButtonBounds()
289{
290 float size = getWidth() / 1000.0f * 15;
291 float lowcutX = getWidth() * juce::mapFromLog10(static_cast<double>(*processor.treeState.getRawParameterValue(LOWCUT_FREQ_ID)), 20.0, 20000.0);
292 float peakX = getWidth() * juce::mapFromLog10(static_cast<double>(*processor.treeState.getRawParameterValue(PEAK_FREQ_ID)), 20.0, 20000.0);
293 float highcutX = getWidth() * juce::mapFromLog10(static_cast<double>(*processor.treeState.getRawParameterValue(HIGHCUT_FREQ_ID)), 20.0, 20000.0);
294
295 float lowcutY = getHeight() / 2.0f * *processor.treeState.getRawParameterValue(LOWCUT_GAIN_ID) / 24.0f;
296 float peakY = getHeight() / 2.0f * *processor.treeState.getRawParameterValue(PEAK_GAIN_ID) / 24.0f;
297 float highcutY = getHeight() / 2.0f * *processor.treeState.getRawParameterValue(HIGHCUT_GAIN_ID) / 24.0f;
298
299 draggableLowButton.setBounds(lowcutX - size / 2.0f, getHeight() / 2.0f - lowcutY - size / 2.0f, size, size);
300 draggablePeakButton.setBounds(peakX - size / 2.0f, getHeight() / 2.0f - peakY - size / 2.0f, size, size);
301 draggableHighButton.setBounds(highcutX - size / 2.0f, getHeight() / 2.0f - highcutY - size / 2.0f, size, size);
302}
303
304void FilterControl::updateChain()
305{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected