From 6bf6a854efc9d6d702699a48484e689396b3b993 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sat, 17 Sep 2022 22:55:58 -0500 Subject: [PATCH] GUI: comfortable wave macro height --- src/gui/doAction.cpp | 3 +++ src/gui/gui.cpp | 1 + src/gui/gui.h | 6 ++++++ src/gui/insEdit.cpp | 2 +- 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/gui/doAction.cpp b/src/gui/doAction.cpp index 92e12a742..468b7e37c 100644 --- a/src/gui/doAction.cpp +++ b/src/gui/doAction.cpp @@ -645,6 +645,7 @@ void FurnaceGUI::doAction(int what) { } else { wantScrollList=true; MARK_MODIFIED; + RESET_WAVE_MACRO_ZOOM; } break; case GUI_ACTION_WAVE_LIST_DUPLICATE: @@ -657,6 +658,7 @@ void FurnaceGUI::doAction(int what) { (*e->song.wave[curWave])=(*e->song.wave[prevWave]); wantScrollList=true; MARK_MODIFIED; + RESET_WAVE_MACRO_ZOOM; } } break; @@ -1326,6 +1328,7 @@ void FurnaceGUI::doAction(int what) { } nextWindow=GUI_WINDOW_WAVE_EDIT; MARK_MODIFIED; + RESET_WAVE_MACRO_ZOOM; } } break; diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 5153e1f6a..06fc65f08 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -3884,6 +3884,7 @@ bool FurnaceGUI::loop() { showError("cannot load wavetable! ("+e->getLastError()+")"); } else { MARK_MODIFIED; + RESET_WAVE_MACRO_ZOOM; } } break; diff --git a/src/gui/gui.h b/src/gui/gui.h index 1c8ee713f..6499c4d19 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -47,6 +47,12 @@ #define MARK_MODIFIED modified=true; #define WAKE_UP drawHalt=16; +#define RESET_WAVE_MACRO_ZOOM \ + for (DivInstrument* _wi: e->song.ins) { \ + _wi->std.waveMacro.vZoom=-1; \ + _wi->std.waveMacro.vScroll=-1; \ + } + #define BIND_FOR(x) getKeyName(actionKeys[x],true).c_str() // TODO: diff --git a/src/gui/insEdit.cpp b/src/gui/insEdit.cpp index b5347cbee..50fd286b8 100644 --- a/src/gui/insEdit.cpp +++ b/src/gui/insEdit.cpp @@ -4227,7 +4227,7 @@ void FurnaceGUI::drawInsEdit() { } const char* waveLabel="Waveform"; - int waveMax=(ins->type==DIV_INS_AY || ins->type==DIV_INS_AY8930 || ins->type==DIV_INS_VERA)?3:255; + int waveMax=(ins->type==DIV_INS_AY || ins->type==DIV_INS_AY8930 || ins->type==DIV_INS_VERA)?3:(MAX(1,e->song.waveLen-1)); bool bitMode=false; if (ins->type==DIV_INS_C64 || ins->type==DIV_INS_AY || ins->type==DIV_INS_AY8930 || ins->type==DIV_INS_SAA1099) { bitMode=true;