Media controls (MPRIS, Windows SMTC); stop old tracks when switching

This commit is contained in:
sarah committed 2026-10-09 18:57:03 +02:00
1 parent e2d7515e08
commit d7f5eba1c2
14 files changed
+799 -26

No files matched your search

+16
View File
@@ -14,6 +14,22 @@ A music player with two modes, switched in the header:
Each mode has its own player, so switching modes doesn't lose your place; starting one pauses
the other.
## Media controls
SaraTune counts as a media player to the system, so the desktop's media widget, the lock screen
and media keys (keyboard or Bluetooth headphones) show and control whatever played last, in
either mode: play/pause, next/previous, seeking, volume, and shuffle/repeat (in Audio mode, repeat
is the loop button; there's no shuffle).
- Linux: MPRIS on the session bus as `org.mpris.MediaPlayer2.SaraTune` (`Mpris.py`, with
`dbus-fast`). Try it with `playerctl -p SaraTune status`.
- Windows: the System Media Transport Controls (`Smtc.py`, with the `winrt` packages), through a
WinRT MediaPlayer whose own command handling is off, since the window belongs to the Flet
client's process. Not tested on real Windows yet.
`MediaControls.py` is the shared part. Settings > General can turn it off; if it can't start
(no session bus, no WinRT), SaraTune plays without it.
## Where things live
| Path | What |