diff --git a/src/gui/piano.cpp b/src/gui/piano.cpp index 7f1360cc..a022f4a1 100644 --- a/src/gui/piano.cpp +++ b/src/gui/piano.cpp @@ -158,7 +158,7 @@ void FurnaceGUI::drawPiano() { } ImGui::TableNextColumn(); - if (pianoInputPadMode==1 && cursor.xFine>0 && curWindow==GUI_WINDOW_PATTERN) { + if (pianoInputPadMode==1 && cursor.xFine>0) { ImVec2 buttonSize=ImGui::GetContentRegionAvail(); if (ImGui::BeginTable("InputPadP",8,ImGuiTableFlags_SizingFixedSame)) { ImGui::TableNextRow(); @@ -431,7 +431,7 @@ void FurnaceGUI::drawPiano() { ImGui::End(); // draw input pad if necessary - if (curWindow==GUI_WINDOW_PATTERN && ((pianoInputPadMode==2 && cursor.xFine>0) || pianoInputPadMode==3)) { + if ((pianoInputPadMode==2 && cursor.xFine>0) || pianoInputPadMode==3) { if (ImGui::Begin("Input Pad",NULL,ImGuiWindowFlags_NoTitleBar)) { ImGui::BeginDisabled(cursor.xFine==0); if (ImGui::BeginTable("InputPad",3,ImGuiTableFlags_Borders)) { diff --git a/src/gui/sampleEdit.cpp b/src/gui/sampleEdit.cpp index 80e9e88b..50edb4eb 100644 --- a/src/gui/sampleEdit.cpp +++ b/src/gui/sampleEdit.cpp @@ -44,6 +44,8 @@ void FurnaceGUI::drawSampleEdit() { ImGui::SetNextWindowPos(patWindowPos); ImGui::SetNextWindowSize(patWindowSize); } + + if (ImGui::Begin("Sample Editor",&sampleEditOpen,globalWinFlags|(settings.allowEditDocking?0:ImGuiWindowFlags_NoDocking))) { if (curSample<0 || curSample>=(int)e->song.sample.size()) { ImGui::SetCursorPosY(ImGui::GetCursorPosY()+(ImGui::GetContentRegionAvail().y-ImGui::GetFrameHeightWithSpacing()*2.0f)*0.5f); @@ -184,11 +186,13 @@ void FurnaceGUI::drawSampleEdit() { popToggleColors(); ImGui::TableNextColumn(); bool doLoop=(sample->isLoopable()); + static int stepSize = 1; if (ImGui::Checkbox("Loop",&doLoop)) { MARK_MODIFIED if (doLoop) { sample->loop=true; sample->loopStart=0; sample->loopEnd=sample->samples; + stepSize = 1; } else { sample->loop=false; sample->loopStart=-1; @@ -199,6 +203,20 @@ void FurnaceGUI::drawSampleEdit() { e->renderSamplesP(); } } + +/* + static bool snesLoopCheckbox = false; + ImGui::Checkbox("SNES", &snesLoopCheckbox); + { + if (snesLoopCheckbox) { + snesLoopCheckbox = true; + stepSize = 16; + } else { + snesLoopCheckbox = false; + stepSize = 1; + } + } +*/ if (ImGui::IsItemHovered() && sample->depth==DIV_SAMPLE_DEPTH_BRR) { ImGui::SetTooltip("changing the loop in a BRR sample may result in glitches!"); } @@ -367,7 +385,7 @@ void FurnaceGUI::drawSampleEdit() { keepLoopAlive=false; ImGui::Text("Mode"); ImGui::SameLine(); - ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); + ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x / 2); if (ImGui::BeginCombo("##SampleLoopMode",loopType.c_str())) { for (int i=0; i1024) { + stepSize = 1024; + } + } ImGui::Text("Start"); ImGui::SameLine(); ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); - if (ImGui::InputInt("##LoopStartPosition",&sample->loopStart,1,16)) { MARK_MODIFIED + if (ImGui::InputInt("##LoopStartPosition",&sample->loopStart,stepSize,16)) { MARK_MODIFIED if (sample->loopStart<0) { sample->loopStart=0; } @@ -407,7 +437,7 @@ void FurnaceGUI::drawSampleEdit() { ImGui::Text("End"); ImGui::SameLine(); ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); - if (ImGui::InputInt("##LoopEndPosition",&sample->loopEnd,1,16)) { MARK_MODIFIED + if (ImGui::InputInt("##LoopEndPosition",&sample->loopEnd,stepSize,16)) { MARK_MODIFIED if (sample->loopEndloopStart) { sample->loopEnd=sample->loopStart; }