1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-06 20:44:11 +01:00

Whitespace fixes.

This commit is contained in:
Doug Kearns
2009-03-28 12:23:22 +11:00
parent 887855ed01
commit 0f311e09e3
2 changed files with 21 additions and 27 deletions

View File

@@ -1,7 +1,5 @@
// Import Artist List as this can be huge // Import Artist List as this can be huge
function Player() // {{{ function Player() // {{{
{ {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@@ -11,11 +9,10 @@ function Player() // {{{
let lastSearchString = ""; let lastSearchString = "";
let lastSearchIndex = 0; let lastSearchIndex = 0;
let lastSearchView = _SBGetCurrentView(); let lastSearchView = _SBGetCurrentView();
// Get the focus to the visible playlist first // Get the focus to the visible playlist first
//window._SBShowMainLibrary(); //window._SBShowMainLibrary();
function getArtistsArray() function getArtistsArray()
{ {
var list = LibraryUtils.mainLibrary; var list = LibraryUtils.mainLibrary;
@@ -49,7 +46,7 @@ function Player() // {{{
artistCounts[artist] = listener.count; artistCounts[artist] = listener.count;
i++; i++;
} }
//liberator.dump("Count : "+artistCounts.toSource()); //liberator.dump("Count : "+artistCounts.toSource());
return artistArray; return artistArray;
} }
@@ -57,7 +54,7 @@ function Player() // {{{
// Get the artist names before hand. // Get the artist names before hand.
let artists = getArtistsArray(); let artists = getArtistsArray();
const pageService = Components.classes["@songbirdnest.com/Songbird/MediaPageManager;1"] const pageService = Components.classes["@songbirdnest.com/Songbird/MediaPageManager;1"]
.getService(Components.interfaces.sbIMediaPageManager); .getService(Components.interfaces.sbIMediaPageManager);
// Register Callbacks for searching. // Register Callbacks for searching.
@@ -202,7 +199,7 @@ function Player() // {{{
mappings.add([modes.PLAYER], mappings.add([modes.PLAYER],
["n"], "Find Next", ["n"], "Find Next",
function () { player.searchViewAgain(false);}); function () { player.searchViewAgain(false);});
mappings.add([modes.PLAYER], mappings.add([modes.PLAYER],
["N"], "Find Previous", ["N"], "Find Previous",
function () { player.searchViewAgain(true);}); function () { player.searchViewAgain(true);});
@@ -211,7 +208,7 @@ function Player() // {{{
mappings.add([modes.PLAYER], mappings.add([modes.PLAYER],
["<C-0>"], "Rate the current media item 0", ["<C-0>"], "Rate the current media item 0",
function () { player.rateMediaItem(0); }); function () { player.rateMediaItem(0); });
mappings.add([modes.PLAYER], mappings.add([modes.PLAYER],
["<C-1>"], "Rate the current media item 1", ["<C-1>"], "Rate the current media item 1",
function () { player.rateMediaItem(1); }); function () { player.rateMediaItem(1); });
@@ -231,8 +228,7 @@ function Player() // {{{
mappings.add([modes.PLAYER], mappings.add([modes.PLAYER],
["<C-5>"], "Rate the current media item 5", ["<C-5>"], "Rate the current media item 5",
function () { player.rateMediaItem(5); }); function () { player.rateMediaItem(5); });
////////////////// ///////////////////////////////////////////////////////////}}} ////////////////// ///////////////////////////////////////////////////////////}}}
////////////////////// COMMANDS //////////////////////////////////////////////// ////////////////////// COMMANDS ////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{ /////////////////////////////////////////////////////////////////////////////{{{
@@ -326,7 +322,7 @@ function Player() // {{{
}, },
{ {
argCount: "?", argCount: "?",
completer: function(context, args) completion.playlist(context, args), completer: function (context, args) completion.playlist(context, args),
literal: 0 literal: 0
}); });
@@ -598,11 +594,11 @@ function Player() // {{{
searchString = args + " " + search; searchString = args + " " + search;
else else
searchString = args; searchString = args;
lastSearchString = searchString; lastSearchString = searchString;
let mySearchView = LibraryUtils.createStandardMediaListView(mediaItemList, searchString); let mySearchView = LibraryUtils.createStandardMediaListView(mediaItemList, searchString);
if (mySearchView.length) if (mySearchView.length)
{ {
lastSearchView = mySearchView; lastSearchView = mySearchView;
@@ -614,7 +610,7 @@ function Player() // {{{
liberator.echoerr("E486 Pattern not found: "+searchString, commandline.FORCE_SINGLELINE); liberator.echoerr("E486 Pattern not found: "+searchString, commandline.FORCE_SINGLELINE);
} }
}, },
//FIXME: commandline.echo should work --ken //FIXME: commandline.echo should work --ken
searchViewAgain: function searchViewAgain(reverse) searchViewAgain: function searchViewAgain(reverse)
{ {
@@ -644,17 +640,17 @@ function Player() // {{{
//FIXME: Implement for "?" --ken //FIXME: Implement for "?" --ken
commandline.echo("/" + lastSearchString, null, commandline.FORCE_SINGLELINE); commandline.echo("/" + lastSearchString, null, commandline.FORCE_SINGLELINE);
focusTrack(lastSearchView.getItemByIndex(lastSearchIndex)); focusTrack(lastSearchView.getItemByIndex(lastSearchIndex));
}, },
getPlaylists: function getPlaylists() getPlaylists: function getPlaylists()
{ {
let mainLibrary = LibraryUtils.mainLibrary; let mainLibrary = LibraryUtils.mainLibrary;
let playlists = [mainLibrary]; let playlists = [mainLibrary];
let listener = { let listener = {
onEnumerationBegin: function() { }, onEnumerationBegin: function () { },
onEnumerationEnd: function() { }, onEnumerationEnd: function () { },
onEnumeratedItem: function(list, item) onEnumeratedItem: function (list, item)
{ {
// FIXME: why are there null items and duplicates? // FIXME: why are there null items and duplicates?
if (!playlists.some(function (list) list.name == item.name) && item.name != null) if (!playlists.some(function (list) list.name == item.name) && item.name != null)
@@ -692,7 +688,7 @@ function Player() // {{{
rateMediaItem: function rateMediaItem(rating) rateMediaItem: function rateMediaItem(rating)
{ {
if (gMM.sequencer.currentItem) if (gMM.sequencer.currentItem)
gMM.sequencer.currentItem.setProperty(SBProperties.rating, rating); gMM.sequencer.currentItem.setProperty(SBProperties.rating, rating);
}, },
getArtists: function getArtists() getArtists: function getArtists()
@@ -707,7 +703,6 @@ function Player() // {{{
var items = list.getItemsByProperty(SBProperties.artistName, artist).enumerate(); var items = list.getItemsByProperty(SBProperties.artistName, artist).enumerate();
var i = 0, j = 0; var i = 0, j = 0;
while (items.hasMoreElements()) while (items.hasMoreElements())
{ {
album = items.getNext().getProperty(SBProperties.albumName); album = items.getNext().getProperty(SBProperties.albumName);
@@ -750,10 +745,9 @@ function Player() // {{{
return tracksArray; return tracksArray;
} }
}; };
//}}} //}}}
} // }}} } // }}}
// vim: set fdm=marker sw=4 ts=4 et: // vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -184,14 +184,14 @@ ________________________________________________________________________________
|n| |n|
||n|| + ||n|| +
________________________________________________________________________________ ________________________________________________________________________________
Find next. Repeats the last search. If the search hits BOTTOM of the view, it Find next. Repeats the last search. If the search hits BOTTOM of the view, it
continues from TOP. continues from TOP.
________________________________________________________________________________ ________________________________________________________________________________
|N| |N|
||N|| + ||N|| +
________________________________________________________________________________ ________________________________________________________________________________
Find previous. Repeats the last search in the opposite direction. If the search Find previous. Repeats the last search in the opposite direction. If the search
hits TOP of the view, it continues from BOTTTOM. hits TOP of the view, it continues from BOTTTOM.
________________________________________________________________________________ ________________________________________________________________________________