@@ -38,6 +38,7 @@ public partial class FramedBeatmapClock : Component, IFrameBasedClock, IAdjustab
38
38
private IDisposable ? beatmapOffsetSubscription ;
39
39
40
40
private readonly DecouplingFramedClock decoupledTrack ;
41
+ private readonly InterpolatingFramedClock interpolatedTrack ;
41
42
42
43
[ Resolved ]
43
44
private OsuConfigManager config { get ; set ; } = null ! ;
@@ -58,7 +59,7 @@ public FramedBeatmapClock(bool applyOffsets, bool requireDecoupling, IClock? sou
58
59
59
60
// An interpolating clock is used to ensure precise time values even when the host audio subsystem is not reporting
60
61
// high precision times (on windows there's generally only 5-10ms reporting intervals, as an example).
61
- var interpolatedTrack = new InterpolatingFramedClock ( decoupledTrack ) ;
62
+ interpolatedTrack = new InterpolatingFramedClock ( decoupledTrack ) ;
62
63
63
64
if ( applyOffsets )
64
65
{
@@ -190,5 +191,28 @@ protected override void Dispose(bool isDisposing)
190
191
base . Dispose ( isDisposing ) ;
191
192
beatmapOffsetSubscription ? . Dispose ( ) ;
192
193
}
194
+
195
+ public string GetSnapshot ( )
196
+ {
197
+ return
198
+ $ "originalSource: { output ( Source ) } \n " +
199
+ $ "userGlobalOffsetClock: { output ( userGlobalOffsetClock ) } \n " +
200
+ $ "platformOffsetClock: { output ( platformOffsetClock ) } \n " +
201
+ $ "userBeatmapOffsetClock: { output ( userBeatmapOffsetClock ) } \n " +
202
+ $ "interpolatedTrack: { output ( interpolatedTrack ) } \n " +
203
+ $ "decoupledTrack: { output ( decoupledTrack ) } \n " +
204
+ $ "finalClockSource: { output ( finalClockSource ) } \n ";
205
+
206
+ string output ( IClock ? clock )
207
+ {
208
+ if ( clock == null )
209
+ return "null" ;
210
+
211
+ if ( clock is IFrameBasedClock framed )
212
+ return $ "current: { clock . CurrentTime : N2} running: { clock . IsRunning } rate: { clock . Rate } elapsed: { framed . ElapsedFrameTime : N2} ";
213
+
214
+ return $ "current: { clock . CurrentTime : N2} running: { clock . IsRunning } rate: { clock . Rate } ";
215
+ }
216
+ }
193
217
}
194
218
}
0 commit comments