mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-27 15:03:01 +00:00
chanOsc visibility checklist
This commit is contained in:
parent
bb1cbbc403
commit
225cdead96
5 changed files with 37 additions and 11 deletions
|
@ -54,8 +54,8 @@ class DivWorkPool;
|
|||
|
||||
#define DIV_UNSTABLE
|
||||
|
||||
#define DIV_VERSION "dev187"
|
||||
#define DIV_ENGINE_VERSION 187
|
||||
#define DIV_VERSION "dev189"
|
||||
#define DIV_ENGINE_VERSION 189
|
||||
// for imports
|
||||
#define DIV_VERSION_MOD 0xff01
|
||||
#define DIV_VERSION_FC 0xff02
|
||||
|
|
|
@ -2182,7 +2182,13 @@ 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();
|
||||
} else { // stores 2 bools in a single char for better compat?
|
||||
unsigned char tempchar=reader.readC();
|
||||
subSong->chanShow[i]=tempchar&0xf;
|
||||
subSong->chanShowChanOsc[i]=(tempchar>>4);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<tchans; i++) {
|
||||
|
@ -2580,7 +2586,13 @@ 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();
|
||||
} else {
|
||||
unsigned char tempchar=reader.readC();
|
||||
subSong->chanShow[i]=tempchar&0xf;
|
||||
subSong->chanShowChanOsc[i]=(tempchar>>4);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<tchans; i++) {
|
||||
|
@ -3449,12 +3461,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
|
||||
|
@ -5402,7 +5416,7 @@ SafeWriter* DivEngine::saveFur(bool notPrimary, bool newPatternFormat) {
|
|||
}
|
||||
|
||||
for (int i=0; i<chans; i++) {
|
||||
w->writeC(subSong->chanShow[i]);
|
||||
w->writeC(subSong->chanShow[i]+(subSong->chanShowChanOsc[i]<<4));
|
||||
}
|
||||
|
||||
for (int i=0; i<chans; i++) {
|
||||
|
@ -5559,7 +5573,7 @@ SafeWriter* DivEngine::saveFur(bool notPrimary, bool newPatternFormat) {
|
|||
}
|
||||
|
||||
for (int i=0; i<chans; i++) {
|
||||
w->writeC(subSong->chanShow[i]);
|
||||
w->writeC(subSong->chanShow[i]+(subSong->chanShowChanOsc[i]<<4));
|
||||
}
|
||||
|
||||
for (int i=0; i<chans; i++) {
|
||||
|
|
|
@ -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];
|
||||
|
@ -183,6 +184,7 @@ struct DivSubSong {
|
|||
patLen(64),
|
||||
ordersLen(1) {
|
||||
for (int i=0; i<DIV_MAX_CHANS; i++) {
|
||||
chanShowChanOsc[i]=true;
|
||||
chanShow[i]=true;
|
||||
chanCollapse[i]=0;
|
||||
}
|
||||
|
|
|
@ -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()) {
|
||||
|
@ -376,7 +376,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);
|
||||
|
|
|
@ -38,22 +38,32 @@ 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",4)) {
|
||||
ImGui::TableSetupColumn("c1",ImGuiTableColumnFlags_WidthFixed,0.0);
|
||||
ImGui::TableSetupColumn("c2",ImGuiTableColumnFlags_WidthStretch,0.0);
|
||||
ImGui::TableSetupColumn("c3",ImGuiTableColumnFlags_WidthFixed,48.0f*dpiScale);
|
||||
ImGui::TableNextRow(ImGuiTableRowFlags_Headers);
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("Visible");
|
||||
ImGui::Text("Visibility");
|
||||
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;
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Show in pattern");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Checkbox("##VisibleChanOsc",&e->curSubSong->chanShowChanOsc[i])) {
|
||||
MARK_MODIFIED;
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Show in per-channel oscilloscope");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(ICON_FA_ARROWS)) {
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue