From a72500509a5a334bd8f0f7d490a4833c03201966 Mon Sep 17 00:00:00 2001 From: Florrie Date: Wed, 24 Jan 2018 22:53:17 -0400 Subject: Revert "Add paused indicator for mpv player" This reverts commit a22688a0f04920c73a06a7c1be09037c4de8f0ce. I still have to think through this feature a fair bit more - currently if you skip to the next track while paused, or pause before MPV actually starts playing, the paused indicator shows while MPV isn't actually paused. --- src/loop-play.js | 15 +++------------ todo.txt | 1 - 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/loop-play.js b/src/loop-play.js index 70b5e5c..34ac4d5 100644 --- a/src/loop-play.js +++ b/src/loop-play.js @@ -22,11 +22,8 @@ const { getItemPathString, safeUnlink, parentSymbol } = require('./playlist-utils') -function createStatusLine({percentStr, curStr, lenStr, paused = false}) { - return ( - `(${percentStr}) ${curStr} / ${lenStr}` + - (paused === true ? ' (Paused)' : '') - ) +function createStatusLine({percentStr, curStr, lenStr}) { + return `(${percentStr}) ${curStr} / ${lenStr}` } class Player extends EventEmitter { @@ -34,7 +31,6 @@ class Player extends EventEmitter { super() this.disablePlaybackStatus = false - this.paused = false } playFile(file) {} @@ -103,9 +99,7 @@ class MPVPlayer extends Player { (Math.trunc(percentVal * 100) / 100).toFixed(2) + '%' ) - this.printStatusLine(createStatusLine({ - percentStr, curStr, lenStr, paused: this.paused - })) + this.printStatusLine(createStatusLine({percentStr, curStr, lenStr})) } }) @@ -156,7 +150,6 @@ class ControllableMPVPlayer extends MPVPlayer { togglePause() { this.sendCommand('cycle pause') - this.paused = !this.paused } kill() { @@ -224,8 +217,6 @@ class SoXPlayer extends Player { lenStr = `${lenMin}:${pad(lenSec)}` } - // No need to pass paused to createStatusLine, since the SoX player - // can never be paused! this.printStatusLine(createStatusLine({percentStr, curStr, lenStr})) } } diff --git a/todo.txt b/todo.txt index a08b3d9..06f1c51 100644 --- a/todo.txt +++ b/todo.txt @@ -161,7 +161,6 @@ TODO: The results of pressing key commands aren't very clear currently. Useful things that come to mind would be presenting the volume when it's changed; making it clear that a song is being skipped when it is; and having "paused" be part of the status bar. - (Done!) TODO: Figure out a way to make the same mpv process be reused, so that options such as volume can be remembered. (At the moment volume is reset to the -- cgit 1.3.0-6-gf8a5