« get me outta code hell

Fix toggling pause not updating screen - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2019-09-17 18:22:07 -0300
committerFlorrie <towerofnix@gmail.com>2019-09-17 18:22:07 -0300
commit8360089b7116675b14f938e967b56ab460bdaa0d (patch)
treeed5b7351e64e2636fa1efeda0fcaee97a96062ca
parentca52191a803879a64c262d7aa5c002d5d374b0a2 (diff)
Fix toggling pause not updating screen
This makes the pause indicator (next to the time remaining in the queue)
work again.
-rw-r--r--todo.txt6
-rw-r--r--ui.js3
2 files changed, 9 insertions, 0 deletions
diff --git a/todo.txt b/todo.txt
index 641f892..8ebb796 100644
--- a/todo.txt
+++ b/todo.txt
@@ -378,3 +378,9 @@ TODO: Create a basic Element class, which DisplayElement extends. We have a lot
       (Done!)
 
 TODO: toString functions for elements! Handy for debugging.
+
+TODO: Revealing a track shouldn't forcibly position it at the bottom of the
+      screen (in grouplike listings that span more than a screen). Don't scroll
+      if the item is already visible, and if it's above the current scroll
+      area, make it appear at the top of the listing view instead of the
+      bottom.
diff --git a/ui.js b/ui.js
index f654ef8..e024eef 100644
--- a/ui.js
+++ b/ui.js
@@ -2572,6 +2572,7 @@ class PlaybackInfoElement extends DisplayElement {
     this.lenSecTotal = lenSecTotal
     this.volume = player.volume
     this.isLooping = player.isLooping
+    this.isPaused = player.isPaused
 
     this.progressBarLabel.text = '-'.repeat(Math.floor(this.w / lenSecTotal * curSecTotal))
     this.progressTextLabel.text = timeDone + ' / ' + duration
@@ -2615,6 +2616,8 @@ class PlaybackInfoElement extends DisplayElement {
   set volume(v) { return this.setDep('volume', v) }
   get isLooping() { return this.getDep('isLooping') }
   set isLooping(v) { return this.setDep('isLooping', v) }
+  get isPaused() { return this.getDep('isPaused') }
+  set isPaused(v) { return this.setDep('isPaused', v) }
 }
 
 class OpenPlaylistDialog extends Dialog {