OS media controls #31
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.
Changes
Add support for operating system level media controls
souvlaki
crate to add cross platform support for OS media controls. Information such as song metadata, play, pause and volume is shared between OS andtunein-cli
.--enable-os-media-controls false
command line argument to disable OS media controls, is on by default.Add
--poll-events-every
and--poll-events-every-while-paused
CLI arguments to reduce resource consumptionFixed panic caused due to player thread returning before main thread
There was an
unwrap()
on a channel receiver that receives from player thread. So when closing the program, if the player thread exits earlier, it would panic on theunwrap()
.Note
Only tested on Linux, specifically
Debian GNU/Linux 12 (bookworm) x86_64, kernel 6.1.0-37-amd64
winit
(like) event loop it might not be possible to have it. I don't have a macOS system to test it on.Look into
termion
dependency, it appears to be unused but might prevent compilation on Windows.It might make sense to introduce a config file instead of using only command line arguments.
Number of user adjustable parameters is only growing, so having a config file would be better.