dev189 - Merge branch 'chanoscchecklist' of https://github.com/Eknous-P/furnace

This commit is contained in:
tildearrow 2023-12-06 12:21:24 -05:00
commit f5b41d5ac3
5 changed files with 54 additions and 14 deletions

View file

@ -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

View file

@ -2185,7 +2185,14 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
if (ds.version>=39) {
for (int i=0; i<tchans; i++) {
subSong->chanShow[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; i<tchans; i++) {
@ -2588,7 +2595,14 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
}
for (int i=0; i<tchans; i++) {
subSong->chanShow[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; i<tchans; i++) {
@ -3457,12 +3471,14 @@ bool DivEngine::loadMod(unsigned char* file, size_t len) {
}
for(int i=0; i<chCount; i++) {
ds.subsong[0]->chanShow[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; i<ds.systemLen*4; i++) {
ds.subsong[0]->pat[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; i<chans; i++) {
w->writeC(subSong->chanShow[i]);
w->writeC(
(subSong->chanShow[i]?1:0)|
(subSong->chanShowChanOsc[i]?2:0)
);
}
for (int i=0; i<chans; i++) {
@ -5568,7 +5587,10 @@ SafeWriter* DivEngine::saveFur(bool notPrimary, bool newPatternFormat) {
}
for (int i=0; i<chans; i++) {
w->writeC(subSong->chanShow[i]);
w->writeC(
(subSong->chanShow[i]?1:0)|
(subSong->chanShowChanOsc[i]?2:0)
);
}
for (int i=0; i<chans; i++) {

View file

@ -164,6 +164,7 @@ struct DivSubSong {
DivChannelData pat[DIV_MAX_CHANS];
bool chanShow[DIV_MAX_CHANS];
bool chanShowChanOsc[DIV_MAX_CHANS];
unsigned char chanCollapse[DIV_MAX_CHANS];
String chanName[DIV_MAX_CHANS];
String chanShortName[DIV_MAX_CHANS];
@ -184,6 +185,7 @@ struct DivSubSong {
ordersLen(1) {
for (int i=0; i<DIV_MAX_CHANS; i++) {
chanShow[i]=true;
chanShowChanOsc[i]=true;
chanCollapse[i]=0;
}
}

View file

@ -92,7 +92,7 @@ void FurnaceGUI::calcChanOsc() {
if (--tryAgain<0) break;
buf=e->getOscBuffer(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; i<chans; i++) {
DivDispatchOscBuffer* buf=e->getOscBuffer(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);

View file

@ -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; i<e->getTotalChannelCount(); 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()) {