code style
This commit is contained in:
parent
a78116ba02
commit
31c19c62a3
4 changed files with 17 additions and 18 deletions
|
|
@ -8249,7 +8249,7 @@ void FurnaceGUI::syncState() {
|
|||
#endif
|
||||
notesOpen=e->getConfBool("notesOpen",false);
|
||||
tunerOpen=e->getConfBool("tunerOpen",false);
|
||||
spectrumOpen=e->getConfBool("spectrumOpen", false);
|
||||
spectrumOpen=e->getConfBool("spectrumOpen",false);
|
||||
channelsOpen=e->getConfBool("channelsOpen",false);
|
||||
patManagerOpen=e->getConfBool("patManagerOpen",false);
|
||||
sysManagerOpen=e->getConfBool("sysManagerOpen",false);
|
||||
|
|
|
|||
|
|
@ -495,7 +495,7 @@ bool FurnaceGUI::chipMixer(int which, ImVec2 size) {
|
|||
float vol=fabs(e->song.systemVol[which]);
|
||||
bool doInvert=e->song.systemVol[which]<0;
|
||||
if (settings.mixerLayout) {
|
||||
if (ImGui::BeginTable("mixerVectRow1", 2)) {
|
||||
if (ImGui::BeginTable("mixerVectRow1",2)) {
|
||||
ImGui::TableSetupColumn("c0",ImGuiTableColumnFlags_WidthStretch);
|
||||
ImGui::TableSetupColumn("c1",ImGuiTableColumnFlags_WidthFixed);
|
||||
ImGui::TableNextRow();
|
||||
|
|
@ -538,7 +538,7 @@ bool FurnaceGUI::chipMixer(int which, ImVec2 size) {
|
|||
ImGui::PopStyleVar(1);
|
||||
ImGui::PopStyleColor(3);
|
||||
}
|
||||
if (ImGui::BeginTable("mixerVectRow3", 2)) {
|
||||
if (ImGui::BeginTable("mixerVectRow3",2)) {
|
||||
ImGui::TableSetupColumn("c0",ImGuiTableColumnFlags_WidthStretch);
|
||||
ImGui::TableSetupColumn("c1",ImGuiTableColumnFlags_WidthStretch);
|
||||
ImGui::TableNextRow();
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ void FurnaceGUI::drawSpectrum() {
|
|||
if (spectrum.running) {
|
||||
for (int z=spectrum.mono?0:(chans-1); z>=0; z--) {
|
||||
// get buffer
|
||||
memset(spectrum.in, 0, sizeof(double)*spectrum.bins);
|
||||
memset(spectrum.in,0,sizeof(double)*spectrum.bins);
|
||||
int needle=e->oscReadPos-spectrum.bins;
|
||||
|
||||
for (int j=0; j<spectrum.bins; j++) {
|
||||
|
|
@ -174,8 +174,8 @@ void FurnaceGUI::drawSpectrum() {
|
|||
spectrum.plot[i].x=origin.x+x;
|
||||
spectrum.plot[i].y=origin.y+size.y*(y-spectrum.yOffset);
|
||||
}
|
||||
ImGui::PushClipRect(origin, origin+size, true);
|
||||
dl->AddPolyline(spectrum.plot, count, ImGui::GetColorU32(uiColors[spectrum.mono?GUI_COLOR_OSC_WAVE:GUI_COLOR_OSC_WAVE_CH0+z]), 0, 1.0f);
|
||||
ImGui::PushClipRect(origin,origin+size,true);
|
||||
dl->AddPolyline(spectrum.plot,count,ImGui::GetColorU32(uiColors[spectrum.mono?GUI_COLOR_OSC_WAVE:GUI_COLOR_OSC_WAVE_CH0+z]),0,1.0f);
|
||||
dl->PathFillConcave(ImGui::GetColorU32(uiColors[spectrum.mono?GUI_COLOR_OSC_WAVE:GUI_COLOR_OSC_WAVE_CH0+z]));
|
||||
ImGui::PopClipRect();
|
||||
}
|
||||
|
|
@ -186,31 +186,31 @@ void FurnaceGUI::drawSpectrum() {
|
|||
ImGui::TextUnformatted(ICON_FA_BARS "##spectrumSettings");
|
||||
}
|
||||
if (ImGui::BeginPopupContextItem("spectrumSettingsPopup",ImGuiPopupFlags_MouseButtonLeft)) {
|
||||
ImGui::Checkbox(_("Mono##spec"), &spectrum.mono);
|
||||
ImGui::Checkbox(_("Mono##spec"),&spectrum.mono);
|
||||
if (ImGui::InputScalar("Bins",ImGuiDataType_U32,&spectrum.bins)) {
|
||||
if (spectrum.bins<32) spectrum.bins=32;
|
||||
if (spectrum.bins>32768) spectrum.bins=32768;
|
||||
spectrum.update=true;
|
||||
}
|
||||
ImGui::Separator();
|
||||
if (ImGui::SliderFloat("X Zoom", &spectrum.xZoom, 1.0f, 10.0f)) {
|
||||
if (ImGui::SliderFloat("X Zoom",&spectrum.xZoom,1.0f,10.0f)) {
|
||||
if (spectrum.xZoom<1.0f) spectrum.xZoom=1.0f;
|
||||
if (spectrum.xZoom>10.0f) spectrum.xZoom=10.0f;
|
||||
}
|
||||
if (ImGui::SliderFloat("X Offset", &spectrum.xOffset, 0.0f, 1.0f)) {
|
||||
if (ImGui::SliderFloat("X Offset",&spectrum.xOffset,0.0f,1.0f)) {
|
||||
if (spectrum.xOffset<0.0f) spectrum.xOffset=0.0f;
|
||||
if (spectrum.xOffset>1.0f) spectrum.xOffset=1.0f;
|
||||
}
|
||||
ImGui::Separator();
|
||||
if (ImGui::SliderFloat("Y Offset", &spectrum.yOffset, 0.0f, 1.0f)) {
|
||||
if (ImGui::SliderFloat("Y Offset",&spectrum.yOffset,0.0f,1.0f)) {
|
||||
if (spectrum.yOffset<0.0f) spectrum.yOffset=0.0f;
|
||||
if (spectrum.yOffset>1.0f) spectrum.yOffset=1.0f;
|
||||
}
|
||||
ImGui::Separator();
|
||||
ImGui::Checkbox(_("Show X Grid"), &spectrum.showXGrid);
|
||||
ImGui::Checkbox(_("Show Y Grid"), &spectrum.showYGrid);
|
||||
ImGui::Checkbox(_("Show X Scale"), &spectrum.showXScale);
|
||||
ImGui::Checkbox(_("Show Y Scale"), &spectrum.showYScale);
|
||||
ImGui::Checkbox(_("Show X Grid"),&spectrum.showXGrid);
|
||||
ImGui::Checkbox(_("Show Y Grid"),&spectrum.showYGrid);
|
||||
ImGui::Checkbox(_("Show X Scale"),&spectrum.showXScale);
|
||||
ImGui::Checkbox(_("Show Y Scale"),&spectrum.showYScale);
|
||||
}
|
||||
}
|
||||
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_SPECTRUM;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ void FurnaceGUI::drawTuner() {
|
|||
if (!tunerFFTOutBuf) tunerFFTOutBuf=(fftw_complex*)fftw_malloc(sizeof(fftw_complex)*FURNACE_TUNER_FFT_SIZE);
|
||||
|
||||
if (!tunerPlan) {
|
||||
tunerPlan=fftw_plan_dft_r2c_1d(FURNACE_TUNER_FFT_SIZE, tunerFFTInBuf, tunerFFTOutBuf, FFTW_ESTIMATE);
|
||||
tunerPlan=fftw_plan_dft_r2c_1d(FURNACE_TUNER_FFT_SIZE,tunerFFTInBuf,tunerFFTOutBuf,FFTW_ESTIMATE);
|
||||
}
|
||||
|
||||
int chans=e->getAudioDescGot().outChans;
|
||||
|
|
@ -97,7 +97,7 @@ void FurnaceGUI::drawTuner() {
|
|||
noteRounded=round(noteExact);
|
||||
cents=(noteExact-noteRounded);
|
||||
noteText=fmt::sprintf("%s",noteName(noteRounded));
|
||||
subtext=fmt::sprintf("%3.3f Hz %dc", freq, (int)(cents*100.0f));
|
||||
subtext=fmt::sprintf("%3.3f Hz %dc",freq,(int)(cents*100.0f));
|
||||
}
|
||||
|
||||
{
|
||||
|
|
@ -132,7 +132,7 @@ void FurnaceGUI::drawTuner() {
|
|||
dl->AddLine(origin+ImVec2(size.x/2.0f,0),origin+ImVec2(size.x/2.0f,boxHeight),ImGui::GetColorU32(uiColors[GUI_COLOR_TUNER_NEEDLE]),2.0f*dpiScale);
|
||||
|
||||
float needleX=size.x*(0.5f+cents);
|
||||
dl->AddLine(origin+ImVec2(needleX, boxHeight-needleHeight),origin+ImVec2(needleX,needleHeight),ImGui::GetColorU32(uiColors[GUI_COLOR_TUNER_NEEDLE]),4.0f*dpiScale);
|
||||
dl->AddLine(origin+ImVec2(needleX,boxHeight-needleHeight),origin+ImVec2(needleX,needleHeight),ImGui::GetColorU32(uiColors[GUI_COLOR_TUNER_NEEDLE]),4.0f*dpiScale);
|
||||
// text
|
||||
ImGui::PushFont(bigFont);
|
||||
ImVec2 textSize=ImGui::CalcTextSize(noteText.c_str());
|
||||
|
|
@ -174,4 +174,3 @@ void FurnaceGUI::drawTuner() {
|
|||
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue