« get me outta code hell

http-music - Command-line music player + utils (not a server!)
about summary refs log tree commit diff
path: root/src/play.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/play.js')
-rwxr-xr-xsrc/play.js19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/play.js b/src/play.js
index c955ce8..db83f13 100755
--- a/src/play.js
+++ b/src/play.js
@@ -397,15 +397,14 @@ async function main(args) {
         player.seekBack(30)
       }
 
-      if (esc(0x41).equals(data)) {
-        player.volUp(10)
-      }
+      if (esc(0x41).equals(data) || equalsChar('p')) { // Previous
+        clearConsoleLine()
+        console.log("Skipping backwards. (Press I for track info!")
 
-      if (esc(0x42).equals(data)) {
-        player.volDown(10)
+        playController.skipBack()
       }
 
-      if (equalsChar('s')) {
+      if (esc(0x42).equals(data) || equalsChar('s')) { // Skip
         clearConsoleLine()
         console.log(
           "Skipping the track that's currently playing. " +
@@ -415,6 +414,14 @@ async function main(args) {
         playController.skip()
       }
 
+      if (shiftEsc(0x41).equals(data)) {
+        player.volUp(10)
+      }
+
+      if (shiftEsc(0x42).equals(data)) {
+        player.volDown(10)
+      }
+
       if (Buffer.from([0x7f]).equals(data)) {
         clearConsoleLine()
         console.log("Skipping the track that's up next.")