GUI: ready for sample chip sel grid?

This commit is contained in:
tildearrow 2022-11-26 04:13:11 -05:00
parent e8f5c9f5f9
commit d4f96617fc
2 changed files with 38 additions and 2 deletions

View File

@ -113,6 +113,8 @@ struct DivSample {
// - 2: Pingpong loop
DivSampleLoopMode loopMode;
bool renderOn[4][32];
// these are the new data structures.
signed char* data8; // 8
short* data16; // 16
@ -325,7 +327,14 @@ struct DivSample {
lengthB(0),
lengthBRR(0),
lengthVOX(0),
samples(0) {}
samples(0) {
for (int i=0; i<32; i++) {
renderOn[0][i]=true;
renderOn[1][i]=true;
renderOn[2][i]=true;
renderOn[3][i]=true;
}
}
~DivSample();
};

View File

@ -273,7 +273,34 @@ void FurnaceGUI::drawSampleEdit() {
ImGui::EndDisabled();
ImGui::TableNextColumn();
ImGui::Text("To-do...");
if (e->song.systemLen<1) {
ImGui::Text("NO CHIPS LESS GOOO");
} else {
if (ImGui::BeginTable("SEChipSel",e->song.systemLen+1,ImGuiTableFlags_SizingFixedSame|ImGuiTableFlags_ScrollX)) {
ImGui::TableNextRow();
ImGui::TableNextColumn();
for (int i=0; i<e->song.systemLen; i++) {
ImGui::TableNextColumn();
ImGui::Text("%d",i+1);
}
char id[1024];
for (int i=0; i<4; i++) {
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::Text("%c",'A'+i);
for (int j=0; j<e->song.systemLen; j++) {
ImGui::TableNextColumn();
snprintf(id,1023,"##_SEC%d_%d",i,j);
if (ImGui::Checkbox(id,&sample->renderOn[i][j])) {
showError("wait! I have not implemented that yet!");
}
}
}
ImGui::EndTable();
}
}
}
ImGui::EndTable();