26 var
Cc = Components.classes;
27 var
Ci = Components.interfaces;
28 var
Cr = Components.results;
29 var
Cu = Components.utils;
31 Cu.import(
"resource://app/jsmodules/ArrayConverter.jsm");
32 Cu.import(
"resource://app/jsmodules/DropHelper.jsm");
33 Cu.import(
"resource://app/jsmodules/kPlaylistCommands.jsm");
34 Cu.import(
"resource://app/jsmodules/sbAddToPlaylist.jsm");
35 Cu.import(
"resource://app/jsmodules/sbAddToDevice.jsm");
36 Cu.import(
"resource://app/jsmodules/sbAddToLibrary.jsm");
37 Cu.import(
"resource://app/jsmodules/sbCoverHelper.jsm");
38 Cu.import(
"resource://app/jsmodules/sbLibraryUtils.jsm");
39 Cu.import(
"resource://app/jsmodules/sbProperties.jsm");
40 Cu.import(
"resource://app/jsmodules/SBJobUtils.jsm");
41 Cu.import(
"resource://app/jsmodules/SBUtils.jsm");
42 Cu.import(
"resource://gre/modules/XPCOMUtils.jsm");
50 this._selection = selection;
57 return this._selection.hasMoreElements();
60 getNext :
function() {
61 var item = this._selection.getNext().mediaItem;
62 item.setProperty(SBProperties.downloadStatusTarget,
63 item.library.guid +
"," + item.guid);
68 if (iid.equals(
Ci.nsISimpleEnumerator) ||
69 iid.equals(
Ci.nsISupports))
71 throw Cr.NS_NOINTERFACE;
75 function PublicPlaylistCommands() {
76 this.m_mgr = Components.
77 classes[
"@songbirdnest.com/Songbird/PlaylistCommandsManager;1"]
78 .getService(
Ci.sbIPlaylistCommandsManager);
80 var obs =
Cc[
"@mozilla.org/observer-service;1"]
81 .getService(
Ci.nsIObserverService);
82 obs.addObserver(
this,
"final-ui-startup",
false);
85 PublicPlaylistCommands.prototype.constructor = PublicPlaylistCommands;
87 PublicPlaylistCommands.prototype = {
90 classID: Components.ID(
"{1126ee77-2d85-4f79-a07a-b014da404e53}"),
91 contractID:
"@songbirdnest.com/Songbird/PublicPlaylistCommands;1",
95 m_defaultCommands :
null,
96 m_webPlaylistCommands :
null,
97 m_webMediaHistoryToolbarCommands:
null,
98 m_smartPlaylistsCommands :
null,
99 m_downloadCommands :
null,
100 m_downloadToolbarCommands :
null,
101 m_downloadCommandsServicePane :
null,
102 m_serviceTreeDefaultCommands :
null,
103 m_deviceLibraryCommands :
null,
104 m_cdDeviceLibraryCommands :
null,
105 m_playQueueCommands :
null,
106 m_playQueueLibraryCommands :
null,
117 m_cmd_Download :
null,
120 m_cmd_CopyTrackLocation :
null,
121 m_cmd_ShowDownloadPlaylist :
null,
122 m_cmd_PauseResumeDownload :
null,
123 m_cmd_CleanUpDownloads :
null,
124 m_cmd_ClearHistory :
null,
125 m_cmd_UpdateSmartPlaylist :
null,
126 m_cmd_EditSmartPlaylist :
null,
127 m_cmd_SmartPlaylistSep :
null,
128 m_cmd_LookupCDInfo :
null,
129 m_cmd_CheckAll :
null,
130 m_cmd_UncheckAll :
null,
132 m_cmd_QueueNext :
null,
133 m_cmd_QueueLast :
null,
136 m_cmd_list_Play :
null,
137 m_cmd_list_Remove :
null,
138 m_cmd_list_Rename :
null,
139 m_cmd_list_QueueNext :
null,
141 m_cmd_list_QueueLast :
null,
145 m_cmd_playqueue_SaveToPlaylist :
null,
146 m_cmd_playqueue_ClearHistory :
null,
147 m_cmd_playqueue_ClearAll :
null,
149 m_downloadListGuid :
null,
154 initCommands:
function() {
156 if (this.m_mgr.request(kPlaylistCommands.MEDIAITEM_DEFAULT)) {
164 var obs =
Cc[
"@mozilla.org/observer-service;1"]
165 .getService(
Ci.nsIObserverService);
166 obs.removeObserver(
this,
"final-ui-startup");
167 obs.addObserver(
this,
"quit-application",
false);
171 var
prefs =
Cc[
"@mozilla.org/preferences-service;1"]
172 .getService(
Ci.nsIPrefBranch2);
175 Components.classes[
"@songbirdnest.com/Songbird/DownloadDeviceHelper;1"]
176 .getService(Components.interfaces.sbIDownloadDeviceHelper);
177 var downloadMediaList = ddh.getDownloadMediaList();
183 if (downloadMediaList)
184 this.m_downloadListGuid = downloadMediaList.guid;
186 this.m_downloadListGuid =
"";
201 Constructor(
"@songbirdnest.com/Songbird/PlaylistCommandsBuilder;1",
202 "sbIPlaylistCommandsBuilder",
"init");
207 this.m_cmd_Play.appendAction(
null,
210 "&command.tooltip.play",
213 this.m_cmd_Play.setCommandShortcut(
null,
215 "&command.shortcut.key.play",
216 "&command.shortcut.keycode.play",
217 "&command.shortcut.modifiers.play",
220 this.m_cmd_Play.setCommandEnabledCallback(
null,
224 this.m_cmd_Play.setCommandVisibleCallback(
null,
229 this.m_cmd_Play.appendAction(
null,
232 "&command.tooltip.play",
235 this.m_cmd_Play.setCommandShortcut(
null,
237 "&command.shortcut.key.altplay",
238 "&command.shortcut.keycode.altplay",
239 "&command.shortcut.modifiers.altplay",
242 this.m_cmd_Play.setCommandEnabledCallback(
null,
246 this.m_cmd_Play.setCommandVisibleCallback(
null,
252 this.m_cmd_Pause.appendAction(
null,
255 "&command.tooltip.pause",
258 this.m_cmd_Pause.setCommandVisibleCallback(
null,
272 this.m_cmd_Remove.appendAction(
null,
273 "library_cmd_remove",
275 "&command.tooltip.remove",
278 this.m_cmd_Remove.setCommandShortcut(
null,
279 "library_cmd_remove",
280 "&command.shortcut.key.remove",
281 "&command.shortcut.keycode.remove",
282 "&command.shortcut.modifiers.remove",
285 this.m_cmd_Remove.setCommandEnabledCallback(
null,
286 "library_cmd_remove",
293 var sysInfo = Components.classes[
"@mozilla.org/system-info;1"]
294 .getService(Components.interfaces.nsIPropertyBag2);
295 if ( sysInfo.getProperty(
"name") ==
"Darwin" ) {
296 this.m_cmd_Remove.appendAction(
null,
297 "library_cmd_remove2",
299 "&command.tooltip.remove",
302 this.m_cmd_Remove.setCommandShortcut(
null,
303 "library_cmd_remove2",
304 "&command.shortcut.key.altremove",
305 "&command.shortcut.keycode.altremove",
306 "&command.shortcut.modifiers.altremove",
309 this.m_cmd_Remove.setCommandEnabledCallback(
null,
310 "library_cmd_remove2",
315 this.m_cmd_Remove.setCommandVisibleCallback(
null,
316 "library_cmd_remove2",
326 this.m_cmd_Edit.appendAction(
null,
329 "&command.tooltip.edit",
332 this.m_cmd_Edit.setCommandShortcut(
null,
334 "&command.shortcut.key.edit",
335 "&command.shortcut.keycode.edit",
336 "&command.shortcut.modifiers.edit",
339 this.m_cmd_Edit.setCommandEnabledCallback(
null,
349 this.m_cmd_Download.appendAction(
null,
350 "library_cmd_download",
352 "&command.tooltip.download",
355 this.m_cmd_Download.setCommandShortcut(
null,
356 "library_cmd_download",
357 "&command.shortcut.key.download",
358 "&command.shortcut.keycode.download",
359 "&command.shortcut.modifiers.download",
362 this.m_cmd_Download.setCommandEnabledCallback(
null,
363 "library_cmd_download",
373 this.m_cmd_Rescan.appendAction(
null,
374 "library_cmd_rescan",
376 "&command.tooltip.rescan",
379 this.m_cmd_Rescan.setCommandShortcut(
null,
380 "library_cmd_rescan",
381 "&command.shortcut.key.rescan",
382 "&command.shortcut.keycode.rescan",
383 "&command.shortcut.modifiers.rescan",
386 this.m_cmd_Rescan.setCommandEnabledCallback(
null,
387 "library_cmd_rescan",
390 this.m_cmd_Rescan.setCommandVisibleCallback(
null,
391 "library_cmd_rescan",
401 this.m_cmd_Reveal.appendAction(
null,
402 "library_cmd_reveal",
404 "&command.tooltip.reveal",
407 this.m_cmd_Reveal.setCommandShortcut(
null,
408 "library_cmd_reveal",
409 "&command.shortcut.key.reveal",
410 "&command.shortcut.keycode.reveal",
411 "&command.shortcut.modifiers.reveal",
414 this.m_cmd_Reveal.setCommandEnabledCallback(
null,
415 "library_cmd_reveal",
423 (
"copylocation-webplaylist-cmd");
425 this.m_cmd_CopyTrackLocation.appendAction(
null,
426 "library_cmd_copylocation",
427 "&command.copylocation",
428 "&command.tooltip.copylocation",
431 this.m_cmd_CopyTrackLocation.setCommandShortcut(
null,
432 "library_cmd_copylocation",
433 "&command.shortcut.key.copylocation",
434 "&command.shortcut.keycode.copylocation",
435 "&command.shortcut.modifiers.copylocation",
438 this.m_cmd_CopyTrackLocation.setCommandEnabledCallback(
null,
439 "library_cmd_copylocation",
447 (
"clearhistory-webhistory-cmd");
449 this.m_cmd_ClearHistory.appendAction
451 "library_cmd_clearhistory",
452 "&command.clearhistory",
453 "&command.tooltip.clearhistory",
456 this.m_cmd_ClearHistory.setCommandShortcut
458 "library_cmd_clearhistory",
459 "&command.shortcut.key.clearhistory",
460 "&command.shortcut.keycode.clearhistory",
461 "&command.shortcut.modifiers.clearhistory",
464 this.m_cmd_ClearHistory.setCommandEnabledCallback
466 "library_cmd_clearhistory",
474 (
"showdl-webplaylist-cmd");
476 this.m_cmd_ShowDownloadPlaylist.appendAction(
null,
477 "library_cmd_showdlplaylist",
478 "&command.showdlplaylist",
479 "&command.tooltip.showdlplaylist",
482 this.m_cmd_ShowDownloadPlaylist.setCommandShortcut(
null,
483 "library_cmd_showdlplaylist",
484 "&command.shortcut.key.showdlplaylist",
485 "&command.shortcut.keycode.showdlplaylist",
486 "&command.shortcut.modifiers.showdlplaylist",
489 this.m_cmd_ShowDownloadPlaylist.setCommandVisibleCallback(
null,
490 "library_cmd_showdlplaylist",
498 (
"pauseresume-download-cmd");
500 this.m_cmd_PauseResumeDownload.appendAction(
null,
503 "&command.tooltip.pause",
506 this.m_cmd_PauseResumeDownload.setCommandShortcut(
null,
508 "&command.shortcut.key.pause",
509 "&command.shortcut.keycode.pause",
510 "&command.shortcut.modifiers.pause",
513 this.m_cmd_PauseResumeDownload.setCommandVisibleCallback(
null,
517 this.m_cmd_PauseResumeDownload.setCommandEnabledCallback(
null,
521 this.m_cmd_PauseResumeDownload.appendAction(
null,
522 "library_cmd_resume",
524 "&command.tooltip.resume",
527 this.m_cmd_PauseResumeDownload.setCommandShortcut(
null,
528 "library_cmd_resume",
529 "&command.shortcut.key.resume",
530 "&command.shortcut.keycode.resume",
531 "&command.shortcut.modifiers.resume",
534 this.m_cmd_PauseResumeDownload.setCommandVisibleCallback(
null,
535 "library_cmd_resume",
543 (
"cleanup-download-cmd");
545 this.m_cmd_CleanUpDownloads.appendAction
547 "library_cmd_cleanupdownloads",
548 "&command.cleanupdownloads",
549 "&command.tooltip.cleanupdownloads",
552 this.m_cmd_CleanUpDownloads.setCommandShortcut
554 "library_cmd_cleanupdownloads",
555 "&command.shortcut.key.cleanupdownloads",
556 "&command.shortcut.keycode.cleanupdownloads",
557 "&command.shortcut.modifiers.cleanupdownloads",
560 this.m_cmd_CleanUpDownloads.setCommandEnabledCallback
562 "library_cmd_cleanupdownloads",
571 this.m_cmd_list_Play.appendAction(
null,
573 "&command.playlist.play",
574 "&command.tooltip.playlist.play",
577 this.m_cmd_list_Play.setCommandShortcut(
null,
579 "&command.playlist.shortcut.key.play",
580 "&command.playlist.shortcut.keycode.play",
581 "&command.playlist.shortcut.modifiers.play",
585 this.m_cmd_list_Play.setCommandEnabledCallback(
null,
595 this.m_cmd_list_Remove.appendAction(
null,
596 "playlist_cmd_remove",
597 "&command.playlist.remove",
598 "&command.tooltip.playlist.remove",
601 this.m_cmd_list_Remove.setCommandShortcut(
null,
602 "playlist_cmd_remove",
603 "&command.playlist.shortcut.key.remove",
604 "&command.playlist.shortcut.keycode.remove",
605 "&command.playlist.shortcut.modifiers.remove",
609 this.m_cmd_list_Remove.setCommandEnabledCallback
611 "playlist_cmd_remove",
620 this.m_cmd_list_Rename.appendAction(
null,
621 "playlist_cmd_rename",
622 "&command.playlist.rename",
623 "&command.tooltip.playlist.rename",
626 this.m_cmd_list_Rename.setCommandShortcut(
null,
627 "playlist_cmd_rename",
628 "&command.playlist.shortcut.key.rename",
629 "&command.playlist.shortcut.keycode.rename",
630 "&command.playlist.shortcut.modifiers.rename",
634 this.m_cmd_list_Rename.setCommandEnabledCallback(
null,
635 "playlist_cmd_rename",
644 this.m_cmd_list_QueueNext.appendAction(
null,
645 "playlist_cmd_queuenext",
646 "&command.playlist.queuenext",
647 "&command.tooltip.playlist.queuenext",
650 this.m_cmd_list_QueueNext.setCommandShortcut(
null,
651 "playlist_cmd_queuenext",
652 "&command.playlist.shortcut.key.queuenext",
653 "&command.playlist.shortcut.keycode.queuenext",
654 "&command.playlist.shortcut.modifiers.queuenext",
657 this.m_cmd_list_QueueNext.setCommandVisibleCallback(
null,
658 "playlist_cmd_queuenext",
662 this.m_cmd_list_QueueNext.setCommandEnabledCallback(
null,
663 "playlist_cmd_queuenext",
672 this.m_cmd_list_QueueLast.appendAction(
null,
673 "playlist_cmd_queuelast",
674 "&command.playlist.queuelast",
675 "&command.tooltip.playlist.queuelast",
678 this.m_cmd_list_QueueLast.setCommandShortcut(
null,
679 "playlist_cmd_queuelast",
680 "&command.playlist.shortcut.key.queuelast",
681 "&command.playlist.shortcut.keycode.queuelast",
682 "&command.playlist.shortcut.modifiers.queuelast",
685 this.m_cmd_list_QueueLast.setCommandVisibleCallback(
null,
686 "playlist_cmd_queuelast",
690 this.m_cmd_list_QueueLast.setCommandEnabledCallback(
null,
691 "playlist_cmd_queuelast",
700 this.m_cmd_GetArtwork.appendAction(
null,
701 "library_cmd_getartwork",
702 "&command.getartwork",
703 "&command.tooltip.getartwork",
706 this.m_cmd_GetArtwork.setCommandShortcut(
null,
707 "library_cmd_getartwork",
708 "&command.shortcut.key.getartwork",
709 "&command.shortcut.keycode.getartwork",
710 "&command.shortcut.modifiers.getartwork",
713 this.m_cmd_GetArtwork.setCommandVisibleCallback(
null,
714 "library_cmd_getartwork",
717 this.m_cmd_GetArtwork.setCommandEnabledCallback(
null,
718 "library_cmd_getartwork",
725 this.m_cmd_DeviceToolbarCmds =
729 this.m_cmd_ShowOnlyOnDevice =
732 this.m_cmd_ShowOnlyOnDevice.appendAction
734 "device_cmd_showdeviceonly",
735 "&device.command.show_only_on_device",
740 this.m_cmd_ShowOnlyOnDevice
741 .setVisibleCallback(plCmd_ShowOnlyOnDevice_VisibleCallback);
743 this.m_cmd_DeviceToolbarCmds.appendPlaylistCommands
745 "device_cmdobj_showdeviceonly",
746 this.m_cmd_ShowOnlyOnDevice);
749 this.m_cmd_ShowAllOnDevice =
752 this.m_cmd_ShowAllOnDevice.appendAction
754 "device_cmd_showallondevice",
755 "&device.command.show_all_on_device",
760 this.m_cmd_DeviceToolbarCmds.appendPlaylistCommands
762 "device_cmdobj_showallondevice",
763 this.m_cmd_ShowAllOnDevice);
766 this.m_cmd_ShowAllOnDevice
767 .setVisibleCallback(plCmd_ShowAllOnDevice_VisibleCallback);
771 this.m_mgr.publish(kPlaylistCommands.MEDIALIST_DEVICE_LIBRARY_TOOLBAR,
772 this.m_cmd_DeviceToolbarCmds);
780 this.m_cmd_LookupCDInfo.appendAction(
null,
781 "library_cmd_lookupcdinfo",
782 "&command.lookupcdinfo",
783 "&command.tooltip.lookupcdinfo",
786 this.m_cmd_LookupCDInfo.setCommandShortcut(
null,
787 "library_cmd_lookupcdinfo",
788 "&command.shortcut.key.lookupcdinfo",
789 "&command.shortcut.keycode.lookupcdinfo",
790 "&command.shortcut.modifiers.lookupcdinfo",
792 this.m_cmd_LookupCDInfo.setCommandEnabledCallback(
null,
793 "library_cmd_lookupcdinfo",
801 (
"saveto-playqueue-cmd");
803 this.m_cmd_playqueue_SaveToPlaylist.appendAction(
null,
804 "playqueue_cmd_savetoplaylist",
805 "&command.queuesavetoplaylist",
806 "&command.tooltip.queuesavetoplaylist",
809 this.m_cmd_playqueue_SaveToPlaylist.setCommandShortcut(
null,
810 "playqueue_cmd_savetoplaylist",
811 "&command.shortcut.key.queuesavetoplaylist",
812 "&command.shortcut.keycode.queuesavetoplaylist",
813 "&command.shortcut.modifiers.queuesavetoplaylist",
817 (
"clearall-playqueue-cmd");
819 this.m_cmd_playqueue_ClearAll.appendAction(
821 "playqueue_cmd_clearall",
822 "&command.queueclearall",
823 "&command.tooltip.queueclearall",
826 this.m_cmd_playqueue_ClearAll.setCommandShortcut(
828 "playqueue_cmd_clearall",
829 "&command.shortcut.key.queueclearall",
830 "&command.shortcut.keycode.queueclearall",
831 "&command.shortcut.modifiers.queueclearall",
835 (
"clearhistory-playqueue-cmd");
837 this.m_cmd_playqueue_ClearHistory.appendSubmenu(
839 "playqueue_cmd_clearhistory",
841 "&command.tooltip.queueclearhistory",
844 this.m_cmd_playqueue_ClearHistory.appendAction(
845 "playqueue_cmd_clearhistory",
846 "playqueue_cmd_clearhistorymenuitem",
847 "&command.queueclearhistory",
848 "&command.tooltip.queueclearhistory",
851 this.m_cmd_playqueue_ClearHistory.setCommandShortcut(
852 "playqueue_cmd_clearhistory",
853 "playqueue_cmd_clearhistorymenuitem",
854 "&command.shortcut.key.queueclearhistory",
855 "&command.shortcut.keycode.queueclearhistory",
856 "&command.shortcut.modifiers.queueclearhistory",
863 this.m_cmd_CheckAll.appendAction(
null,
864 "library_cmd_checkall",
866 "&command.tooltip.checkall",
868 this.m_cmd_CheckAll.setCommandVisibleCallback(
870 "library_cmd_checkall",
872 this.m_cmd_CheckAll.setCommandEnabledCallback(
null,
873 "library_cmd_checkall",
877 this.m_cmd_UncheckAll.appendAction(
879 "library_cmd_uncheckall",
880 "&command.uncheckall",
881 "&command.tooltip.uncheckall",
883 this.m_cmd_UncheckAll.setCommandVisibleCallback(
null,
884 "library_cmd_uncheckall",
886 this.m_cmd_UncheckAll.setCommandEnabledCallback(
null,
887 "library_cmd_uncheckall",
894 this.m_cmd_QueueNext.appendAction(
null,
895 "library_cmd_queuenext",
896 "&command.queuenext",
897 "&command.tooltip.queuenext",
900 this.m_cmd_QueueNext.setCommandShortcut(
null,
901 "library_cmd_queuenext",
902 "&command.shortcut.key.queuenext",
903 "&command.shortcut.keycode.queuenext",
904 "&command.shortcut.modifiers.queuenext",
907 this.m_cmd_QueueNext.setCommandEnabledCallback(
null,
908 "library_cmd_queuenext",
915 this.m_cmd_QueueLast.appendAction(
null,
916 "library_cmd_queuelast",
917 "&command.queuelast",
918 "&command.tooltip.queuelast",
921 this.m_cmd_QueueLast.setCommandShortcut(
null,
922 "library_cmd_queuelast",
923 "&command.shortcut.key.queuelast",
924 "&command.shortcut.keycode.queuelast",
925 "&command.shortcut.modifiers.queuelast",
927 this.m_cmd_QueueLast.setCommandEnabledCallback(
null,
928 "library_cmd_queuelast",
935 this.m_mgr.publish(kPlaylistCommands.MEDIAITEM_PLAY,
this.m_cmd_Play);
936 this.m_mgr.publish(kPlaylistCommands.MEDIAITEM_PAUSE,
this.m_cmd_Pause);
937 this.m_mgr.publish(kPlaylistCommands.MEDIAITEM_REMOVE,
this.m_cmd_Remove);
938 this.m_mgr.publish(kPlaylistCommands.MEDIAITEM_EDIT,
this.m_cmd_Edit);
939 this.m_mgr.publish(kPlaylistCommands.MEDIAITEM_DOWNLOAD,
this.m_cmd_Download);
940 this.m_mgr.publish(kPlaylistCommands.MEDIAITEM_RESCAN,
this.m_cmd_Rescan);
941 this.m_mgr.publish(kPlaylistCommands.MEDIAITEM_REVEAL,
this.m_cmd_Reveal);
945 this.m_mgr.publish(kPlaylistCommands.MEDIAITEM_COPYTRACKLOCATION,
this.m_cmd_CopyTrackLocation);
946 this.m_mgr.publish(kPlaylistCommands.MEDIAITEM_SHOWDOWNLOADPLAYLIST,
this.m_cmd_ShowDownloadPlaylist);
947 this.m_mgr.publish(kPlaylistCommands.MEDIAITEM_PAUSERESUMEDOWNLOAD,
this.m_cmd_PauseResumeDownload);
948 this.m_mgr.publish(kPlaylistCommands.MEDIAITEM_CLEANUPDOWNLOADS,
this.m_cmd_CleanUpDownloads);
949 this.m_mgr.publish(kPlaylistCommands.MEDIAITEM_CLEARHISTORY,
this.m_cmd_ClearHistory);
950 this.m_mgr.publish(kPlaylistCommands.MEDIAITEM_GETARTWORK,
this.m_cmd_GetArtwork);
951 this.m_mgr.publish(kPlaylistCommands.MEDIAITEM_QUEUENEXT,
this.m_cmd_QueueNext);
952 this.m_mgr.publish(kPlaylistCommands.MEDIAITEM_QUEUELAST,
this.m_cmd_QueueLast);
954 this.m_mgr.publish(kPlaylistCommands.MEDIALIST_PLAY,
this.m_cmd_list_Play);
955 this.m_mgr.publish(kPlaylistCommands.MEDIALIST_REMOVE,
this.m_cmd_list_Remove);
956 this.m_mgr.publish(kPlaylistCommands.MEDIALIST_RENAME,
this.m_cmd_list_Rename);
957 this.m_mgr.publish(kPlaylistCommands.MEDIALIST_QUEUENEXT,
this.m_cmd_list_QueueNext);
958 this.m_mgr.publish(kPlaylistCommands.MEDIALIST_QUEUELAST,
this.m_cmd_list_QueueLast);
966 this.m_defaultCommands.appendPlaylistCommands(
null,
967 "library_cmdobj_play",
970 this.m_defaultCommands.appendPlaylistCommands(
null,
971 "library_cmdobj_pause",
974 this.m_defaultCommands.appendPlaylistCommands(
null,
975 "library_cmdobj_edit",
977 this.m_defaultCommands.appendPlaylistCommands(
null,
978 "library_cmdobj_reveal",
980 this.m_defaultCommands.appendPlaylistCommands(
null,
981 "library_cmdobj_getartwork",
982 this.m_cmd_GetArtwork);
984 this.m_defaultCommands.appendSeparator(
null,
"default_commands_separator_1");
986 this.m_defaultCommands.appendPlaylistCommands(
null,
987 "library_cmdobj_addtoplaylist",
989 this.m_defaultCommands.appendPlaylistCommands(
null,
990 "library_cmdobj_addtodevice",
993 this.m_defaultCommands.appendSeparator(
null,
"default_commands_separator_2");
995 this.m_defaultCommands.appendPlaylistCommands(
null,
996 "library_cmdobj_rescan",
999 this.m_defaultCommands.appendPlaylistCommands(
null,
1000 "library_cmdobj_remove",
1003 this.m_defaultCommands.appendSeparator(
null,
"default_commands_separator_3");
1005 this.m_defaultCommands.appendPlaylistCommands(
null,
1006 "library_cmdobj_queuenext",
1007 this.m_cmd_QueueNext);
1009 this.m_defaultCommands.appendPlaylistCommands(
null,
1010 "library_cmdobj_queuenast",
1011 this.m_cmd_QueueLast);
1013 this.m_defaultCommands.setVisibleCallback(plCmd_ShowDefaultInToolbarCheck);
1015 this.m_mgr.publish(kPlaylistCommands.MEDIAITEM_DEFAULT,
this.m_defaultCommands);
1023 (
"update-smartplaylist-cmd");
1025 this.m_cmd_UpdateSmartPlaylist.appendAction
1027 "smartpl_cmd_update",
1028 "&command.smartpl.update",
1029 "&command.tooltip.smartpl.update",
1032 this.m_cmd_UpdateSmartPlaylist.setCommandShortcut
1034 "smartpl_cmd_update",
1035 "&command.shortcut.key.smartpl.update",
1036 "&command.shortcut.keycode.smartpl.update",
1037 "&command.shortcut.modifiers.smartpl.update",
1040 this.m_cmd_UpdateSmartPlaylist.setCommandVisibleCallback(
null,
1041 "smartpl_cmd_update",
1045 (
"properties-smartplaylist-cmd");
1047 this.m_cmd_EditSmartPlaylist.appendAction
1049 "smartpl_cmd_properties",
1050 "&command.smartpl.properties",
1051 "&command.tooltip.smartpl.properties",
1054 this.m_cmd_EditSmartPlaylist.setCommandShortcut
1056 "smartpl_cmd_properties",
1057 "&command.shortcut.key.smartpl.properties",
1058 "&command.shortcut.keycode.smartpl.properties",
1059 "&command.shortcut.modifiers.smartpl.properties",
1062 this.m_cmd_EditSmartPlaylist.setCommandVisibleCallback(
null,
1063 "smartpl_cmd_properties",
1067 (
"smartplaylist_cmds");
1069 this.m_smartPlaylistsCommands.appendPlaylistCommands(
null,
1070 "library_cmdobj_defaults",
1071 this.m_defaultCommands);
1074 (
"separator-smartplaylist-cmd");
1076 this.m_cmd_SmartPlaylistSep.appendSeparator(
null,
"smartpl_separator");
1078 this.m_cmd_SmartPlaylistSep.setVisibleCallback(
plCmd_NOT(plCmd_ShowForToolbarCheck));
1080 this.m_smartPlaylistsCommands.appendPlaylistCommands(
null,
1081 "smartpl_cmdobj_sep",
1082 this.m_cmd_SmartPlaylistSep);
1084 this.m_smartPlaylistsCommands.appendPlaylistCommands(
null,
1085 "smartpl_cmdobj_update",
1086 this.m_cmd_UpdateSmartPlaylist);
1088 this.m_smartPlaylistsCommands.appendPlaylistCommands(
null,
1089 "smartpl_cmdobj_properties",
1090 this.m_cmd_EditSmartPlaylist);
1092 this.m_mgr.publish(kPlaylistCommands.MEDIALIST_UPDATESMARTMEDIALIST,
this.m_cmd_UpdateSmartPlaylist);
1093 this.m_mgr.publish(kPlaylistCommands.MEDIALIST_EDITSMARTMEDIALIST,
this.m_cmd_EditSmartPlaylist);
1095 this.m_mgr.publish(kPlaylistCommands.MEDIAITEM_SMARTPLAYLIST,
this.m_smartPlaylistsCommands);
1096 this.m_mgr.registerPlaylistCommandsMediaItem(
"",
"smart", this.m_smartPlaylistsCommands);
1103 (
"webplaylist-cmds");
1105 this.m_webPlaylistCommands.appendPlaylistCommands(
null,
1106 "library_cmdobj_play",
1108 this.m_webPlaylistCommands.appendPlaylistCommands(
null,
1109 "library_cmdobj_pause",
1112 this.m_webPlaylistCommands.appendPlaylistCommands(
null,
1113 "library_cmdobj_remove",
1115 this.m_webPlaylistCommands.appendPlaylistCommands(
null,
1116 "library_cmdobj_download",
1117 this.m_cmd_Download);
1120 this.m_webPlaylistCommands.appendPlaylistCommands(
null,
1121 "library_cmdobj_addtoplaylist",
1124 this.m_webPlaylistCommands.appendPlaylistCommands(
null,
1125 "library_cmdobj_copylocation",
1126 this.m_cmd_CopyTrackLocation);
1127 this.m_webPlaylistCommands.appendSeparator(
null,
"separator");
1128 this.m_webPlaylistCommands.appendPlaylistCommands(
null,
1129 "library_cmdobj_showdlplaylist",
1130 this.m_cmd_ShowDownloadPlaylist);
1131 this.m_webPlaylistCommands.appendSeparator(
null,
"web_commands_separator_2");
1133 this.m_webPlaylistCommands.appendPlaylistCommands(
null,
1134 "library_cmdobj_queuenext",
1135 this.m_cmd_QueueNext);
1137 this.m_webPlaylistCommands.appendPlaylistCommands(
null,
1138 "library_cmdobj_queuelast",
1139 this.m_cmd_QueueLast);
1141 this.m_webPlaylistCommands.setVisibleCallback(plCmd_ShowDefaultInToolbarCheck);
1143 this.m_mgr.publish(kPlaylistCommands.MEDIAITEM_WEBPLAYLIST,
this.m_webPlaylistCommands);
1148 prefs.getComplexValue(
"songbird.library.web",
1149 Ci.nsISupportsString);
1151 this.m_mgr.registerPlaylistCommandsMediaItem(webListGUID,
"", this.m_webPlaylistCommands);
1158 (
"webhistory-cmds");
1160 this.m_webMediaHistoryToolbarCommands.appendPlaylistCommands
1162 "library_cmdobj_clearhistory",
1163 this.m_cmd_ClearHistory);
1165 this.m_webMediaHistoryToolbarCommands.setVisibleCallback
1166 (plCmd_ShowForToolbarCheck);
1168 this.m_mgr.publish(kPlaylistCommands.MEDIAITEM_WEBTOOLBAR,
1169 this.m_webMediaHistoryToolbarCommands);
1173 this.m_mgr.registerPlaylistCommandsMediaItem
1176 this.m_webMediaHistoryToolbarCommands);
1184 this.m_downloadCommands.appendPlaylistCommands(
null,
1185 "library_cmdobj_play",
1187 this.m_downloadCommands.appendPlaylistCommands(
null,
1188 "library_cmdobj_pause",
1190 this.m_downloadCommands.appendPlaylistCommands(
null,
1191 "library_cmdobj_remove",
1193 this.m_downloadCommands.appendPlaylistCommands(
null,
1194 "library_cmdobj_pauseresumedownload",
1195 this.m_cmd_PauseResumeDownload);
1197 this.m_downloadCommands.setVisibleCallback(plCmd_HideForToolbarCheck);
1199 this.m_mgr.publish(kPlaylistCommands.MEDIAITEM_DOWNLOADPLAYLIST,
this.m_downloadCommands);
1206 this.m_mgr.registerPlaylistCommandsMediaItem(this.m_downloadListGuid,
"", this.m_downloadCommands);
1215 this.m_deviceLibraryCommands.appendPlaylistCommands(
null,
1216 "library_cmdobj_edit",
1218 this.m_deviceLibraryCommands.appendPlaylistCommands(
null,
1219 "library_cmdobj_reveal",
1222 this.m_deviceLibraryCommands.appendSeparator(
null,
"default_commands_separator_1");
1224 this.m_deviceLibraryCommands.appendPlaylistCommands(
null,
1225 "library_cmdobj_addtolibrary",
1228 this.m_deviceLibraryCommands.appendSeparator(
null,
"default_commands_separator_2");
1230 this.m_deviceLibraryCommands.appendPlaylistCommands(
null,
1231 "library_cmdobj_remove",
1234 this.m_deviceLibraryCommands.setVisibleCallback(plCmd_ShowDefaultInToolbarCheck);
1236 this.m_mgr.publish(kPlaylistCommands.MEDIALIST_DEVICE_LIBRARY_CONTEXTMENU,
1237 this.m_deviceLibraryCommands);
1246 this.m_cdDeviceLibraryCommands.appendPlaylistCommands(
null,
1247 "library_cmdobj_check",
1248 this.m_cmd_CheckAll);
1250 this.m_cdDeviceLibraryCommands.appendPlaylistCommands(
null,
1251 "library_cmdobj_uncheck",
1252 this.m_cmd_UncheckAll);
1254 this.m_cdDeviceLibraryCommands.appendPlaylistCommands(
null,
1255 "library_cmdobj_edit",
1258 this.m_cdDeviceLibraryCommands.appendPlaylistCommands(
null,
1259 "library_cmdobj_lookup",
1260 this.m_cmd_LookupCDInfo);
1262 this.m_mgr.publish(kPlaylistCommands.MEDIALIST_CDDEVICE_LIBRARY,
1263 this.m_cdDeviceLibraryCommands);
1270 (
"playqueue-toolbar-cmds");
1272 this.m_playQueueLibraryCommands.appendPlaylistCommands(
null,
1273 "playqueue_cmdobj_savetoplaylist",
1274 this.m_cmd_playqueue_SaveToPlaylist);
1276 this.m_playQueueLibraryCommands.appendPlaylistCommands(
null,
1277 "playqueue_cmdobj_clearall",
1278 this.m_cmd_playqueue_ClearAll);
1280 this.m_playQueueLibraryCommands.appendPlaylistCommands(
null,
1281 "playqueue_cmdobj_clearhistory",
1282 this.m_cmd_playqueue_ClearHistory);
1284 this.m_playQueueLibraryCommands.setVisibleCallback(plCmd_ShowForToolbarCheck);
1286 this.m_mgr.publish(kPlaylistCommands.MEDIALIST_PLAYQUEUE_LIBRARY,
1287 this.m_playQueueLibraryCommands);
1290 var queueService =
Cc[
"@songbirdnest.com/Songbird/playqueue/service;1"]
1291 .getService(
Ci.sbIPlayQueueService);
1292 var playQueueListGUID = queueService.mediaList.guid;
1294 this.m_mgr.registerPlaylistCommandsMediaItem(playQueueListGUID,
"", this.m_playQueueLibraryCommands);
1301 (
"playqueue-menu-cmds");
1303 this.m_playQueueCommands.appendPlaylistCommands(
null,
1304 "library_cmdobj_play",
1307 this.m_playQueueCommands.appendPlaylistCommands(
null,
1308 "library_cmdobj_pause",
1311 this.m_playQueueCommands.appendPlaylistCommands(
null,
1312 "library_cmdobj_reveal",
1315 this.m_playQueueCommands.appendSeparator(
null,
"default_commands_separator_1");
1317 this.m_playQueueCommands.appendPlaylistCommands(
null,
1318 "library_cmdobj_addtoplaylist",
1321 this.m_playQueueCommands.appendPlaylistCommands(
null,
1322 "library_cmdobj_addtolibrary",
1325 this.m_playQueueCommands.appendSeparator(
null,
"default_commands_separator_2");
1327 this.m_playQueueCommands.appendPlaylistCommands(
null,
1328 "library_cmdobj_rescan",
1331 this.m_playQueueCommands.appendPlaylistCommands(
null,
1332 "library_cmdobj_remove",
1335 this.m_playQueueCommands.setVisibleCallback(plCmd_HideForToolbarCheck);
1337 this.m_mgr.publish(kPlaylistCommands.MEDIAITEM_PLAYQUEUE,
this.m_playQueueCommands);
1339 this.m_mgr.registerPlaylistCommandsMediaItem(playQueueListGUID,
"", this.m_playQueueCommands);
1346 (
"download-toolbar-cmds");
1348 this.m_downloadToolbarCommands.appendPlaylistCommands
1350 "library_cmdobj_cleanupdownloads",
1351 this.m_cmd_CleanUpDownloads);
1352 this.m_downloadToolbarCommands.appendPlaylistCommands
1354 "library_cmdobj_pauseresumedownload",
1355 this.m_cmd_PauseResumeDownload);
1357 this.m_downloadToolbarCommands.setVisibleCallback
1358 (plCmd_ShowForToolbarCheck);
1359 this.m_downloadToolbarCommands.setInitCallback(plCmd_DownloadInit);
1360 this.m_downloadToolbarCommands.setShutdownCallback(plCmd_DownloadShutdown);
1362 this.m_mgr.publish(kPlaylistCommands.MEDIAITEM_DOWNLOADTOOLBAR,
1363 this.m_downloadToolbarCommands);
1367 this.m_mgr.registerPlaylistCommandsMediaItem
1368 (this.m_downloadListGuid,
1370 this.m_downloadToolbarCommands);
1377 (
"download-servicepane-cmds");
1379 this.m_downloadCommandsServicePane.
1380 appendPlaylistCommands(
null,
1381 "library_cmdobj_pauseresumedownload",
1382 this.m_cmd_PauseResumeDownload);
1384 this.m_downloadCommandsServicePane.setInitCallback(plCmd_DownloadInit);
1385 this.m_downloadCommandsServicePane.setShutdownCallback(plCmd_DownloadShutdown);
1387 this.m_mgr.publish(kPlaylistCommands.MEDIALIST_DOWNLOADPLAYLIST,
this.m_downloadCommandsServicePane);
1389 this.m_mgr.registerPlaylistCommandsMediaList(this.m_downloadListGuid,
"", this.m_downloadCommandsServicePane);
1396 (
"servicetree-cmds");
1398 this.m_serviceTreeDefaultCommands.appendPlaylistCommands(
null,
1399 "servicetree_cmdobj_play",
1400 this.m_cmd_list_Play);
1402 this.m_serviceTreeDefaultCommands.appendPlaylistCommands(
null,
1403 "servicetree_cmdobj_remove",
1404 this.m_cmd_list_Remove);
1406 this.m_serviceTreeDefaultCommands.setCommandEnabledCallback(
null,
1407 "servicetree_cmdobj_remove",
1410 this.m_serviceTreeDefaultCommands.appendPlaylistCommands(
null,
1411 "servicetree_cmdobj_rename",
1412 this.m_cmd_list_Rename);
1414 this.m_serviceTreeDefaultCommands.setCommandEnabledCallback(
null,
1415 "servicetree_cmdobj_rename",
1418 this.m_serviceTreeDefaultCommands.appendPlaylistCommands(
null,
1419 "servicetree_cmdobj_queuenext",
1420 this.m_cmd_list_QueueNext);
1422 this.m_serviceTreeDefaultCommands.appendPlaylistCommands(
null,
1423 "servicetree_cmdobj_queuelast",
1424 this.m_cmd_list_QueueLast);
1426 this.m_mgr.publish(kPlaylistCommands.MEDIALIST_DEFAULT,
this.m_serviceTreeDefaultCommands);
1430 this.m_mgr.registerPlaylistCommandsMediaList(
"",
"simple", this.m_serviceTreeDefaultCommands );
1431 this.m_mgr.registerPlaylistCommandsMediaList(
"",
"smart", this.m_serviceTreeDefaultCommands );
1438 .getService(
Ci.nsIObserverService);
1439 observerService.notifyObservers(
null,
"playlist-commands-ready",
"default");
1445 shutdownCommands:
function() {
1447 var observerService =
Cc[
"@mozilla.org/observer-service;1"]
1448 .getService(
Ci.nsIObserverService);
1449 observerService.notifyObservers(
null,
"playlist-commands-shutdown",
"default");
1451 var prefs =
Cc[
"@mozilla.org/preferences-service;1"]
1452 .getService(
Ci.nsIPrefBranch2);
1456 this.m_mgr.withdraw(kPlaylistCommands.MEDIAITEM_PLAY,
this.m_cmd_Play);
1457 this.m_mgr.withdraw(kPlaylistCommands.MEDIAITEM_PAUSE,
this.m_cmd_Pause);
1458 this.m_mgr.withdraw(kPlaylistCommands.MEDIAITEM_REMOVE,
this.m_cmd_Remove);
1459 this.m_mgr.withdraw(kPlaylistCommands.MEDIAITEM_EDIT,
this.m_cmd_Edit);
1460 this.m_mgr.withdraw(kPlaylistCommands.MEDIAITEM_DOWNLOAD,
this.m_cmd_Download);
1461 this.m_mgr.withdraw(kPlaylistCommands.MEDIAITEM_RESCAN,
this.m_cmd_Rescan);
1462 this.m_mgr.withdraw(kPlaylistCommands.MEDIAITEM_REVEAL,
this.m_cmd_Reveal);
1466 this.m_mgr.withdraw(kPlaylistCommands.MEDIAITEM_COPYTRACKLOCATION,
this.m_cmd_CopyTrackLocation);
1467 this.m_mgr.withdraw(kPlaylistCommands.MEDIAITEM_SHOWDOWNLOADPLAYLIST,
this.m_cmd_ShowDownloadPlaylist);
1468 this.m_mgr.withdraw(kPlaylistCommands.MEDIAITEM_PAUSERESUMEDOWNLOAD,
this.m_cmd_PauseResumeDownload);
1469 this.m_mgr.withdraw(kPlaylistCommands.MEDIAITEM_CLEANUPDOWNLOADS,
this.m_cmd_CleanUpDownloads);
1470 this.m_mgr.withdraw(kPlaylistCommands.MEDIAITEM_CLEARHISTORY,
this.m_cmd_ClearHistory);
1471 this.m_mgr.withdraw(kPlaylistCommands.MEDIAITEM_GETARTWORK,
this.m_cmd_GetArtwork);
1472 this.m_mgr.withdraw(kPlaylistCommands.MEDIAITEM_QUEUENEXT,
this.m_cmd_QueueNext);
1473 this.m_mgr.withdraw(kPlaylistCommands.MEDIAITEM_QUEUELAST,
this.m_cmd_QueueLast);
1475 this.m_mgr.withdraw(kPlaylistCommands.MEDIALIST_PLAY,
this.m_cmd_list_Play);
1476 this.m_mgr.withdraw(kPlaylistCommands.MEDIALIST_REMOVE,
this.m_cmd_list_Remove);
1477 this.m_mgr.withdraw(kPlaylistCommands.MEDIALIST_RENAME,
this.m_cmd_list_Rename);
1478 this.m_mgr.withdraw(kPlaylistCommands.MEDIALIST_QUEUENEXT,
this.m_cmd_list_QueueNext);
1479 this.m_mgr.withdraw(kPlaylistCommands.MEDIALIST_QUEUELAST,
this.m_cmd_list_QueueLast);
1480 this.m_mgr.withdraw(kPlaylistCommands.MEDIALIST_UPDATESMARTMEDIALIST,
this.m_cmd_UpdateSmartPlaylist);
1481 this.m_mgr.withdraw(kPlaylistCommands.MEDIALIST_EDITSMARTMEDIALIST,
this.m_cmd_EditSmartPlaylist);
1485 this.m_mgr.withdraw(kPlaylistCommands.MEDIAITEM_DEFAULT,
this.m_defaultCommands);
1486 this.m_mgr.withdraw(kPlaylistCommands.MEDIAITEM_WEBPLAYLIST,
this.m_webPlaylistCommands);
1487 this.m_mgr.withdraw(kPlaylistCommands.MEDIAITEM_WEBTOOLBAR,
this.m_webMediaHistoryToolbarCommands);
1488 this.m_mgr.withdraw(kPlaylistCommands.MEDIAITEM_DOWNLOADPLAYLIST,
this.m_downloadCommands);
1489 this.m_mgr.withdraw(kPlaylistCommands.MEDIAITEM_DOWNLOADTOOLBAR,
this.m_downloadToolbarCommands);
1490 this.m_mgr.withdraw(kPlaylistCommands.MEDIALIST_DEFAULT,
this.m_serviceTreeDefaultCommands);
1491 this.m_mgr.withdraw(kPlaylistCommands.MEDIALIST_DOWNLOADPLAYLIST,
this.m_downloadCommandsServicePane);
1492 this.m_mgr.withdraw(kPlaylistCommands.MEDIAITEM_SMARTPLAYLIST,
this.m_smartPlaylistsCommands);
1493 this.m_mgr.withdraw(kPlaylistCommands.MEDIALIST_DEVICE_LIBRARY_CONTEXTMENU,
this.m_deviceLibraryCommands);
1494 this.m_mgr.withdraw(kPlaylistCommands.MEDIALIST_DEVICE_LIBRARY_TOOLBAR,
this.m_cmd_DeviceToolbarCmds);
1495 this.m_mgr.withdraw(kPlaylistCommands.MEDIALIST_CDDEVICE_LIBRARY,
this.m_cdDeviceLibraryCommands);
1496 this.m_mgr.withdraw(kPlaylistCommands.MEDIAITEM_PLAYQUEUE,
this.m_playQueueCommands);
1497 this.m_mgr.withdraw(kPlaylistCommands.MEDIALIST_PLAYQUEUE_LIBRARY,
this.m_playQueueLibraryCommands);
1501 this.m_mgr.unregisterPlaylistCommandsMediaItem(this.m_downloadListGuid,
1503 this.m_downloadCommands);
1505 this.m_mgr.unregisterPlaylistCommandsMediaItem
1506 (this.m_downloadListGuid,
1508 this.m_downloadToolbarCommands);
1510 this.m_mgr.unregisterPlaylistCommandsMediaList
1511 (this.m_downloadListGuid,
1513 this.m_downloadCommandsServicePane);
1522 prefs.getComplexValue(
"songbird.library.web",
1523 Ci.nsISupportsString);
1525 this.m_mgr.unregisterPlaylistCommandsMediaItem(webListGUID,
1527 this.m_webPlaylistCommands);
1532 unregisterPlaylistCommandsMediaItem(webListGUID,
1534 this.m_webMediaHistoryToolbarCommands);
1537 var queueService =
Cc[
"@songbirdnest.com/Songbird/playqueue/service;1"]
1538 .getService(
Ci.sbIPlayQueueService);
1539 var playQueueListGUID = queueService.mediaList.guid;
1542 unregisterPlaylistCommandsMediaItem(playQueueListGUID,
1544 this.m_playQueueCommands);
1547 unregisterPlaylistCommandsMediaItem(playQueueListGUID,
1549 this.m_playQueueLibraryCommands);
1555 unregisterPlaylistCommandsMediaItem(
"",
1557 this.m_smartPlaylistsCommands);
1563 unregisterPlaylistCommandsMediaList(
"",
1565 this.m_serviceTreeDefaultCommands);
1567 unregisterPlaylistCommandsMediaList(
"",
1569 this.m_serviceTreeDefaultCommands);
1579 this.m_cmd_Play.shutdown();
1580 this.m_cmd_Pause.shutdown();
1581 this.m_cmd_Remove.shutdown();
1582 this.m_cmd_Edit.shutdown();
1583 this.m_cmd_Download.shutdown();
1584 this.m_cmd_Rescan.shutdown();
1585 this.m_cmd_Reveal.shutdown();
1586 this.m_cmd_CopyTrackLocation.shutdown();
1587 this.m_cmd_ShowDownloadPlaylist.shutdown();
1588 this.m_cmd_PauseResumeDownload.shutdown();
1589 this.m_cmd_CleanUpDownloads.shutdown();
1590 this.m_cmd_ClearHistory.shutdown();
1591 this.m_cmd_GetArtwork.shutdown();
1592 this.m_cmd_QueueNext.shutdown();
1593 this.m_cmd_QueueLast.shutdown();
1594 this.m_cmd_list_Play.shutdown();
1595 this.m_cmd_list_Remove.shutdown();
1596 this.m_cmd_list_Rename.shutdown();
1597 this.m_cmd_list_QueueNext.shutdown();
1598 this.m_cmd_list_QueueLast.shutdown();
1599 this.m_cmd_UpdateSmartPlaylist.shutdown();
1600 this.m_cmd_EditSmartPlaylist.shutdown();
1601 this.m_cmd_SmartPlaylistSep.shutdown();
1602 this.m_defaultCommands.shutdown();
1603 this.m_webPlaylistCommands.shutdown();
1604 this.m_webMediaHistoryToolbarCommands.shutdown();
1605 this.m_smartPlaylistsCommands.shutdown();
1606 this.m_downloadCommands.shutdown();
1607 this.m_downloadToolbarCommands.shutdown();
1608 this.m_downloadCommandsServicePane.shutdown();
1609 this.m_serviceTreeDefaultCommands.shutdown();
1610 this.m_deviceLibraryCommands.shutdown();
1611 this.m_cmd_ShowOnlyOnDevice.shutdown();
1612 this.m_cmd_ShowAllOnDevice.shutdown();
1613 this.m_cmd_DeviceToolbarCmds.shutdown();
1614 this.m_cdDeviceLibraryCommands.shutdown();
1615 this.m_cmd_playqueue_SaveToPlaylist.shutdown();
1616 this.m_cmd_playqueue_ClearAll.shutdown();
1617 this.m_cmd_playqueue_ClearHistory.shutdown();
1618 this.m_playQueueCommands.shutdown();
1619 this.m_playQueueLibraryCommands.shutdown();
1620 this.m_cmd_LookupCDInfo.shutdown();
1621 this.m_cmd_CheckAll.shutdown();
1622 this.m_cmd_UncheckAll.shutdown();
1624 g_dataRemoteService =
null;
1626 var obs =
Cc[
"@mozilla.org/observer-service;1"]
1627 .getService(
Ci.nsIObserverService);
1629 obs.removeObserver(
this,
"quit-application");
1635 case "final-ui-startup":
1636 this.initCommands();
1638 case "quit-application":
1639 this.shutdownCommands();
1645 XPCOMUtils.generateQI([
Ci.nsIObserver])
1649 if (obj && obj.wrappedJSObject)
1650 obj = obj.wrappedJSObject;
1657 var playbackControl =
Cc[
"@songbirdnest.com/Songbird/Mediacore/Manager;1"]
1658 .getService(
Ci.sbIMediacoreManager).playbackControl;
1659 var view =
unwrap(aContext.playlist).mediaListView;
1664 playbackControl.play();
1669 unwrap(aContext.playlist).sendPlayEvent();
1675 var view =
unwrap(aContext.playlist).mediaListView
1678 if (view.selection.count > 1)
1683 var mediaCoreMgr =
Cc[
"@songbirdnest.com/Songbird/Mediacore/Manager;1"]
1684 .getService(
Ci.sbIMediacoreManager);
1688 return !(mediaCoreMgr.status.state ==
Ci.sbIMediacoreStatus.STATUS_PLAYING &&
1695 var mediaCoreMgr =
Cc[
"@songbirdnest.com/Songbird/Mediacore/Manager;1"]
1696 .getService(
Ci.sbIMediacoreManager);
1698 var sequencer = mediaCoreMgr.sequencer;
1699 var currItem = mediaListView.selection.currentMediaItem;
1700 var currMediaList = mediaListView.mediaList;
1703 return (currItem.equals(sequencer.currentItem) &&
1704 currMediaList.equals(sequencer.view.mediaList) &&
1705 mediaListView.selection.currentIndex == sequencer.viewPosition);
1710 var playbackControl =
Cc[
"@songbirdnest.com/Songbird/Mediacore/Manager;1"]
1711 .getService(
Ci.sbIMediacoreManager).playbackControl;
1712 playbackControl.pause();
1717 var selection =
unwrap(aContext.playlist).mediaListView.selection;
1720 if (selection.count > 1)
1725 var mediaCoreMgr =
Cc[
"@songbirdnest.com/Songbird/Mediacore/Manager;1"]
1726 .getService(
Ci.sbIMediacoreManager);
1734 return (!isPlayVisible &&
1735 mediaCoreMgr.status.state ==
Ci.sbIMediacoreStatus.STATUS_PLAYING);
1741 var playlist =
unwrap(aContext.playlist);
1742 playlist.onPlaylistEditor();
1750 unwrap(aContext.playlist).removeSelectedTracks();
1758 var playlist =
unwrap(aContext.playlist);
1760 if(playlist.mediaListView.selection.count) {
1762 playlist.mediaListView.selection.selectedIndexedMediaItems));
1767 onEnumerationBegin:
function(aMediaList) {
1769 onEnumeratedItem:
function(aMediaList, aMediaItem) {
1770 this.items.push(aMediaItem);
1772 onEnumerationEnd:
function(aMediaList, aResultCode) {
1776 playlist.mediaList.enumerateAllItems(allItems);
1778 var itemEnum = ArrayConverter.enumerator(allItems.items);
1784 Cu.reportError(err);
1791 var playlist =
unwrap(aContext.playlist);
1794 if(playlist.mediaListView.selection.count) {
1795 var mediaItemArray =
Cc[
"@songbirdnest.com/moz/xpcom/threadsafe-array;1"]
1796 .createInstance(
Ci.nsIMutableArray);
1798 var selection = playlist.mediaListView.selection.selectedIndexedMediaItems;
1799 while(selection.hasMoreElements()) {
1800 let item = selection.getNext()
1801 .QueryInterface(
Ci.sbIIndexedMediaItem).mediaItem;
1802 mediaItemArray.appendElement(item,
false);
1805 var metadataService =
Cc[
"@songbirdnest.com/Songbird/FileMetadataService;1"]
1806 .getService(
Ci.sbIFileMetadataService);
1807 var job = metadataService.read(mediaItemArray);
1808 SBJobUtils.showProgressDialog(job,
null);
1813 Cu.reportError(err);
1820 var playlist =
unwrap(aContext.playlist);
1823 if (playlist.mediaListView.selection.count != 1) {
return; }
1825 var selection = playlist.mediaListView.selection.selectedIndexedMediaItems;
1826 var item = selection.getNext().QueryInterface(
Ci.sbIIndexedMediaItem).mediaItem;
1828 Cu.reportError(
"No item selected in reveal playlist command.")
1831 var
uri = item.contentSrc;
1832 if (!uri || uri.scheme !=
"file") {
return; }
1834 let f = uri.QueryInterface(
Ci.nsIFileURL).file;
1837 f.QueryInterface(
Ci.nsILocalFile);
1842 let parent = f.parent.QueryInterface(
Ci.nsILocalFile);
1852 var parentUri =
Cc[
"@mozilla.org/network/io-service;1"]
1853 .getService(
Ci.nsIIOService).newFileURI(parent);
1855 var protocolSvc =
Cc[
"@mozilla.org/uriloader/external-protocol-service;1"]
1856 .getService(
Ci.nsIExternalProtocolService);
1857 protocolSvc.loadURI(parentUri);
1863 Cu.reportError(err);
1869 var clipboardtext =
"";
1871 var playlist =
unwrap(aContext.playlist);
1873 var selectedEnum = playlist.mediaListView.selection.selectedIndexedMediaItems;
1874 while (selectedEnum.hasMoreElements()) {
1875 var curItem = selectedEnum.getNext();
1877 var originURL = curItem.mediaItem.getProperty(SBProperties.contentURL);
1878 if (clipboardtext !=
"")
1879 clipboardtext +=
"\n";
1880 clipboardtext += originURL;
1884 var clipboard =
Cc[
"@mozilla.org/widget/clipboardhelper;1"]
1885 .getService(
Ci.nsIClipboardHelper);
1886 clipboard.copyString(clipboardtext);
1892 var
browser = window.gBrowser;
1896 browser.loadMediaList(device.downloadMediaList);
1904 if (!device)
return;
1905 var deviceState = device.getDeviceState(
'');
1906 if ( deviceState ==
Ci.sbIDeviceBase.STATE_DOWNLOADING )
1908 device.suspendTransfer(
'');
1910 else if ( deviceState ==
Ci.sbIDeviceBase.STATE_DOWNLOAD_PAUSED )
1912 device.resumeTransfer(
'');
1920 if (!device)
return;
1922 device.clearCompletedItems();
1929 var wl = getWebLibrary();
1939 var playlist =
unwrap(aContext.playlist);
1942 var isAudioItem =
function(aElement) {
1943 return aElement.getProperty(SBProperties.contentType) ==
"audio";
1946 playlist.mediaListView.selection.selectedMediaItems,
1951 var sip =
Cc[
"@mozilla.org/supports-interface-pointer;1"]
1952 .createInstance(
Ci.nsISupportsInterfacePointer);
1953 sip.data = selectedAudioItems;
1954 selectedAudioItems = sip.data;
1956 sbCoverHelper.getArtworkForItems(selectedAudioItems,
1967 let queueService =
Cc[
"@songbirdnest.com/Songbird/playqueue/service;1"]
1968 .getService(
Ci.sbIPlayQueueService);
1969 queueService.queueSomeNext(wrapper);
1978 let queueService =
Cc[
"@songbirdnest.com/Songbird/playqueue/service;1"]
1979 .getService(
Ci.sbIPlayQueueService);
1980 queueService.queueSomeLast(wrapper);
1988 if (
aPlaylist.mediaListView.selection.count) {
1989 let indexedSelection =
1990 aPlaylist.mediaListView.selection.selectedIndexedMediaItems;
1991 wrapper =
Cc[
"@songbirdnest.com/Songbird/Library/EnumeratorWrapper;1"]
1992 .createInstance(
Ci.sbIMediaListEnumeratorWrapper);
1993 wrapper.initialize(indexedSelection);
2001 var queueService =
Cc[
"@songbirdnest.com/Songbird/playqueue/service;1"]
2002 .getService(
Ci.sbIPlayQueueService);
2003 var newMediaList = aContext.window.makeNewPlaylist(
"simple");
2004 newMediaList.addAll(queueService.mediaList);
2009 var queueService =
Cc[
"@songbirdnest.com/Songbird/playqueue/service;1"]
2010 .getService(
Ci.sbIPlayQueueService);
2011 queueService.clearAll();
2016 var queueService =
Cc[
"@songbirdnest.com/Songbird/playqueue/service;1"]
2017 .getService(
Ci.sbIPlayQueueService);
2018 queueService.clearHistory();
2025 var playlist =
unwrap(aContext.playlist);
2026 var medialist = playlist.mediaListView.mediaList;
2027 var firstItem = medialist.getItemByIndex(0);
2030 Cu.reportError(
"Unable to get CD Device: " + err);
2034 Cu.reportError(
"Unable to get CD Device: " + err);
2038 var devMgr =
Cc[
"@songbirdnest.com/Songbird/DeviceManager;2"]
2039 .getService(
Ci.sbIDeviceManager2);
2040 var device = devMgr.getDeviceForItem(firstItem);
2042 Cu.reportError(
"Unable to get CD Device");
2047 var bag =
Cc[
"@mozilla.org/hash-property-bag;1"]
2048 .createInstance(
Ci.nsIPropertyBag2);
2049 device.submitRequest(
Ci.sbICDDeviceEvent.REQUEST_CDLOOKUP, bag);
2056 var playlist =
unwrap(aContext.playlist);
2057 var view = playlist.mediaListView;
2058 var propIndex = view.cascadeFilterSet
2059 .appendFilter(SBProperties.originIsInMainLibrary);
2063 var constraints = [0];
2064 view.cascadeFilterSet.set(propIndex, constraints, constraints.length);
2068 playlist.refreshCommands();
2074 var playlist =
unwrap(aContext.playlist);
2075 var filterSet = playlist.mediaListView.cascadeFilterSet;
2076 for (var
i = 0;
i < filterSet.length;
i++) {
2077 if (filterSet.getProperty(
i) == SBProperties.originIsInMainLibrary) {
2078 filterSet.remove(
i);
2085 playlist.refreshCommands();
2091 var mediaList =
aPlaylist.mediaListView.mediaList;
2092 mediaList.enumerateItemsByProperty(
2093 "http://songbirdnest.com/data/1.0#shouldRip",
2096 onEnumerationBegin:
function() { },
2097 onEnumeratedItem:
function(aList, aItem) {
2099 "http://songbirdnest.com/data/1.0#shouldRip",
2101 return Ci.sbIMediaListEnumerationListener.CONTINUE;
2103 onEnumerationEnd:
function() { }
2111 aSubMenuId, aCommandId,
aHost) {
2112 var pls =
unwrap(aContext.playlist);
2117 aSubMenuId, aCommandId,
aHost) {
2118 var pls =
unwrap(aContext.playlist);
2127 unwrap(aContext.playlist).sendBurnToCDEvent();
2142 aSubMenuId, aCommandId,
aHost) {
2144 var mediaList =
unwrap(aContext.medialist);
2145 var gBrowser = window.gBrowser;
2146 var
gMM =
Cc[
"@songbirdnest.com/Songbird/Mediacore/Manager;1"]
2147 .getService(
Ci.sbIMediacoreManager);
2148 gBrowser.loadMediaList(mediaList);
2149 var view = mediaList.createView();
2150 gMM.sequencer.playView(view);
2155 unwrap(aContext.window).SBDeleteMediaList(aContext.medialist);
2161 var medialist =
unwrap(aContext.medialist);
2162 var servicePane = window.gServicePane;
2165 var librarySPS =
Cc[
'@songbirdnest.com/servicepane/library;1']
2166 .getService(
Ci.sbILibraryServicePaneService);
2168 var
node = librarySPS.getNodeForLibraryResource(medialist);
2173 servicePane.startEditingNode(node);
2175 throw(
"Error: Couldn't find a service pane node for the list we just created\n");
2181 .getService(
Ci.nsIPromptService);
2183 var input = {
value: medialist.name};
2184 var title =
SBString(
"renamePlaylist.title",
"Rename Playlist");
2185 var
prompt =
SBString(
"renamePlaylist.prompt",
"Enter the new name of the playlist.");
2187 if (promptService.prompt(window, title, prompt, input,
null, {})) {
2188 medialist.name = input.value;
2195 var mediaList =
unwrap(aContext.medialist);
2196 var queueService =
Cc[
"@songbirdnest.com/Songbird/playqueue/service;1"]
2197 .getService(
Ci.sbIPlayQueueService);
2198 queueService.queueNext(mediaList);
2203 var mediaList =
unwrap(aContext.medialist);
2204 var queueService =
Cc[
"@songbirdnest.com/Songbird/playqueue/service;1"]
2205 .getService(
Ci.sbIPlayQueueService);
2206 queueService.queueLast(mediaList);
2210 var medialist =
unwrap(aContext.medialist);
2211 if (medialist instanceof
Ci.sbILocalDatabaseSmartMediaList)
2212 medialist.rebuild();
2216 var medialist =
unwrap(aContext.medialist);
2217 if (medialist instanceof
Ci.sbILocalDatabaseSmartMediaList) {
2218 var watcher =
Cc[
"@mozilla.org/embedcomp/window-watcher;1"]
2219 .getService(
Ci.nsIWindowWatcher);
2220 watcher.openWindow(aContext.window,
2221 "chrome://songbird/content/xul/smartPlaylist.xul",
2223 "chrome,resizable=yes,dialog=yes,centerscreen,modal,titlebar=no",
2225 unwrap(aContext.playlist).refreshCommands();
2231 return (
unwrap(aContext.playlist).mediaListView.selection.count != 0);
2237 var selection =
unwrap(aContext.playlist).mediaListView.selection;
2240 var item = selection.currentMediaItem;
2241 if (item && item.getProperty(SBProperties.contentType) ==
"audio") {
2245 if (selection.isContentTypeSelected(
"audio"))
2253 return (
unwrap(aContext.playlist).mediaListView
2255 .getProperty(SBProperties.isReadOnly) ==
"1");
2266 var pls =
unwrap(aContext.playlist);
2267 var checkedItemCount = 0;
2269 var mediaList = pls.mediaListView.mediaList;
2270 mediaList.enumerateItemsByProperty(
2271 "http://songbirdnest.com/data/1.0#shouldRip",
2274 onEnumerationBegin:
function() { },
2275 onEnumeratedItem:
function(aList, aItem) {
2278 onEnumerationEnd:
function() { }
2280 returnValue = mediaList.length != checkedItemCount;
2290 var playlist =
unwrap(aContext.playlist);
2292 var enumerator = playlist.mediaListView.selection.selectedMediaItems;
2293 while (enumerator.hasMoreElements()) {
2294 var item = enumerator.getNext().QueryInterface(
Ci.sbIMediaItem);
2295 if (!item)
continue;
2296 if (item.getProperty(SBProperties.disableDownload) ==
'1') {
2304 Cu.reportError(err);
2312 var prefs =
Cc[
"@mozilla.org/preferences-service;1"]
2313 .getService(
Ci.nsIPrefBranch2);
2314 var enabled =
false;
2316 enabled = prefs.getBoolPref(
"songbird.commands.enableRescanItem");
2325 var selection =
unwrap(aContext.playlist).mediaListView.selection;
2326 if (selection.count != 1) {
return false; }
2327 var items = selection.selectedIndexedMediaItems;
2328 var item = items.getNext().QueryInterface(
Ci.sbIIndexedMediaItem).mediaItem;
2329 return (item.contentSrc.scheme ==
"file")
2334 return (
aHost ==
"shortcuts");
2339 return (
aHost ==
"toolbar");
2344 var medialist =
unwrap(aContext.medialist);
2345 return (medialist.library != medialist);
2350 return !!(
unwrap(aContext.medialist).length);
2360 var queueService =
Cc[
"@songbirdnest.com/Songbird/playqueue/service;1"]
2361 .getService(
Ci.sbIPlayQueueService);
2363 return !queueService.operationInProgress;
2373 var queueService =
Cc[
"@songbirdnest.com/Songbird/playqueue/service;1"]
2374 .getService(
Ci.sbIPlayQueueService);
2376 return !queueService.operationInProgress;
2390 var deviceManager =
Cc[
"@songbirdnest.com/Songbird/DeviceManager;2"]
2391 .getService(
Ci.sbIDeviceManager2);
2394 var device = deviceManager.getDeviceForItem(
unwrap(aContext.medialist));
2407 var medialist =
unwrap(aContext.medialist);
2408 return !medialist.library.userEditable;
2413 var medialist =
unwrap(aContext.medialist);
2414 return !medialist.userEditable;
2421 var medialist =
unwrap(aContext.medialist);
2422 return !medialist.library.userEditableContent;
2429 var medialist =
unwrap(aContext.medialist);
2430 return !medialist.userEditableContent;
2443 if (!device)
return false;
2444 var deviceState = device.getDeviceState(
'');
2445 return (deviceState ==
Ci.sbIDeviceBase.STATE_DOWNLOADING);
2451 if (!device)
return false;
2452 var deviceState = device.getDeviceState(
'');
2453 return (deviceState ==
Ci.sbIDeviceBase.STATE_DOWNLOAD_PAUSED);
2473 if (!device)
return false;
2474 return (device.completedItemCount > 0);
2479 var wl = getWebLibrary();
2480 return wl && !wl.isEmpty;
2486 return (window.gBrowser);
2491 var medialist =
unwrap(aContext.medialist);
2492 return (medialist.type ==
"smart");
2496 var medialist =
unwrap(aContext.medialist);
2497 if (medialist instanceof
Ci.sbILocalDatabaseSmartMediaList)
2498 return medialist.autoUpdate;
2505 return function _plCmd_Conjunction(aContext, aSubMenuId, aCommandId,
aHost) {
2506 for each (var f
in methods) {
2507 if (!f(aContext, aSubMenuId, aCommandId,
aHost))
2517 return function _plCmd_Disjunction(aContext, aSubMenuId, aCommandId,
aHost) {
2518 for each (var f
in methods) {
2519 if (f(aContext, aSubMenuId, aCommandId,
aHost))
2528 return function _plCmd_Negation(aContext, aSubMenuId, aCommandId,
aHost) {
2529 return !aFunction(aContext, aSubMenuId, aCommandId,
aHost);
2541 Cc[
"@songbirdnest.com/Songbird/DownloadDeviceHelper;1"]
2542 .getService(
Ci.sbIDownloadDeviceHelper);
2543 ddh.downloadSome(mediaItems);
2550 if (!g_downloadDevice) {
2551 var deviceManager =
Cc[
"@songbirdnest.com/Songbird/DeviceManager;1"]
2552 .getService(
Ci.sbIDeviceManager);
2556 var downloadCategory =
'Songbird Download Device';
2557 if (deviceManager.hasDeviceForCategory(downloadCategory))
2559 g_downloadDevice = deviceManager.getDeviceByCategory(downloadCategory);
2560 g_downloadDevice = g_downloadDevice.QueryInterface
2561 (
Ci.sbIDownloadDevice);
2573 function getWebLibrary() {
2575 if (g_webLibrary ==
null) {
2576 var prefs =
Cc[
"@mozilla.org/preferences-service;1"]
2577 .getService(
Ci.nsIPrefBranch2);
2578 var webListGUID = prefs.getComplexValue(
"songbird.library.web",
2579 Ci.nsISupportsString);
2581 Cc[
"@songbirdnest.com/Songbird/library/Manager;1"]
2582 .getService(
Ci.sbILibraryManager);
2583 g_webLibrary = libraryManager.getLibrary(webListGUID);
2592 function plCmd_ShowDefaultInToolbarCheck(aContext,
aHost) {
2593 if (
aHost ==
"toolbar") {
2594 if (
dataRemote(
"commands.showdefaultintoolbar",
null).boolValue)
return true;
2600 function plCmd_HideForToolbarCheck(aContext,
aHost) {
2601 return (
aHost !=
"toolbar");
2604 function plCmd_ShowForToolbarCheck(aContext,
aHost) {
2605 return (
aHost ==
"toolbar");
2610 function isShowingDeviceOnly(playlist) {
2611 var filterSet = playlist.mediaListView.cascadeFilterSet;
2612 for (var
i = 0;
i < filterSet.length;
i++) {
2613 if (filterSet.getProperty(
i) === SBProperties.originIsInMainLibrary) {
2621 function plCmd_ShowOnlyOnDevice_VisibleCallback(aContext,
aHost) {
2622 var playlist =
unwrap(aContext.playlist);
2623 return (
aHost ==
"toolbar" && !isShowingDeviceOnly(playlist));
2627 function plCmd_ShowAllOnDevice_VisibleCallback(aContext,
aHost) {
2628 var playlist =
unwrap(aContext.playlist);
2629 return (
aHost ==
"toolbar" && isShowingDeviceOnly(playlist));
2632 function plCmd_DownloadInit(aContext,
aHost) {
2633 var implementorContext = {
2639 onTransferComplete:
function(aMediaItem, aStatus) {
2640 this.refreshCommands();
2643 onStateChanged:
function(aDeviceIdentifier,
aState) {
2644 this.refreshCommands();
2647 onDeviceConnect:
function(aDeviceIdentifier) {},
2648 onDeviceDisconnect:
function(aDeviceIdentifier) {},
2649 onTransferStart:
function(aMediaItem) {},
2653 onAfterItemRemoved:
function(aMediaList, aMediaItem) {
2654 return this.onMediaListChanged();
2657 onBeforeListCleared:
function(aMediaList, aExcludeLists) {
2661 onListCleared:
function(aMediaList, aExcludeLists) {
2662 return this.onMediaListChanged();
2665 onBatchBegin:
function(aMediaList) {
2666 this.batchHelper.begin();
2669 onBatchEnd:
function(aMediaList) {
2670 this.batchHelper.end();
2671 if (!this.batchHelper.isActive() && this.needRefresh) {
2672 this.refreshCommands();
2673 this.needRefresh =
false;
2677 onItemAdded:
function(aMediaList, aMediaItem, aIndex) {
return true; },
2678 onBeforeItemRemoved:
function(aMediaList, aMediaItem, aIndex) {
2681 onItemUpdated:
function(aMediaList, aMediaItem, aProperties) {
2684 onItemMoved:
function(aMediaList, aFromIndex, aToIndex) {
return true; },
2687 onMediaListChanged:
function() {
2688 if (this.batchHelper.isActive()) {
2689 this.needRefresh =
true;
2692 this.refreshCommands();
2696 refreshCommands:
function() {
2697 var playlist =
unwrap(this.context.playlist);
2699 playlist.refreshCommands();
2704 if (!device)
return false;
2705 device.addCallback(implementorContext);
2706 device.downloadMediaList.addListener
2707 (implementorContext,
2709 Ci.sbIMediaList.LISTENER_FLAGS_AFTERITEMREMOVED |
2710 Ci.sbIMediaList.LISTENER_FLAGS_LISTCLEARED |
2711 Ci.sbIMediaList.LISTENER_FLAGS_BATCHBEGIN |
2712 Ci.sbIMediaList.LISTENER_FLAGS_BATCHEND);
2713 aContext.implementorContext = implementorContext;
2716 function plCmd_DownloadShutdown(aContext,
aHost) {
2718 if (!device)
return false;
2719 if (aContext.implementorContext) {
2720 device.removeCallback(aContext.implementorContext);
2721 device.downloadMediaList.removeListener(aContext.implementorContext);
2723 aContext.implementorContext =
null;
2726 var g_dataRemoteService =
null;
2728 if (!g_dataRemoteService) {
2729 g_dataRemoteService =
new Components.
2730 Constructor(
"@songbirdnest.com/Songbird/DataRemote;1",
2734 return g_dataRemoteService(aKey, aRoot);
2738 var consoleService =
Cc[
'@mozilla.org/consoleservice;1']
2739 .getService(
Ci.nsIConsoleService);
2740 consoleService.logStringMessage(
str);
2745 return XPCOMUtils.generateModule([PublicPlaylistCommands],
2746 function(aCompMgr, aFileSpec, aLocation) {
2747 XPCOMUtils.categoryManager.addCategoryEntry(
2749 PublicPlaylistCommands.prototype.classDescription,
2750 "service," + PublicPlaylistCommands.prototype.contractID,
function plCmd_Remove_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
const PlaylistCommandsBuilder
function plCmd_CanModifyPlaylist(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_ClearHistory_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
function isCurrentSelectionActive(mediaListView)
function plCmd_IsDownloading(aContext, aSubMenuId, aCommandId, aHost)
var SBPlaylistCommand_DownloadToPlaylist
function plCmd_RemoveList_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_Play_VisibleCallback(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_IsNotLibraryContext(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_QueueListLast_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_GetSelectedItemWrapperForPlaylist(aPlaylist)
function SBFilteredEnumerator(aEnumerator, aFilterFunc)
static nsCOMPtr< nsIObserverService > observerService
function plCmd_isReadOnlyPlaylistContent(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_ListContextMenuQueueEnabled(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_QueueClearHistory_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_IsShortcutsInstantiator(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_CopyToDevice_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_CheckAllVisibleCallback(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_PlayPlaylist_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_ContextMenuQueueEnabled(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_CanQueuePlaylist(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_IsMediaListReadOnly(aContext, aSubMenuId, aCommandId, aHost)
const WEB_PLAYLIST_TABLE_NAME
function plCmd_Download_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_EditSmartPlaylist_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
sbDeviceFirmwareAutoCheckForUpdate prototype contractID
function plCmd_RenameList_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_Pause_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_isSmartPlaylist(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_Edit_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
var SBPlaylistCommand_AddToPlaylist
function plCmd_ShowDownloadPlaylist_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
sbOSDControlService prototype QueryInterface
const WEB_PLAYLIST_LIBRARY_NAME
sbDeviceFirmwareAutoCheckForUpdate prototype classDescription
function plCmd_Rescan_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_QueueListNext_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
function NSGetModule(compMgr, fileSpec)
function plCmd_PauseResumeDownload_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_UpdateSmartPlaylist_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_IsDownloadingOrNotActive(aContext, aSubMenuId, aCommandId, aHost)
function SBString(aKey, aDefault, aStringBundle)
function plCmd_CheckAll_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
function playlist_setRipProperty(aPlaylist, aVal, aNewVal)
function plCmd_isReadOnlyLibraryContent(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_QueueClearAll_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
function onBrowserTransfer(mediaItems, parentWindow)
function plCmd_DownloadHasCompletedItems(aContext, aSubMenuId, aCommandId, aHost)
function SelectionUnwrapper(selection)
function plCmd_isReadOnlyPlaylist(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_ShowOnlyOnDevice_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_IsRescanItemEnabled(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_CanAddToLibrary(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_Play_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_IsToolbarInstantiator(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_ContextHasBrowser(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_BurnToCD_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
const WEB_PLAYLIST_CONTEXT
function plCmd_CanModifyPlaylistContent(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_CopyTrackLocation_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_isReadOnlyLibrary(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_IsAnyAudioSelected(aContext, aSubMenuId, aCommandId, aHost)
function getDownloadDevice()
return!aWindow arguments!aWindow arguments[0]
function plCmd_IsNotEmptyPlaylist(aContext, aSubMenuId, aCommandId, ahost)
function plCmd_QueueLast_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
SimpleArrayEnumerator prototype hasMoreElements
function plCmd_CleanUpDownloads_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_WebMediaHistoryHasItems(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_IsDownloadActive(aContext, aSubMenuId, aCommandId, aHost)
var SBPlaylistCommand_AddToDevice
function plCmd_QueueNext_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_IsAnyTrackSelected(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_UncheckAll_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_Reveal_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_IsDownloadPaused(aContext, aSubMenuId, aCommandId, aHost)
sbDeviceFirmwareAutoCheckForUpdate prototype classID
function plCmd_Download_EnabledCallback(aContext, aSubMenuId, aCommandId, aHost)
Javascript wrappers for common library tasks.
var SBPlaylistCommand_AddToLibrary
function plCmd_ShowAllOnDevice_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_isSelectionRevealable(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_QueueSaveToPlaylist_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
_getSelectedPageStyle s i
function plCmd_NOT(aFunction)
function plCmd_Pause_VisibleCallback(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_False(aContext, aSubMenuId, aCommandId, aHost)
function dataRemote(aKey, aRoot)
function plCmd_GetArtwork_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
function plCmd_LookupCDInfo_TriggerCallback(aContext, aSubMenuId, aCommandId, aHost)
_updateTextAndScrollDataForFrame aData
sbDeviceFirmwareAutoCheckForUpdate prototype observe
function plCmd_isLiveUpdateSmartPlaylist(aContext, aSubMenuId, aCommandId, aHost)