@@ -13,8 +13,8 @@ internal static class UtilitiesInternal
13
13
public static extern float ConvertTickToPosition ( int tick , int resolution ) ;
14
14
15
15
[ 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 ) ;
18
18
19
19
[ DllImport ( "libRhythmGameUtilities" , CallingConvention = CallingConvention . Cdecl ) ]
20
20
public static extern bool IsOnTheBeat ( int bpm , float currentTime , float delta ) ;
@@ -26,8 +26,8 @@ public static extern int ConvertSecondsToTicksInternal(float seconds, int resolu
26
26
public static extern float CalculateAccuracyRatio ( int position , int currentPosition , int delta ) ;
27
27
28
28
[ 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 ,
31
31
bool includeHalfNotes , out int size ) ;
32
32
33
33
}
@@ -56,11 +56,11 @@ public static float ConvertTickToPosition(int tick, int resolution)
56
56
/// <param name="resolution">The resolution of the song.</param>
57
57
/// <param name="bpmChanges">All BPM changes within the song.</param>
58
58
/// <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 ,
60
60
TimeSignature [ ] timeSignatureChanges )
61
61
{
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 ) ;
64
64
}
65
65
66
66
/// <summary>
@@ -86,12 +86,11 @@ public static int RoundUpToTheNearestMultiplier(int value, int multiplier)
86
86
return UtilitiesInternal . RoundUpToTheNearestMultiplier ( value , multiplier ) ;
87
87
}
88
88
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 ,
90
90
bool includeHalfNotes = true )
91
91
{
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 ,
95
94
out var size ) ;
96
95
97
96
var beatBarSize = Marshal . SizeOf ( typeof ( BeatBar ) ) ;
0 commit comments