the massive preparations - GUI

This commit is contained in:
tildearrow 2024-05-26 19:31:17 -05:00
parent 34c176a799
commit 00e0679442
48 changed files with 41493 additions and 2734 deletions

View file

@ -140,7 +140,7 @@ void FurnaceGUI::drawChanOsc() {
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::AlignTextToFramePadding();
ImGui::Text("Columns");
ImGui::Text(_("Columns"));
ImGui::SameLine();
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
if (ImGui::InputInt("##COSColumns",&chanOscCols,1,3)) {
@ -149,7 +149,7 @@ void FurnaceGUI::drawChanOsc() {
}
ImGui::TableNextColumn();
ImGui::Text("Size (ms)");
ImGui::Text(_("Size (ms)"));
ImGui::SameLine();
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
if (ImGui::InputFloat("##COSWinSize",&chanOscWindowSize,1.0f,10.0f)) {
@ -160,7 +160,7 @@ void FurnaceGUI::drawChanOsc() {
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::AlignTextToFramePadding();
ImGui::Text("Automatic columns");
ImGui::Text(_("Automatic columns"));
ImGui::SameLine();
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
const char* previewColType=autoColsTypes[chanOscAutoColsType&3];
@ -174,19 +174,19 @@ void FurnaceGUI::drawChanOsc() {
}
ImGui::TableNextColumn();
if (ImGui::Checkbox("Center waveform",&chanOscWaveCorr)) {
if (ImGui::Checkbox(_("Center waveform"),&chanOscWaveCorr)) {
centerSettingReset=true;
}
ImGui::TableNextRow();
ImGui::TableNextColumn();
if (ImGui::Checkbox("Randomize phase on note",&chanOscRandomPhase)) {
if (ImGui::Checkbox(_("Randomize phase on note"),&chanOscRandomPhase)) {
}
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::AlignTextToFramePadding();
ImGui::Text("Amplitude");
ImGui::Text(_("Amplitude"));
ImGui::SameLine();
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
if (CWSliderFloat("##COSAmp",&chanOscAmplify,0.0f,2.0f)) {
@ -196,7 +196,7 @@ void FurnaceGUI::drawChanOsc() {
ImGui::TableNextColumn();
ImGui::AlignTextToFramePadding();
ImGui::Text("Line size");
ImGui::Text(_("Line size"));
ImGui::SameLine();
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
if (CWSliderFloat("##COSLine",&chanOscLineSize,0.25f,16.0f)) {
@ -208,14 +208,14 @@ void FurnaceGUI::drawChanOsc() {
ImGui::EndTable();
}
ImGui::Checkbox("Gradient",&chanOscUseGrad);
ImGui::Checkbox(_("Gradient"),&chanOscUseGrad);
if (chanOscUseGrad) {
if (chanOscGradTex==NULL) {
chanOscGradTex=rend->createTexture(true,chanOscGrad.width,chanOscGrad.height,true,bestTexFormat);
if (chanOscGradTex==NULL) {
logE("error while creating gradient texture!");
logE(_("error while creating gradient texture!"));
} else {
updateChanOscGradTex=true;
}
@ -233,7 +233,7 @@ void FurnaceGUI::drawChanOsc() {
if (rend->updateTexture(chanOscGradTex,chanOscGrad.grad.get(),chanOscGrad.width*4)) {
updateChanOscGradTex=false;
} else {
logE("error while updating gradient texture!");
logE(_("error while updating gradient texture!"));
}
}
@ -289,11 +289,11 @@ void FurnaceGUI::drawChanOsc() {
i.prevY=i.y;
}
if (ImGui::BeginPopup("gradPointSettings",ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_AlwaysAutoResize)) {
if (ImGui::ColorPicker4("Color",(float*)&i.color)) {
if (ImGui::ColorPicker4(_("Color"),(float*)&i.color)) {
updateChanOscGradTex=true;
}
ImGui::AlignTextToFramePadding();
ImGui::Text("Distance");
ImGui::Text(_("Distance"));
ImGui::SameLine();
float pDist=i.distance*100.0f;
if (ImGui::SliderFloat("##PDistance",&pDist,0.0f,150.0f,"%.1f%%")) {
@ -302,7 +302,7 @@ void FurnaceGUI::drawChanOsc() {
}
ImGui::AlignTextToFramePadding();
ImGui::Text("Spread");
ImGui::Text(_("Spread"));
ImGui::SameLine();
float pSpread=i.spread*100.0f;
if (ImGui::SliderFloat("##PSpread",&pSpread,0.0f,150.0f,"%.1f%%")) {
@ -311,7 +311,7 @@ void FurnaceGUI::drawChanOsc() {
}
pushDestColor();
if (ImGui::Button("Remove")) {
if (ImGui::Button(_("Remove"))) {
removePoint=index;
ImGui::CloseCurrentPopup();
}
@ -335,26 +335,26 @@ void FurnaceGUI::drawChanOsc() {
}
ImGui::TableNextColumn();
if (ImGui::ColorEdit4("Background",(float*)&chanOscGrad.bgColor)) {
if (ImGui::ColorEdit4(_("Background"),(float*)&chanOscGrad.bgColor)) {
updateChanOscGradTex=true;
}
ImGui::Combo("X Axis##AxisX",&chanOscColorX,chanOscRefs,GUI_OSCREF_MAX);
ImGui::Combo("Y Axis##AxisY",&chanOscColorY,chanOscRefs,GUI_OSCREF_MAX);
ImGui::Combo(_("X Axis##AxisX"),&chanOscColorX,chanOscRefs,GUI_OSCREF_MAX);
ImGui::Combo(_("Y Axis##AxisY"),&chanOscColorY,chanOscRefs,GUI_OSCREF_MAX);
ImGui::EndTable();
}
} else {
ImGui::SetNextItemWidth(400.0f*dpiScale);
ImGui::ColorPicker4("Color",(float*)&chanOscColor);
ImGui::ColorPicker4(_("Color"),(float*)&chanOscColor);
}
ImGui::AlignTextToFramePadding();
ImGui::Text("Text format:");
ImGui::Text(_("Text format:"));
ImGui::SameLine();
ImGui::InputText("##TextFormat",&chanOscTextFormat);
if (ImGui::IsItemHovered()) {
if (ImGui::BeginTooltip()) {
ImGui::TextUnformatted(
ImGui::TextUnformatted(_(
"format guide:\n"
"- %c: channel name\n"
"- %C: channel short name\n"
@ -372,14 +372,14 @@ void FurnaceGUI::drawChanOsc() {
"- %b: volume (hex)\n"
"- %l: new line\n"
"- %%: percent sign"
);
));
ImGui::EndTooltip();
}
}
ImGui::ColorEdit4("Text color",(float*)&chanOscTextColor);
ImGui::ColorEdit4(_("Text color"),(float*)&chanOscTextColor);
if (ImGui::Button("OK")) {
if (ImGui::Button(_("OK"))) {
chanOscOptions=false;
}
} else {
@ -397,7 +397,7 @@ void FurnaceGUI::drawChanOsc() {
// check work thread
if (chanOscWorkPool==NULL) {
logV("creating chan osc work pool");
logV(_("creating chan osc work pool"));
chanOscWorkPool=new DivWorkPool(settings.chanOscThreads);
}
@ -426,18 +426,18 @@ void FurnaceGUI::drawChanOsc() {
// check FFT status existence
if (!fft_->ready) {
logD("creating FFT plan for channel %d",fft_->relatedCh);
logD(_("creating FFT plan for channel %d"),fft_->relatedCh);
fft_->inBuf=(double*)fftw_malloc(FURNACE_FFT_SIZE*sizeof(double));
fft_->outBuf=(fftw_complex*)fftw_malloc(FURNACE_FFT_SIZE*sizeof(fftw_complex));
fft_->corrBuf=(double*)fftw_malloc(FURNACE_FFT_SIZE*sizeof(double));
fft_->plan=fftw_plan_dft_r2c_1d(FURNACE_FFT_SIZE,fft_->inBuf,fft_->outBuf,FFTW_ESTIMATE);
fft_->planI=fftw_plan_dft_c2r_1d(FURNACE_FFT_SIZE,fft_->outBuf,fft_->corrBuf,FFTW_ESTIMATE);
if (fft_->plan==NULL) {
logE("failed to create plan!");
logE(_("failed to create plan!"));
} else if (fft_->planI==NULL) {
logE("failed to create inverse plan!");
logE(_("failed to create inverse plan!"));
} else if (fft_->inBuf==NULL || fft_->outBuf==NULL || fft_->corrBuf==NULL) {
logE("failed to create FFT buffers");
logE(_("failed to create FFT buffers"));
} else {
fft_->ready=true;
}
@ -582,7 +582,7 @@ void FurnaceGUI::drawChanOsc() {
ChanOscStatus* fft=oscFFTs[i];
int ch=oscChans[i];
if (buf==NULL) {
ImGui::Text("Error!");
ImGui::Text(_("Error!"));
} else {
ImVec2 size=ImGui::GetContentRegionAvail();
size.y=availY/rows;