add AudioExclusive mode
This commit is contained in:
+1
-1
@@ -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
@@ -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,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user