setting to disable fade out on pause
This commit is contained in:
@@ -21,7 +21,7 @@
|
|||||||
],
|
],
|
||||||
"postStartCommand": "sudo setfacl -m u:vscode:rw /dev/snd/*",
|
"postStartCommand": "sudo setfacl -m u:vscode:rw /dev/snd/*",
|
||||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||||
// "forwardPorts": [],
|
"forwardPorts": [5901, 6080],
|
||||||
// Use 'postCreateCommand' to run commands after the container is created.
|
// Use 'postCreateCommand' to run commands after the container is created.
|
||||||
"onCreateCommand": {
|
"onCreateCommand": {
|
||||||
"log": "echo 'Starting post-create script...'",
|
"log": "echo 'Starting post-create script...'",
|
||||||
|
|||||||
@@ -384,6 +384,7 @@ func (a *App) setupMPV() error {
|
|||||||
PreampGain: a.Config.ReplayGain.PreampGainDB,
|
PreampGain: a.Config.ReplayGain.PreampGainDB,
|
||||||
})
|
})
|
||||||
a.LocalPlayer.SetAudioExclusive(a.Config.LocalPlayback.AudioExclusive)
|
a.LocalPlayer.SetAudioExclusive(a.Config.LocalPlayback.AudioExclusive)
|
||||||
|
a.LocalPlayer.SetPauseFade(a.Config.LocalPlayback.PauseFade)
|
||||||
|
|
||||||
eq := &mpv.ISO15BandEqualizer{
|
eq := &mpv.ISO15BandEqualizer{
|
||||||
EQPreamp: a.Config.LocalPlayback.EqualizerPreamp,
|
EQPreamp: a.Config.LocalPlayback.EqualizerPreamp,
|
||||||
|
|||||||
@@ -136,6 +136,7 @@ type LocalPlaybackConfig struct {
|
|||||||
EqualizerEnabled bool
|
EqualizerEnabled bool
|
||||||
EqualizerPreamp float64
|
EqualizerPreamp float64
|
||||||
GraphicEqualizerBands []float64
|
GraphicEqualizerBands []float64
|
||||||
|
PauseFade bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type ScrobbleConfig struct {
|
type ScrobbleConfig struct {
|
||||||
@@ -270,6 +271,7 @@ func DefaultConfig(appVersionTag string) *Config {
|
|||||||
EqualizerEnabled: false,
|
EqualizerEnabled: false,
|
||||||
EqualizerPreamp: 0,
|
EqualizerPreamp: 0,
|
||||||
GraphicEqualizerBands: make([]float64, 15),
|
GraphicEqualizerBands: make([]float64, 15),
|
||||||
|
PauseFade: true,
|
||||||
},
|
},
|
||||||
Scrobbling: ScrobbleConfig{
|
Scrobbling: ScrobbleConfig{
|
||||||
Enabled: true,
|
Enabled: true,
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ type Player struct {
|
|||||||
clientName string
|
clientName string
|
||||||
equalizer Equalizer
|
equalizer Equalizer
|
||||||
peaksEnabled bool
|
peaksEnabled bool
|
||||||
|
pauseFade bool
|
||||||
|
|
||||||
fileLoadedLock sync.Mutex
|
fileLoadedLock sync.Mutex
|
||||||
fileLoadedSig *sync.Cond
|
fileLoadedSig *sync.Cond
|
||||||
@@ -283,6 +284,10 @@ func (p *Player) SetAudioExclusive(tf bool) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *Player) SetPauseFade(pauseFade bool) {
|
||||||
|
p.pauseFade = pauseFade
|
||||||
|
}
|
||||||
|
|
||||||
// Gets the current volume of the player.
|
// Gets the current volume of the player.
|
||||||
func (p *Player) GetVolume() int {
|
func (p *Player) GetVolume() int {
|
||||||
return p.vol
|
return p.vol
|
||||||
@@ -308,6 +313,8 @@ func (p *Player) Pause() error {
|
|||||||
if p.status.State != player.Playing {
|
if p.status.State != player.Playing {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if p.pauseFade {
|
||||||
p.prePausedState = p.status.State
|
p.prePausedState = p.status.State
|
||||||
p.setState(player.Paused)
|
p.setState(player.Paused)
|
||||||
|
|
||||||
@@ -329,6 +336,14 @@ func (p *Player) Pause() error {
|
|||||||
p.setPaused(true)
|
p.setPaused(true)
|
||||||
}()
|
}()
|
||||||
return nil
|
return nil
|
||||||
|
} else {
|
||||||
|
err := p.setPaused(true)
|
||||||
|
if err == nil {
|
||||||
|
p.prePausedState = p.status.State
|
||||||
|
p.setState(player.Paused)
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Continue playback and update the player state
|
// Continue playback and update the player state
|
||||||
|
|||||||
@@ -94,6 +94,7 @@
|
|||||||
"Error": "Error",
|
"Error": "Error",
|
||||||
"Error creating playlist": "Error creating playlist",
|
"Error creating playlist": "Error creating playlist",
|
||||||
"Exclusive mode": "Exclusive mode",
|
"Exclusive mode": "Exclusive mode",
|
||||||
|
"Fade out on pause": "Fade out on pause",
|
||||||
"Favorites": "Favorites",
|
"Favorites": "Favorites",
|
||||||
"Field Recording": "Field Recording",
|
"Field Recording": "Field Recording",
|
||||||
"File path": "File path",
|
"File path": "File path",
|
||||||
|
|||||||
@@ -334,6 +334,9 @@ func (c *Controller) ShowSettingsDialog(themeUpdateCallbk func(), themeFiles map
|
|||||||
dlg.OnAudioExclusiveSettingChanged = func() {
|
dlg.OnAudioExclusiveSettingChanged = func() {
|
||||||
c.App.LocalPlayer.SetAudioExclusive(c.App.Config.LocalPlayback.AudioExclusive)
|
c.App.LocalPlayer.SetAudioExclusive(c.App.Config.LocalPlayback.AudioExclusive)
|
||||||
}
|
}
|
||||||
|
dlg.OnPauseFadeSettingsChanged = func() {
|
||||||
|
c.App.LocalPlayer.SetPauseFade(c.App.Config.LocalPlayback.PauseFade)
|
||||||
|
}
|
||||||
dlg.OnAudioDeviceSettingChanged = func() {
|
dlg.OnAudioDeviceSettingChanged = func() {
|
||||||
c.App.LocalPlayer.SetAudioDevice(c.App.Config.LocalPlayback.AudioDeviceName)
|
c.App.LocalPlayer.SetAudioDevice(c.App.Config.LocalPlayback.AudioDeviceName)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ type SettingsDialog struct {
|
|||||||
|
|
||||||
OnReplayGainSettingsChanged func()
|
OnReplayGainSettingsChanged func()
|
||||||
OnAudioExclusiveSettingChanged func()
|
OnAudioExclusiveSettingChanged func()
|
||||||
|
OnPauseFadeSettingsChanged func()
|
||||||
OnAudioDeviceSettingChanged func()
|
OnAudioDeviceSettingChanged func()
|
||||||
OnThemeSettingChanged func()
|
OnThemeSettingChanged func()
|
||||||
OnDismiss func()
|
OnDismiss func()
|
||||||
@@ -407,9 +408,18 @@ func (s *SettingsDialog) createPlaybackTab(isLocalPlayer, isReplayGainPlayer boo
|
|||||||
})
|
})
|
||||||
audioExclusive.Checked = s.config.LocalPlayback.AudioExclusive
|
audioExclusive.Checked = s.config.LocalPlayback.AudioExclusive
|
||||||
|
|
||||||
|
pauseFade := widget.NewCheck(lang.L("Fade out on pause"), func(checked bool) {
|
||||||
|
s.config.LocalPlayback.PauseFade = checked
|
||||||
|
if s.OnPauseFadeSettingsChanged != nil {
|
||||||
|
s.OnPauseFadeSettingsChanged()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
pauseFade.Checked = s.config.LocalPlayback.PauseFade
|
||||||
|
|
||||||
if !isLocalPlayer {
|
if !isLocalPlayer {
|
||||||
deviceSelect.Disable()
|
deviceSelect.Disable()
|
||||||
audioExclusive.Disable()
|
audioExclusive.Disable()
|
||||||
|
pauseFade.Disable()
|
||||||
}
|
}
|
||||||
if !isReplayGainPlayer {
|
if !isReplayGainPlayer {
|
||||||
replayGainSelect.Disable()
|
replayGainSelect.Disable()
|
||||||
@@ -424,6 +434,7 @@ func (s *SettingsDialog) createPlaybackTab(isLocalPlayer, isReplayGainPlayer boo
|
|||||||
widget.NewLabel(lang.L("Audio device")), container.NewBorder(nil, nil, nil, util.NewHSpace(70), deviceSelect),
|
widget.NewLabel(lang.L("Audio device")), container.NewBorder(nil, nil, nil, util.NewHSpace(70), deviceSelect),
|
||||||
layout.NewSpacer(), audioExclusive,
|
layout.NewSpacer(), audioExclusive,
|
||||||
)),
|
)),
|
||||||
|
pauseFade,
|
||||||
s.newSectionSeparator(),
|
s.newSectionSeparator(),
|
||||||
disableTranscode,
|
disableTranscode,
|
||||||
container.NewHBox(transcode, transcodeCodec, transcodeBitRate),
|
container.NewHBox(transcode, transcodeCodec, transcodeBitRate),
|
||||||
|
|||||||
Reference in New Issue
Block a user