-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Music module reliability #1315
Open
Eathox
wants to merge
11
commits into
CBATeam:master
Choose a base branch
from
Eathox:isMusicPlaying-fix
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Music module reliability #1315
Conversation
This file contains 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
_remainingTime can result in a negative number right round the end of track Limited it to 0 since a negative number would be unexpected
Eathox
changed the title
Fix for CBA_fnc_isMusicPlaying not handling music stop properly
CBA_fnc_isMusicPlaying incorrect return value
Mar 30, 2020
Eathox
changed the title
CBA_fnc_isMusicPlaying incorrect return value
Music module reliability
Mar 30, 2020
Eathox
force-pushed
the
isMusicPlaying-fix
branch
from
March 30, 2020 02:47
3014c4a
to
bc040f9
Compare
commy2
reviewed
Mar 30, 2020
commy2
reviewed
Mar 30, 2020
Now clamping _trackTime instead of _remainingTime so that _trackTime can never go over the _duration
CBA_missionTime takes accTime in to account which doesn't affect music
commy2
reviewed
Aug 29, 2020
No longer change the minimum wait time based on FPS isntead use one that accommodates the worst case scenario.
This is to keep the system in sync in case of false positives.
Remove comment stating that only `CBA_fnc_playMusic` is supported
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.
As you might know the CBA Music module isn't reliable in its current state. This is because the function
CBA_fnc_isMusicPlaying
is unable to detect when a song ended and cant handle music that was started without callingCBA_fnc_playMusic
.This pull request fixes most of these issues by utilizing the vanilla music event handlers, however this leave's one special case. That being
playMusic ""
since that doesn't trigger any of the currently present music events, this issue is fixed by incorporating an extra check inCBA_fnc_isMusicPlaying
.When merged this pull request will:
CBA_fnc_isMusicPlaying
incorrect return value (#1241, #1024)CBA_fnc_getMusicPlaying
useCBA_fnc_isMusicPlaying
instead of aisNil
check_trackTime
value returned fromCBA_fnc_getMusicPlaying
(by using
getMusicPlayedTime
instead of a time based calculation)