Initial implementation of loopPoint

This commit is contained in:
Uneven Prankster 2021-09-23 14:22:37 -03:00
parent ddc1fdf6d5
commit 672b5cc253
3 changed files with 3 additions and 0 deletions

View File

@ -1779,6 +1779,7 @@ void UpdateMusicStream(Music music)
{ {
StopMusicStream(music); // Stop music (and reset) StopMusicStream(music); // Stop music (and reset)
if (music.looping) PlayMusicStream(music); // Play again if (music.looping) PlayMusicStream(music); // Play again
if (music.loopPoint != 0.0f) SeekMusicStream(music, music.loopPoint) // Skip to loop point
} }
else else
{ {

View File

@ -108,6 +108,7 @@ typedef struct Sound {
typedef struct Music { typedef struct Music {
AudioStream stream; // Audio stream AudioStream stream; // Audio stream
unsigned int frameCount; // Total number of frames (considering channels) unsigned int frameCount; // Total number of frames (considering channels)
float loopPoint; // Position (in seconds) to return to after looping
bool looping; // Music looping enable bool looping; // Music looping enable
int ctxType; // Type of music context (audio filetype) int ctxType; // Type of music context (audio filetype)

View File

@ -445,6 +445,7 @@ typedef struct Sound {
typedef struct Music { typedef struct Music {
AudioStream stream; // Audio stream AudioStream stream; // Audio stream
unsigned int frameCount; // Total number of frames (considering channels) unsigned int frameCount; // Total number of frames (considering channels)
float loopPoint; // Position (in seconds) to return to after looping
bool looping; // Music looping enable bool looping; // Music looping enable
int ctxType; // Type of music context (audio filetype) int ctxType; // Type of music context (audio filetype)