Skip to content

Commit

Permalink
Merge pull request #9 from keyth72/feature-knob-state-saving
Browse files Browse the repository at this point in the history
Fixed knob state save logic
  • Loading branch information
GuitarML authored Oct 15, 2020
2 parents b387dfe + 5bad7b0 commit efe4597
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
8 changes: 8 additions & 0 deletions plugins/SmartAmp/Source/PluginEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,18 @@ void WaveNetVaAudioProcessorEditor::sliderValueChanged(Slider* slider)
else if (slider == &ampCleanBassKnob || slider == &ampCleanMidKnob || slider == &ampCleanTrebleKnob) {
if (processor.amp_lead == 1)
processor.set_ampEQ(ampCleanBassKnob.getValue(), ampCleanMidKnob.getValue(), ampCleanTrebleKnob.getValue(), ampPresenceKnob.getValue());
// Set knob states for saving positions when closing/reopening GUI
processor.ampCleanBassKnobState = ampCleanBassKnob.getValue();
processor.ampCleanMidKnobState = ampCleanMidKnob.getValue();
processor.ampCleanTrebleKnobState = ampCleanTrebleKnob.getValue();
}
else if (slider == &ampLeadBassKnob || slider == &ampLeadMidKnob || slider == &ampLeadTrebleKnob) {
if (processor.amp_lead == 0)
processor.set_ampEQ(ampLeadBassKnob.getValue(), ampLeadMidKnob.getValue(), ampLeadTrebleKnob.getValue(), ampPresenceKnob.getValue());
// Set knob states for saving positions when closing/reopening GUI
processor.ampLeadBassKnobState = ampLeadBassKnob.getValue();
processor.ampLeadMidKnobState = ampLeadMidKnob.getValue();
processor.ampLeadTrebleKnobState = ampLeadTrebleKnob.getValue();
}
else if (slider == &ampPresenceKnob) {
if (processor.amp_lead == 1)
Expand Down
10 changes: 0 additions & 10 deletions plugins/SmartAmp/Source/PluginProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,16 +261,6 @@ void WaveNetVaAudioProcessor::set_ampEQ(float bass_slider, float mid_slider, flo
{
eq4band.setParameters(bass_slider, mid_slider, treble_slider, presence_slider);

// Set knob states for saving positions when closing/reopening GUI
if ( amp_lead == 1 ) {
ampCleanBassKnobState = bass_slider;
ampCleanMidKnobState = mid_slider;
ampCleanTrebleKnobState = treble_slider;
} else {
ampLeadBassKnobState = bass_slider;
ampLeadMidKnobState = mid_slider;
ampLeadTrebleKnobState = treble_slider;
}
ampPresenceKnobState = presence_slider;
}

Expand Down

0 comments on commit efe4597

Please sign in to comment.