mirror of
https://github.com/AynaLivePlayer/AynaLivePlayer.git
synced 2025-12-15 06:28:18 +08:00
Initial commit
This commit is contained in:
28
controller/handlers.go
Normal file
28
controller/handlers.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"AynaLivePlayer/event"
|
||||
"github.com/aynakeya/go-mpv"
|
||||
)
|
||||
|
||||
func handleMpvIdlePlayNext(property *mpv.EventProperty) {
|
||||
isIdle := property.Data.(mpv.Node).Value.(bool)
|
||||
if isIdle {
|
||||
l().Info("mpv went idle, try play next")
|
||||
PlayNext()
|
||||
}
|
||||
}
|
||||
|
||||
func handlePlaylistAdd(event *event.Event) {
|
||||
if MainPlayer.IsIdle() {
|
||||
PlayNext()
|
||||
}
|
||||
}
|
||||
|
||||
func handleLyricUpdate(property *mpv.EventProperty) {
|
||||
if property.Data == nil {
|
||||
return
|
||||
}
|
||||
t := property.Data.(mpv.Node).Value.(float64)
|
||||
CurrentLyric.Update(t)
|
||||
}
|
||||
Reference in New Issue
Block a user