From 2b1010251b6a9e258f316410fa329b6498747a60 Mon Sep 17 00:00:00 2001 From: Prathyush Thota Date: Sat, 28 Mar 2009 01:14:08 +0530 Subject: [PATCH] Added mappings for changing rating of current mediaItem --- xulmus/content/player.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/xulmus/content/player.js b/xulmus/content/player.js index e6198d7f..2da8215b 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -164,6 +164,32 @@ function Player() // {{{ ["N"], "Find Previous", function () { player.searchViewAgain(true);}); + //FIXME: Better way to do this ? --ken + mappings.add([modes.PLAYER], + [""], "Rate the current media item 0", + function () { player.rateMediaItem(0); }); + + mappings.add([modes.PLAYER], + [""], "Rate the current media item 1", + function () { player.rateMediaItem(1); }); + + mappings.add([modes.PLAYER], + [""], "Rate the current media item 2", + function () { player.rateMediaItem(2); }); + + mappings.add([modes.PLAYER], + [""], "Rate the current media item 3", + function () { player.rateMediaItem(3); }); + + mappings.add([modes.PLAYER], + [""], "Rate the current media item 4", + function () { player.rateMediaItem(4); }); + + mappings.add([modes.PLAYER], + [""], "Rate the current media item 5", + function () { player.rateMediaItem(5); }); + + ////////////////// ///////////////////////////////////////////////////////////}}} ////////////////////// COMMANDS //////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ @@ -414,11 +440,13 @@ function Player() // {{{ next: function next() { gSongbirdWindowController.doCommand("cmd_control_next"); + gSongbirdWindowController.doCommand("cmd_find_current_track"); }, previous: function previous() { gSongbirdWindowController.doCommand("cmd_control_previous"); + gSongbirdWindowController.doCommand("cmd_find_current_track"); }, togglePlayPause: function togglePlayPause() @@ -615,6 +643,12 @@ function Player() // {{{ { pageService.setPage(list, page); gBrowser.loadMediaList(list, null, null, view, null); + }, + + rateMediaItem: function rateMediaItem(rating) + { + if (gMM.sequencer.currentItem) + gMM.sequencer.currentItem.setProperty(SBProperties.rating, rating); } }; //}}}