« get me outta code hell

"Pause when this track ends" option - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
path: root/ui.js
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2019-07-30 21:49:04 -0300
committerFlorrie <towerofnix@gmail.com>2019-07-30 21:49:04 -0300
commit0e9b316165f8b6585d5822a8a3b8199b7ec3e671 (patch)
tree3f9a7810d524319591ca7b05de303a9b4a9c5816 /ui.js
parent182514a1e8170d124907b982f5f87f1bffad147c (diff)
"Pause when this track ends" option
Diffstat (limited to 'ui.js')
-rw-r--r--ui.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/ui.js b/ui.js
index e73d8f5..25cc0e1 100644
--- a/ui.js
+++ b/ui.js
@@ -280,6 +280,7 @@ class AppElement extends FocusElement {
           {divider: true},
           playingTrack && {element: this.playingControl},
           {element: this.loopingControl},
+          {element: this.pauseNextControl},
           {element: this.volumeSlider},
           {divider: true},
           previous && {label: `Previous (${previous.name})`, action: () => this.backend.playPrevious(playingTrack)},
@@ -312,6 +313,12 @@ class AppElement extends FocusElement {
       getEnabled: () => this.config.canControlPlayback
     })
 
+    this.pauseNextControl = new ToggleControl('Pause when this track ends?', {
+      setValue: val => this.backend.setPauseNextTrack(val),
+      getValue: () => this.backend.pauseNextTrack,
+      getEnabled: () => this.config.canControlPlayback
+    })
+
     this.volumeSlider = new SliderElement('Volume', {
       setValue: val => this.backend.setVolume(val),
       getValue: () => this.backend.player.volume,