2
0
Fork 0

MIDI clean fix

This commit is contained in:
George Reales 2021-05-20 19:34:21 +02:00
parent a1b851a4eb
commit d283309d88
2 changed files with 14 additions and 3 deletions

View File

@ -877,6 +877,7 @@ void ObxdAudioProcessorEditor::buttonClicked (Button* b)
auto toggleButton = dynamic_cast<TooglableButton*> (b);
if (toggleButton == midiUnlearnButton){
if (midiUnlearnButton->getToggleState()){
countTimerForLed = 0;
processor.getMidiMap().reset();
processor.getMidiMap().set_default();
processor.sendChangeMessage();
@ -904,9 +905,10 @@ void ObxdAudioProcessorEditor::updateFromHost() {
}
// Set to unlearn to false
if ( midiUnlearnButton && midiUnlearnButton->getToggleState()) {
midiUnlearnButton->setToggleState(false, NotificationType:: sendNotification);
}
//if ( midiUnlearnButton && midiUnlearnButton->getToggleState()) {
// Thread::sleep(500);
// midiUnlearnButton->setToggleState(false, NotificationType:: sendNotification);
//}
repaint();
}

View File

@ -89,6 +89,12 @@ public:
needNotifytoHost= false;
processor.updateHostDisplay();
}
countTimerForLed++;
if (midiUnlearnButton && midiUnlearnButton->getToggleState() && countTimerForLed > 3) {
midiUnlearnButton->setToggleState(false, NotificationType::sendNotification);
countTimerForLed = 0;
}
}
ApplicationCommandTarget* getNextCommandTarget() override {
return nullptr;
@ -276,8 +282,11 @@ private:
ApplicationCommandManager commandManager;
int countTimer =0;
bool needNotifytoHost = false;
Array<String> midiFiles;
int menuMidiNum;
int countTimerForLed = 0;
};
#endif // PLUGINEDITOR_H_INCLUDED