mirror of
https://github.com/AynaLivePlayer/AynaLivePlayer.git
synced 2025-12-13 13:38:16 +08:00
55 lines
1.2 KiB
Go
55 lines
1.2 KiB
Go
package events
|
|
|
|
import (
|
|
"AynaLivePlayer/common/event"
|
|
"AynaLivePlayer/core/model"
|
|
)
|
|
|
|
const (
|
|
EventPlay event.EventId = "player.play"
|
|
EventPlayed event.EventId = "player.played"
|
|
EventPlaylistPreInsert event.EventId = "playlist.insert.pre"
|
|
EventPlaylistInsert event.EventId = "playlist.insert.after"
|
|
EventPlaylistUpdate event.EventId = "playlist.update"
|
|
EventLyricUpdate event.EventId = "lyric.update"
|
|
EventLyricReload event.EventId = "lyric.reload"
|
|
)
|
|
|
|
func EventPlayerPropertyUpdate(property model.PlayerProperty) event.EventId {
|
|
return event.EventId("player.property.update." + string(property))
|
|
}
|
|
|
|
type PlaylistInsertEvent struct {
|
|
Playlist *model.Playlist
|
|
Index int
|
|
Media *model.Media
|
|
}
|
|
|
|
type PlaylistUpdateEvent struct {
|
|
Playlist *model.Playlist // Playlist is a copy of the playlist
|
|
}
|
|
|
|
type PlayEvent struct {
|
|
Media *model.Media
|
|
}
|
|
|
|
type LyricUpdateEvent struct {
|
|
Lyrics *model.Lyric
|
|
Time float64
|
|
Lyric *model.LyricContext
|
|
}
|
|
|
|
type LyricReloadEvent struct {
|
|
Lyrics *model.Lyric
|
|
}
|
|
|
|
type PlayerPropertyUpdateEvent struct {
|
|
Property model.PlayerProperty
|
|
Value model.PlayerPropertyValue
|
|
}
|
|
|
|
type LiveRoomStatusUpdateEvent struct {
|
|
RoomTitle string
|
|
Status bool
|
|
}
|