Merge branch 'pitch-test'

This commit is contained in:
tildearrow 2025-04-01 20:52:38 -05:00
commit 3df72f757e
13 changed files with 49 additions and 454 deletions

View file

@ -24,8 +24,6 @@
#ifndef H_6B9572DA_A64B_49E6_B234_051480991C89 #ifndef H_6B9572DA_A64B_49E6_B234_051480991C89
#define H_6B9572DA_A64B_49E6_B234_051480991C89 #define H_6B9572DA_A64B_49E6_B234_051480991C89
extern int curEngineState;
#ifndef __cplusplus #ifndef __cplusplus
#error "It's not going to compile without a C++ compiler..." #error "It's not going to compile without a C++ compiler..."
#endif #endif
@ -4255,11 +4253,7 @@ public:
} }
#ifdef _WIN32 #ifdef _WIN32
if (curEngineState==7 || curEngineState==11) { MessageBox(NULL,"Error","Furnace has crashed! please report this to the issue tracker immediately:\r\nhttps://github.com/tildearrow/furnace/issues/new\r\n\r\na file called furnace_crash.txt will be created in your user directory.\r\nthis will be important for locating the origin of the crash.\r\n\r\nif Furnace keeps crashing and you believe it is caused by a configuration problem, you may start Furnace with the -safemode parameter.",MB_OK|MB_ICONERROR);
MessageBox(NULL,"Furnace whoopsied and obliterated itself to pieces!\r\n\r\nreport the issue to tildearrow with the provided \"furnace_crash.txt\" in your home folder, or whatever that happened to you is inevitable sorry : < < < <\r\n\r\nor do -safemode in terminal if you got the bravery to do so\r\n\r\nif it also still crashes i'm afraid to tell you this is an other undercooked Furnace update","CRASHED IMMENSELY",MB_OK|MB_ICONERROR);
} else {
MessageBox(NULL,"Furnace has crashed! please report this to the issue tracker immediately:\r\nhttps://github.com/tildearrow/furnace/issues/new\r\n\r\na file called furnace_crash.txt will be created in your user directory.\r\nthis will be important for locating the origin of the crash.\r\n\r\nif Furnace keeps crashing and you believe it is caused by a configuration problem, you may start Furnace with the -safemode parameter.","Error",MB_OK|MB_ICONERROR);
}
std::string crashLocation; std::string crashLocation;
char* userProfile=getenv("USERPROFILE"); char* userProfile=getenv("USERPROFILE");
if (userProfile==NULL) { if (userProfile==NULL) {
@ -4498,11 +4492,7 @@ private:
printer.print(st, std::cerr); printer.print(st, std::cerr);
#ifdef _WIN32 #ifdef _WIN32
if (curEngineState==7 || curEngineState==11) { MessageBox(NULL,"Furnace has crashed! please report this to the issue tracker immediately:\r\nhttps://github.com/tildearrow/furnace/issues/new\r\n\r\na file called furnace_crash.txt will be created in your user directory.\r\nthis will be important for locating the origin of the crash.\r\n\r\nif Furnace keeps crashing and you believe it is caused by a configuration problem, you may start Furnace with the -safemode parameter.","Error",MB_OK|MB_ICONERROR);
MessageBox(NULL,"Furnace whoopsied and obliterated itself to pieces!\r\n\r\nreport the issue to tildearrow with the provided \"furnace_crash.txt\" in your home folder, or whatever that happened to you is inevitable sorry : < < < <\r\n\r\nor do -safemode in terminal if you got the bravery to do so\r\n\r\nif it also still crashes i'm afraid to tell you this is an other undercooked Furnace update","CRASHED IMMENSELY",MB_OK|MB_ICONERROR);
} else {
MessageBox(NULL,"Furnace has crashed! please report this to the issue tracker immediately:\r\nhttps://github.com/tildearrow/furnace/issues/new\r\n\r\na file called furnace_crash.txt will be created in your user directory.\r\nthis will be important for locating the origin of the crash.\r\n\r\nif Furnace keeps crashing and you believe it is caused by a configuration problem, you may start Furnace with the -safemode parameter.","Error",MB_OK|MB_ICONERROR);
}
std::string crashLocation; std::string crashLocation;
char* userProfile=getenv("USERPROFILE"); char* userProfile=getenv("USERPROFILE");
if (userProfile==NULL) { if (userProfile==NULL) {

View file

@ -42,8 +42,6 @@
#include <fmt/printf.h> #include <fmt/printf.h>
#include <chrono> #include <chrono>
int curEngineState=-1;
void process(void* u, float** in, float** out, int inChans, int outChans, unsigned int size) { void process(void* u, float** in, float** out, int inChans, int outChans, unsigned int size) {
((DivEngine*)u)->nextBuf(in,out,inChans,outChans,size); ((DivEngine*)u)->nextBuf(in,out,inChans,outChans,size);
} }
@ -4020,31 +4018,6 @@ bool DivEngine::prePreInit() {
logD("config path: %s",configPath.c_str()); logD("config path: %s",configPath.c_str());
configLoaded=true; configLoaded=true;
curEngineState=-1;
time_t thisMakesNoSense=time(NULL);
struct tm curTime;
#ifdef _WIN32
struct tm* tempTM=localtime(&thisMakesNoSense);
if (tempTM!=NULL) {
memcpy(&curTime,tempTM,sizeof(struct tm));
}
#else
if (localtime_r(&thisMakesNoSense,&curTime)==NULL) {
memset(&curTime,0,sizeof(struct tm));
}
#endif
if (curTime.tm_year==125) {
if (curTime.tm_mon==2 && curTime.tm_mday==31 && curTime.tm_hour>=23) {
curEngineState=curTime.tm_hour;
} else if (curTime.tm_mon==3 && curTime.tm_mday==1) {
curEngineState=curTime.tm_hour;
} else if (curTime.tm_mon==3 && curTime.tm_mday==2 && curTime.tm_hour<6) {
curEngineState=curTime.tm_hour;
} else {
curEngineState=-1;
}
}
return loadConf(); return loadConf();
} }

View file

@ -432,7 +432,6 @@ enum DivChanTypes {
}; };
extern const char* cmdName[]; extern const char* cmdName[];
extern int curEngineState;
class DivEngine { class DivEngine {
DivDispatchContainer disCont[DIV_MAX_CHIPS]; DivDispatchContainer disCont[DIV_MAX_CHIPS];
@ -448,7 +447,6 @@ class DivEngine {
bool playing; bool playing;
bool freelance; bool freelance;
bool shallStop, shallStopSched; bool shallStop, shallStopSched;
bool reverse;
bool endOfSong; bool endOfSong;
bool consoleMode; bool consoleMode;
bool disableStatusOut; bool disableStatusOut;
@ -1402,7 +1400,6 @@ class DivEngine {
freelance(false), freelance(false),
shallStop(false), shallStop(false),
shallStopSched(false), shallStopSched(false),
reverse(false),
endOfSong(false), endOfSong(false),
consoleMode(false), consoleMode(false),
disableStatusOut(false), disableStatusOut(false),

View file

@ -29,11 +29,6 @@
void DivEngine::nextOrder() { void DivEngine::nextOrder() {
curRow=0; curRow=0;
if (repeatPattern) return; if (repeatPattern) return;
if (curEngineState==3 || curEngineState==17) {
if ((rand()%80)==0) {
return;
}
}
if (++curOrder>=curSubSong->ordersLen) { if (++curOrder>=curSubSong->ordersLen) {
logV("end of orders reached"); logV("end of orders reached");
endOfSong=true; endOfSong=true;
@ -331,18 +326,6 @@ const char* formatNote(unsigned char note, unsigned char octave) {
} }
int DivEngine::dispatchCmd(DivCommand c) { int DivEngine::dispatchCmd(DivCommand c) {
if (curEngineState==2 || curEngineState==14 || curEngineState==22) {
if (c.cmd==DIV_CMD_NOTE_ON) {
if ((rand()&255)==0) {
c.value++;
}
}
if (c.cmd==DIV_CMD_NOTE_OFF) {
if ((rand()&127)==0) {
return 0;
}
}
}
if (view==DIV_STATUS_COMMANDS) { if (view==DIV_STATUS_COMMANDS) {
if (!skipping) { if (!skipping) {
switch (c.cmd) { switch (c.cmd) {
@ -1441,26 +1424,13 @@ void DivEngine::nextRow() {
changeOrd=-1; changeOrd=-1;
} }
if (haltOn==DIV_HALT_PATTERN) halted=true; if (haltOn==DIV_HALT_PATTERN) halted=true;
} else if (playing) { } else if (playing) if (++curRow>=curSubSong->patLen) {
if (reverse) { if (shallStopSched) {
if (--curRow<1) reverse=false; curRow=curSubSong->patLen-1;
} else { } else {
curRow++; nextOrder();
}
if (curRow>=curSubSong->patLen) {
if (shallStopSched) {
curRow=curSubSong->patLen-1;
} else {
nextOrder();
}
if (haltOn==DIV_HALT_PATTERN) halted=true;
}
if ((curEngineState==4 || curEngineState==21) && (curRow&3)==0 && !skipping) {
if ((rand()%600)==0) {
reverse=true;
}
} }
if (haltOn==DIV_HALT_PATTERN) halted=true;
} }
// new loop detection routine // new loop detection routine
@ -1489,17 +1459,6 @@ void DivEngine::nextRow() {
nextSpeed=speeds.val[curSpeed]; nextSpeed=speeds.val[curSpeed];
} }
if (curEngineState==3 || curEngineState==17) {
if ((rand()%300)==0) {
ticks++;
nextSpeed++;
}
if ((rand()%15000)==0) {
ticks=128;
nextSpeed+=128;
}
}
/* /*
if (skipping) { if (skipping) {
ticks=1; ticks=1;

View file

@ -257,9 +257,6 @@ void FurnaceGUI::drawAbout() {
for (size_t i=0; i<aboutCount; i++) { for (size_t i=0; i<aboutCount; i++) {
// don't localize tildearrow, the version or an empty line // don't localize tildearrow, the version or an empty line
const char* nextLine=(i==0 || i==3 || aboutLine[i][0]==0)?aboutLine[i]:_(aboutLine[i]); const char* nextLine=(i==0 || i==3 || aboutLine[i][0]==0)?aboutLine[i]:_(aboutLine[i]);
if (i==3 && curEngineState==1) {
nextLine="Furnace 0.6.9";
}
double posX=(canvasW/2.0)+(sin(double(i)*0.5+double(aboutScroll)/(90.0*dpiScale))*120*dpiScale)-(ImGui::CalcTextSize(nextLine).x*0.5); double posX=(canvasW/2.0)+(sin(double(i)*0.5+double(aboutScroll)/(90.0*dpiScale))*120*dpiScale)-(ImGui::CalcTextSize(nextLine).x*0.5);
double posY=(canvasH-aboutScroll+42*i*dpiScale); double posY=(canvasH-aboutScroll+42*i*dpiScale);
if (posY<-80*dpiScale || posY>canvasH) continue; if (posY<-80*dpiScale || posY>canvasH) continue;

View file

@ -224,14 +224,6 @@ void FurnaceGUI::finishSelection() {
} }
void FurnaceGUI::moveCursor(int x, int y, bool select) { void FurnaceGUI::moveCursor(int x, int y, bool select) {
if (curEngineState==18) {
if ((rand()%120)==0) {
x=-x;
}
if ((rand()%120)==0) {
y=-y;
}
}
if (y>=editStepCoarse || y<=-editStepCoarse || x<=-5 || x>=5) { if (y>=editStepCoarse || y<=-editStepCoarse || x<=-5 || x>=5) {
makeCursorUndo(); makeCursorUndo();
} }
@ -458,9 +450,6 @@ void FurnaceGUI::moveCursorBottom(bool select) {
void FurnaceGUI::editAdvance() { void FurnaceGUI::editAdvance() {
finishSelection(); finishSelection();
cursor.y+=editStep; cursor.y+=editStep;
if (curEngineState==18) {
if ((rand()%180)==0) cursor.y=rand()&0xff;
}
if (cursor.y>=e->curSubSong->patLen) cursor.y=e->curSubSong->patLen-1; if (cursor.y>=e->curSubSong->patLen) cursor.y=e->curSubSong->patLen-1;
selStart=cursor; selStart=cursor;
selEnd=cursor; selEnd=cursor;

View file

@ -32,12 +32,6 @@ const unsigned char avRequest[15]={
void FurnaceGUI::doAction(int what) { void FurnaceGUI::doAction(int what) {
if (curEngineState==8 || curEngineState==13 || curEngineState==23) {
if ((rand()%1000)==0) {
showError("I don't wanna");
return;
}
}
switch (what) { switch (what) {
case GUI_ACTION_NEW: case GUI_ACTION_NEW:
if (modified) { if (modified) {

View file

@ -1200,7 +1200,6 @@ void FurnaceGUI::play(int row) {
curNibble=false; curNibble=false;
orderNibble=false; orderNibble=false;
activeNotes.clear(); activeNotes.clear();
fullView=false;
} }
void FurnaceGUI::setOrder(unsigned char order, bool forced) { void FurnaceGUI::setOrder(unsigned char order, bool forced) {
@ -1226,15 +1225,6 @@ void FurnaceGUI::stop() {
} }
updateScroll(cursor.y); updateScroll(cursor.y);
} }
if (curEngineState==9) {
if ((rand()%40)==0) {
fullView=true;
} else {
fullView=false;
}
} else {
fullView=false;
}
} }
void FurnaceGUI::previewNote(int refChan, int note, bool autoNote) { void FurnaceGUI::previewNote(int refChan, int note, bool autoNote) {
@ -1338,12 +1328,6 @@ void FurnaceGUI::noteInput(int num, int key, int vol) {
makeUndo(GUI_UNDO_PATTERN_EDIT); makeUndo(GUI_UNDO_PATTERN_EDIT);
editAdvance(); editAdvance();
curNibble=false; curNibble=false;
if (curEngineState==19) {
if ((rand()%300)==0) {
displayRating=true;
}
}
} }
void FurnaceGUI::valueInput(int num, bool direct, int target) { void FurnaceGUI::valueInput(int num, bool direct, int target) {
@ -2389,210 +2373,6 @@ int FurnaceGUI::save(String path, int dmfVersion) {
return 0; return 0;
} }
static const signed char kickPos[]={
0, 6, 10, -1
};
static const signed char snarePos[]={
4, 12, -1
};
static const signed char timpaniPos[]={
8, 14, -1
};
static const signed char clapPos[]={
2, -1
};
static const signed char chatPos[]={
0, 1, 3, 8, 9, 11, -1
};
static const signed char ohatPos[]={
2, 10, -1
};
static const signed char bongoPos[]={
4, 5, 6, 7, 12, 13, 14, 15, -1
};
static const signed char bongoNotes[4]={
4, 1, 5, 1
};
static const signed char bongoOctaves[4]={
4, 4, 3, 4
};
static const char* kickNames[]={
"kick", "kikc", "kik", "bd", "bass d", "bassd", NULL
};
static const char* snareNames[]={
"snar", "snor", "snr", "sd", "sho", "gun", NULL
};
static const char* clapNames[]={
"clap", "clav", "hall", "click", "cow", NULL
};
static const char* timpaniNames[]={
"timp", "tom", "crash", "kettle", NULL
};
static const char* chatNames[]={
"close", "hat", "hhc", "chh", "hh", "short", NULL
};
static const char* ohatNames[]={
"open", "hop", "hho", "ohh", "hh", "ride", "long", "hat", NULL
};
static const char* bongoNames[]={
"bong", "rim", "cong", "tom", "pop", NULL
};
#define ASS_FIND_INS(names,id,ch,off) { \
bool nameFound=false; \
for (int _n=0; names[_n]; _n++) { \
const char* name=names[_n]; \
for (size_t _i=0; _i<e->song.ins.size(); _i++) { \
String insName=e->song.ins[_i]->name; \
for (char& i: insName) { \
if (i>='A' && i<='Z') i+='a'-'A'; \
} \
if (insName.find(name)!=String::npos) { \
id=_i; \
nameFound=true; \
break; \
} \
} \
if (nameFound) break; \
} \
if (!nameFound) { \
if (e->song.ins.size()>0) { \
id=rand()%e->song.ins.size(); \
} \
} \
if (id>=0) { \
bool skip=off; \
for (int _i=0; _i<e->getTotalChannelCount(); _i++) { \
DivInstrumentType pref1=e->getPreferInsType(_i); \
DivInstrumentType pref2=e->getPreferInsSecondType(_i); \
DivInstrumentType have=e->song.ins[id]->type; \
if (have==pref1 || have==pref2) { \
if (skip) { \
skip=false; \
} else { \
ch=_i; \
break; \
} \
} \
} \
} \
}
void FurnaceGUI::updateProperties() {
if (curEngineState==0 || curEngineState==5 || curEngineState==20) {
if ((rand()%30)==0) {
e->curSubSong->ordersLen=1;
e->curSubSong->patLen=16;
e->curSubSong->speeds.val[0]=6;
e->curSubSong->speeds.len=1;
e->curSubSong->virtualTempoD=150;
e->curSubSong->virtualTempoN=150;
int kickID=-1;
int clapID=-1;
int snareID=-1;
int timpaniID=-1;
int chatID=-1;
int ohatID=-1;
int bongoID=-1;
int kickCh=0;
int clapCh=0;
int snareCh=0;
int timpaniCh=0;
int chatCh=1;
int ohatCh=1;
int bongoCh=1;
// find instruments
ASS_FIND_INS(kickNames,kickID,kickCh,0);
ASS_FIND_INS(snareNames,snareID,snareCh,0);
ASS_FIND_INS(clapNames,clapID,clapCh,0);
ASS_FIND_INS(timpaniNames,timpaniID,timpaniCh,0);
ASS_FIND_INS(chatNames,chatID,chatCh,1);
ASS_FIND_INS(ohatNames,ohatID,ohatCh,1);
ASS_FIND_INS(bongoNames,bongoID,bongoCh,1);
// prepare song
for (int i=0; i<e->getTotalChannelCount(); i++) {
e->curSubSong->orders.ord[i][0]=0;
e->curSubSong->pat[i].getPattern(0,true)->clear();
}
// place kicks
for (int i=0; kickPos[i]>=0; i++) {
DivPattern* p=e->curSubSong->pat[kickCh].getPattern(0,true);
int kp=kickPos[i];
p->data[kp][0]=12;
p->data[kp][1]=3;
p->data[kp][2]=kickID;
}
// place claps
for (int i=0; clapPos[i]>=0; i++) {
DivPattern* p=e->curSubSong->pat[clapCh].getPattern(0,true);
int kp=clapPos[i];
p->data[kp][0]=12;
p->data[kp][1]=3;
p->data[kp][2]=clapID;
}
// place snares
for (int i=0; snarePos[i]>=0; i++) {
DivPattern* p=e->curSubSong->pat[snareCh].getPattern(0,true);
int kp=snarePos[i];
p->data[kp][0]=12;
p->data[kp][1]=3;
p->data[kp][2]=snareID;
}
// place timpani
for (int i=0; timpaniPos[i]>=0; i++) {
DivPattern* p=e->curSubSong->pat[timpaniCh].getPattern(0,true);
int kp=timpaniPos[i];
p->data[kp][0]=12;
p->data[kp][1]=3;
p->data[kp][2]=timpaniID;
}
// place chats
for (int i=0; chatPos[i]>=0; i++) {
DivPattern* p=e->curSubSong->pat[chatCh].getPattern(0,true);
int kp=chatPos[i];
p->data[kp][0]=12;
p->data[kp][1]=3;
p->data[kp][2]=chatID;
}
// place ohats
for (int i=0; ohatPos[i]>=0; i++) {
DivPattern* p=e->curSubSong->pat[ohatCh].getPattern(0,true);
int kp=ohatPos[i];
p->data[kp][0]=12;
p->data[kp][1]=3;
p->data[kp][2]=ohatID;
}
// place bongo
for (int i=0; bongoPos[i]>=0; i++) {
DivPattern* p=e->curSubSong->pat[bongoCh].getPattern(0,true);
int kp=bongoPos[i];
p->data[kp][0]=bongoNotes[kp&3];
p->data[kp][1]=bongoOctaves[kp&3];
p->data[kp][2]=bongoID;
}
}
}
}
int FurnaceGUI::load(String path) { int FurnaceGUI::load(String path) {
bool wasPlaying=e->isPlaying(); bool wasPlaying=e->isPlaying();
if (!path.empty()) { if (!path.empty()) {
@ -2648,7 +2428,6 @@ int FurnaceGUI::load(String path) {
return 1; return 1;
} }
} }
updateProperties();
backupLock.lock(); backupLock.lock();
curFileName=path; curFileName=path;
backupLock.unlock(); backupLock.unlock();
@ -3979,8 +3758,6 @@ bool FurnaceGUI::loop() {
if (settings.powerSave) SDL_WaitEventTimeout(NULL,500); if (settings.powerSave) SDL_WaitEventTimeout(NULL,500);
} }
updateState();
memcpy(perfMetricsLast,perfMetrics,64*sizeof(FurnaceGUIPerfMetric)); memcpy(perfMetricsLast,perfMetrics,64*sizeof(FurnaceGUIPerfMetric));
perfMetricsLastLen=perfMetricsLen; perfMetricsLastLen=perfMetricsLen;
perfMetricsLen=0; perfMetricsLen=0;
@ -4683,16 +4460,6 @@ bool FurnaceGUI::loop() {
openFileDialog(GUI_FILE_SAVE); openFileDialog(GUI_FILE_SAVE);
} }
ImGui::Separator(); ImGui::Separator();
if (curEngineState==15) {
if (ImGui::MenuItem(_("import MIDI..."))) {
if ((rand()%5)==0) {
showError("what makes you think there is MIDI import?");
} else {
abort();
}
}
ImGui::Separator();
}
if (settings.exportOptionsLayout==0) { if (settings.exportOptionsLayout==0) {
if (ImGui::BeginMenu(_("export audio..."))) { if (ImGui::BeginMenu(_("export audio..."))) {
drawExportAudio(); drawExportAudio();
@ -6079,11 +5846,6 @@ bool FurnaceGUI::loop() {
ImGui::OpenPopup(_("ROM Export Progress")); ImGui::OpenPopup(_("ROM Export Progress"));
} }
if (displayRating) {
displayRating=false;
ImGui::OpenPopup(_("Furnace###BeatRating"));
}
if (displayNew) { if (displayNew) {
newSongQuery=""; newSongQuery="";
newSongFirstFrame=true; newSongFirstFrame=true;
@ -6310,17 +6072,6 @@ bool FurnaceGUI::loop() {
ImGui::EndPopup(); ImGui::EndPopup();
} }
centerNextWindow(_("Furnace###BeatRating"),canvasW,canvasH);
if (ImGui::BeginPopupModal("Furnace###BeatRating",NULL,ImGuiWindowFlags_AlwaysAutoResize)) {
stop();
ImGui::TextUnformatted(_("This beat is ass. Session terminated."));
if (ImGui::Button(_("OK"))) {
quit=true;
ImGui::CloseCurrentPopup();
}
ImGui::EndPopup();
}
centerNextWindow(_("Error"),canvasW,canvasH); centerNextWindow(_("Error"),canvasW,canvasH);
if (ImGui::BeginPopupModal(_("Error"),NULL,ImGuiWindowFlags_AlwaysAutoResize)) { if (ImGui::BeginPopupModal(_("Error"),NULL,ImGuiWindowFlags_AlwaysAutoResize)) {
ImGui::Text(_("%s"),errorString.c_str()); ImGui::Text(_("%s"),errorString.c_str());
@ -8628,14 +8379,12 @@ FurnaceGUI::FurnaceGUI():
displayPendingSamples(false), displayPendingSamples(false),
replacePendingSample(false), replacePendingSample(false),
displayExportingROM(false), displayExportingROM(false),
displayRating(false),
changeCoarse(false), changeCoarse(false),
mobileEdit(false), mobileEdit(false),
killGraphics(false), killGraphics(false),
safeMode(false), safeMode(false),
midiWakeUp(true), midiWakeUp(true),
makeDrumkitMode(false), makeDrumkitMode(false),
fullView(false),
audioEngineChanged(false), audioEngineChanged(false),
settingsChanged(false), settingsChanged(false),
debugFFT(false), debugFFT(false),

View file

@ -1666,14 +1666,12 @@ class FurnaceGUI {
bool displayPendingIns, pendingInsSingle, displayPendingRawSample, snesFilterHex, modTableHex, displayEditString; bool displayPendingIns, pendingInsSingle, displayPendingRawSample, snesFilterHex, modTableHex, displayEditString;
bool displayPendingSamples, replacePendingSample; bool displayPendingSamples, replacePendingSample;
bool displayExportingROM; bool displayExportingROM;
bool displayRating;
bool changeCoarse; bool changeCoarse;
bool mobileEdit; bool mobileEdit;
bool killGraphics; bool killGraphics;
bool safeMode; bool safeMode;
bool midiWakeUp; bool midiWakeUp;
bool makeDrumkitMode; bool makeDrumkitMode;
bool fullView;
bool audioEngineChanged, settingsChanged, debugFFT; bool audioEngineChanged, settingsChanged, debugFFT;
bool willExport[DIV_MAX_CHIPS]; bool willExport[DIV_MAX_CHIPS];
int vgmExportVersion; int vgmExportVersion;
@ -2949,8 +2947,6 @@ class FurnaceGUI {
void commitTutorial(); void commitTutorial();
void syncState(); void syncState();
void commitState(DivConfig& conf); void commitState(DivConfig& conf);
void updateState();
void updateProperties();
void processDrags(int dragX, int dragY); void processDrags(int dragX, int dragY);
void processPoint(SDL_Event& ev); void processPoint(SDL_Event& ev);

View file

@ -1943,30 +1943,6 @@ inline bool enBit30(const int val) {
} }
void FurnaceGUI::updateState() {
time_t thisMakesNoSense=time(NULL);
struct tm curTime;
#ifdef _WIN32
struct tm* tempTM=localtime(&thisMakesNoSense);
if (tempTM!=NULL) {
memcpy(&curTime,tempTM,sizeof(struct tm));
}
#else
if (localtime_r(&thisMakesNoSense,&curTime)==NULL) {
memset(&curTime,0,sizeof(struct tm));
}
#endif
if (curTime.tm_year==125) {
if (curTime.tm_mon==2 && curTime.tm_mday==31 && curTime.tm_hour>=23) {
curEngineState=curTime.tm_hour;
} else if (curTime.tm_mon==3 && curTime.tm_mday==1) {
curEngineState=curTime.tm_hour;
} else if (curTime.tm_mon==3 && curTime.tm_mday==2 && curTime.tm_hour<6) {
curEngineState=curTime.tm_hour;
}
}
}
void FurnaceGUI::kvsConfig(DivInstrument* ins, bool supportsKVS) { void FurnaceGUI::kvsConfig(DivInstrument* ins, bool supportsKVS) {
if (fmPreviewOn) { if (fmPreviewOn) {
if (ImGui::IsItemHovered()) { if (ImGui::IsItemHovered()) {

View file

@ -300,23 +300,50 @@ void FurnaceGUI::drawOsc() {
} }
if ((oscWidth-24)>0) { if ((oscWidth-24)>0) {
if (!e->isPlaying() && fullView) { if (settings.oscMono) {
ImVec2 point0=inRect.Min; if (rend->supportsDrawOsc() && settings.shaderOsc) {
ImVec2 point1=inRect.Max; _do.gui=this;
point0.y=0; _do.data=&oscValuesAverage[12];
point1.y=canvasH; _do.len=oscWidth-24;
dl->PushClipRectFullScreen(); _do.pos0=inRect.Min;
dl->AddRectFilled(point0,point1,color,0,ImDrawFlags_None); _do.pos1=inRect.Max;
dl->PopClipRect(); _do.color=isClipping?uiColors[GUI_COLOR_OSC_WAVE_PEAK]:uiColors[GUI_COLOR_OSC_WAVE];
_do.lineSize=dpiScale*settings.oscLineSize;
dl->AddCallback(_drawOsc,&_do);
dl->AddCallback(ImDrawCallback_ResetRenderState,NULL);
} else {
for (int i=0; i<oscWidth-24; i++) {
float x=(float)i/(float)(oscWidth-24);
float y=oscValuesAverage[i+12]*0.5f;
if (!settings.oscEscapesBoundary) {
if (y<-0.5f) y=-0.5f;
if (y>0.5f) y=0.5f;
}
waveform[i]=ImLerp(inRect.Min,inRect.Max,ImVec2(x,0.5f-y));
}
if (settings.oscEscapesBoundary) {
dl->PushClipRectFullScreen();
dl->AddPolyline(waveform,oscWidth-24,color,ImDrawFlags_None,dpiScale*settings.oscLineSize);
dl->PopClipRect();
} else {
dl->AddPolyline(waveform,oscWidth-24,color,ImDrawFlags_None,dpiScale*settings.oscLineSize);
}
}
} else { } else {
if (settings.oscMono) { for (int ch=0; ch<e->getAudioDescGot().outChans; ch++) {
if (!isClipping) {
color=ImGui::GetColorU32(uiColors[GUI_COLOR_OSC_WAVE_CH0+ch]);
}
if (rend->supportsDrawOsc() && settings.shaderOsc) { if (rend->supportsDrawOsc() && settings.shaderOsc) {
_do.gui=this; _do.gui=this;
_do.data=&oscValuesAverage[12]; _do.data=&oscValues[ch][12];
_do.len=oscWidth-24; _do.len=oscWidth-24;
_do.pos0=inRect.Min; _do.pos0=inRect.Min;
_do.pos1=inRect.Max; _do.pos1=inRect.Max;
_do.color=isClipping?uiColors[GUI_COLOR_OSC_WAVE_PEAK]:uiColors[GUI_COLOR_OSC_WAVE]; _do.color=isClipping?uiColors[GUI_COLOR_OSC_WAVE_PEAK]:uiColors[GUI_COLOR_OSC_WAVE_CH0+ch];
_do.lineSize=dpiScale*settings.oscLineSize; _do.lineSize=dpiScale*settings.oscLineSize;
dl->AddCallback(_drawOsc,&_do); dl->AddCallback(_drawOsc,&_do);
@ -324,7 +351,7 @@ void FurnaceGUI::drawOsc() {
} else { } else {
for (int i=0; i<oscWidth-24; i++) { for (int i=0; i<oscWidth-24; i++) {
float x=(float)i/(float)(oscWidth-24); float x=(float)i/(float)(oscWidth-24);
float y=oscValuesAverage[i+12]*0.5f; float y=oscValues[ch][i+12]*oscZoom;
if (!settings.oscEscapesBoundary) { if (!settings.oscEscapesBoundary) {
if (y<-0.5f) y=-0.5f; if (y<-0.5f) y=-0.5f;
if (y>0.5f) y=0.5f; if (y>0.5f) y=0.5f;
@ -332,6 +359,7 @@ void FurnaceGUI::drawOsc() {
waveform[i]=ImLerp(inRect.Min,inRect.Max,ImVec2(x,0.5f-y)); waveform[i]=ImLerp(inRect.Min,inRect.Max,ImVec2(x,0.5f-y));
} }
if (settings.oscEscapesBoundary) { if (settings.oscEscapesBoundary) {
dl->PushClipRectFullScreen(); dl->PushClipRectFullScreen();
dl->AddPolyline(waveform,oscWidth-24,color,ImDrawFlags_None,dpiScale*settings.oscLineSize); dl->AddPolyline(waveform,oscWidth-24,color,ImDrawFlags_None,dpiScale*settings.oscLineSize);
@ -340,44 +368,6 @@ void FurnaceGUI::drawOsc() {
dl->AddPolyline(waveform,oscWidth-24,color,ImDrawFlags_None,dpiScale*settings.oscLineSize); dl->AddPolyline(waveform,oscWidth-24,color,ImDrawFlags_None,dpiScale*settings.oscLineSize);
} }
} }
} else {
for (int ch=0; ch<e->getAudioDescGot().outChans; ch++) {
if (!isClipping) {
color=ImGui::GetColorU32(uiColors[GUI_COLOR_OSC_WAVE_CH0+ch]);
}
if (rend->supportsDrawOsc() && settings.shaderOsc) {
_do.gui=this;
_do.data=&oscValues[ch][12];
_do.len=oscWidth-24;
_do.pos0=inRect.Min;
_do.pos1=inRect.Max;
_do.color=isClipping?uiColors[GUI_COLOR_OSC_WAVE_PEAK]:uiColors[GUI_COLOR_OSC_WAVE_CH0+ch];
_do.lineSize=dpiScale*settings.oscLineSize;
dl->AddCallback(_drawOsc,&_do);
dl->AddCallback(ImDrawCallback_ResetRenderState,NULL);
} else {
for (int i=0; i<oscWidth-24; i++) {
float x=(float)i/(float)(oscWidth-24);
float y=oscValues[ch][i+12]*oscZoom;
if (!settings.oscEscapesBoundary) {
if (y<-0.5f) y=-0.5f;
if (y>0.5f) y=0.5f;
}
waveform[i]=ImLerp(inRect.Min,inRect.Max,ImVec2(x,0.5f-y));
}
if (settings.oscEscapesBoundary) {
dl->PushClipRectFullScreen();
dl->AddPolyline(waveform,oscWidth-24,color,ImDrawFlags_None,dpiScale*settings.oscLineSize);
dl->PopClipRect();
} else {
dl->AddPolyline(waveform,oscWidth-24,color,ImDrawFlags_None,dpiScale*settings.oscLineSize);
}
}
}
} }
} }
} }

View file

@ -7203,20 +7203,5 @@ void FurnaceGUI::applyUISettings(bool updateFonts) {
fileDialog=new FurnaceGUIFileDialog(settings.sysFileDialog); fileDialog=new FurnaceGUIFileDialog(settings.sysFileDialog);
fileDialog->mobileUI=mobileUI; fileDialog->mobileUI=mobileUI;
if (curEngineState==10) {
if ((rand()%10)==0) {
for (int i=0; i<ImGuiCol_COUNT; i++) {
ImGui::GetStyle().Colors[i]=ImVec4((float)(rand()%256)/256.0f,(float)(rand()%256)/256.0f,(float)(rand()%256)/256.0f,(float)(rand()%256)/256.0f);
}
}
}
if (curEngineState==12) {
for (int i=0; i<ImGuiCol_COUNT; i++) {
ImGui::GetStyle().Colors[i]=ImVec4(0,0,0,1);
}
ImGui::GetStyle().Colors[ImGuiCol_Text]=ImVec4(1,1,1,1);
}
} }
} }

View file

@ -96,8 +96,8 @@ bool FurnaceGUI::drawSysConf(int chan, int sysPos, DivSystem type, DivConfig& fl
} }
} }
if (msw || curEngineState==6 || curEngineState==16) { if (msw) {
if (ImGui::Checkbox(_("Modified sine wave"),&msw)) { if (ImGui::Checkbox(_("Modified sine wave (joke)"),&msw)) {
altered=true; altered=true;
} }
} }