Add new preference: DefaultGroupOffsetSeconds to dictate the default sync bias on the machine when no group.ini is present (or if there is no SyncOffset field in said file).

- Generally Supports either ITG (9ms) or NULL (0ms).
- Alternatively, one could edit the preference manually to put a different value
- Name/Description probably worth ironing out
This commit is contained in:
Crash Cringle
2025-03-03 23:25:32 -08:00
committed by teejusb
parent 835ca35065
commit 00342feadc
7 changed files with 23 additions and 11 deletions
+2
View File
@@ -531,6 +531,7 @@ Transfer Edits to USB=Transfer Edits to USB
Transfer Edits from USB=Transfer Edits from USB
UseUnlockSystem=Enable or disable the unlock system.
VisualDelaySeconds=Calibrate display lag.
DefaultGroupOffsetSeconds=Change the Default Sync Bias
Vsync=Cap your frame rate your display's refresh rate. This option only has an effect when the Display Mode is set to &oq;Full Screen&cq;.
WideScreen16_9=Enable widescreen display.
WideScreen16_10=Enable widescreen display.
@@ -1308,6 +1309,7 @@ Undo=Undo
UseUnlockSystem=Unlock System
View steps data=View Steps Data
VisualDelaySeconds=Visual Delay
DefaultGroupOffsetSeconds=Default Group Offset
Voltage=Voltage
Vsync=Wait For Vsync
Warps=Warps
+3 -2
View File
@@ -3067,7 +3067,7 @@ Line22="conf,EventMode"
Fallback="ScreenOptionsServiceChild"
NextScreen="ScreenOptionsService"
PrevScreen="ScreenOptionsService"
LineNames="1,2,3,RefreshRate,FSType,4,5,6,7,8,9,10,11,13,FNR,14,17,18,19,20,21"
LineNames="1,2,3,RefreshRate,FSType,4,5,6,7,8,9,10,11,13,FNR,14,17,18,19,20,21,22"
Line1="lua,ConfDisplayMode()"
Line2="lua,ConfAspectRatio()"
Line3="lua,ConfDisplayResolution()"
@@ -3092,7 +3092,8 @@ Line17="conf,SoundVolume"
Line18="conf,EnableAttackSounds"
Line19="conf,EnableMineHitSound"
Line20="conf,VisualDelaySeconds"
Line21="conf,RateModPreservesPitch"
Line21="conf,DefaultGroupOffsetSeconds"
Line22="conf,RateModPreservesPitch",
[ScreenOptionsAdvanced]
Fallback="ScreenOptionsServiceChild"
+9 -7
View File
@@ -43,7 +43,7 @@ Group::Group(const RString sDir, const RString &sGroupDirName) {
RString Series = "";
RString bannerPath = "";
RString authorsNotes = "";
float fOffset = 0;
float fOffset = PREFSMAN->m_fDefaultGroupOffsetSeconds;
if (FILEMAN->DoesFileExist(sGroupIniPath)) {
IniFile ini;
@@ -65,12 +65,14 @@ Group::Group(const RString sDir, const RString &sGroupDirName) {
RString sValue = "";
ini.GetValue("Group", "SyncOffset", sValue);
if (sValue.CompareNoCase("null") == 0) {
fOffset = 0;
} else if (sValue.CompareNoCase("itg") == 0) {
fOffset = 0.009f;
} else {
fOffset = StringToFloat(sValue);
if (!sValue.empty()) {
if (sValue.CompareNoCase("null") == 0) {
fOffset = 0.0f;
} else if (sValue.CompareNoCase("itg") == 0) {
fOffset = 0.009f;
} else {
fOffset = StringToFloat(sValue);
}
}
ini.GetValue("Group", "Year", m_iYearReleased);
ini.GetValue( "Group", "Credits", credits );
+1
View File
@@ -237,6 +237,7 @@ PrefsManager::PrefsManager() :
m_ShowDancingCharacters ( "ShowDancingCharacters", SDC_Random ),
m_bUseUnlockSystem ( "UseUnlockSystem", false ),
m_fGlobalOffsetSeconds ( "GlobalOffsetSeconds", -0.008f ),
m_fDefaultGroupOffsetSeconds ( "DefaultGroupOffsetSeconds", 0.0f ),
m_iProgressiveLifebar ( "ProgressiveLifebar", 0 ),
m_iProgressiveStageLifebar ( "ProgressiveStageLifebar", 0 ),
m_iProgressiveNonstopLifebar ( "ProgressiveNonstopLifebar", 0 ),
+1
View File
@@ -240,6 +240,7 @@ public:
Preference<ShowDancingCharacters> m_ShowDancingCharacters;
Preference<bool> m_bUseUnlockSystem;
Preference<float> m_fGlobalOffsetSeconds;
Preference<float> m_fDefaultGroupOffsetSeconds;
Preference<int> m_iProgressiveLifebar;
Preference<int> m_iProgressiveStageLifebar;
Preference<int> m_iProgressiveNonstopLifebar;
+7
View File
@@ -710,6 +710,12 @@ static void GlobalOffsetSeconds( int &sel, bool ToSel, const ConfOption *pConfOp
MoveMap( sel, pConfOption, ToSel, mapping, ARRAYLEN(mapping) );
}
static void DefaultGroupOffsetSeconds( int &sel, bool ToSel, const ConfOption *pConfOption )
{
const float mapping[] = { 0.0f, 0.009f };
MoveMap( sel, pConfOption, ToSel, mapping, ARRAYLEN(mapping) );
}
static void EditRecordModeLeadIn(int &sel, bool to_sel, const ConfOption* conf_option)
{
float mapping[32];
@@ -941,6 +947,7 @@ static void InitializeConfOptions()
c.AddOption( ssprintf("%+i ms", i) );
ADD( c );
}
ADD( ConfOption( "DefaultGroupOffsetSeconds", DefaultGroupOffsetSeconds, "Null","|ITG" ) );
ADD( ConfOption( "EnableAttackSounds", MovePref<bool>, "No","Yes" ) );
ADD( ConfOption( "EnableMineHitSound", MovePref<bool>, "No","Yes" ) );
ADD( ConfOption( "RateModPreservesPitch", MovePref<bool>, "No","Yes") );
-2
View File
@@ -418,8 +418,6 @@ void SongManager::LoadSongDir( RString sDir, LoadingWindow *ld, bool onlyAdditio
const std::vector<Steps*>& vpSteps = pNewSong->GetAllSteps();
for (Steps* s : vpSteps)
{
// Empty TimingData means it's inherited
// from the song and is already changed.
if( s->m_Timing.empty() )
continue;
s->m_Timing.m_fBeat0GroupOffsetInSeconds = group->GetSyncOffset();