From 8d9cd7b216dafa8a18e481c31b6f2ec9af6faaab Mon Sep 17 00:00:00 2001 From: Florrie Date: Sat, 2 Sep 2017 13:04:17 -0300 Subject: Skip back/forwards --- src/play.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/play.js') 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.") -- cgit 1.3.0-6-gf8a5