GUI: prepare for FM preview

This commit is contained in:
tildearrow 2023-03-17 19:12:09 -05:00
parent d58270efed
commit 57f4cc8561
4 changed files with 101 additions and 0 deletions

View file

@ -519,6 +519,18 @@ void FurnaceGUI::drawDebug() {
ImGui::InputFloat("maxRr",&maxRr);
ImGui::TreePop();
}
if (ImGui::TreeNode("FM Preview")) {
if (ImGui::Button("Generate")) {
DivInstrument* ins=e->getIns(curIns);
if (ins!=NULL) renderFMPreview(ins->fm);
}
float asFloat[FM_PREVIEW_SIZE];
for (int i=0; i<FM_PREVIEW_SIZE; i++) {
asFloat[i]=(float)fmPreview[i]/8192.0f;
}
ImGui::PlotLines("##DebugFMPreview",asFloat,FM_PREVIEW_SIZE,0,"Preview",-1.0,1.0,ImVec2(300.0f*dpiScale,150.0f*dpiScale));
ImGui::TreePop();
}
if (ImGui::TreeNode("User Interface")) {
if (ImGui::Button("Inspect")) {
inspectorOpen=!inspectorOpen;