@@ -13,8 +13,8 @@ internal static class UtilitiesInternal
1313 public static extern float ConvertTickToPosition ( int tick , int resolution ) ;
1414
1515 [ DllImport ( "libRhythmGameUtilities" , CallingConvention = CallingConvention . Cdecl ) ]
16- public static extern int ConvertSecondsToTicksInternal ( float seconds , int resolution , int [ ] bpmChangesKeys ,
17- int [ ] bpmChangesValues , int bpmChangesSize , TimeSignature [ ] timeSignatures , int timeSignaturesSize ) ;
16+ public static extern int ConvertSecondsToTicksInternal ( float seconds , int resolution , Tempo [ ] bpmChanges ,
17+ int bpmChangesSize , TimeSignature [ ] timeSignatures , int timeSignaturesSize ) ;
1818
1919 [ DllImport ( "libRhythmGameUtilities" , CallingConvention = CallingConvention . Cdecl ) ]
2020 public static extern bool IsOnTheBeat ( int bpm , float currentTime , float delta ) ;
@@ -26,8 +26,8 @@ public static extern int ConvertSecondsToTicksInternal(float seconds, int resolu
2626 public static extern float CalculateAccuracyRatio ( int position , int currentPosition , int delta ) ;
2727
2828 [ DllImport ( "libRhythmGameUtilities" , CallingConvention = CallingConvention . Cdecl ) ]
29- public static extern IntPtr CalculateBeatBarsInternal ( int [ ] bpmChangesKeys ,
30- int [ ] bpmChangesValues , int bpmChangesSize , int resolution , int ts ,
29+ public static extern IntPtr CalculateBeatBarsInternal ( Tempo [ ] bpmChanges , int bpmChangesSize , int resolution ,
30+ int ts ,
3131 bool includeHalfNotes , out int size ) ;
3232
3333 }
@@ -56,11 +56,11 @@ public static float ConvertTickToPosition(int tick, int resolution)
5656 /// <param name="resolution">The resolution of the song.</param>
5757 /// <param name="bpmChanges">All BPM changes within the song.</param>
5858 /// <param name="timeSignatureChanges">All time signature changes within the song.</param>
59- public static int ConvertSecondsToTicks ( float seconds , int resolution , Dictionary < int , int > bpmChanges ,
59+ public static int ConvertSecondsToTicks ( float seconds , int resolution , Tempo [ ] bpmChanges ,
6060 TimeSignature [ ] timeSignatureChanges )
6161 {
62- return UtilitiesInternal . ConvertSecondsToTicksInternal ( seconds , resolution , bpmChanges . Keys . ToArray ( ) ,
63- bpmChanges . Values . ToArray ( ) , bpmChanges . Count , timeSignatureChanges , timeSignatureChanges . Length ) ;
62+ return UtilitiesInternal . ConvertSecondsToTicksInternal ( seconds , resolution , bpmChanges , bpmChanges . Length ,
63+ timeSignatureChanges , timeSignatureChanges . Length ) ;
6464 }
6565
6666 /// <summary>
@@ -86,12 +86,11 @@ public static int RoundUpToTheNearestMultiplier(int value, int multiplier)
8686 return UtilitiesInternal . RoundUpToTheNearestMultiplier ( value , multiplier ) ;
8787 }
8888
89- public static BeatBar [ ] CalculateBeatBars ( Dictionary < int , int > bpmChanges , int resolution = 192 , int ts = 4 ,
89+ public static BeatBar [ ] CalculateBeatBars ( Tempo [ ] bpmChanges , int resolution = 192 , int ts = 4 ,
9090 bool includeHalfNotes = true )
9191 {
92-
93- var ptrArray = UtilitiesInternal . CalculateBeatBarsInternal ( bpmChanges . Keys . ToArray ( ) ,
94- bpmChanges . Values . ToArray ( ) , bpmChanges . Count , resolution , ts , includeHalfNotes ,
92+ var ptrArray = UtilitiesInternal . CalculateBeatBarsInternal ( bpmChanges , bpmChanges . Length , resolution , ts ,
93+ includeHalfNotes ,
9594 out var size ) ;
9695
9796 var beatBarSize = Marshal . SizeOf ( typeof ( BeatBar ) ) ;
0 commit comments