add AudioExclusive mode

This commit is contained in:
Drew Weymouth
2023-03-17 18:14:08 -07:00
parent ae4660aa2c
commit 26b3a7f667
3 changed files with 10 additions and 4 deletions
+1 -1
View File
@@ -80,7 +80,7 @@ func (a *App) readConfig() {
func (a *App) initMPV() error {
p := player.NewWithClientName(AppName)
if err := p.Init(); err != nil {
if err := p.Init(a.Config.LocalPlayback.AudioExclusive); err != nil {
return fmt.Errorf("failed to initialize mpv player: %s", err.Error())
}
a.Player = p
+4 -2
View File
@@ -48,7 +48,8 @@ type PlaylistPageConfig struct {
}
type LocalPlaybackConfig struct {
Volume int
AudioExclusive bool
Volume int
}
type Config struct {
@@ -90,7 +91,8 @@ func DefaultConfig() *Config {
TracklistColumns: []string{"Artist", "Album", "Time", "Plays"},
},
LocalPlayback: LocalPlaybackConfig{
Volume: 100,
AudioExclusive: false,
Volume: 100,
},
}
}