Add a new button to the controls that defines whether the media repeats
at the end of the stream. The states are:
- Disabled: Media does not repeat. This is existing behavior and the
default state.
- Always: Media always repeats.
- Once: Media repeats once. Flag is reset when loading new media.
Tested all three states with both audio and video.
Added a `rustfmt.toml` to avoid reordering imports. They keep moving
around in previous pull requests, best to just define what we want in
the repository.
Fixes: #39
Closes: #157
XDG portals expose a D-Bus interface allowing apps to prevent screen
idling, user switching, and other actions. That interface,
org.freedesktop.portal.Inhibit, does all of the heavy lifting here.
Idling = the screen dimming or shutting off.
Idling is inhibited when a video is actively playing.
Idling is NOT inhibited when videos aren't playing - this includes
paused or stopped videos.
`lazy_static` and `smol_str` weren't used. COSMIC Player used `dirs`
once to find the user's home directory. Rust fixed and undeprecated its
`home_dir` function in 1.85, which released earlier this year and is the
MSRV of libcosmic.
We hide the title bar similarly on how we hide the controls bar.
The difference between the header bar and the controls bar is that in
`Fullscreen` mode we don't display the header bar even if we have mouse
movement.
If a menu or sub-menu is open, but then the user makes no mouse
movement, then the menus will be hidden when the header bar is hidden.
I'm not sure how to handle the side panel, the `nav_bar`, what I call
"the playlist". I decided to not handle it's hiding based on mouse
movement because it is still displayed when we put the window in
`Fullscreen` mode.
Closes#37
For an executable the first argument is always the binary itself.
Because of this we have to skip it.
If we don't skip it, then it will be treated as another URL, therefore
`cosmic-player` will end up opening two URLs, one for the binary and one
for the actual file we want to play.
When opening multiple files `cosmic-player` will show the side panel /
playlist with the list of files.
The regression this commit fixed was introduced by `01be9152`.
Closes#96.
Prior to this commit, projects/playlists were limited to folders even if
file URLs were passed as arguments. With this commit both files and
folders are added to projects from the command line.
This doesn't affect opening a file from the GUI yet, but this patch
implements the required plumbing for that as well.
Allows opening a folder on the command line rather than only a single
file. This is useful for Freedesktop compliant file managers as they
pass files URLs to media players.
This currently only handles one URL whereas the spec allows multiple.