mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-27 15:03:01 +00:00
GUI: more note preview fixes
This commit is contained in:
parent
a81393472c
commit
d0c76e020c
5 changed files with 22 additions and 25 deletions
|
@ -1997,6 +1997,20 @@ void DivEngine::autoNoteOff(int ch, int note, int vol) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DivEngine::autoNoteOffAll() {
|
||||||
|
if (!playing) {
|
||||||
|
reset();
|
||||||
|
freelance=true;
|
||||||
|
playing=true;
|
||||||
|
}
|
||||||
|
for (int i=0; i<chans; i++) {
|
||||||
|
if (chan[i].midiNote!=-1) {
|
||||||
|
pendingNotes.push(DivNoteEvent(i,-1,-1,-1,false));
|
||||||
|
chan[i].midiNote=-1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void DivEngine::setOrder(unsigned char order) {
|
void DivEngine::setOrder(unsigned char order) {
|
||||||
BUSY_BEGIN_SOFT;
|
BUSY_BEGIN_SOFT;
|
||||||
curOrder=order;
|
curOrder=order;
|
||||||
|
|
|
@ -571,6 +571,7 @@ class DivEngine {
|
||||||
|
|
||||||
void autoNoteOn(int chan, int ins, int note, int vol=-1);
|
void autoNoteOn(int chan, int ins, int note, int vol=-1);
|
||||||
void autoNoteOff(int chan, int note, int vol=-1);
|
void autoNoteOff(int chan, int note, int vol=-1);
|
||||||
|
void autoNoteOffAll();
|
||||||
|
|
||||||
// go to order
|
// go to order
|
||||||
void setOrder(unsigned char order);
|
void setOrder(unsigned char order);
|
||||||
|
|
|
@ -99,20 +99,14 @@ void FurnaceGUI::doAction(int what) {
|
||||||
if (++curOctave>7) {
|
if (++curOctave>7) {
|
||||||
curOctave=7;
|
curOctave=7;
|
||||||
} else {
|
} else {
|
||||||
for (size_t i=0; i<activeNotes.size(); i++) {
|
e->autoNoteOffAll();
|
||||||
e->noteOff(activeNotes[i].chan);
|
|
||||||
}
|
|
||||||
activeNotes.clear();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GUI_ACTION_OCTAVE_DOWN:
|
case GUI_ACTION_OCTAVE_DOWN:
|
||||||
if (--curOctave<-5) {
|
if (--curOctave<-5) {
|
||||||
curOctave=-5;
|
curOctave=-5;
|
||||||
} else {
|
} else {
|
||||||
for (size_t i=0; i<activeNotes.size(); i++) {
|
e->autoNoteOffAll();
|
||||||
e->noteOff(activeNotes[i].chan);
|
|
||||||
}
|
|
||||||
activeNotes.clear();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GUI_ACTION_INS_UP:
|
case GUI_ACTION_INS_UP:
|
||||||
|
|
|
@ -35,10 +35,7 @@ void FurnaceGUI::drawEditControls() {
|
||||||
if (ImGui::InputInt("##Octave",&curOctave,1,1)) {
|
if (ImGui::InputInt("##Octave",&curOctave,1,1)) {
|
||||||
if (curOctave>7) curOctave=7;
|
if (curOctave>7) curOctave=7;
|
||||||
if (curOctave<-5) curOctave=-5;
|
if (curOctave<-5) curOctave=-5;
|
||||||
for (size_t i=0; i<activeNotes.size(); i++) {
|
e->autoNoteOffAll();
|
||||||
e->noteOff(activeNotes[i].chan);
|
|
||||||
}
|
|
||||||
activeNotes.clear();
|
|
||||||
|
|
||||||
if (settings.insFocusesPattern && !ImGui::IsItemActive() && patternOpen) {
|
if (settings.insFocusesPattern && !ImGui::IsItemActive() && patternOpen) {
|
||||||
nextWindow=GUI_WINDOW_PATTERN;
|
nextWindow=GUI_WINDOW_PATTERN;
|
||||||
|
@ -139,10 +136,7 @@ void FurnaceGUI::drawEditControls() {
|
||||||
if (ImGui::InputInt("##Octave",&curOctave,1,1)) {
|
if (ImGui::InputInt("##Octave",&curOctave,1,1)) {
|
||||||
if (curOctave>7) curOctave=7;
|
if (curOctave>7) curOctave=7;
|
||||||
if (curOctave<-5) curOctave=-5;
|
if (curOctave<-5) curOctave=-5;
|
||||||
for (size_t i=0; i<activeNotes.size(); i++) {
|
e->autoNoteOffAll();
|
||||||
e->noteOff(activeNotes[i].chan);
|
|
||||||
}
|
|
||||||
activeNotes.clear();
|
|
||||||
|
|
||||||
if (settings.insFocusesPattern && !ImGui::IsItemActive() && patternOpen) {
|
if (settings.insFocusesPattern && !ImGui::IsItemActive() && patternOpen) {
|
||||||
nextWindow=GUI_WINDOW_PATTERN;
|
nextWindow=GUI_WINDOW_PATTERN;
|
||||||
|
@ -213,10 +207,7 @@ void FurnaceGUI::drawEditControls() {
|
||||||
if (ImGui::InputInt("##Octave",&curOctave,0,0)) {
|
if (ImGui::InputInt("##Octave",&curOctave,0,0)) {
|
||||||
if (curOctave>7) curOctave=7;
|
if (curOctave>7) curOctave=7;
|
||||||
if (curOctave<-5) curOctave=-5;
|
if (curOctave<-5) curOctave=-5;
|
||||||
for (size_t i=0; i<activeNotes.size(); i++) {
|
e->autoNoteOffAll();
|
||||||
e->noteOff(activeNotes[i].chan);
|
|
||||||
}
|
|
||||||
activeNotes.clear();
|
|
||||||
|
|
||||||
if (settings.insFocusesPattern && !ImGui::IsItemActive() && patternOpen) {
|
if (settings.insFocusesPattern && !ImGui::IsItemActive() && patternOpen) {
|
||||||
nextWindow=GUI_WINDOW_PATTERN;
|
nextWindow=GUI_WINDOW_PATTERN;
|
||||||
|
@ -314,10 +305,7 @@ void FurnaceGUI::drawEditControls() {
|
||||||
if (ImGui::InputInt("##Octave",&curOctave,1,1)) {
|
if (ImGui::InputInt("##Octave",&curOctave,1,1)) {
|
||||||
if (curOctave>7) curOctave=7;
|
if (curOctave>7) curOctave=7;
|
||||||
if (curOctave<-5) curOctave=-5;
|
if (curOctave<-5) curOctave=-5;
|
||||||
for (size_t i=0; i<activeNotes.size(); i++) {
|
e->autoNoteOffAll();
|
||||||
e->noteOff(activeNotes[i].chan);
|
|
||||||
}
|
|
||||||
activeNotes.clear();
|
|
||||||
|
|
||||||
if (settings.insFocusesPattern && !ImGui::IsItemActive() && patternOpen) {
|
if (settings.insFocusesPattern && !ImGui::IsItemActive() && patternOpen) {
|
||||||
nextWindow=GUI_WINDOW_PATTERN;
|
nextWindow=GUI_WINDOW_PATTERN;
|
||||||
|
|
|
@ -1959,7 +1959,7 @@ int _processEvent(void* instance, SDL_Event* event) {
|
||||||
|
|
||||||
int FurnaceGUI::processEvent(SDL_Event* ev) {
|
int FurnaceGUI::processEvent(SDL_Event* ev) {
|
||||||
if (ev->type==SDL_KEYDOWN) {
|
if (ev->type==SDL_KEYDOWN) {
|
||||||
if (!ev->key.repeat && !wantCaptureKeyboard) {
|
if (!ev->key.repeat && !wantCaptureKeyboard && (ev->key.keysym.mod&(~(KMOD_NUM|KMOD_CAPS|KMOD_SCROLL)))==0) {
|
||||||
switch (curWindow) {
|
switch (curWindow) {
|
||||||
case GUI_WINDOW_SAMPLE_EDIT:
|
case GUI_WINDOW_SAMPLE_EDIT:
|
||||||
case GUI_WINDOW_SAMPLE_LIST:
|
case GUI_WINDOW_SAMPLE_LIST:
|
||||||
|
|
Loading…
Reference in a new issue