Now it works ofr OPLL too, plus global sus
This commit is contained in:
parent
62ea469600
commit
83baae92d9
2 changed files with 9 additions and 5 deletions
|
|
@ -901,7 +901,7 @@ void FurnaceGUI::drawAlgorithm(unsigned char alg, FurnaceGUIFMAlgs algType, cons
|
|||
}
|
||||
}
|
||||
|
||||
void FurnaceGUI::drawFMEnv(unsigned char tl, unsigned char ar, unsigned char dr, unsigned char d2r, unsigned char rr, unsigned char sl, unsigned char sus, float maxTl, float maxArDr, const ImVec2& size) {
|
||||
void FurnaceGUI::drawFMEnv(unsigned char tl, unsigned char ar, unsigned char dr, unsigned char d2r, unsigned char rr, unsigned char sl, unsigned char sus, unsigned char egt, unsigned char algOrGlobalSus, float maxTl, float maxArDr, const ImVec2& size, unsigned short instType) {
|
||||
ImDrawList* dl=ImGui::GetWindowDrawList();
|
||||
ImGuiWindow* window=ImGui::GetCurrentWindow();
|
||||
|
||||
|
|
@ -918,6 +918,10 @@ void FurnaceGUI::drawFMEnv(unsigned char tl, unsigned char ar, unsigned char dr,
|
|||
if (ImGui::ItemAdd(rect,ImGui::GetID("alg"))) {
|
||||
ImGui::RenderFrame(rect.Min,rect.Max,ImGui::GetColorU32(ImGuiCol_FrameBg),true,style.FrameRounding);
|
||||
|
||||
//Adjust for OPLL global sustain setting
|
||||
if (instType==DIV_INS_OPLL && algOrGlobalSus==1.0){
|
||||
rr = 5.0;
|
||||
}
|
||||
//calculate x positions
|
||||
float arPos=float(maxArDr-ar)/maxArDr; //peak of AR, start of DR
|
||||
float drPos=arPos+((sl/15.0)*(float(maxArDr-dr)/maxArDr)); //end of DR, start of D2R
|
||||
|
|
@ -951,7 +955,7 @@ void FurnaceGUI::drawFMEnv(unsigned char tl, unsigned char ar, unsigned char dr,
|
|||
//addAALine(dl,pos3,posSLineVEnd,colorS); //draw vert. line through sustain level
|
||||
addAALine(dl,pos1,pos2,color); //A
|
||||
addAALine(dl,pos2,posDecayRate0Pt,color); //Line from A to end of graph
|
||||
} else if (d2r==0.0 || sus==1.0) { //if D2R = 0, the envelope stays at the sustain level forever
|
||||
} else if (d2r==0.0 || (instType==DIV_INS_OPL && sus==1.0) || (instType==DIV_INS_OPLL && egt!=0.0)) { //envelope stays at the sustain level forever
|
||||
dl->AddTriangleFilled(posRStart,posREnd,pos1,colorS); //draw release as shaded triangle behind everything
|
||||
addAALine(dl,pos3,posSLineHEnd,colorS); //draw horiz line through sustain level
|
||||
addAALine(dl,pos3,posSLineVEnd,colorS); //draw vert. line through sustain level
|
||||
|
|
@ -1806,7 +1810,7 @@ void FurnaceGUI::drawInsEdit() {
|
|||
}
|
||||
|
||||
ImGui::TableNextColumn();
|
||||
drawFMEnv(op.tl&maxTl,op.ar&maxArDr,op.dr&maxArDr,(ins->type==DIV_INS_OPL || ins->type==DIV_INS_OPLL)?((op.rr&15)*2):op.d2r&31,op.rr&15,op.sl&15,op.sus,maxTl,maxArDr,ImVec2(ImGui::GetContentRegionAvail().x,sliderHeight));
|
||||
drawFMEnv(op.tl&maxTl,op.ar&maxArDr,op.dr&maxArDr,(ins->type==DIV_INS_OPL || ins->type==DIV_INS_OPLL)?((op.rr&15)*2):op.d2r&31,op.rr&15,op.sl&15,op.sus,op.ssgEnv&8,ins->fm.alg,maxTl,maxArDr,ImVec2(ImGui::GetContentRegionAvail().x,sliderHeight),ins->type);
|
||||
|
||||
ImGui::PopID();
|
||||
}
|
||||
|
|
@ -1889,7 +1893,7 @@ void FurnaceGUI::drawInsEdit() {
|
|||
}
|
||||
|
||||
//52.0 controls vert scaling; default 96
|
||||
drawFMEnv(op.tl&maxTl,op.ar&maxArDr,op.dr&maxArDr,(ins->type==DIV_INS_OPL || ins->type==DIV_INS_OPLL)?((op.rr&15)*2):op.d2r&31,op.rr&15,op.sl&15,op.sus,maxTl,maxArDr,ImVec2(ImGui::GetContentRegionAvail().x,52.0*dpiScale));
|
||||
drawFMEnv(op.tl&maxTl,op.ar&maxArDr,op.dr&maxArDr,(ins->type==DIV_INS_OPL || ins->type==DIV_INS_OPLL)?((op.rr&15)*2):op.d2r&31,op.rr&15,op.sl&15,op.sus,op.ssgEnv&8,ins->fm.alg,maxTl,maxArDr,ImVec2(ImGui::GetContentRegionAvail().x,52.0*dpiScale),ins->type);
|
||||
//P(CWSliderScalar(FM_NAME(FM_AR),ImGuiDataType_U8,&op.ar,&_ZERO,&_THIRTY_ONE)); rightClickable
|
||||
if (ImGui::BeginTable("opParams",2,ImGuiTableFlags_SizingStretchProp)) {
|
||||
ImGui::TableSetupColumn("c0",ImGuiTableColumnFlags_WidthStretch,0.0); \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue