32 const Cc = Components.classes;
33 const Ci = Components.interfaces;
34 const Cu = Components.utils;
36 Cu.import(
"resource://app/jsmodules/sbLibraryUtils.jsm");
37 Cu.import(
"resource://gre/modules/XPCOMUtils.jsm");
41 openPlayQueue:
function PlayQueueUtils_openPlayQueue() {
42 var
paneMgr =
Cc[
"@songbirdnest.com/Songbird/DisplayPane/Manager;1"]
43 .getService(
Ci.sbIDisplayPaneManager);
44 var contentInfo =
Cc[
"@songbirdnest.com/Songbird/playqueue/contentInfo;1"]
45 .createInstance(
Ci.sbIDisplayPaneContentInfo);
46 paneMgr.showPane(contentInfo.contentUrl);
54 play:
function PlayQueueUtils_play(aIndex ) {
56 if (typeof(aIndex) ==
"undefined")
58 var playQueueService =
Cc[
"@songbirdnest.com/Songbird/playqueue/service;1"]
59 .getService(
Ci.sbIPlayQueueService);
60 aIndex = playQueueService.index;
62 var sequencer =
Cc[
"@songbirdnest.com/Songbird/Mediacore/Manager;1"]
63 .getService(
Ci.sbIMediacoreManager).sequencer;
64 sequencer.playView(PlayQueueUtils.view, aIndex,
true);
68 XPCOMUtils.defineLazyGetter(PlayQueueUtils,
"view",
function() {
69 var playQueueService =
Cc[
"@songbirdnest.com/Songbird/playqueue/service;1"]
70 .getService(
Ci.sbIPlayQueueService);
71 return LibraryUtils.createStandardMediaListView(playQueueService.mediaList);
Javascript wrappers for common library tasks.