diff --git a/src/engine/defines.h b/src/engine/defines.h index 5a2fc2a7b..46d0a09aa 100644 --- a/src/engine/defines.h +++ b/src/engine/defines.h @@ -39,8 +39,8 @@ #define DIV_PAT_FXVAL(_x) (4+((_x)<<1)) // column type checks -#define DIV_PAT_IS_EFFECT(_x) ((_x)>DIV_PAT_VOL && (!((_x)&1))) -#define DIV_PAT_IS_EFFECT_VAL(_x) ((_x)>DIV_PAT_VOL && ((_x)&1)) +#define DIV_PAT_IS_EFFECT(_x) ((_x)>DIV_PAT_VOL && ((_x)&1)) +#define DIV_PAT_IS_EFFECT_VAL(_x) ((_x)>DIV_PAT_VOL && (!((_x)&1))) #define DIV_NOTE_NULL_PAT 252 #define DIV_NOTE_OFF 253 diff --git a/src/engine/legacySample.cpp b/src/engine/legacySample.cpp index db827adda..22e22d713 100644 --- a/src/engine/legacySample.cpp +++ b/src/engine/legacySample.cpp @@ -284,6 +284,7 @@ bool DivEngine::convertLegacySampleMode() { continue; } sampleMode=1; + preferredInsType=DIV_INS_ADPCMB; break; case DIV_SYSTEM_Y8950_DRUMS: // Y8950 ADPCM diff --git a/src/engine/playback.cpp b/src/engine/playback.cpp index 687a0ef9d..05f70c4ba 100644 --- a/src/engine/playback.cpp +++ b/src/engine/playback.cpp @@ -2138,9 +2138,8 @@ bool DivEngine::nextTick(bool noAccum, bool inhibitLowLat) { // advance tempo accumulator (for virtual tempo) unless we are step playing and waiting for the next step (stepPlay==2) // then advance tick counter and then call nextRow() if (stepPlay!=1) { - // fast-forward the accumulator if we are "skipping" (seeking to a position) - // otherwise increase accumulator by virtual tempo numerator - tempoAccum+=(skipping && virtualTempoN=virtualTempoD) { // wrap the accumulator back diff --git a/src/gui/editing.cpp b/src/gui/editing.cpp index 3999b4911..b61524e04 100644 --- a/src/gui/editing.cpp +++ b/src/gui/editing.cpp @@ -380,7 +380,7 @@ void FurnaceGUI::doDelete() { for (; jcurSubSong->patLen && (j<=selEnd.y || jOrdernewData[j][DIV_PAT_VOL]=-1; + if (selStart.y==selEnd.y && selStart.order==selEnd.order) pat->newData[j][DIV_PAT_INS]=-1; } pat->newData[j][iFine]=-1; diff --git a/src/gui/insEdit.cpp b/src/gui/insEdit.cpp index f22a1dbb2..e2e5393b6 100644 --- a/src/gui/insEdit.cpp +++ b/src/gui/insEdit.cpp @@ -2843,9 +2843,9 @@ void FurnaceGUI::drawMacros(std::vector& macros, FurnaceGUI char buf[256]; if (macros[i].macro->len>0) { - snprintf(buf,255,"%s [%d]###%s",macros[i].displayName,macros[i].macro->len,macros[i].displayName); + snprintf(buf,255,"%s [%d]###%s_%d",macros[i].displayName,macros[i].macro->len,macros[i].displayName,(int)i); } else { - snprintf(buf,255,"%s",macros[i].displayName); + snprintf(buf,255,"%s###%s_%d",macros[i].displayName,macros[i].displayName,(int)i); } if (ImGui::Selectable(buf,state.selectedMacro==(int)i)) { diff --git a/src/gui/refPlayer.cpp b/src/gui/refPlayer.cpp index f7f46cd2c..cd8d05e59 100644 --- a/src/gui/refPlayer.cpp +++ b/src/gui/refPlayer.cpp @@ -109,17 +109,20 @@ void FurnaceGUI::drawRefPlayer() { if (ImGui::IsItemClicked(ImGuiMouseButton_Middle)) { fp->setPos(0); } + if (ImGui::IsItemClicked(ImGuiMouseButton_Right)) { + TimeMicros cueTime=e->getFilePlayerCue(); + fpCueInput=cueTime.toString(-1,TA_TIME_FORMAT_AUTO); + } if (ImGui::BeginPopupContextItem("Edit Cue Position",ImGuiPopupFlags_MouseButtonRight)) { ImGui::TextUnformatted(_("Set cue position at first order:")); TimeMicros cueTime=e->getFilePlayerCue(); bool altered=false; - fpCueInput=cueTime.toString(-1,TA_TIME_FORMAT_AUTO); pushWarningColor(false,fpCueInputFailed); if (ImGui::InputText("##CuePos",&fpCueInput)) { + fpCueInputFailed=false; try { cueTime=TimeMicros::fromString(fpCueInput); altered=true; - fpCueInputFailed=false; } catch (std::invalid_argument& e) { fpCueInputFailed=true; fpCueInputFailReason=e.what(); diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index 7c785d169..cbef9ce30 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -5116,7 +5116,7 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) { settings.rackShowLEDs=conf.getInt("rackShowLEDs",1); settings.mixerStyle=conf.getInt("mixerStyle",1); - settings.mixerLayout=conf.getInt("mixerLayout",1); + settings.mixerLayout=conf.getInt("mixerLayout",0); settings.channelColors=conf.getInt("channelColors",1); settings.channelTextColors=conf.getInt("channelTextColors",0); diff --git a/src/timeutils.h b/src/timeutils.h index 48b1d3cbe..ef79bd2eb 100644 --- a/src/timeutils.h +++ b/src/timeutils.h @@ -55,7 +55,7 @@ struct TimeMicros { } // operators - inline TimeMicros& operator+(TimeMicros& other) { + inline TimeMicros& operator+=(TimeMicros& other) { seconds+=other.seconds; micros+=other.micros; while (micros>=1000000) { @@ -64,11 +64,11 @@ struct TimeMicros { } return *this; } - inline TimeMicros& operator+(int other) { + inline TimeMicros& operator+=(int other) { seconds+=other; return *this; } - inline TimeMicros& operator-(TimeMicros& other) { + inline TimeMicros& operator-=(TimeMicros& other) { seconds-=other.seconds; micros-=other.micros; while (micros<0) { @@ -77,7 +77,7 @@ struct TimeMicros { } return *this; } - inline TimeMicros& operator-(int other) { + inline TimeMicros& operator-=(int other) { seconds-=other; return *this; } @@ -124,4 +124,16 @@ struct TimeMicros { seconds(0), micros(0) {} }; +inline TimeMicros operator+(TimeMicros& t1, TimeMicros t2) { + TimeMicros result=t1; + result+=t2; + return result; +} + +inline TimeMicros operator-(TimeMicros& t1, TimeMicros t2) { + TimeMicros result=t1; + result-=t2; + return result; +} + #endif