Skip to content

Commit

Permalink
fix: always notify volume changes
Browse files Browse the repository at this point in the history
Fixes #146
  • Loading branch information
devgianlu committed Nov 19, 2024
1 parent a0d52ac commit f79e7ce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/daemon/controls.go
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ func (p *AppPlayer) apiVolume() uint32 {
return uint32(math.Ceil(float64(p.state.device.Volume*p.app.cfg.VolumeSteps) / player.MaxStateVolume))
}

// Set the player volume to the new volume.
// Set the player volume to the new volume, also notifies about the change.
func (p *AppPlayer) updateVolume(newVal uint32) {
if newVal > player.MaxStateVolume {
newVal = player.MaxStateVolume
Expand All @@ -599,6 +599,8 @@ func (p *AppPlayer) updateVolume(newVal uint32) {

log.Debugf("update volume to %d/%d", newVal, player.MaxStateVolume)
p.player.SetVolume(newVal)

p.volumeUpdate <- float32(newVal) / player.MaxStateVolume
}

// Send notification that the volume changed.
Expand Down

0 comments on commit f79e7ce

Please sign in to comment.