Skip to content

Commit fb11ba1

Browse files
Merge pull request #8 from leandrosimoes/develop
Develop
2 parents 1861d08 + 5d25223 commit fb11ba1

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

Source/PluginEditor.cpp

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -231,29 +231,25 @@ void NoteNumberRemaperByVelocityAudioProcessorEditor::resized()
231231
}
232232

233233
void NoteNumberRemaperByVelocityAudioProcessorEditor::sliderValueChanged(Slider* slider) {
234-
auto currentValue = slider->getValue();
235-
236234
if (slider == &hihatSlider)
237-
audioProcessor.midiProcessor.hihatVelocity->store(currentValue);
238-
else if (slider == &crashLeftSlider)
239-
audioProcessor.midiProcessor.crashLeftVelocity->store(currentValue);
240-
else if (slider == &crashRightSlider)
241-
audioProcessor.midiProcessor.crashRightVelocity->store(currentValue);
235+
audioProcessor.midiProcessor.hihatVelocity->store(slider->getValue());
236+
if (slider == &crashLeftSlider)
237+
audioProcessor.midiProcessor.crashLeftVelocity->store(slider->getValue());
238+
if (slider == &crashRightSlider)
239+
audioProcessor.midiProcessor.crashRightVelocity->store(slider->getValue());
242240
}
243241

244242
void NoteNumberRemaperByVelocityAudioProcessorEditor::comboBoxChanged(ComboBox* cb) {
245-
auto currentValue = cb->getSelectedIdAsValue().getValue();
246-
247243
if (cb == &hihatNoteInCB)
248-
audioProcessor.midiProcessor.hihatNoteIn->store(currentValue);
244+
audioProcessor.midiProcessor.hihatNoteIn->store(cb->getSelectedIdAsValue().getValue());
249245
if (cb == &hihatNoteOutCB)
250-
audioProcessor.midiProcessor.hihatNoteOut->store(currentValue);
246+
audioProcessor.midiProcessor.hihatNoteOut->store(cb->getSelectedIdAsValue().getValue());
251247
if (cb == &crashLeftNoteInCB)
252-
audioProcessor.midiProcessor.crashLeftNoteIn->store(currentValue);
248+
audioProcessor.midiProcessor.crashLeftNoteIn->store(cb->getSelectedIdAsValue().getValue());
253249
if (cb == &crashLeftNoteOutCB)
254-
audioProcessor.midiProcessor.crashLeftNoteOut->store(currentValue);
250+
audioProcessor.midiProcessor.crashLeftNoteOut->store(cb->getSelectedIdAsValue().getValue());
255251
if (cb == &crashRightNoteInCB)
256-
audioProcessor.midiProcessor.crashRightNoteIn->store(currentValue);
252+
audioProcessor.midiProcessor.crashRightNoteIn->store(cb->getSelectedIdAsValue().getValue());
257253
if (cb == &crashRightNoteOutCB)
258-
audioProcessor.midiProcessor.crashRightNoteOut->store(currentValue);
254+
audioProcessor.midiProcessor.crashRightNoteOut->store(cb->getSelectedIdAsValue().getValue());
259255
}

Source/PluginProcessor.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ NoteNumberRemaperByVelocityAudioProcessor::NoteNumberRemaperByVelocityAudioProce
3434
})
3535
#endif
3636
{
37+
midiProcessor.setDefaultValues();
3738
}
3839

3940
NoteNumberRemaperByVelocityAudioProcessor::~NoteNumberRemaperByVelocityAudioProcessor()
@@ -176,8 +177,6 @@ void NoteNumberRemaperByVelocityAudioProcessor::setStateInformation(const void*
176177

177178
std::unique_ptr<juce::XmlElement> xmlState(getXmlFromBinary(data, sizeInBytes));
178179

179-
midiProcessor.setDefaultValues();
180-
181180
if (xmlState.get() != nullptr) {
182181
if (xmlState->hasTagName(parameters.state.getType())) {
183182
parameters.replaceState(juce::ValueTree::fromXml(*xmlState));

0 commit comments

Comments
 (0)