Add audioPlayerShouldStopAtEndOfAudio: delegate method#897
Open
sbooth wants to merge 9 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
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 fromvoidtoBOOLand document the return value. - Update
AudioPlayerend-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.
BOOL return to audioPlayerEndOfAudio: delegate methodaudioPlayerShouldStopAtEndOfAudio: delegate method
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a breaking API change since this PR removes the
audioPlayerEndOfAudio:delegate method.