implement MPRIS SetVolume

This commit is contained in:
Drew Weymouth
2023-07-13 14:41:11 -07:00
parent a12b6dd276
commit e754b40a09
5 changed files with 59 additions and 20 deletions
+4 -4
View File
@@ -163,15 +163,15 @@ func (m *MainWindow) SetupSystemTrayMenu(appName string, fyneApp fyne.App) {
}),
fyne.NewMenuItemSeparator(),
fyne.NewMenuItem("Volume +10%", func() {
vol := m.App.Player.GetVolume()
vol := m.App.PlaybackManager.Volume()
vol = vol + int(float64(vol)*0.1)
// will clamp to range for us
m.BottomPanel.AuxControls.VolumeControl.SetVolume(vol)
m.App.PlaybackManager.SetVolume(vol)
}),
fyne.NewMenuItem("Volume -10%", func() {
vol := m.App.Player.GetVolume()
vol := m.App.PlaybackManager.Volume()
vol = vol - int(float64(vol)*0.1)
m.BottomPanel.AuxControls.VolumeControl.SetVolume(vol)
m.App.PlaybackManager.SetVolume(vol)
}),
fyne.NewMenuItemSeparator(),
fyne.NewMenuItem("Show", m.Window.Show),