diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 57c0aa4bb..c1a90b5cc 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -8351,6 +8351,7 @@ void FurnaceGUI::syncState() { pianoOffsetEdit=e->getConfInt("pianoOffsetEdit",pianoOffsetEdit); pianoView=e->getConfInt("pianoView",pianoView); pianoInputPadMode=e->getConfInt("pianoInputPadMode",pianoInputPadMode); + pianoLabelsMode=e->getConfInt("pianoLabelsMode",pianoLabelsMode); chanOscCols=e->getConfInt("chanOscCols",3); chanOscAutoColsType=e->getConfInt("chanOscAutoColsType",0); @@ -8512,6 +8513,7 @@ void FurnaceGUI::commitState(DivConfig& conf) { conf.set("pianoOffsetEdit",pianoOffsetEdit); conf.set("pianoView",pianoView); conf.set("pianoInputPadMode",pianoInputPadMode); + conf.set("pianoLabelsMode",pianoLabelsMode); // commit per-chan osc state conf.set("chanOscCols",chanOscCols); @@ -9164,6 +9166,7 @@ FurnaceGUI::FurnaceGUI(): pianoOffsetEdit(9), pianoView(PIANO_LAYOUT_AUTOMATIC), pianoInputPadMode(PIANO_INPUT_PAD_SPLIT_AUTO), + pianoLabelsMode(PIANO_LABELS_OCTAVE), #else pianoOctaves(7), pianoOctavesEdit(4), @@ -9174,6 +9177,7 @@ FurnaceGUI::FurnaceGUI(): pianoOffsetEdit(6), pianoView(PIANO_LAYOUT_STANDARD), pianoInputPadMode(PIANO_INPUT_PAD_DISABLE), + pianoLabelsMode(PIANO_LABELS_OCTAVE), #endif hasACED(false), waveGenBaseShape(0), diff --git a/src/gui/gui.h b/src/gui/gui.h index 8618ef51b..b181bd8eb 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -2777,13 +2777,21 @@ class FurnaceGUI { PIANO_INPUT_PAD_MAX }; + enum PianoLabelsMode { + PIANO_LABELS_OFF=0, + PIANO_LABELS_OCTAVE, + PIANO_LABELS_NOTE, + PIANO_LABELS_OCTAVE_C, + PIANO_LABELS_OCTAVE_NOTE + }; + int pianoOctaves, pianoOctavesEdit; bool pianoOptions, pianoSharePosition, pianoOptionsSet; float pianoKeyHit[180]; bool pianoKeyPressed[180]; bool pianoReadonly; int pianoOffset, pianoOffsetEdit; - int pianoView, pianoInputPadMode; + int pianoView, pianoInputPadMode, pianoLabelsMode; // effect sorting / searching bool effectsShow[10]; diff --git a/src/gui/piano.cpp b/src/gui/piano.cpp index 18ef208bb..23c1d4d91 100644 --- a/src/gui/piano.cpp +++ b/src/gui/piano.cpp @@ -130,6 +130,24 @@ void FurnaceGUI::drawPiano() { pianoInputPadMode=PIANO_INPUT_PAD_SPLIT_VISIBLE; } ImGui::Unindent(); + ImGui::Text(_("Key labels:")); + ImGui::Indent(); + if (ImGui::RadioButton(_("Disabled"),pianoLabelsMode==PIANO_LABELS_OFF)) { + pianoLabelsMode=PIANO_LABELS_OFF; + } + if (ImGui::RadioButton(_("Octaves"),pianoLabelsMode==PIANO_LABELS_OCTAVE)) { + pianoLabelsMode=PIANO_LABELS_OCTAVE; + } + if (ImGui::RadioButton(_("Notes"),pianoLabelsMode==PIANO_LABELS_NOTE)) { + pianoLabelsMode=PIANO_LABELS_NOTE; + } + if (ImGui::RadioButton(_("Octaves (with C)"),pianoLabelsMode==PIANO_LABELS_OCTAVE_C)) { + pianoLabelsMode=PIANO_LABELS_OCTAVE_C; + } + if (ImGui::RadioButton(_("Notes + Octaves"),pianoLabelsMode==PIANO_LABELS_OCTAVE_NOTE)) { + pianoLabelsMode=PIANO_LABELS_OCTAVE_NOTE; + } + ImGui::Unindent(); ImGui::Checkbox(_("Share play/edit offset/range"),&pianoSharePosition); ImGui::Checkbox(_("Read-only (can't input notes)"),&pianoReadonly); ImGui::EndPopup(); @@ -268,7 +286,12 @@ void FurnaceGUI::drawPiano() { p1.x-=dpiScale; dl->AddRectFilled(p0,p1,ImGui::ColorConvertFloat4ToU32(color)); if ((i%12)==0) { - String label=fmt::sprintf("%d",(note-60)/12); + String label=""; + switch (pianoLabelsMode) { + case PIANO_LABELS_OCTAVE: + label=fmt::sprintf("%d",(note-60)/12); + break; + } ImVec2 pText=ImLerp(p0,p1,ImVec2(0.5f,1.0f)); ImVec2 labelSize=ImGui::CalcTextSize(label.c_str()); pText.x-=labelSize.x*0.5f;