GUI: more channel bar polishing
This commit is contained in:
parent
eb0aac0f54
commit
28d3417196
|
@ -547,6 +547,9 @@ void FurnaceGUI::drawPattern() {
|
||||||
} else {
|
} else {
|
||||||
minLabelArea.x+=padding;
|
minLabelArea.x+=padding;
|
||||||
maxLabelArea.x-=padding;
|
maxLabelArea.x-=padding;
|
||||||
|
if (settings.channelStyle==3) { // split button
|
||||||
|
maxLabelArea.x-=ImGui::GetFrameHeightWithSpacing();
|
||||||
|
}
|
||||||
const char* chName=e->getChannelName(i);
|
const char* chName=e->getChannelName(i);
|
||||||
float chNameLimit=maxLabelArea.x-minLabelArea.x;
|
float chNameLimit=maxLabelArea.x-minLabelArea.x;
|
||||||
if (ImGui::CalcTextSize(chName).x>chNameLimit) {
|
if (ImGui::CalcTextSize(chName).x>chNameLimit) {
|
||||||
|
@ -578,6 +581,8 @@ void FurnaceGUI::drawPattern() {
|
||||||
minLabelArea.x+=0.5f*(maxLabelArea.x-minLabelArea.x-ImGui::CalcTextSize(chanID).x);
|
minLabelArea.x+=0.5f*(maxLabelArea.x-minLabelArea.x-ImGui::CalcTextSize(chanID).x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (extraChannelButtons==0 || settings.channelVolStyle!=0) ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing,ImVec2(0.0f,0.0f));
|
||||||
|
|
||||||
ImGui::PushID(2048+i);
|
ImGui::PushID(2048+i);
|
||||||
switch (settings.channelStyle) {
|
switch (settings.channelStyle) {
|
||||||
case 0: // classic
|
case 0: // classic
|
||||||
|
@ -640,6 +645,7 @@ void FurnaceGUI::drawPattern() {
|
||||||
}
|
}
|
||||||
case 3: // split button
|
case 3: // split button
|
||||||
ImGui::Dummy(ImVec2(1.0f,2.0f*dpiScale));
|
ImGui::Dummy(ImVec2(1.0f,2.0f*dpiScale));
|
||||||
|
ImGui::SetCursorPosX(minLabelArea.x);
|
||||||
ImGui::TextUnformatted(chanID);
|
ImGui::TextUnformatted(chanID);
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::PushFont(mainFont);
|
ImGui::PushFont(mainFont);
|
||||||
|
@ -691,6 +697,8 @@ void FurnaceGUI::drawPattern() {
|
||||||
}
|
}
|
||||||
ImGui::PopID();
|
ImGui::PopID();
|
||||||
|
|
||||||
|
if (extraChannelButtons==0 || settings.channelVolStyle!=0) ImGui::PopStyleVar();
|
||||||
|
|
||||||
if (displayTooltip && ImGui::IsItemHovered()) {
|
if (displayTooltip && ImGui::IsItemHovered()) {
|
||||||
ImGui::SetTooltip("%s",e->getChannelName(i));
|
ImGui::SetTooltip("%s",e->getChannelName(i));
|
||||||
}
|
}
|
||||||
|
@ -739,20 +747,24 @@ void FurnaceGUI::drawPattern() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e->isRunning()) {
|
if (e->isRunning()) {
|
||||||
|
DivChannelState* cs=e->getChanState(i);
|
||||||
|
float stereoPan=(float)(e->convertPanSplitToLinearLR(cs->panL,cs->panR,256)-128)/128.0;
|
||||||
switch (settings.channelVolStyle) {
|
switch (settings.channelVolStyle) {
|
||||||
case 1: // simple
|
case 1: // simple
|
||||||
xRight=((float)(e->getChanState(i)->volume>>8)/(float)e->getMaxVolumeChan(i))*0.9+(keyHit1[i]*0.1f);
|
xRight=((float)(e->getChanState(i)->volume>>8)/(float)e->getMaxVolumeChan(i))*0.9+(keyHit1[i]*0.1f);
|
||||||
break;
|
break;
|
||||||
case 2: // stereo
|
case 2: { // stereo
|
||||||
xRight=0.5+((float)(e->getChanState(i)->volume>>8)/(float)e->getMaxVolumeChan(i))*0.4+(keyHit1[i]*0.1f);
|
float amount=((float)(e->getChanState(i)->volume>>8)/(float)e->getMaxVolumeChan(i))*0.4+(keyHit1[i]*0.1f);
|
||||||
xLeft=1.0-xRight;
|
xRight=0.5+amount*(1.0+MIN(0.0,stereoPan));
|
||||||
|
xLeft=0.5-amount*(1.0-MAX(0.0,stereoPan));
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case 3: // real
|
case 3: // real
|
||||||
xRight=chanOscVol[i];
|
xRight=chanOscVol[i];
|
||||||
break;
|
break;
|
||||||
case 4: // real (stereo)
|
case 4: // real (stereo)
|
||||||
xRight=0.5+chanOscVol[i]*0.5;
|
xRight=0.5+chanOscVol[i]*0.5*(1.0+MIN(0.0,stereoPan));
|
||||||
xLeft=1.0-xRight;
|
xLeft=0.5-chanOscVol[i]*0.5*(1.0-MAX(0.0,stereoPan));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue