From 9b3e6cea5ba1395eb11c80e9ec4c6b86145f5756 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sat, 15 Nov 2025 10:00:17 -0500 Subject: [PATCH] giga-refactor, part 8 allow setting channel count --- src/gui/sysConf.cpp | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/gui/sysConf.cpp b/src/gui/sysConf.cpp index 09d3a5ede..2dced97a5 100644 --- a/src/gui/sysConf.cpp +++ b/src/gui/sysConf.cpp @@ -28,6 +28,7 @@ bool FurnaceGUI::drawSysConf(int chan, int sysPos, DivSystem type, DivConfig& fl bool mustRender=false; bool restart=modifyOnChange; bool supportsCustomRate=true; + bool supportsChannelCount=(chan>=0); switch (type) { case DIV_SYSTEM_YM2612: @@ -2775,8 +2776,38 @@ bool FurnaceGUI::drawSysConf(int chan, int sysPos, DivSystem type, DivConfig& fl } } - if (supportsCustomRate) { + bool separatedYet=false; + if (supportsChannelCount) { ImGui::Separator(); + separatedYet=true; + const DivSysDef* sysDef=e->getSystemDef(type); + int chCount=e->song.systemChans[chan]; + ImGui::AlignTextToFramePadding(); + ImGui::TextUnformatted(_("Channels")); + ImGui::SameLine(); + ImGui::SetNextItemWidth(120.0f*dpiScale); + ImGui::InputInt("##ChCount",&chCount,0,0); + if (ImGui::IsItemDeactivatedAfterEdit() && chCount!=e->song.systemChans[chan]) { + if (e->setSystemChans(chan,chCount,preserveChanPos)) { + MARK_MODIFIED; + recalcTimestamps=true; + if (e->song.autoSystem) { + autoDetectSystem(); + } + updateWindowTitle(); + updateROMExportAvail(); + } else { + showError(fmt::sprintf(_("cannot change chip! (%s)"),e->getLastError())); + } + } + if (sysDef!=NULL) { + ImGui::SameLine(); + ImGui::Text("(%d - %d)",sysDef->minChans,sysDef->maxChans); + } + } + + if (supportsCustomRate) { + if (!separatedYet) ImGui::Separator(); int customClock=flags.getInt("customClock",0); bool usingCustomClock=customClock>=MIN_CUSTOM_CLOCK;