GUI: rewrite note preview logic

now with polyphony! see issue #16
This commit is contained in:
tildearrow 2022-01-20 01:32:16 -05:00
parent 6db9d312ec
commit 93c4ab0cc8
2 changed files with 83 additions and 45 deletions

View file

@ -219,9 +219,14 @@ class FurnaceGUI {
bool selecting, curNibble, extraChannelButtons, followOrders, followPattern, changeAllOrders;
FurnaceGUIWindows curWindow;
bool noteOffOnRelease;
SDL_Scancode noteOffOnReleaseKey;
int noteOffOnReleaseChan;
struct ActiveNote {
int chan;
int note;
ActiveNote(int c, int n):
chan(c),
note(n) {}
};
std::vector<ActiveNote> activeNotes;
bool wavePreviewOn;
SDL_Scancode wavePreviewKey;
@ -303,6 +308,12 @@ class FurnaceGUI {
void doUndo();
void doRedo();
void play();
void stop();
void previewNote(int refChan, int note);
void stopPreviewNote(SDL_Scancode scancode);
void keyDown(SDL_Event& ev);
void keyUp(SDL_Event& ev);