From 5762a825d589704a53aaabb425d9470c726bbc0d Mon Sep 17 00:00:00 2001 From: Florrie Date: Thu, 24 Jan 2019 23:32:42 -0400 Subject: (v), (V) - Volume controls "v" increases because it's lowercase and therefore more likely to be accidentally pressed, hence more likely to confuse the user when it decreases the volume (if it decreased the volume - since it increases the volume, it generally doesn't seem to have any effect until you've already discovered that v and V are used for volume controls). --- ui.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'ui.js') diff --git a/ui.js b/ui.js index 4a8f0a4..67f1bf4 100644 --- a/ui.js +++ b/ui.js @@ -409,6 +409,10 @@ class AppElement extends FocusElement { this.togglePause() } else if (telc.isCaselessLetter(keyBuf, 'l')) { this.toggleLoop() + } else if (telc.isCharacter(keyBuf, 'v')) { + this.volUp() + } else if (telc.isCharacter(keyBuf, 'V')) { + this.volDown() } else if (telc.isEscape(keyBuf)) { this.clearPlayingTrack() } else if (telc.isShiftUp(keyBuf) || telc.isCaselessLetter(keyBuf, 'p')) { @@ -503,6 +507,14 @@ class AppElement extends FocusElement { this.player.toggleLoop() } + volUp(amount = 10) { + this.player.volUp(amount) + } + + volDown(amount = 10) { + this.player.volDown(amount) + } + stopPlaying() { // We emit this so playTrack doesn't immediately start a new track. // We aren't *actually* about to play a new track. @@ -1664,6 +1676,9 @@ class PlaybackInfoElement extends DisplayElement { if (player.isLooping) { this.progressTextLabel.text += ' [Looping]' } + if (player.volume !== 100) { + this.progressTextLabel.text += ` [Volume: ${Math.round(player.volume)}%]` + } this.fixLayout() } -- cgit 1.3.0-6-gf8a5