Fix reporting time in foobar2000 over 24 hours #14570
Merged
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.
Link to issue number:
Fixes #14127
Supersedes #14451
Summary of the issue:
When using the foobar2000 audio player, the
ctrl+shift+r
command should report the remaining time in the audio file in the SS, MM:SS, HH:MM:SS, or D HH:MM:SS format depending on the remaining time length.However, using the command on audio files over a day long produces an error as the code attempts to read the time string in the HH:MM:SS format instead of the D HH:MM:SS format.
Description of user facing changes
Time calculation is now processed correctly for all audio length up to 31 days. After this point, it is uncertain how foobar reports time.
In addition to fixing the time calculations, the spoken UI message was also amended to say "[time] total", "[time] elapsed", or "[time] remaining", rather than just "[time]" so as to be more understandable for the listener.
Description of development approach
Created a collection of translatable time string output formats.
Created a generic way to parse timedeltas to localised formatted strings.
Created internal functions for foobar appModule to parse foobar time strings to localised formatted strings.
Testing strategy:
Unit testing has been added
Known issues with pull request:
It is uncertain how reporting works for files over a month long.
Change log entries:
Code Review Checklist: