GUI: channel pair hints, part 3
to-do: - flooring
This commit is contained in:
parent
7fc734744d
commit
8422e5dc1b
|
@ -310,6 +310,8 @@ enum FurnaceGUIColors {
|
||||||
GUI_COLOR_PATTERN_STATUS_REL_ON,
|
GUI_COLOR_PATTERN_STATUS_REL_ON,
|
||||||
GUI_COLOR_PATTERN_STATUS_ON,
|
GUI_COLOR_PATTERN_STATUS_ON,
|
||||||
|
|
||||||
|
GUI_COLOR_PATTERN_PAIR,
|
||||||
|
|
||||||
GUI_COLOR_SAMPLE_BG,
|
GUI_COLOR_SAMPLE_BG,
|
||||||
GUI_COLOR_SAMPLE_FG,
|
GUI_COLOR_SAMPLE_FG,
|
||||||
GUI_COLOR_SAMPLE_LOOP,
|
GUI_COLOR_SAMPLE_LOOP,
|
||||||
|
|
|
@ -993,6 +993,8 @@ const FurnaceGUIColorDef guiColors[GUI_COLOR_MAX]={
|
||||||
D(GUI_COLOR_PATTERN_STATUS_REL_ON,"",ImVec4(1.0f,0.8f,0.1f,1.0f)),
|
D(GUI_COLOR_PATTERN_STATUS_REL_ON,"",ImVec4(1.0f,0.8f,0.1f,1.0f)),
|
||||||
D(GUI_COLOR_PATTERN_STATUS_ON,"",ImVec4(0.3f,1.0f,0.1f,1.0f)),
|
D(GUI_COLOR_PATTERN_STATUS_ON,"",ImVec4(0.3f,1.0f,0.1f,1.0f)),
|
||||||
|
|
||||||
|
D(GUI_COLOR_PATTERN_PAIR,"",ImVec4(0.6f,0.8f,1.0f,1.0f)),
|
||||||
|
|
||||||
D(GUI_COLOR_SAMPLE_BG,"",ImVec4(0.04f,0.13f,0.2f,1.0f)),
|
D(GUI_COLOR_SAMPLE_BG,"",ImVec4(0.04f,0.13f,0.2f,1.0f)),
|
||||||
D(GUI_COLOR_SAMPLE_FG,"",ImVec4(0.7f,0.7f,0.7f,1.0f)),
|
D(GUI_COLOR_SAMPLE_FG,"",ImVec4(0.7f,0.7f,0.7f,1.0f)),
|
||||||
D(GUI_COLOR_SAMPLE_LOOP,"",ImVec4(0.1f,0.22f,0.35f,1.0f)),
|
D(GUI_COLOR_SAMPLE_LOOP,"",ImVec4(0.1f,0.22f,0.35f,1.0f)),
|
||||||
|
|
|
@ -448,6 +448,7 @@ void FurnaceGUI::drawPattern() {
|
||||||
nextScroll=-1.0f;
|
nextScroll=-1.0f;
|
||||||
nextAddScroll=0.0f;
|
nextAddScroll=0.0f;
|
||||||
}
|
}
|
||||||
|
ImDrawList* tdl=NULL;
|
||||||
if (ImGui::BeginTable("PatternView",displayChans+2,ImGuiTableFlags_BordersInnerV|ImGuiTableFlags_ScrollX|ImGuiTableFlags_ScrollY|ImGuiTableFlags_NoPadInnerX|ImGuiTableFlags_NoBordersInFrozenArea|((settings.cursorFollowsWheel || wheelCalmDown)?ImGuiTableFlags_NoScrollWithMouse:0))) {
|
if (ImGui::BeginTable("PatternView",displayChans+2,ImGuiTableFlags_BordersInnerV|ImGuiTableFlags_ScrollX|ImGuiTableFlags_ScrollY|ImGuiTableFlags_NoPadInnerX|ImGuiTableFlags_NoBordersInFrozenArea|((settings.cursorFollowsWheel || wheelCalmDown)?ImGuiTableFlags_NoScrollWithMouse:0))) {
|
||||||
ImGui::TableSetupColumn("pos",ImGuiTableColumnFlags_WidthFixed);
|
ImGui::TableSetupColumn("pos",ImGuiTableColumnFlags_WidthFixed);
|
||||||
char chanID[2048];
|
char chanID[2048];
|
||||||
|
@ -1134,11 +1135,13 @@ void FurnaceGUI::drawPattern() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// HACK: rendering here would cause the pairs to be drawn behind the pattern for some reason...
|
||||||
|
tdl=ImGui::GetWindowDrawList();
|
||||||
ImGui::EndTable();
|
ImGui::EndTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (patChannelPairs && e->isRunning()) { // pair hints
|
ImGui::PushFont(mainFont);
|
||||||
ImDrawList* dl=ImGui::GetWindowDrawList();
|
if (patChannelPairs && e->isRunning() && tdl!=NULL) { // pair hints
|
||||||
float pos=0.0f;
|
float pos=0.0f;
|
||||||
float posCenter=0.0f;
|
float posCenter=0.0f;
|
||||||
float posMin=FLT_MAX;
|
float posMin=FLT_MAX;
|
||||||
|
@ -1177,11 +1180,11 @@ void FurnaceGUI::drawPattern() {
|
||||||
} else {
|
} else {
|
||||||
textSize=ImGui::CalcTextSize(pairs.label);
|
textSize=ImGui::CalcTextSize(pairs.label);
|
||||||
}
|
}
|
||||||
dl->AddLine(
|
tdl->AddLine(
|
||||||
ImVec2(pos,posY),
|
ImVec2(pos,posY),
|
||||||
ImVec2(pos,posY+textSize.y),
|
ImVec2(pos,posY+textSize.y),
|
||||||
0xffffffff,
|
ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]),
|
||||||
dpiScale
|
2.0f*dpiScale
|
||||||
);
|
);
|
||||||
|
|
||||||
for (int j=0; j<8; j++) {
|
for (int j=0; j<8; j++) {
|
||||||
|
@ -1196,45 +1199,54 @@ void FurnaceGUI::drawPattern() {
|
||||||
numPairs++;
|
numPairs++;
|
||||||
if (pos<posMin) posMin=pos;
|
if (pos<posMin) posMin=pos;
|
||||||
if (pos>posMax) posMax=pos;
|
if (pos>posMax) posMax=pos;
|
||||||
dl->AddLine(
|
tdl->AddLine(
|
||||||
ImVec2(pos,posY),
|
ImVec2(pos,posY),
|
||||||
ImVec2(pos,posY+textSize.y),
|
ImVec2(pos,posY+textSize.y),
|
||||||
0xffffffff,
|
ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]),
|
||||||
dpiScale
|
2.0f*dpiScale
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
posCenter/=numPairs;
|
posCenter/=numPairs;
|
||||||
|
|
||||||
if (pairs.label==NULL) {
|
if (pairs.label==NULL) {
|
||||||
dl->AddLine(
|
tdl->AddLine(
|
||||||
ImVec2(posMin,posY+textSize.y),
|
ImVec2(posMin,posY+textSize.y),
|
||||||
ImVec2(posMax,posY+textSize.y),
|
ImVec2(posMax,posY+textSize.y),
|
||||||
0xffffffff,
|
ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]),
|
||||||
dpiScale
|
2.0f*dpiScale
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
dl->AddLine(
|
tdl->AddLine(
|
||||||
ImVec2(posMin,posY+textSize.y),
|
ImVec2(posMin,posY+textSize.y),
|
||||||
ImVec2(posCenter-textSize.x*0.5,posY+textSize.y),
|
ImVec2(posCenter-textSize.x*0.5-6.0f*dpiScale,posY+textSize.y),
|
||||||
0xffffffff,
|
ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]),
|
||||||
dpiScale
|
2.0f*dpiScale
|
||||||
);
|
);
|
||||||
dl->AddLine(
|
tdl->AddLine(
|
||||||
ImVec2(posCenter+textSize.x*0.5,posY+textSize.y),
|
ImVec2(posCenter+textSize.x*0.5+6.0f*dpiScale,posY+textSize.y),
|
||||||
ImVec2(posMax,posY+textSize.y),
|
ImVec2(posMax,posY+textSize.y),
|
||||||
0xffffffff,
|
ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]),
|
||||||
dpiScale
|
2.0f*dpiScale
|
||||||
);
|
);
|
||||||
|
|
||||||
dl->AddText(
|
ImGui::RenderFrame(
|
||||||
|
ImVec2(posCenter-textSize.x*0.5-6.0f*dpiScale,posY+textSize.y*0.5-3.0f*dpiScale),
|
||||||
|
ImVec2(posCenter+textSize.x*0.5+6.0f*dpiScale,posY+textSize.y*1.5+3.0f*dpiScale),
|
||||||
|
ImGui::GetColorU32(ImGuiCol_FrameBg),
|
||||||
|
true,
|
||||||
|
ImGui::GetStyle().FrameRounding
|
||||||
|
);
|
||||||
|
|
||||||
|
tdl->AddText(
|
||||||
ImVec2(posCenter-textSize.x*0.5,posY+textSize.y*0.5),
|
ImVec2(posCenter-textSize.x*0.5,posY+textSize.y*0.5),
|
||||||
0xffffffff,
|
ImGui::GetColorU32(ImGuiCol_Text),
|
||||||
pairs.label
|
pairs.label
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ImGui::PopFont();
|
||||||
|
|
||||||
if (fancyPattern) { // visualizer
|
if (fancyPattern) { // visualizer
|
||||||
e->getCommandStream(cmdStream);
|
e->getCommandStream(cmdStream);
|
||||||
|
|
Loading…
Reference in a new issue