diff --git a/src/engine/engine.h b/src/engine/engine.h index 556057cc2..4ffe7744b 100644 --- a/src/engine/engine.h +++ b/src/engine/engine.h @@ -54,8 +54,8 @@ class DivWorkPool; #define DIV_UNSTABLE -#define DIV_VERSION "dev188" -#define DIV_ENGINE_VERSION 188 +#define DIV_VERSION "dev189" +#define DIV_ENGINE_VERSION 189 // for imports #define DIV_VERSION_MOD 0xff01 #define DIV_VERSION_FC 0xff02 diff --git a/src/engine/fileOps.cpp b/src/engine/fileOps.cpp index ef11593d2..cb6f4fa90 100644 --- a/src/engine/fileOps.cpp +++ b/src/engine/fileOps.cpp @@ -2185,7 +2185,14 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) { if (ds.version>=39) { for (int i=0; ichanShow[i]=reader.readC(); + if (ds.version<189) { + subSong->chanShow[i]=reader.readC(); + subSong->chanShowChanOsc[i]=subSong->chanShow[i]; + } else { + unsigned char tempchar=reader.readC(); + subSong->chanShow[i]=tempchar&1; + subSong->chanShowChanOsc[i]=(tempchar&2); + } } for (int i=0; ichanShow[i]=reader.readC(); + if (ds.version<189) { + subSong->chanShow[i]=reader.readC(); + subSong->chanShowChanOsc[i]=subSong->chanShow[i]; + } else { + unsigned char tempchar=reader.readC(); + subSong->chanShow[i]=tempchar&1; + subSong->chanShowChanOsc[i]=tempchar&2; + } } for (int i=0; ichanShow[i]=true; + ds.subsong[0]->chanShowChanOsc[i]=true; ds.subsong[0]->chanName[i]=fmt::sprintf("Channel %d",i+1); ds.subsong[0]->chanShortName[i]=fmt::sprintf("C%d",i+1); } for(int i=chCount; ipat[i].effectCols=1; ds.subsong[0]->chanShow[i]=false; + ds.subsong[0]->chanShowChanOsc[i]=false; } // instrument creation @@ -5410,7 +5426,10 @@ SafeWriter* DivEngine::saveFur(bool notPrimary, bool newPatternFormat) { } for (int i=0; iwriteC(subSong->chanShow[i]); + w->writeC( + (subSong->chanShow[i]?1:0)| + (subSong->chanShowChanOsc[i]?2:0) + ); } for (int i=0; iwriteC(subSong->chanShow[i]); + w->writeC( + (subSong->chanShow[i]?1:0)| + (subSong->chanShowChanOsc[i]?2:0) + ); } for (int i=0; igetOscBuffer(tryAgain); } - if (buf!=NULL && e->curSubSong->chanShow[i]) { + if (buf!=NULL && e->curSubSong->chanShowChanOsc[i]) { // 30ms should be enough int displaySize=(float)(buf->rate)*0.03f; if (e->isRunning()) { @@ -381,7 +381,7 @@ void FurnaceGUI::drawChanOsc() { // fill buffers for (int i=0; igetOscBuffer(i); - if (buf!=NULL && e->curSubSong->chanShow[i]) { + if (buf!=NULL && e->curSubSong->chanShowChanOsc[i]) { oscBufs.push_back(buf); oscFFTs.push_back(&chanOscChan[i]); oscChans.push_back(i); diff --git a/src/gui/channels.cpp b/src/gui/channels.cpp index 48dad94f5..608604ea8 100644 --- a/src/gui/channels.cpp +++ b/src/gui/channels.cpp @@ -38,23 +38,39 @@ void FurnaceGUI::drawChannels() { //ImGui::SetNextWindowSizeConstraints(ImVec2(440.0f*dpiScale,400.0f*dpiScale),ImVec2(canvasW,canvasH)); } if (ImGui::Begin("Channels",&channelsOpen,globalWinFlags)) { - if (ImGui::BeginTable("ChannelList",3)) { + if (ImGui::BeginTable("ChannelList",5)) { + ImGui::TableSetupColumn("c0",ImGuiTableColumnFlags_WidthFixed,0.0); ImGui::TableSetupColumn("c1",ImGuiTableColumnFlags_WidthFixed,0.0); - ImGui::TableSetupColumn("c2",ImGuiTableColumnFlags_WidthStretch,0.0); - ImGui::TableSetupColumn("c3",ImGuiTableColumnFlags_WidthFixed,48.0f*dpiScale); + ImGui::TableSetupColumn("c2",ImGuiTableColumnFlags_WidthFixed,0.0); + ImGui::TableSetupColumn("c3",ImGuiTableColumnFlags_WidthStretch,0.0); + ImGui::TableSetupColumn("c4",ImGuiTableColumnFlags_WidthFixed,48.0f*dpiScale); ImGui::TableNextRow(ImGuiTableRowFlags_Headers); ImGui::TableNextColumn(); - ImGui::Text("Visible"); + ImGui::Text("Pat"); + ImGui::TableNextColumn(); + ImGui::Text("Osc"); + ImGui::TableNextColumn(); + ImGui::Text("Swap"); ImGui::TableNextColumn(); ImGui::Text("Name"); for (int i=0; igetTotalChannelCount(); i++) { ImGui::PushID(i); ImGui::TableNextRow(); ImGui::TableNextColumn(); - if (ImGui::Checkbox("##Visible",&e->curSubSong->chanShow[i])) { + if (ImGui::Checkbox("##VisiblePat",&e->curSubSong->chanShow[i])) { MARK_MODIFIED; } - ImGui::SameLine(); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Show in pattern"); + } + ImGui::TableNextColumn(); + if (ImGui::Checkbox("##VisibleChanOsc",&e->curSubSong->chanShowChanOsc[i])) { + MARK_MODIFIED; + } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Show in per-channel oscilloscope"); + } + ImGui::TableNextColumn(); if (ImGui::Button(ICON_FA_ARROWS)) { } if (ImGui::BeginDragDropSource()) {