From 3132f177f36cc633dae16964c85967525d22edce Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Thu, 6 Apr 2006 19:54:07 +0000 Subject: [PATCH] show standard deviation --- stepmania/src/AdjustSync.cpp | 4 ++++ stepmania/src/AdjustSync.h | 1 + stepmania/src/ScreenGameplaySyncMachine.cpp | 3 +++ 3 files changed, 8 insertions(+) diff --git a/stepmania/src/AdjustSync.cpp b/stepmania/src/AdjustSync.cpp index 8b6fe6269c..8202cd0f11 100644 --- a/stepmania/src/AdjustSync.cpp +++ b/stepmania/src/AdjustSync.cpp @@ -10,6 +10,7 @@ TimingData *AdjustSync::s_pTimingDataOriginal = NULL; float AdjustSync::s_fGlobalOffsetSecondsOriginal = 0; int AdjustSync::s_iAutosyncOffsetSample = 0; float AdjustSync::s_fAutosyncOffset[SAMPLE_COUNT]; +float AdjustSync::s_fStandardDeviation = 0; void AdjustSync::ResetOriginalSyncData() { @@ -45,6 +46,7 @@ void AdjustSync::SaveSyncChanges() if( s_fGlobalOffsetSecondsOriginal != PREFSMAN->m_fGlobalOffsetSeconds ) PREFSMAN->SavePrefsToDisk(); ResetOriginalSyncData(); + s_fStandardDeviation = 0; } void AdjustSync::RevertSyncChanges() @@ -53,6 +55,7 @@ void AdjustSync::RevertSyncChanges() return; PREFSMAN->m_fGlobalOffsetSeconds.Set( s_fGlobalOffsetSecondsOriginal ); GAMESTATE->m_pCurSong->m_Timing = *s_pTimingDataOriginal; + s_fStandardDeviation = 0; } static LocalizedString AUTOSYNC_CORRECTION_APPLIED ( "AdjustSync", "Autosync: Correction applied." ); @@ -108,6 +111,7 @@ void AdjustSync::HandleAutosync( float fNoteOffBySeconds ) } s_iAutosyncOffsetSample = 0; + s_fStandardDeviation = stddev; } diff --git a/stepmania/src/AdjustSync.h b/stepmania/src/AdjustSync.h index 007be335db..953cd59a9b 100644 --- a/stepmania/src/AdjustSync.h +++ b/stepmania/src/AdjustSync.h @@ -20,6 +20,7 @@ public: static float s_fAutosyncOffset[SAMPLE_COUNT]; static int s_iAutosyncOffsetSample; + static float s_fStandardDeviation; }; #endif diff --git a/stepmania/src/ScreenGameplaySyncMachine.cpp b/stepmania/src/ScreenGameplaySyncMachine.cpp index 39fe1fdde0..af3a7c88a7 100644 --- a/stepmania/src/ScreenGameplaySyncMachine.cpp +++ b/stepmania/src/ScreenGameplaySyncMachine.cpp @@ -100,13 +100,16 @@ void ScreenGameplaySyncMachine::ResetAndRestartCurrentSong() static LocalizedString OLD_OFFSET ( "ScreenGameplaySyncMachine", "Old offset" ); static LocalizedString NEW_OFFSET ( "ScreenGameplaySyncMachine", "New offset" ); static LocalizedString COLLECTING_SAMPLE( "ScreenGameplaySyncMachine", "Collecting sample" ); +static LocalizedString STANDARD_DEVIATION( "ScreenGameplaySyncMachine", "Standard deviation" ); void ScreenGameplaySyncMachine::RefreshText() { float fNew = PREFSMAN->m_fGlobalOffsetSeconds; float fOld = AdjustSync::s_fGlobalOffsetSecondsOriginal; + float fStdDev = AdjustSync::s_fStandardDeviation; RString s; s += OLD_OFFSET.GetValue() + ssprintf( ": %0.3f\n", fOld ); s += NEW_OFFSET.GetValue() + ssprintf( ": %0.3f\n", fNew ); + s += STANDARD_DEVIATION.GetValue() + ssprintf( ": %0.3f\n", fStdDev ); s += COLLECTING_SAMPLE.GetValue() + ssprintf( ": %d / %d", AdjustSync::s_iAutosyncOffsetSample+1, SAMPLE_COUNT ); m_textSyncInfo.SetText( s );