more progress - player switching working

This commit is contained in:
Drew Weymouth
2025-03-29 15:15:13 -07:00
parent 8bd1c8183d
commit 1ad45a33db
8 changed files with 58 additions and 2 deletions
+20
View File
@@ -151,6 +151,26 @@ func (m *Controller) HaveModal() bool {
return m.haveModal
}
func (m *Controller) ShowCastMenu() {
devices := m.App.PlaybackManager.RemotePlayers()
menu := fyne.NewMenu("")
menu.Items = append(menu.Items, fyne.NewMenuItem(lang.L("Local player"), func() {
m.App.PlaybackManager.SetRemotePlayer(nil)
}))
for _, d := range devices {
_d := d
menu.Items = append(menu.Items, fyne.NewMenuItem(d.Name, func() {
m.App.PlaybackManager.SetRemotePlayer(&_d)
}))
}
pop := widget.NewPopUpMenu(menu, m.MainWindow.Canvas())
canvasSize := m.MainWindow.Canvas().Size()
pop.ShowAtPosition(fyne.NewPos(
canvasSize.Width-pop.MinSize().Width-10,
canvasSize.Height-pop.MinSize().Height-100,
))
}
func (m *Controller) ShowPopUpPlayQueue() {
m.popUpQueueMutex.Lock()
if m.popUpQueue == nil {