finish config_basic.go

This commit is contained in:
Aynakeya
2022-06-29 00:42:59 -07:00
parent dd46c167ff
commit c78922cf09
13 changed files with 240 additions and 107 deletions

View File

@@ -19,6 +19,8 @@ var CurrentMedia *player.Media
func Initialize() {
MainPlayer = player.NewPlayer()
SetAudioDevice(config.Player.AudioDevice)
SetVolume(config.Player.Volume)
UserPlaylist = player.NewPlaylist("user", player.PlaylistConfig{RandomNext: false})
SystemPlaylist = player.NewPlaylist("system", player.PlaylistConfig{RandomNext: config.Player.PlaylistRandom})
PlaylistManager = make([]*player.Playlist, 0)
@@ -29,6 +31,7 @@ func Initialize() {
UserPlaylist.Handler.RegisterA(player.EventPlaylistInsert, "controller.playnextwhenadd", handlePlaylistAdd)
MainPlayer.ObserveProperty("time-pos", handleLyricUpdate)
MainPlayer.Start()
}
func loadPlaylists() {