mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-17 00:44:19 +00:00
Avoided parameter jumping when dragging the sliders in the GenericAudioProcessorEditor
This commit is contained in:
parent
625d4289f3
commit
0eab0962ba
1 changed files with 8 additions and 6 deletions
|
|
@ -27,12 +27,12 @@ class ProcessorParameterPropertyComp : public PropertyComponent,
|
|||
private Timer
|
||||
{
|
||||
public:
|
||||
ProcessorParameterPropertyComp (const String& name, AudioProcessor& p, const int index_)
|
||||
ProcessorParameterPropertyComp (const String& name, AudioProcessor& p, int paramIndex)
|
||||
: PropertyComponent (name),
|
||||
owner (p),
|
||||
index (index_),
|
||||
index (paramIndex),
|
||||
paramHasChanged (false),
|
||||
slider (p, index_)
|
||||
slider (p, paramIndex)
|
||||
{
|
||||
startTimer (100);
|
||||
addAndMakeVisible (slider);
|
||||
|
|
@ -47,7 +47,10 @@ public:
|
|||
void refresh() override
|
||||
{
|
||||
paramHasChanged = false;
|
||||
slider.setValue (owner.getParameter (index), dontSendNotification);
|
||||
|
||||
if (slider.getThumbBeingDragged() < 0)
|
||||
slider.setValue (owner.getParameter (index), dontSendNotification);
|
||||
|
||||
slider.updateText();
|
||||
}
|
||||
|
||||
|
|
@ -77,8 +80,7 @@ private:
|
|||
class ParamSlider : public Slider
|
||||
{
|
||||
public:
|
||||
ParamSlider (AudioProcessor& p, const int index_)
|
||||
: owner (p), index (index_)
|
||||
ParamSlider (AudioProcessor& p, int paramIndex) : owner (p), index (paramIndex)
|
||||
{
|
||||
const int steps = owner.getParameterNumSteps (index);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue