From fef970145ea9f6894be66d8caa4e2088e21a898e Mon Sep 17 00:00:00 2001 From: supertick Date: Fri, 26 Apr 2024 12:20:58 -0700 Subject: [PATCH] quick-audio-player-fixes --- .../org/myrobotlab/audio/PlaylistPlayer.java | 5 +++++ .../WebGui/app/service/js/AudioFileGui.js | 14 ++----------- .../app/service/views/AudioFileGui.html | 20 +++++++++---------- 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/src/main/java/org/myrobotlab/audio/PlaylistPlayer.java b/src/main/java/org/myrobotlab/audio/PlaylistPlayer.java index 46396bb50b..7ff3d128f0 100644 --- a/src/main/java/org/myrobotlab/audio/PlaylistPlayer.java +++ b/src/main/java/org/myrobotlab/audio/PlaylistPlayer.java @@ -4,10 +4,14 @@ import java.util.Collections; import java.util.List; +import org.myrobotlab.logging.LoggerFactory; import org.myrobotlab.service.AudioFile; +import org.slf4j.Logger; public class PlaylistPlayer implements Runnable { + static final Logger log = LoggerFactory.getLogger(PlaylistPlayer.class); + private transient AudioFile audioFile = null; private transient Thread player; private boolean shuffle; @@ -34,6 +38,7 @@ public void run() { audioFile.play(list.get(i), true, null, track); } if (!repeat) { + log.info("finished playing playlist"); done = true; } } diff --git a/src/main/resources/resource/WebGui/app/service/js/AudioFileGui.js b/src/main/resources/resource/WebGui/app/service/js/AudioFileGui.js index 2a34217609..2510678548 100644 --- a/src/main/resources/resource/WebGui/app/service/js/AudioFileGui.js +++ b/src/main/resources/resource/WebGui/app/service/js/AudioFileGui.js @@ -8,19 +8,9 @@ angular.module('mrlapp.service.AudioFileGui', []).controller('AudioFileGuiCtrl', // playing paused stopped $scope.activity = null - // $scope.playFile = function() { - // msg.send('playFile', $scope.selectedFile) - // } - $scope.play = function() { - // if (blah){ - // $scope.selectedFile = selectedFiles[0] - // } else { - // $scope.selectedFile = selectedFiles[0] - // } let playFile = $scope.selectedFile msg.send('play', $scope.selectedFile) - } $scope.setSelectedFileFromTrack = function(selected) { @@ -29,7 +19,7 @@ angular.module('mrlapp.service.AudioFileGui', []).controller('AudioFileGuiCtrl', $scope.startPlaylist = function() { if ($scope.selectedPlaylist) { - msg.send('startPlaylist', $scope.selectedPlaylist[0]) + msg.send('startPlaylist', $scope.selectedPlaylist) } else { msg.send('startPlaylist') } @@ -37,7 +27,7 @@ angular.module('mrlapp.service.AudioFileGui', []).controller('AudioFileGuiCtrl', $scope.stopPlaylist = function() { if ($scope.selectedPlaylist) { - msg.send('stopPlaylist', $scope.selectedPlaylist[0]) + msg.send('stopPlaylist', $scope.selectedPlaylist) msg.send('stop') } else { msg.send('stopPlaylist') diff --git a/src/main/resources/resource/WebGui/app/service/views/AudioFileGui.html b/src/main/resources/resource/WebGui/app/service/views/AudioFileGui.html index ffd479fc41..77304e74f9 100644 --- a/src/main/resources/resource/WebGui/app/service/views/AudioFileGui.html +++ b/src/main/resources/resource/WebGui/app/service/views/AudioFileGui.html @@ -23,10 +23,10 @@ - - @@ -47,7 +47,7 @@ volume - {{service.volume.toFixed(2) * 100}} + {{service.config.volume.toFixed(2) * 100}} peak volume multiplier @@ -69,7 +69,7 @@
- @@ -79,10 +79,10 @@
- {{selectedPlaylist[0]}} + {{selectedPlaylist}} - +
-
+
- +