@@ -34,9 +34,10 @@ const float SECONDS_PER_MINUTE = 60.0f;
34
34
* @public
35
35
*/
36
36
37
- int ConvertSecondsToTicks (float seconds, int resolution,
38
- std::vector<Tempo> tempoChanges,
39
- std::vector<TimeSignature> timeSignatureChanges)
37
+ inline int
38
+ ConvertSecondsToTicks (float seconds, int resolution,
39
+ std::vector<Tempo> tempoChanges,
40
+ std::vector<TimeSignature> timeSignatureChanges)
40
41
{
41
42
auto tempoChangesIterator = tempoChanges.begin ();
42
43
auto timeSignatureIterator = timeSignatureChanges.begin ();
@@ -99,7 +100,7 @@ int ConvertSecondsToTicks(float seconds, int resolution,
99
100
* @public
100
101
*/
101
102
102
- std::vector<std::tuple<int , int >>
103
+ inline std::vector<std::tuple<int , int >>
103
104
GenerateAdjacentKeyPairs (std::map<int , int > keyValuePairs)
104
105
{
105
106
auto adjacentKeyPairs = std::vector<std::tuple<int , int >>();
@@ -122,9 +123,9 @@ GenerateAdjacentKeyPairs(std::map<int, int> keyValuePairs)
122
123
return adjacentKeyPairs;
123
124
}
124
125
125
- std::vector<BeatBar> CalculateBeatBars (std::vector<Tempo> tempoChanges,
126
- int resolution, int ts,
127
- bool includeHalfNotes)
126
+ inline std::vector<BeatBar> CalculateBeatBars (std::vector<Tempo> tempoChanges,
127
+ int resolution, int ts,
128
+ bool includeHalfNotes)
128
129
{
129
130
std::vector<BeatBar> beatBars;
130
131
@@ -159,8 +160,8 @@ std::vector<BeatBar> CalculateBeatBars(std::vector<Tempo> tempoChanges,
159
160
return beatBars;
160
161
}
161
162
162
- std::optional<Note> FindPositionNearGivenTick (std::vector<Note> notes, int tick ,
163
- int delta = 50 )
163
+ inline std::optional<Note> FindPositionNearGivenTick (std::vector<Note> notes,
164
+ int tick, int delta = 50 )
164
165
{
165
166
auto left = 0 ;
166
167
auto right = static_cast <int >(notes.size ()) - 1 ;
@@ -198,7 +199,7 @@ extern "C"
198
199
* @public
199
200
*/
200
201
201
- PACKAGE_API float ConvertTickToPosition (int tick, int resolution)
202
+ PACKAGE_API inline float ConvertTickToPosition (int tick, int resolution)
202
203
{
203
204
return tick / static_cast <float >(resolution);
204
205
}
@@ -212,8 +213,8 @@ extern "C"
212
213
* @public
213
214
*/
214
215
215
- PACKAGE_API bool IsOnTheBeat (int bpm, float currentTime,
216
- float delta = 0 .05f )
216
+ PACKAGE_API inline bool IsOnTheBeat (int bpm, float currentTime,
217
+ float delta = 0 .05f )
217
218
{
218
219
auto beatInterval = SECONDS_PER_MINUTE / static_cast <float >(bpm);
219
220
@@ -234,7 +235,8 @@ extern "C"
234
235
* @public
235
236
*/
236
237
237
- PACKAGE_API int RoundUpToTheNearestMultiplier (int value, int multiplier)
238
+ PACKAGE_API inline int RoundUpToTheNearestMultiplier (int value,
239
+ int multiplier)
238
240
{
239
241
return static_cast <int >(
240
242
std::ceil (static_cast <float >(value) / multiplier) * multiplier);
@@ -250,8 +252,8 @@ extern "C"
250
252
* @public
251
253
*/
252
254
253
- PACKAGE_API float CalculateAccuracyRatio ( int position, int currentPosition,
254
- int delta = 50 )
255
+ PACKAGE_API inline float
256
+ CalculateAccuracyRatio ( int position, int currentPosition, int delta = 50 )
255
257
{
256
258
auto diff = position - currentPosition;
257
259
0 commit comments