
- Adds : empty queue, shuffle queue, add one song to queue, remove one song from queue, restart the current song - Removes the "playEnded" method : we now use correctly scope.$apply() in the directive after calling nextTrack(). The next song is correctly called after the end of the current one. - Starts replacing the old rootScope functions with calls to the player service.
30 lines
781 B
JavaScript
30 lines
781 B
JavaScript
angular.module('jamstash.queue.controller', ['jamstash.player.service'])
|
|
|
|
.controller('QueueController', ['$scope', 'globals', 'player',
|
|
function ($scope, globals, player) {
|
|
'use strict';
|
|
$scope.settings = globals.settings;
|
|
$scope.player = player;
|
|
$scope.itemType = 'pl'; // TODO: Hyz: What is this ?
|
|
|
|
$scope.playSong = function (song) {
|
|
console.log('Queue Controller - playSong()', song);
|
|
player.play(song);
|
|
};
|
|
|
|
$scope.queueEmpty = function() {
|
|
player.emptyQueue();
|
|
};
|
|
|
|
$scope.queueShuffle = function() {
|
|
player.shuffleQueue();
|
|
};
|
|
|
|
$scope.addSongToQueue = function(song) {
|
|
player.addSong(song);
|
|
};
|
|
|
|
$scope.removeSongFromQueue = function(song) {
|
|
player.removeSong(song);
|
|
};
|
|
}]);
|