fix tuner, spectrum, vertical mixer layout

This commit is contained in:
Eknous-P 2025-10-31 23:19:43 +04:00
parent 8626937f89
commit 242af1d5f8
11 changed files with 648 additions and 208 deletions

View file

@ -3839,6 +3839,7 @@ bool FurnaceGUI::loop() {
DECLARE_METRIC(piano)
DECLARE_METRIC(notes)
DECLARE_METRIC(tuner)
DECLARE_METRIC(spectrum)
DECLARE_METRIC(channels)
DECLARE_METRIC(patManager)
DECLARE_METRIC(sysManager)
@ -4443,6 +4444,7 @@ bool FurnaceGUI::loop() {
IMPORT_CLOSE(pianoOpen);
IMPORT_CLOSE(notesOpen);
IMPORT_CLOSE(tunerOpen);
IMPORT_CLOSE(spectrumOpen);
IMPORT_CLOSE(channelsOpen);
IMPORT_CLOSE(regViewOpen);
IMPORT_CLOSE(logOpen);
@ -4809,6 +4811,7 @@ bool FurnaceGUI::loop() {
if (ImGui::MenuItem(_("oscilloscope (X-Y)"),BIND_FOR(GUI_ACTION_WINDOW_XY_OSC),xyOscOpen)) xyOscOpen=!xyOscOpen;
if (ImGui::MenuItem(_("volume meter"),BIND_FOR(GUI_ACTION_WINDOW_VOL_METER),volMeterOpen)) volMeterOpen=!volMeterOpen;
if (ImGui::MenuItem(_("tuner"), BIND_FOR(GUI_ACTION_WINDOW_TUNER), tunerOpen)) tunerOpen = !tunerOpen;
if (ImGui::MenuItem(_("spectrum"), BIND_FOR(GUI_ACTION_WINDOW_SPECTRUM), spectrumOpen)) spectrumOpen = !spectrumOpen;
ImGui::EndMenu();
}
if (ImGui::BeginMenu(_("tempo"))) {
@ -5089,6 +5092,7 @@ bool FurnaceGUI::loop() {
MEASURE(piano,drawPiano());
MEASURE(notes,drawNotes());
MEASURE(tuner,drawTuner());
MEASURE(spectrum, drawSpectrum());
MEASURE(channels,drawChannels());
MEASURE(patManager,drawPatManager());
MEASURE(sysManager,drawSysManager());
@ -8213,6 +8217,7 @@ void FurnaceGUI::syncState() {
#endif
notesOpen=e->getConfBool("notesOpen",false);
tunerOpen=e->getConfBool("tunerOpen",false);
spectrumOpen=e->getConfBool("spectrumOpen", false);
channelsOpen=e->getConfBool("channelsOpen",false);
patManagerOpen=e->getConfBool("patManagerOpen",false);
sysManagerOpen=e->getConfBool("sysManagerOpen",false);
@ -8273,6 +8278,12 @@ void FurnaceGUI::syncState() {
oscZoomSlider=e->getConfBool("oscZoomSlider",false);
oscWindowSize=e->getConfFloat("oscWindowSize",20.0f);
spectrum.bins=e->getConfInt("spectrumBins",2048);
spectrum.xZoom=e->getConfFloat("spectrumxZoom",1.0f);
spectrum.xOffset=e->getConfFloat("spectrumxOffset",0);
spectrum.yOffset=e->getConfFloat("spectrumyOffset",0);
spectrum.mono=e->getConfBool("spectrumMono",false);
pianoOctaves=e->getConfInt("pianoOctaves",pianoOctaves);
pianoOctavesEdit=e->getConfInt("pianoOctavesEdit",pianoOctavesEdit);
pianoOptions=e->getConfBool("pianoOptions",pianoOptions);
@ -8374,6 +8385,7 @@ void FurnaceGUI::commitState(DivConfig& conf) {
conf.set("pianoOpen",pianoOpen);
conf.set("notesOpen",notesOpen);
conf.set("tunerOpen",tunerOpen);
conf.set("spectrumOpen",spectrumOpen);
conf.set("channelsOpen",channelsOpen);
conf.set("patManagerOpen",patManagerOpen);
conf.set("sysManagerOpen",sysManagerOpen);
@ -8428,6 +8440,13 @@ void FurnaceGUI::commitState(DivConfig& conf) {
conf.set("oscZoomSlider",oscZoomSlider);
conf.set("oscWindowSize",oscWindowSize);
// commit spectrum state
conf.set("spectrumBins",spectrum.bins);
conf.set("spectrumxZoom",spectrum.xZoom);
conf.set("spectrumxOffset",spectrum.xOffset);
conf.set("spectrumyOffset",spectrum.yOffset);
conf.set("spectrumMono",spectrum.mono);
// commit piano state
conf.set("pianoOctaves",pianoOctaves);
conf.set("pianoOctavesEdit",pianoOctavesEdit);
@ -8544,14 +8563,17 @@ bool FurnaceGUI::finish(bool saveConfig) {
fftw_free(tunerFFTOutBuf);
tunerFFTOutBuf=NULL;
}
if (spectrumPlan) {
fftw_free(spectrumPlan);
spectrumPlan=NULL;
}
if (tunerPlan) {
fftw_free(tunerPlan);
tunerPlan=NULL;
}
if (spectrum.in) {
delete[] spectrum.in;
spectrum.in=NULL;
}
if (spectrum.buffer) {
fftw_free(spectrum.buffer);
}
return true;
}
@ -9092,9 +9114,7 @@ FurnaceGUI::FurnaceGUI():
xyOscDecayTime(10.0f),
xyOscIntensity(2.0f),
xyOscThickness(2.0f),
spectrumPlan(NULL),
tunerPlan(NULL),
spectrumBins(2048),
followLog(true),
#ifdef IS_MOBILE
pianoOctaves(7),