fix: better callbacks handling#1092
Open
mdydek wants to merge 7 commits into
Open
Conversation
closetcaiman
requested changes
Jun 11, 2026
closetcaiman
left a comment
Contributor
There was a problem hiding this comment.
Nice job reducing the scatter here!
Comment on lines
-160
to
+162
| if (processor_->atBoundary()) { | ||
| if (processor_->shouldStop()) { | ||
| playbackState_ = PlaybackState::STOP_SCHEDULED; | ||
| } | ||
| if (processor_->didCrossLoopBoundary()) { | ||
| sendOnLoopEndedEvent(); | ||
| } | ||
|
|
||
| if (processor_->atBoundary() && processor_->shouldStop()) { | ||
| playbackState_ = PlaybackState::STOP_SCHEDULED; | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
This handling is inconsistent with AudioBufferQueueSourceNode.
Here the event dispatch is called outside of the processor while in AudioBufferQueueSourceNode a lambda is passed to be invoked.
It would be best to unify this.
Comment on lines
+11
to
+13
| /// @brief Wrapper around EventCaller that dispatches position changed events | ||
| /// with interval throttling and optional flush-on-seek behavior. | ||
| class PositionChangedDispatcher { |
Contributor
There was a problem hiding this comment.
If we are planning to add more dispatchers it would be good to add a base class for them. Just a thought.
Comment on lines
+32
to
+35
| void PositionChangedDispatcher::setIntervalMs(int intervalInMs, float sampleRate) { | ||
| //NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers, readability-magic-numbers) | ||
| setIntervalInFrames(static_cast<int>(sampleRate * static_cast<float>(intervalInMs) / 1000.0f)); | ||
| } |
Contributor
There was a problem hiding this comment.
I'm not a fan of ignoring the linter here. Don't we have any methods that handle calculation between frames and {m}s? I believe we have a unit conversion namespace somewhere.
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.
Closes #
Introduced changes
Checklist