From 672b5cc253f37c61f4a87fb3fb3c65ba55533030 Mon Sep 17 00:00:00 2001 From: Uneven Prankster <33995085+GithubPrankster@users.noreply.github.com> Date: Thu, 23 Sep 2021 14:22:37 -0300 Subject: [PATCH] Initial implementation of loopPoint --- src/raudio.c | 1 + src/raudio.h | 1 + src/raylib.h | 1 + 3 files changed, 3 insertions(+) diff --git a/src/raudio.c b/src/raudio.c index 36820abe2..cc10f5185 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -1779,6 +1779,7 @@ void UpdateMusicStream(Music music) { StopMusicStream(music); // Stop music (and reset) if (music.looping) PlayMusicStream(music); // Play again + if (music.loopPoint != 0.0f) SeekMusicStream(music, music.loopPoint) // Skip to loop point } else { diff --git a/src/raudio.h b/src/raudio.h index 7e3c42f4e..43a5c52d3 100644 --- a/src/raudio.h +++ b/src/raudio.h @@ -108,6 +108,7 @@ typedef struct Sound { typedef struct Music { AudioStream stream; // Audio stream unsigned int frameCount; // Total number of frames (considering channels) + float loopPoint; // Position (in seconds) to return to after looping bool looping; // Music looping enable int ctxType; // Type of music context (audio filetype) diff --git a/src/raylib.h b/src/raylib.h index eeaf0c731..d2315cbbe 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -445,6 +445,7 @@ typedef struct Sound { typedef struct Music { AudioStream stream; // Audio stream unsigned int frameCount; // Total number of frames (considering channels) + float loopPoint; // Position (in seconds) to return to after looping bool looping; // Music looping enable int ctxType; // Type of music context (audio filetype)