Skip to content

Add audioPlayerShouldStopAtEndOfAudio: delegate method#897

Open
sbooth wants to merge 9 commits into
mainfrom
endofaudio
Open

Add audioPlayerShouldStopAtEndOfAudio: delegate method#897
sbooth wants to merge 9 commits into
mainfrom
endofaudio

Conversation

@sbooth
Copy link
Copy Markdown
Owner

@sbooth sbooth commented Mar 28, 2026

This is a breaking API change since this PR removes the audioPlayerEndOfAudio: delegate method.

Copilot AI review requested due to automatic review settings March 28, 2026 14:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the SFBAudioPlayerDelegate end-of-audio callback to return a boolean so the delegate can decide whether playback should stop or the engine should continue rendering silence after all decoders are finished.

Changes:

  • Change audioPlayerEndOfAudio: delegate method signature from void to BOOL and document the return value.
  • Update AudioPlayer end-of-audio handling to stop the engine only when the delegate indicates it should.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
Sources/CSFBAudioEngine/include/SFBAudioEngine/SFBAudioPlayer.h Updates delegate API to return BOOL at end-of-audio and documents behavior.
Sources/CSFBAudioEngine/Player/AudioPlayer.mm Uses the delegate’s return value to decide whether to stop the engine after reaching end-of-audio.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Sources/CSFBAudioEngine/include/SFBAudioEngine/SFBAudioPlayer.h Outdated
Comment thread Sources/CSFBAudioEngine/Player/AudioPlayer.mm
@sbooth sbooth changed the title Add BOOL return to audioPlayerEndOfAudio: delegate method Add audioPlayerShouldStopAtEndOfAudio: delegate method Mar 30, 2026
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-linter Review

Used clang-format v22.1.3

Click here for the full clang-format patch
diff --git a/Sources/CSFBAudioEngine/include/SFBAudioEngine/SFBAudioPlayer.h b/Sources/CSFBAudioEngine/include/SFBAudioEngine/SFBAudioPlayer.h
index 1976cf8..0105323 100644
--- a/Sources/CSFBAudioEngine/include/SFBAudioEngine/SFBAudioPlayer.h
+++ b/Sources/CSFBAudioEngine/include/SFBAudioEngine/SFBAudioPlayer.h
@@ -370 +370,2 @@ NS_SWIFT_NAME(AudioPlayer.Delegate)
-- (BOOL)audioPlayerShouldStopAtEndOfAudio:(SFBAudioPlayer *)audioPlayer NS_SWIFT_NAME(audioPlayerShouldStopAtEndOfAudio(_:));
+- (BOOL)audioPlayerShouldStopAtEndOfAudio:(SFBAudioPlayer *)audioPlayer
+        NS_SWIFT_NAME(audioPlayerShouldStopAtEndOfAudio(_:));

Have any feedback or feature suggestions? Share it here.

Comment thread Sources/CSFBAudioEngine/include/SFBAudioEngine/SFBAudioPlayer.h Outdated
@github-actions github-actions Bot dismissed their stale review March 30, 2026 15:57

outdated suggestion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants