mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-29 16:03:01 +00:00
make GUI hide block/f-num in the pitch control mode
This commit is contained in:
parent
2118fb3fdd
commit
b905671798
1 changed files with 72 additions and 57 deletions
|
@ -3804,18 +3804,7 @@ void FurnaceGUI::insTabFM(DivInstrument* ins) {
|
|||
ImGui::TableNextColumn();
|
||||
CENTER_VSLIDER;
|
||||
bool egtOn=op.egt;
|
||||
if(egtOn)
|
||||
{
|
||||
bool susOn=op.sus;
|
||||
if (ImGui::Checkbox("Pitch control",&susOn)) { PARAMETER
|
||||
op.sus=susOn;
|
||||
}
|
||||
if(ImGui::IsItemHovered())
|
||||
{
|
||||
ImGui::SetTooltip(_("Use op's arpeggio and pitch macros control instead of block/f-num macros"));
|
||||
}
|
||||
}
|
||||
else
|
||||
if(!egtOn)
|
||||
{
|
||||
P(CWVSliderScalar("##FINE",ImVec2(20.0f*dpiScale,sliderHeight),ImGuiDataType_U8,&op.dvb,&_ZERO,&_FIFTEEN)); rightClickable
|
||||
}
|
||||
|
@ -3847,8 +3836,9 @@ void FurnaceGUI::insTabFM(DivInstrument* ins) {
|
|||
bool amOn=op.am;
|
||||
if (ins->type==DIV_INS_OPZ) {
|
||||
bool egtOn=op.egt;
|
||||
bool susOn=op.sus;
|
||||
if (egtOn) {
|
||||
ImGui::SetCursorPosY(ImGui::GetCursorPosY()+0.5*(sliderHeight-ImGui::GetFrameHeight()*4.0-ImGui::GetStyle().ItemSpacing.y*3.0));
|
||||
ImGui::SetCursorPosY(ImGui::GetCursorPosY()+0.5*(sliderHeight-ImGui::GetFrameHeight()*4.0-ImGui::GetStyle().ItemSpacing.y*3.5));
|
||||
} else {
|
||||
ImGui::SetCursorPosY(ImGui::GetCursorPosY()+0.5*(sliderHeight-ImGui::GetFrameHeight()*2.0-ImGui::GetStyle().ItemSpacing.y*1.0));
|
||||
}
|
||||
|
@ -3859,6 +3849,18 @@ void FurnaceGUI::insTabFM(DivInstrument* ins) {
|
|||
op.egt=egtOn;
|
||||
}
|
||||
if (egtOn) {
|
||||
if (ImGui::Checkbox("Pitch control",&susOn)) { PARAMETER
|
||||
op.sus=susOn;
|
||||
// HACK: reset zoom and scroll in fixed pitch macros so that they draw correctly
|
||||
ins->std.opMacros[i].ssgMacro.vZoom=-1;
|
||||
ins->std.opMacros[i].susMacro.vZoom=-1;
|
||||
}
|
||||
if(ImGui::IsItemHovered())
|
||||
{
|
||||
ImGui::SetTooltip(_("Use op's arpeggio and pitch macros control instead of block/f-num macros"));
|
||||
}
|
||||
}
|
||||
if (egtOn && !susOn) {
|
||||
int block=op.dt;
|
||||
int freqNum=(op.mult<<4)|(op.dvb&15);
|
||||
if (ImGui::InputInt(_("Block"),&block,1,1)) {
|
||||
|
@ -4463,6 +4465,8 @@ void FurnaceGUI::insTabFM(DivInstrument* ins) {
|
|||
// params
|
||||
ImGui::Separator();
|
||||
if (egtOn) {
|
||||
if(!op.sus)
|
||||
{
|
||||
int block=op.dt;
|
||||
int freqNum=(op.mult<<4)|(op.dvb&15);
|
||||
ImGui::Text(_("Block"));
|
||||
|
@ -4485,6 +4489,7 @@ void FurnaceGUI::insTabFM(DivInstrument* ins) {
|
|||
op.mult=freqNum>>4;
|
||||
op.dvb=freqNum&15;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
|
||||
snprintf(tempID,1024,"%s: %%d",FM_NAME(FM_MULT));
|
||||
|
@ -4613,6 +4618,9 @@ void FurnaceGUI::insTabFM(DivInstrument* ins) {
|
|||
bool susOn=op.sus;
|
||||
if (ImGui::Checkbox("Pitch control",&susOn)) { PARAMETER
|
||||
op.sus=susOn;
|
||||
// HACK: reset zoom and scroll in fixed pitch macros so that they draw correctly
|
||||
ins->std.opMacros[i].ssgMacro.vZoom=-1;
|
||||
ins->std.opMacros[i].susMacro.vZoom=-1;
|
||||
}
|
||||
if(ImGui::IsItemHovered())
|
||||
{
|
||||
|
@ -4929,6 +4937,9 @@ void FurnaceGUI::insTabFM(DivInstrument* ins) {
|
|||
ImGui::SameLine();
|
||||
if (ImGui::Checkbox("Pitch control",&susOn)) { PARAMETER
|
||||
op.sus=susOn;
|
||||
// HACK: reset zoom and scroll in fixed pitch macros so that they draw correctly
|
||||
ins->std.opMacros[i].ssgMacro.vZoom=-1;
|
||||
ins->std.opMacros[i].susMacro.vZoom=-1;
|
||||
}
|
||||
if(ImGui::IsItemHovered())
|
||||
{
|
||||
|
@ -5053,6 +5064,9 @@ void FurnaceGUI::insTabFM(DivInstrument* ins) {
|
|||
|
||||
if (ins->type==DIV_INS_OPZ) {
|
||||
if (op.egt) {
|
||||
bool susOn=op.sus;
|
||||
if(!susOn)
|
||||
{
|
||||
int block=op.dt;
|
||||
int freqNum=(op.mult<<4)|(op.dvb&15);
|
||||
|
||||
|
@ -5078,6 +5092,7 @@ void FurnaceGUI::insTabFM(DivInstrument* ins) {
|
|||
} rightClickable
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text(_("FreqNum"));
|
||||
}
|
||||
} else {
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
|
|
Loading…
Reference in a new issue