
- Removes queue-related functions from the main controller. They are now handled by queue.js, which delegates them to player-service.js - Fixes problem in scrobbling. A song is no longer scrobbled every time it is paused. A song will not be scrobbled upon loading, only while it is playing. - Moves the entire html for the sidebar queue to queue.html. It replaces a template that was no longer used. - Most queue-related functions in player return player itself to make them chainable just like in jQuery, e.g. : player.shuffleQueue().playFirstSong();
35 lines
917 B
JavaScript
35 lines
917 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) {
|
|
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);
|
|
};
|
|
}]);
|