From d6899ed6a6b1ee8e2dc2b9a4218ea12d4df96cc2 Mon Sep 17 00:00:00 2001 From: Eknous-P Date: Fri, 10 Oct 2025 19:44:34 +0400 Subject: [PATCH] code style --- src/gui/mixer.cpp | 20 ++++++++++---------- src/gui/volMeter.cpp | 3 +-- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/gui/mixer.cpp b/src/gui/mixer.cpp index d9cabc2b9..dc132a18b 100644 --- a/src/gui/mixer.cpp +++ b/src/gui/mixer.cpp @@ -227,10 +227,10 @@ void FurnaceGUI::drawMixer() { if (ImGui::BeginTabBar("MixerView")) { if (ImGui::BeginTabItem(_("Mixer"))) { float maxY=ImGui::GetContentRegionAvail().y; - VerticalText(maxY, true,_("Master Volume")); + VerticalText(maxY,true,_("Master Volume")); ImGui::SameLine(); ImVec2 pos=ImGui::GetCursorScreenPos(); - drawVolMeterInternal(ImGui::GetWindowDrawList(), ImRect(pos,pos+ImVec2(40*dpiScale,maxY)),peak,e->getAudioDescGot().outChans,false); + drawVolMeterInternal(ImGui::GetWindowDrawList(),ImRect(pos,pos+ImVec2(40*dpiScale,maxY)),peak,e->getAudioDescGot().outChans,false); ImGui::PushStyleColor(ImGuiCol_FrameBg,0); ImGui::PushStyleColor(ImGuiCol_FrameBgActive,0); ImGui::PushStyleColor(ImGuiCol_FrameBgHovered,127<song.systemLen; float realwidth=ImGui::GetWindowWidth()-ImGui::GetCursorPosX(); if (calcWidth>realwidth) maxY-=ImGui::GetStyle().ScrollbarSize; - if (ImGui::BeginChild("##mixerPerChipContainer", ImVec2(0,0),0,ImGuiWindowFlags_HorizontalScrollbar)) { + if (ImGui::BeginChild("##mixerPerChipContainer",ImVec2(0,0),0,ImGuiWindowFlags_HorizontalScrollbar)) { for (int i=0; isong.systemLen; i++) { ImGui::GetWindowDrawList()->AddRectFilled( ImGui::GetCursorScreenPos(), @@ -256,7 +256,7 @@ void FurnaceGUI::drawMixer() { ); ImGui::Dummy(ImVec2(dpiScale,maxY)); ImGui::SameLine(); - if (chipMixer(i, ImVec2(itemWidth,maxY))) MARK_MODIFIED; + if (chipMixer(i,ImVec2(itemWidth,maxY))) MARK_MODIFIED; ImGui::SameLine(); } } @@ -435,7 +435,7 @@ bool FurnaceGUI::chipMixer(int which, ImVec2 size) { float vol=fabs(e->song.systemVol[which]); bool doInvert=e->song.systemVol[which]<0; - if (ImGui::Checkbox("##ChipInvert", &doInvert)) { + if (ImGui::Checkbox("##ChipInvert",&doInvert)) { e->song.systemVol[which]=doInvert?-vol:vol; ret=true; } @@ -449,7 +449,7 @@ bool FurnaceGUI::chipMixer(int which, ImVec2 size) { float volSliderHeight=size.y-ImGui::GetStyle().FramePadding.y*7-textHeight*2; - VerticalText(volSliderHeight-(ImGui::GetCursorPosY()-curPos.y), true,"%s",e->getSystemName(e->song.system[which])); + VerticalText(volSliderHeight-(ImGui::GetCursorPosY()-curPos.y),true,"%s",e->getSystemName(e->song.system[which])); ImGui::SameLine(); @@ -461,8 +461,8 @@ bool FurnaceGUI::chipMixer(int which, ImVec2 size) { ImGui::PushStyleColor(ImGuiCol_FrameBg,0); ImGui::PushStyleColor(ImGuiCol_FrameBgActive,0); ImGui::PushStyleColor(ImGuiCol_FrameBgHovered,127<song.systemPan[which], -1.0f, 1.0f)) { + if (ImGui::SliderFloat("##ChipPan",&e->song.systemPan[which],-1.0f,1.0f)) { if (e->song.systemPan[which]<-1.0f) e->song.systemPan[which]=-1.0f; if (e->song.systemPan[which]>1.0f) e->song.systemPan[which]=1.0f; ret=true; @@ -488,7 +488,7 @@ bool FurnaceGUI::chipMixer(int which, ImVec2 size) { } ImGui::SetNextItemWidth(size.x+1.5f*ImGui::GetStyle().FramePadding.x); - if (ImGui::SliderFloat("##ChipPanFR", &e->song.systemPanFR[which], -1.0f, 1.0f)) { + if (ImGui::SliderFloat("##ChipPanFR",&e->song.systemPanFR[which],-1.0f,1.0f)) { if (e->song.systemPanFR[which]<-1.0f) e->song.systemPanFR[which]=-1.0f; if (e->song.systemPanFR[which]>1.0f) e->song.systemPanFR[which]=1.0f; ret=true; diff --git a/src/gui/volMeter.cpp b/src/gui/volMeter.cpp index b5a5576dc..74fbe01c3 100644 --- a/src/gui/volMeter.cpp +++ b/src/gui/volMeter.cpp @@ -48,11 +48,10 @@ void FurnaceGUI::drawVolMeter() { ImRect rect=ImRect(minArea,maxArea); ImGuiStyle& style=ImGui::GetStyle(); ImGui::ItemSize(ImVec2(4.0f,4.0f),style.FramePadding.y); - // ImU32 lowColor=ImGui::GetColorU32(uiColors[GUI_COLOR_VOLMETER_LOW]); if (ImGui::ItemAdd(rect,ImGui::GetID("volMeter"))) { ImGui::RenderFrame(rect.Min,rect.Max,ImGui::GetColorU32(ImGuiCol_FrameBg),true,style.FrameRounding); int outChans=e->getAudioDescGot().outChans; - drawVolMeterInternal(dl, rect, peak, outChans, aspectRatio); + drawVolMeterInternal(dl,rect,peak,outChans,aspectRatio); if (ImGui::IsItemHovered()) { if (aspectRatio) { ImGui::SetTooltip("%.1fdB",36*((ImGui::GetMousePos().x-ImGui::GetItemRectMin().x)/(rect.Max.x-rect.Min.x)-1.0));