27 const Cc = Components.classes;
28 const Ci = Components.interfaces;
29 const Cr = Components.results;
30 const Ce = Components.Exception;
31 const Cu = Components.utils;
33 Cu.import(
"resource://gre/modules/XPCOMUtils.jsm");
47 [
Ci.sbIApplicationController,
Ci.nsIClassInfo]),
49 classID : Components.ID(
"{8492c5a0-ab8e-11dd-ad8b-0800200c9a66}"),
50 contractID :
"@songbirdnest.com/Songbird/ApplicationController;1",
51 flags :
Ci.nsIClassInfo.MAIN_THREAD_ONLY,
59 count.value = interfaces.length;
67 var windowMediator =
Cc[
"@mozilla.org/appshell/window-mediator;1"]
68 .getService(
Ci.nsIWindowMediator);
69 return windowMediator.getMostRecentWindow(
null);
75 get activeMainWindow() {
76 var windowMediator =
Cc[
"@mozilla.org/appshell/window-mediator;1"]
77 .getService(
Ci.nsIWindowMediator);
84 playDefault:
function ApplicationController_playDefault() {
85 var mm =
Cc[
"@songbirdnest.com/Songbird/Mediacore/Manager;1"]
86 .getService(
Ci.sbIMediacoreManager);
89 if (mm.status.state ==
Ci.sbIMediacoreStatus.STATUS_PAUSED) {
90 mm.playbackControl.play();
98 var
window = this.activeWindow;
100 if (this._sendEventToWindow(
"Play", window))
106 var mainWindow = this.activeMainWindow;
107 if (mainWindow && mainWindow != window) {
108 if (this._sendEventToWindow(
"Play", mainWindow))
117 var view = mm.sequencer.view;
122 Cu.import(
"resource://app/jsmodules/sbLibraryUtils.jsm");
127 var index = view.selection.currentIndex;
131 if((index == -1) && (mm.sequencer.view == view)) {
132 index = mm.sequencer.viewPosition;
135 mm.sequencer.playView(view,
137 Ci.sbIMediacoreSequencer.AUTO_PICK_INDEX));
145 function ApplicationController__sendEventToWindow(aEventName, aWindow) {
146 var
event = aWindow.document.createEvent(
"Events");
147 event.initEvent(aEventName,
true,
true);
148 return !aWindow.dispatchEvent(
event);
sbDeviceFirmwareAutoCheckForUpdate prototype flags
sbDeviceFirmwareAutoCheckForUpdate prototype contractID
Service representing the global instance of the Songbird application.
sbOSDControlService prototype QueryInterface
sbDeviceFirmwareAutoCheckForUpdate prototype classDescription
sbDeviceFirmwareAutoCheckForUpdate prototype getHelperForLanguage
function ApplicationController()
const WINDOWTYPE_SONGBIRD_PLAYER
sbDeviceFirmwareAutoCheckForUpdate prototype classID
Javascript wrappers for common library tasks.
sbDeviceFirmwareAutoCheckForUpdate prototype getInterfaces
const WINDOWTYPE_SONGBIRD_CORE
sbDeviceFirmwareAutoCheckForUpdate prototype interfaces
classDescription implementationLanguage