mirror of
https://github.com/tildearrow/furnace.git
synced 2025-01-03 22:21:09 +00:00
GUI: stop notes on octave change
This commit is contained in:
parent
4f5d37d415
commit
6c6cb52dd1
1 changed files with 20 additions and 2 deletions
|
@ -548,6 +548,10 @@ void FurnaceGUI::drawEditControls() {
|
||||||
if (ImGui::InputInt("##Octave",&curOctave,1,1)) {
|
if (ImGui::InputInt("##Octave",&curOctave,1,1)) {
|
||||||
if (curOctave>6) curOctave=6;
|
if (curOctave>6) curOctave=6;
|
||||||
if (curOctave<-5) curOctave=-5;
|
if (curOctave<-5) curOctave=-5;
|
||||||
|
for (size_t i=0; i<activeNotes.size(); i++) {
|
||||||
|
e->noteOff(activeNotes[i].chan);
|
||||||
|
}
|
||||||
|
activeNotes.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::Text("Edit Step");
|
ImGui::Text("Edit Step");
|
||||||
|
@ -3989,10 +3993,24 @@ void FurnaceGUI::keyDown(SDL_Event& ev) {
|
||||||
stop();
|
stop();
|
||||||
break;
|
break;
|
||||||
case SDLK_KP_DIVIDE:
|
case SDLK_KP_DIVIDE:
|
||||||
if (--curOctave<-5) curOctave=-5;
|
if (--curOctave<-5) {
|
||||||
|
curOctave=-5;
|
||||||
|
} else {
|
||||||
|
for (size_t i=0; i<activeNotes.size(); i++) {
|
||||||
|
e->noteOff(activeNotes[i].chan);
|
||||||
|
}
|
||||||
|
activeNotes.clear();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case SDLK_KP_MULTIPLY:
|
case SDLK_KP_MULTIPLY:
|
||||||
if (++curOctave>6) curOctave=6;
|
if (++curOctave>6) {
|
||||||
|
curOctave=6;
|
||||||
|
} else {
|
||||||
|
for (size_t i=0; i<activeNotes.size(); i++) {
|
||||||
|
e->noteOff(activeNotes[i].chan);
|
||||||
|
}
|
||||||
|
activeNotes.clear();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case SDLK_RETURN:
|
case SDLK_RETURN:
|
||||||
if (e->isPlaying()) {
|
if (e->isPlaying()) {
|
||||||
|
|
Loading…
Reference in a new issue