mirror of
https://git.srhtnin.garden/sarah/SaraTune.git
synced 2026-10-15 02:23:17 +02:00
Media controls (MPRIS, Windows SMTC); stop old tracks when switching
This commit is contained in:
1 parent
e2d7515e08
commit
d7f5eba1c2
14 files changed
+799
-26
No files matched your search
@@ -137,6 +137,8 @@ def ShowSettingsDialog(TheApp: App, OnSaved: Callable[[bool], None], OnClearCach
|
||||
SeekField = _NumberField("Arrow keys seek by (seconds, Audio mode)", Config.SeekSeconds)
|
||||
AdvanceSwitch = ft.Switch(label="Audio mode plays the next file in the folder when one ends",
|
||||
value=Config.AudioAutoAdvance)
|
||||
MediaSwitch = ft.Switch(label="Show in the system's media controls and answer media keys",
|
||||
value=Config.MediaControls)
|
||||
|
||||
# Music: one folder per line, plus a Browse button that adds a line.
|
||||
FoldersField = ft.TextField(label="Music folders (one per line)", value="\n".join(Config.MusicFolders),
|
||||
@@ -212,6 +214,9 @@ def ShowSettingsDialog(TheApp: App, OnSaved: Callable[[bool], None], OnClearCach
|
||||
_Note("Opening files with SaraTune (e.g. from a file manager) always starts in Audio mode."),
|
||||
SeekField,
|
||||
AdvanceSwitch,
|
||||
MediaSwitch,
|
||||
_Note("Media controls: the desktop's media widget and lock screen (MPRIS on Linux), the media "
|
||||
"overlay on Windows. Changing it applies the next time SaraTune starts."),
|
||||
ft.Divider(height=1, color=Palette.Surface1),
|
||||
OwnAppearance,
|
||||
],
|
||||
@@ -271,6 +276,7 @@ def ShowSettingsDialog(TheApp: App, OnSaved: Callable[[bool], None], OnClearCach
|
||||
Config.StartMode = StartMode.value or Config.StartMode
|
||||
Config.SeekSeconds = _ReadInt(SeekField, Config.SeekSeconds, 1)
|
||||
Config.AudioAutoAdvance = AdvanceSwitch.value
|
||||
Config.MediaControls = MediaSwitch.value
|
||||
Config.MusicFolders = [os.path.expanduser(Line.strip()) for Line in (FoldersField.value or "").splitlines()
|
||||
if Line.strip()]
|
||||
Config.ScanOnStart = ScanSwitch.value
|
||||
|
||||
Reference in new issue
Block a user