Skip to content

Commit

Permalink
Volume configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
DECE2183 committed Dec 19, 2023
1 parent e86e5e0 commit 906cc54
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@ type Config struct {
Token string `yaml:"token"`
BufferSize float64 `yaml:"buffer-size-ms"`
RewindDuration float64 `yaml:"rewind-duration-s"`
Volume float64 `yaml:"volume"`
Controls Controls `yaml:"controls"`
}

var defaultConfig = Config{
BufferSize: 80,
RewindDuration: 5,
Volume: 0.5,
Controls: Controls{
PlaylistsUp: "ctrl+up",
PlaylistsDown: "ctrl+down",
Expand Down
2 changes: 1 addition & 1 deletion ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ func (m *model) playTrack(track *api.Track) {
m.trackWrapper.trackStartTime = time.Now()

m.player = m.playerContext.NewPlayer(m.trackWrapper)
m.player.SetVolume(0.5)
m.player.SetVolume(config.Current.Volume)
m.player.Play()

go m.client.PlayTrack(track, false)
Expand Down

0 comments on commit 906cc54

Please sign in to comment.