mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-15 17:25:06 +00:00
GUI: add pattern cell spacing settings
This commit is contained in:
parent
3a9ef81fe0
commit
33dc18bac2
3 changed files with 78 additions and 10 deletions
|
@ -943,6 +943,11 @@ class FurnaceGUI {
|
||||||
int noMultiSystem;
|
int noMultiSystem;
|
||||||
int oldMacroVSlider;
|
int oldMacroVSlider;
|
||||||
int displayAllInsTypes;
|
int displayAllInsTypes;
|
||||||
|
int noteCellSpacing;
|
||||||
|
int insCellSpacing;
|
||||||
|
int volCellSpacing;
|
||||||
|
int effectCellSpacing;
|
||||||
|
int effectValCellSpacing;
|
||||||
unsigned int maxUndoSteps;
|
unsigned int maxUndoSteps;
|
||||||
String mainFontPath;
|
String mainFontPath;
|
||||||
String patFontPath;
|
String patFontPath;
|
||||||
|
@ -1036,6 +1041,11 @@ class FurnaceGUI {
|
||||||
noMultiSystem(0),
|
noMultiSystem(0),
|
||||||
oldMacroVSlider(0),
|
oldMacroVSlider(0),
|
||||||
displayAllInsTypes(0),
|
displayAllInsTypes(0),
|
||||||
|
noteCellSpacing(0),
|
||||||
|
insCellSpacing(0),
|
||||||
|
volCellSpacing(0),
|
||||||
|
effectCellSpacing(0),
|
||||||
|
effectValCellSpacing(0),
|
||||||
maxUndoSteps(100),
|
maxUndoSteps(100),
|
||||||
mainFontPath(""),
|
mainFontPath(""),
|
||||||
patFontPath(""),
|
patFontPath(""),
|
||||||
|
@ -1183,6 +1193,7 @@ class FurnaceGUI {
|
||||||
|
|
||||||
// pattern view specific
|
// pattern view specific
|
||||||
ImVec2 fourChars, threeChars, twoChars;
|
ImVec2 fourChars, threeChars, twoChars;
|
||||||
|
ImVec2 noteCellSize, insCellSize, volCellSize, effectCellSize, effectValCellSize;
|
||||||
SelectionPoint sel1, sel2;
|
SelectionPoint sel1, sel2;
|
||||||
int dummyRows, demandX;
|
int dummyRows, demandX;
|
||||||
int transposeAmount, randomizeMin, randomizeMax, fadeMin, fadeMax;
|
int transposeAmount, randomizeMin, randomizeMax, fadeMin, fadeMax;
|
||||||
|
|
|
@ -138,12 +138,12 @@ inline void FurnaceGUI::patternRow(int i, bool isPlaying, float lineHeight, int
|
||||||
ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_CURSOR]);
|
ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_CURSOR]);
|
||||||
ImGui::PushStyleColor(ImGuiCol_HeaderActive,uiColors[GUI_COLOR_PATTERN_CURSOR_ACTIVE]);
|
ImGui::PushStyleColor(ImGuiCol_HeaderActive,uiColors[GUI_COLOR_PATTERN_CURSOR_ACTIVE]);
|
||||||
ImGui::PushStyleColor(ImGuiCol_HeaderHovered,uiColors[GUI_COLOR_PATTERN_CURSOR_HOVER]);
|
ImGui::PushStyleColor(ImGuiCol_HeaderHovered,uiColors[GUI_COLOR_PATTERN_CURSOR_HOVER]);
|
||||||
ImGui::Selectable(id,true,ImGuiSelectableFlags_NoPadWithHalfSpacing,threeChars);
|
ImGui::Selectable(id,true,ImGuiSelectableFlags_NoPadWithHalfSpacing,noteCellSize);
|
||||||
demandX=ImGui::GetCursorPosX();
|
demandX=ImGui::GetCursorPosX();
|
||||||
ImGui::PopStyleColor(3);
|
ImGui::PopStyleColor(3);
|
||||||
} else {
|
} else {
|
||||||
if (selectedNote) ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_SELECTION]);
|
if (selectedNote) ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_SELECTION]);
|
||||||
ImGui::Selectable(id,isPushing || selectedNote,ImGuiSelectableFlags_NoPadWithHalfSpacing,threeChars);
|
ImGui::Selectable(id,isPushing || selectedNote,ImGuiSelectableFlags_NoPadWithHalfSpacing,noteCellSize);
|
||||||
if (selectedNote) ImGui::PopStyleColor();
|
if (selectedNote) ImGui::PopStyleColor();
|
||||||
}
|
}
|
||||||
if (ImGui::IsItemClicked()) {
|
if (ImGui::IsItemClicked()) {
|
||||||
|
@ -178,12 +178,12 @@ inline void FurnaceGUI::patternRow(int i, bool isPlaying, float lineHeight, int
|
||||||
ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_CURSOR]);
|
ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_CURSOR]);
|
||||||
ImGui::PushStyleColor(ImGuiCol_HeaderActive,uiColors[GUI_COLOR_PATTERN_CURSOR_ACTIVE]);
|
ImGui::PushStyleColor(ImGuiCol_HeaderActive,uiColors[GUI_COLOR_PATTERN_CURSOR_ACTIVE]);
|
||||||
ImGui::PushStyleColor(ImGuiCol_HeaderHovered,uiColors[GUI_COLOR_PATTERN_CURSOR_HOVER]);
|
ImGui::PushStyleColor(ImGuiCol_HeaderHovered,uiColors[GUI_COLOR_PATTERN_CURSOR_HOVER]);
|
||||||
ImGui::Selectable(id,true,ImGuiSelectableFlags_NoPadWithHalfSpacing,twoChars);
|
ImGui::Selectable(id,true,ImGuiSelectableFlags_NoPadWithHalfSpacing,insCellSize);
|
||||||
demandX=ImGui::GetCursorPosX();
|
demandX=ImGui::GetCursorPosX();
|
||||||
ImGui::PopStyleColor(3);
|
ImGui::PopStyleColor(3);
|
||||||
} else {
|
} else {
|
||||||
if (selectedIns) ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_SELECTION]);
|
if (selectedIns) ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_SELECTION]);
|
||||||
ImGui::Selectable(id,isPushing || selectedIns,ImGuiSelectableFlags_NoPadWithHalfSpacing,twoChars);
|
ImGui::Selectable(id,isPushing || selectedIns,ImGuiSelectableFlags_NoPadWithHalfSpacing,insCellSize);
|
||||||
if (selectedIns) ImGui::PopStyleColor();
|
if (selectedIns) ImGui::PopStyleColor();
|
||||||
}
|
}
|
||||||
if (ImGui::IsItemClicked()) {
|
if (ImGui::IsItemClicked()) {
|
||||||
|
@ -212,12 +212,12 @@ inline void FurnaceGUI::patternRow(int i, bool isPlaying, float lineHeight, int
|
||||||
ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_CURSOR]);
|
ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_CURSOR]);
|
||||||
ImGui::PushStyleColor(ImGuiCol_HeaderActive,uiColors[GUI_COLOR_PATTERN_CURSOR_ACTIVE]);
|
ImGui::PushStyleColor(ImGuiCol_HeaderActive,uiColors[GUI_COLOR_PATTERN_CURSOR_ACTIVE]);
|
||||||
ImGui::PushStyleColor(ImGuiCol_HeaderHovered,uiColors[GUI_COLOR_PATTERN_CURSOR_HOVER]);
|
ImGui::PushStyleColor(ImGuiCol_HeaderHovered,uiColors[GUI_COLOR_PATTERN_CURSOR_HOVER]);
|
||||||
ImGui::Selectable(id,true,ImGuiSelectableFlags_NoPadWithHalfSpacing,twoChars);
|
ImGui::Selectable(id,true,ImGuiSelectableFlags_NoPadWithHalfSpacing,volCellSize);
|
||||||
demandX=ImGui::GetCursorPosX();
|
demandX=ImGui::GetCursorPosX();
|
||||||
ImGui::PopStyleColor(3);
|
ImGui::PopStyleColor(3);
|
||||||
} else {
|
} else {
|
||||||
if (selectedVol) ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_SELECTION]);
|
if (selectedVol) ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_SELECTION]);
|
||||||
ImGui::Selectable(id,isPushing || selectedVol,ImGuiSelectableFlags_NoPadWithHalfSpacing,twoChars);
|
ImGui::Selectable(id,isPushing || selectedVol,ImGuiSelectableFlags_NoPadWithHalfSpacing,volCellSize);
|
||||||
if (selectedVol) ImGui::PopStyleColor();
|
if (selectedVol) ImGui::PopStyleColor();
|
||||||
}
|
}
|
||||||
if (ImGui::IsItemClicked()) {
|
if (ImGui::IsItemClicked()) {
|
||||||
|
@ -257,12 +257,12 @@ inline void FurnaceGUI::patternRow(int i, bool isPlaying, float lineHeight, int
|
||||||
ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_CURSOR]);
|
ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_CURSOR]);
|
||||||
ImGui::PushStyleColor(ImGuiCol_HeaderActive,uiColors[GUI_COLOR_PATTERN_CURSOR_ACTIVE]);
|
ImGui::PushStyleColor(ImGuiCol_HeaderActive,uiColors[GUI_COLOR_PATTERN_CURSOR_ACTIVE]);
|
||||||
ImGui::PushStyleColor(ImGuiCol_HeaderHovered,uiColors[GUI_COLOR_PATTERN_CURSOR_HOVER]);
|
ImGui::PushStyleColor(ImGuiCol_HeaderHovered,uiColors[GUI_COLOR_PATTERN_CURSOR_HOVER]);
|
||||||
ImGui::Selectable(id,true,ImGuiSelectableFlags_NoPadWithHalfSpacing,twoChars);
|
ImGui::Selectable(id,true,ImGuiSelectableFlags_NoPadWithHalfSpacing,effectCellSize);
|
||||||
demandX=ImGui::GetCursorPosX();
|
demandX=ImGui::GetCursorPosX();
|
||||||
ImGui::PopStyleColor(3);
|
ImGui::PopStyleColor(3);
|
||||||
} else {
|
} else {
|
||||||
if (selectedEffect) ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_SELECTION]);
|
if (selectedEffect) ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_SELECTION]);
|
||||||
ImGui::Selectable(id,isPushing || selectedEffect,ImGuiSelectableFlags_NoPadWithHalfSpacing,twoChars);
|
ImGui::Selectable(id,isPushing || selectedEffect,ImGuiSelectableFlags_NoPadWithHalfSpacing,effectCellSize);
|
||||||
if (selectedEffect) ImGui::PopStyleColor();
|
if (selectedEffect) ImGui::PopStyleColor();
|
||||||
}
|
}
|
||||||
if (ImGui::IsItemClicked()) {
|
if (ImGui::IsItemClicked()) {
|
||||||
|
@ -283,12 +283,12 @@ inline void FurnaceGUI::patternRow(int i, bool isPlaying, float lineHeight, int
|
||||||
ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_CURSOR]);
|
ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_CURSOR]);
|
||||||
ImGui::PushStyleColor(ImGuiCol_HeaderActive,uiColors[GUI_COLOR_PATTERN_CURSOR_ACTIVE]);
|
ImGui::PushStyleColor(ImGuiCol_HeaderActive,uiColors[GUI_COLOR_PATTERN_CURSOR_ACTIVE]);
|
||||||
ImGui::PushStyleColor(ImGuiCol_HeaderHovered,uiColors[GUI_COLOR_PATTERN_CURSOR_HOVER]);
|
ImGui::PushStyleColor(ImGuiCol_HeaderHovered,uiColors[GUI_COLOR_PATTERN_CURSOR_HOVER]);
|
||||||
ImGui::Selectable(id,true,ImGuiSelectableFlags_NoPadWithHalfSpacing,twoChars);
|
ImGui::Selectable(id,true,ImGuiSelectableFlags_NoPadWithHalfSpacing,effectValCellSize);
|
||||||
demandX=ImGui::GetCursorPosX();
|
demandX=ImGui::GetCursorPosX();
|
||||||
ImGui::PopStyleColor(3);
|
ImGui::PopStyleColor(3);
|
||||||
} else {
|
} else {
|
||||||
if (selectedEffectVal) ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_SELECTION]);
|
if (selectedEffectVal) ImGui::PushStyleColor(ImGuiCol_Header,uiColors[GUI_COLOR_PATTERN_SELECTION]);
|
||||||
ImGui::Selectable(id,isPushing || selectedEffectVal,ImGuiSelectableFlags_NoPadWithHalfSpacing,twoChars);
|
ImGui::Selectable(id,isPushing || selectedEffectVal,ImGuiSelectableFlags_NoPadWithHalfSpacing,effectValCellSize);
|
||||||
if (selectedEffectVal) ImGui::PopStyleColor();
|
if (selectedEffectVal) ImGui::PopStyleColor();
|
||||||
}
|
}
|
||||||
if (ImGui::IsItemClicked()) {
|
if (ImGui::IsItemClicked()) {
|
||||||
|
@ -549,7 +549,20 @@ void FurnaceGUI::drawPattern() {
|
||||||
threeChars=ImVec2(oneCharSize*3.0f,lineHeight);
|
threeChars=ImVec2(oneCharSize*3.0f,lineHeight);
|
||||||
twoChars=ImVec2(oneCharSize*2.0f,lineHeight);
|
twoChars=ImVec2(oneCharSize*2.0f,lineHeight);
|
||||||
//ImVec2 oneChar=ImVec2(oneCharSize,lineHeight);
|
//ImVec2 oneChar=ImVec2(oneCharSize,lineHeight);
|
||||||
|
|
||||||
|
noteCellSize=threeChars;
|
||||||
|
noteCellSize.x+=(float)settings.noteCellSpacing*dpiScale;
|
||||||
|
insCellSize=twoChars;
|
||||||
|
insCellSize.x+=(float)settings.insCellSpacing*dpiScale;
|
||||||
|
volCellSize=twoChars;
|
||||||
|
volCellSize.x+=(float)settings.volCellSpacing*dpiScale;
|
||||||
|
effectCellSize=twoChars;
|
||||||
|
effectCellSize.x+=(float)settings.effectCellSpacing*dpiScale;
|
||||||
|
effectValCellSize=twoChars;
|
||||||
|
effectValCellSize.x+=(float)settings.effectValCellSpacing*dpiScale;
|
||||||
|
|
||||||
dummyRows=(ImGui::GetWindowSize().y/lineHeight)/2;
|
dummyRows=(ImGui::GetWindowSize().y/lineHeight)/2;
|
||||||
|
|
||||||
// オップナー2608 i owe you one more for this horrible code
|
// オップナー2608 i owe you one more for this horrible code
|
||||||
// previous pattern
|
// previous pattern
|
||||||
ImGui::BeginDisabled();
|
ImGui::BeginDisabled();
|
||||||
|
|
|
@ -1240,6 +1240,35 @@ void FurnaceGUI::drawSettings() {
|
||||||
|
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
|
|
||||||
|
ImGui::Text("Pattern view spacing after:");
|
||||||
|
|
||||||
|
if (CWSliderInt("Note",&settings.noteCellSpacing,0,32)) {
|
||||||
|
if (settings.noteCellSpacing<0) settings.noteCellSpacing=0;
|
||||||
|
if (settings.noteCellSpacing>32) settings.noteCellSpacing=32;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CWSliderInt("Instrument",&settings.insCellSpacing,0,32)) {
|
||||||
|
if (settings.insCellSpacing<0) settings.insCellSpacing=0;
|
||||||
|
if (settings.insCellSpacing>32) settings.insCellSpacing=32;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CWSliderInt("Volume",&settings.volCellSpacing,0,32)) {
|
||||||
|
if (settings.volCellSpacing<0) settings.volCellSpacing=0;
|
||||||
|
if (settings.volCellSpacing>32) settings.volCellSpacing=32;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CWSliderInt("Effect",&settings.effectCellSpacing,0,32)) {
|
||||||
|
if (settings.effectCellSpacing<0) settings.effectCellSpacing=0;
|
||||||
|
if (settings.effectCellSpacing>32) settings.effectCellSpacing=32;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CWSliderInt("Effect value",&settings.effectValCellSpacing,0,32)) {
|
||||||
|
if (settings.effectValCellSpacing<0) settings.effectValCellSpacing=0;
|
||||||
|
if (settings.effectValCellSpacing>32) settings.effectValCellSpacing=32;
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui::Separator();
|
||||||
|
|
||||||
if (ImGui::TreeNode("Color scheme")) {
|
if (ImGui::TreeNode("Color scheme")) {
|
||||||
if (ImGui::Button("Import")) {
|
if (ImGui::Button("Import")) {
|
||||||
openFileDialog(GUI_FILE_IMPORT_COLORS);
|
openFileDialog(GUI_FILE_IMPORT_COLORS);
|
||||||
|
@ -1975,6 +2004,11 @@ void FurnaceGUI::syncSettings() {
|
||||||
settings.noMultiSystem=e->getConfInt("noMultiSystem",0);
|
settings.noMultiSystem=e->getConfInt("noMultiSystem",0);
|
||||||
settings.oldMacroVSlider=e->getConfInt("oldMacroVSlider",0);
|
settings.oldMacroVSlider=e->getConfInt("oldMacroVSlider",0);
|
||||||
settings.displayAllInsTypes=e->getConfInt("displayAllInsTypes",0);
|
settings.displayAllInsTypes=e->getConfInt("displayAllInsTypes",0);
|
||||||
|
settings.noteCellSpacing=e->getConfInt("noteCellSpacing",0);
|
||||||
|
settings.insCellSpacing=e->getConfInt("insCellSpacing",0);
|
||||||
|
settings.volCellSpacing=e->getConfInt("volCellSpacing",0);
|
||||||
|
settings.effectCellSpacing=e->getConfInt("effectCellSpacing",0);
|
||||||
|
settings.effectValCellSpacing=e->getConfInt("effectValCellSpacing",0);
|
||||||
|
|
||||||
clampSetting(settings.mainFontSize,2,96);
|
clampSetting(settings.mainFontSize,2,96);
|
||||||
clampSetting(settings.patFontSize,2,96);
|
clampSetting(settings.patFontSize,2,96);
|
||||||
|
@ -2052,6 +2086,11 @@ void FurnaceGUI::syncSettings() {
|
||||||
clampSetting(settings.noMultiSystem,0,1);
|
clampSetting(settings.noMultiSystem,0,1);
|
||||||
clampSetting(settings.oldMacroVSlider,0,1);
|
clampSetting(settings.oldMacroVSlider,0,1);
|
||||||
clampSetting(settings.displayAllInsTypes,0,1);
|
clampSetting(settings.displayAllInsTypes,0,1);
|
||||||
|
clampSetting(settings.noteCellSpacing,0,32);
|
||||||
|
clampSetting(settings.insCellSpacing,0,32);
|
||||||
|
clampSetting(settings.volCellSpacing,0,32);
|
||||||
|
clampSetting(settings.effectCellSpacing,0,32);
|
||||||
|
clampSetting(settings.effectValCellSpacing,0,32);
|
||||||
|
|
||||||
settings.initialSys=e->decodeSysDesc(e->getConfString("initialSys",""));
|
settings.initialSys=e->decodeSysDesc(e->getConfString("initialSys",""));
|
||||||
if (settings.initialSys.size()<4) {
|
if (settings.initialSys.size()<4) {
|
||||||
|
@ -2178,6 +2217,11 @@ void FurnaceGUI::commitSettings() {
|
||||||
e->setConf("noMultiSystem",settings.noMultiSystem);
|
e->setConf("noMultiSystem",settings.noMultiSystem);
|
||||||
e->setConf("oldMacroVSlider",settings.oldMacroVSlider);
|
e->setConf("oldMacroVSlider",settings.oldMacroVSlider);
|
||||||
e->setConf("displayAllInsTypes",settings.displayAllInsTypes);
|
e->setConf("displayAllInsTypes",settings.displayAllInsTypes);
|
||||||
|
e->setConf("noteCellSpacing",settings.noteCellSpacing);
|
||||||
|
e->setConf("insCellSpacing",settings.insCellSpacing);
|
||||||
|
e->setConf("volCellSpacing",settings.volCellSpacing);
|
||||||
|
e->setConf("effectCellSpacing",settings.effectCellSpacing);
|
||||||
|
e->setConf("effectValCellSpacing",settings.effectValCellSpacing);
|
||||||
|
|
||||||
// colors
|
// colors
|
||||||
for (int i=0; i<GUI_COLOR_MAX; i++) {
|
for (int i=0; i<GUI_COLOR_MAX; i++) {
|
||||||
|
|
Loading…
Reference in a new issue