Skip to content
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
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Conversation

Eathox
Copy link

@Eathox Eathox commented Mar 30, 2020

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 calling CBA_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 in CBA_fnc_isMusicPlaying.

When merged this pull request will:

  • Fix CBA_fnc_isMusicPlaying incorrect return value (#1241, #1024)
  • Make CBA_fnc_getMusicPlaying use CBA_fnc_isMusicPlaying instead of a isNil check
  • Improve the reliability of the _trackTime value returned from CBA_fnc_getMusicPlaying
    (by using getMusicPlayedTime instead of a time based calculation)

_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 Eathox changed the title Fix for CBA_fnc_isMusicPlaying not handling music stop properly CBA_fnc_isMusicPlaying incorrect return value Mar 30, 2020
@Eathox Eathox changed the title CBA_fnc_isMusicPlaying incorrect return value Music module reliability 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
@Eathox Eathox requested a review from commy2 August 28, 2020 12:39
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
@Eathox Eathox requested a review from commy2 September 6, 2020 10:17
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