prepare to fix pitch linearity issues
This commit is contained in:
parent
b5faddf319
commit
c064cf089d
13 changed files with 49 additions and 454 deletions
|
|
@ -257,9 +257,6 @@ void FurnaceGUI::drawAbout() {
|
|||
for (size_t i=0; i<aboutCount; i++) {
|
||||
// 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]);
|
||||
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 posY=(canvasH-aboutScroll+42*i*dpiScale);
|
||||
if (posY<-80*dpiScale || posY>canvasH) continue;
|
||||
|
|
|
|||
|
|
@ -224,14 +224,6 @@ void FurnaceGUI::finishSelection() {
|
|||
}
|
||||
|
||||
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) {
|
||||
makeCursorUndo();
|
||||
}
|
||||
|
|
@ -458,9 +450,6 @@ void FurnaceGUI::moveCursorBottom(bool select) {
|
|||
void FurnaceGUI::editAdvance() {
|
||||
finishSelection();
|
||||
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;
|
||||
selStart=cursor;
|
||||
selEnd=cursor;
|
||||
|
|
|
|||
|
|
@ -32,12 +32,6 @@ const unsigned char avRequest[15]={
|
|||
|
||||
|
||||
void FurnaceGUI::doAction(int what) {
|
||||
if (curEngineState==8 || curEngineState==13 || curEngineState==23) {
|
||||
if ((rand()%1000)==0) {
|
||||
showError("I don't wanna");
|
||||
return;
|
||||
}
|
||||
}
|
||||
switch (what) {
|
||||
case GUI_ACTION_NEW:
|
||||
if (modified) {
|
||||
|
|
|
|||
251
src/gui/gui.cpp
251
src/gui/gui.cpp
|
|
@ -1200,7 +1200,6 @@ void FurnaceGUI::play(int row) {
|
|||
curNibble=false;
|
||||
orderNibble=false;
|
||||
activeNotes.clear();
|
||||
fullView=false;
|
||||
}
|
||||
|
||||
void FurnaceGUI::setOrder(unsigned char order, bool forced) {
|
||||
|
|
@ -1226,15 +1225,6 @@ void FurnaceGUI::stop() {
|
|||
}
|
||||
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) {
|
||||
|
|
@ -1338,12 +1328,6 @@ void FurnaceGUI::noteInput(int num, int key, int vol) {
|
|||
makeUndo(GUI_UNDO_PATTERN_EDIT);
|
||||
editAdvance();
|
||||
curNibble=false;
|
||||
|
||||
if (curEngineState==19) {
|
||||
if ((rand()%300)==0) {
|
||||
displayRating=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FurnaceGUI::valueInput(int num, bool direct, int target) {
|
||||
|
|
@ -2389,210 +2373,6 @@ int FurnaceGUI::save(String path, int dmfVersion) {
|
|||
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) {
|
||||
bool wasPlaying=e->isPlaying();
|
||||
if (!path.empty()) {
|
||||
|
|
@ -2648,7 +2428,6 @@ int FurnaceGUI::load(String path) {
|
|||
return 1;
|
||||
}
|
||||
}
|
||||
updateProperties();
|
||||
backupLock.lock();
|
||||
curFileName=path;
|
||||
backupLock.unlock();
|
||||
|
|
@ -3979,8 +3758,6 @@ bool FurnaceGUI::loop() {
|
|||
if (settings.powerSave) SDL_WaitEventTimeout(NULL,500);
|
||||
}
|
||||
|
||||
updateState();
|
||||
|
||||
memcpy(perfMetricsLast,perfMetrics,64*sizeof(FurnaceGUIPerfMetric));
|
||||
perfMetricsLastLen=perfMetricsLen;
|
||||
perfMetricsLen=0;
|
||||
|
|
@ -4683,16 +4460,6 @@ bool FurnaceGUI::loop() {
|
|||
openFileDialog(GUI_FILE_SAVE);
|
||||
}
|
||||
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 (ImGui::BeginMenu(_("export audio..."))) {
|
||||
drawExportAudio();
|
||||
|
|
@ -6079,11 +5846,6 @@ bool FurnaceGUI::loop() {
|
|||
ImGui::OpenPopup(_("ROM Export Progress"));
|
||||
}
|
||||
|
||||
if (displayRating) {
|
||||
displayRating=false;
|
||||
ImGui::OpenPopup(_("Furnace###BeatRating"));
|
||||
}
|
||||
|
||||
if (displayNew) {
|
||||
newSongQuery="";
|
||||
newSongFirstFrame=true;
|
||||
|
|
@ -6310,17 +6072,6 @@ bool FurnaceGUI::loop() {
|
|||
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);
|
||||
if (ImGui::BeginPopupModal(_("Error"),NULL,ImGuiWindowFlags_AlwaysAutoResize)) {
|
||||
ImGui::Text(_("%s"),errorString.c_str());
|
||||
|
|
@ -8628,14 +8379,12 @@ FurnaceGUI::FurnaceGUI():
|
|||
displayPendingSamples(false),
|
||||
replacePendingSample(false),
|
||||
displayExportingROM(false),
|
||||
displayRating(false),
|
||||
changeCoarse(false),
|
||||
mobileEdit(false),
|
||||
killGraphics(false),
|
||||
safeMode(false),
|
||||
midiWakeUp(true),
|
||||
makeDrumkitMode(false),
|
||||
fullView(false),
|
||||
audioEngineChanged(false),
|
||||
settingsChanged(false),
|
||||
debugFFT(false),
|
||||
|
|
|
|||
|
|
@ -1666,14 +1666,12 @@ class FurnaceGUI {
|
|||
bool displayPendingIns, pendingInsSingle, displayPendingRawSample, snesFilterHex, modTableHex, displayEditString;
|
||||
bool displayPendingSamples, replacePendingSample;
|
||||
bool displayExportingROM;
|
||||
bool displayRating;
|
||||
bool changeCoarse;
|
||||
bool mobileEdit;
|
||||
bool killGraphics;
|
||||
bool safeMode;
|
||||
bool midiWakeUp;
|
||||
bool makeDrumkitMode;
|
||||
bool fullView;
|
||||
bool audioEngineChanged, settingsChanged, debugFFT;
|
||||
bool willExport[DIV_MAX_CHIPS];
|
||||
int vgmExportVersion;
|
||||
|
|
@ -2949,8 +2947,6 @@ class FurnaceGUI {
|
|||
void commitTutorial();
|
||||
void syncState();
|
||||
void commitState(DivConfig& conf);
|
||||
void updateState();
|
||||
void updateProperties();
|
||||
void processDrags(int dragX, int dragY);
|
||||
void processPoint(SDL_Event& ev);
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
if (fmPreviewOn) {
|
||||
if (ImGui::IsItemHovered()) {
|
||||
|
|
|
|||
|
|
@ -300,23 +300,50 @@ void FurnaceGUI::drawOsc() {
|
|||
}
|
||||
|
||||
if ((oscWidth-24)>0) {
|
||||
if (!e->isPlaying() && fullView) {
|
||||
ImVec2 point0=inRect.Min;
|
||||
ImVec2 point1=inRect.Max;
|
||||
point0.y=0;
|
||||
point1.y=canvasH;
|
||||
dl->PushClipRectFullScreen();
|
||||
dl->AddRectFilled(point0,point1,color,0,ImDrawFlags_None);
|
||||
dl->PopClipRect();
|
||||
if (settings.oscMono) {
|
||||
if (rend->supportsDrawOsc() && settings.shaderOsc) {
|
||||
_do.gui=this;
|
||||
_do.data=&oscValuesAverage[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];
|
||||
_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 {
|
||||
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) {
|
||||
_do.gui=this;
|
||||
_do.data=&oscValuesAverage[12];
|
||||
_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];
|
||||
_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);
|
||||
|
|
@ -324,7 +351,7 @@ void FurnaceGUI::drawOsc() {
|
|||
} else {
|
||||
for (int i=0; i<oscWidth-24; i++) {
|
||||
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 (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));
|
||||
}
|
||||
|
||||
|
||||
if (settings.oscEscapesBoundary) {
|
||||
dl->PushClipRectFullScreen();
|
||||
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);
|
||||
}
|
||||
}
|
||||
} 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7203,20 +7203,5 @@ void FurnaceGUI::applyUISettings(bool updateFonts) {
|
|||
fileDialog=new FurnaceGUIFileDialog(settings.sysFileDialog);
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,8 +96,8 @@ bool FurnaceGUI::drawSysConf(int chan, int sysPos, DivSystem type, DivConfig& fl
|
|||
}
|
||||
}
|
||||
|
||||
if (msw || curEngineState==6 || curEngineState==16) {
|
||||
if (ImGui::Checkbox(_("Modified sine wave"),&msw)) {
|
||||
if (msw) {
|
||||
if (ImGui::Checkbox(_("Modified sine wave (joke)"),&msw)) {
|
||||
altered=true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue