diff --git a/player.go b/player.go index 6e7aa9f..9134a9f 100644 --- a/player.go +++ b/player.go @@ -43,7 +43,6 @@ func newPlayer() *Player { func (p *Player) run(currSong *AudioFile) error { p.isSkipped = make(chan bool, 1) - f, err := os.Open(currSong.path) if err != nil { @@ -109,9 +108,7 @@ func (p *Player) run(currSong *AudioFile) error { // sets the volume of previous player volume.Volume += p.volume - p._volume = volume - speaker.Play(p._volume) position := func() time.Duration { @@ -212,7 +209,7 @@ func (p *Player) setVolume(v float64) float64 { defer func() { // saves the volume - volume := int(p.volume*10) + 50 + volume := int(p.volume*10) + 100 viper.Set("volume", volume) }() diff --git a/popup.go b/popup.go index 8dcdd95..28fc70e 100644 --- a/popup.go +++ b/popup.go @@ -166,13 +166,13 @@ func timedPopup( // Shows popup for the current volume func volumePopup(volume float64) { - vol := int(volume*10) + 50 + vol := int(volume*10) + 100 progress := fmt.Sprintf("\n%d |%s%s| %s", vol, strings.Repeat("█", vol), - strings.Repeat("-", 50-vol), - "50", + strings.Repeat("-", 100-vol), + "100", ) timedPopup(" Volume ", progress, getPopupTimeout(), 0, 0) diff --git a/start.go b/start.go index 33dfdd7..023dc01 100644 --- a/start.go +++ b/start.go @@ -176,14 +176,14 @@ func start(application *tview.Application, args Args) { gomu.player.togglePause() case '+': - v := int(gomu.player.volume*10) + 50 - if v < 50 { + v := int(gomu.player.volume*10) + 100 + if v < 100 { vol := gomu.player.setVolume(0.5) volumePopup(vol) } case '-': - v := int(gomu.player.volume*10) + 50 + v := int(gomu.player.volume*10) + 100 if v > 0 { vol := gomu.player.setVolume(-0.5) volumePopup(vol)