
We no longer alter the song, the queue gets this from the player. That way we can't have two songs marked as 'playing' at the same time.
41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
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) {
|
|
player.play(song);
|
|
};
|
|
|
|
$scope.emptyQueue = function() {
|
|
player.emptyQueue();
|
|
//TODO: Hyz: Shouldn't it be in a directive ?
|
|
$.fancybox.close();
|
|
};
|
|
|
|
$scope.shuffleQueue = function() {
|
|
player.shuffleQueue();
|
|
};
|
|
|
|
$scope.addSongToQueue = function(song) {
|
|
player.addSong(song);
|
|
};
|
|
|
|
$scope.removeSongFromQueue = function(song) {
|
|
player.removeSong(song);
|
|
};
|
|
|
|
$scope.removeSelectedSongsFromQueue = function () {
|
|
player.removeSongs($scope.selectedSongs);
|
|
};
|
|
|
|
$scope.isPlayingSong = function (song) {
|
|
return angular.equals(song, player.getPlayingSong());
|
|
};
|
|
|
|
//TODO: Hyz: updateFavorite - leave in rootScope ?
|
|
}]);
|