App Class
Main app support classes and functions
Item Index
Methods
- allowCollect
- closeApp
- createWindow
- currentLayout
- currentSkin
- findUpdatesAsync
- flushState
- getAddonList
- getCurrentPlayer
- getIniFile
- getLayouts
- getObject
- getSkins
- getValue
- inSafeMode
- installAddonAsync
- listen
- loadLayout
- ODS
- preventCollect
- removeValue
- restart
- selectSkin
- setValue
- switchToMainPlayer
- switchToMicroPlayer
- switchToMiniPlayer
- uninstallAddonAsync
- unlisten
Properties
Methods
allowCollect
()
Allow app to collect garbage.
closeApp
()
Close application.
createWindow
-
url
-
params
Creates new window with URL. Currently these parameters are supported: left, top, width, height - position and size of the window posSaveName - save/restore name of the window isPopup (true/false) - is popup window
Parameters:
-
url
StringURL to be opened in new window
-
params
ObjectParameters (optional)
Returns:
SharedWindow
currentLayout
()
String
Get current layout name.
Returns:
currentSkin
()
String
Get current skin name.
Returns:
findUpdatesAsync
-
addon
Finds whether updates are available for the addon list
Parameters:
-
addon
Addon listlist to find updates for
Returns:
flushState
()
Stores all persistent values to hard drive
getAddonList
-
archiveType
Get list of addons. As archiveType parameter script can set type of addons to retrieve or 'all' for all addons.
Parameters:
-
archiveType
StringType of the addon
Returns:
getCurrentPlayer
()
Integer
Get's current player type. Possible values: 0 - main player 1 - micro player 2 - mini player
Returns:
getIniFile
()
IniFileAccess
Creates new SharedIniFile interface to be used for reading and writing values from/to MediaMonkey.ini
Returns:
getLayouts
()
LayoutList
Get {SkinList} of available layouts. Selected item in this list is current layout.
Returns:
getObject
-
objectType
-
JS
Gets object by its type and additional info. Can return nil only if passed JS object contains parameter canReturnEmpty: true
Parameters:
-
objectType
Stringlike 'album', 'genre'
-
JS
Objectobject with specifying info in its properties, like id, name, mbgid
Returns:
getSkins
()
SkinList
Get {SkinList} of available skins. Selected item in this list is current skin.
Returns:
getValue
-
id
-
object
Gets JS value/object previously stored by setValue,
Parameters:
-
id
Stringunique id of the stored value
-
object
Objectobject to pass (default value)
Returns:
object (modified object from the second parameter)
inSafeMode
()
Boolean
Return true when app is on safe mode where scripts are not loaded and default skin/layout is set.
Returns:
installAddonAsync
-
path
Install new addon.
Parameters:
-
path
StringFilename of the addon to install (or download URL)
Returns:
listen
-
object
-
event
-
callback
-
capture
Sets event listener of the object. Event function MUST be binded to object's window class.
Parameters:
-
object
ObjectObject where to set listener
-
event
StringEvent of the listener
-
callback
MethodMethod for callback dispatch
-
capture
BooleanCapture mode
Returns:
Method
loadLayout
-
name
Load defined layout.
Parameters:
-
name
StringName of the layout to load
ODS
-
string
Send debug string to event list.
Parameters:
-
string
Stringdebug string
preventCollect
()
Prevent app to collect garbage (must be in pair with allowCollect).
removeValue
-
id
Remove JS value/object
Parameters:
-
id
Stringunique id of the stored value
restart
-
safemode
Restart app. Using first optional parameter can restart in safe mode.
Parameters:
-
safemode
BooleanTrue to restart in safe mode
selectSkin
-
name
Load defined skin.
Parameters:
-
name
StringName of the skin
setValue
-
id
-
value
Stores JS value/object to be persistent
Parameters:
-
id
Stringunique id of the stored value
-
value
Object
switchToMainPlayer
()
Switch to player in main window.
switchToMicroPlayer
()
Switch to player in tray bar.
switchToMiniPlayer
()
Switch to player in separate mini window.
uninstallAddonAsync
-
addon
Uninstall addon.
Parameters:
-
addon
AddonAddon to uninstall
Returns:
unlisten
-
object
-
event
-
callback
Removed event listener of the object.
Parameters:
-
object
ObjectObject of the listener
-
event
EventEvent of the listener (optional)
-
callback
MethodMethod to be removed (optional)
Properties
fileFormats
FileFormats
Gets class for operating file formats
hotkeys
Hotkeys
Gets hotkeys class
importer
TImporter
Gets class for importer operations
inPartyMode
Boolean
Gets/Sets whether app is in party mode
platform
String
Gets application platform, possible values are 'win', 'mac'
Events
onAfterReload
Event is called when app reload is done.
onBeforeReload
Event is called just before app reload (like when skin is changed).
onClose
Event is called when app is going to close.
onCollectionChange
Event is called when collection is changed.
Event Payload:
-
collection
Collectionchanged Collection
onCommonChange
Event is called when something is changed (like artist were changed, new genre is added to DB etc.). Parameters of this event can be various based on change notification.
onDockChange
Event is called when taskbar MM dock orientation changed.
Event Payload:
-
horizontal
Booleannew taskbar dock is in horizontal orientation
onHotkey
Event is called when hotkey is received.
Event Payload:
-
hotkey
Hotkeyreceived hotkey
onIdle
Event is called when app is idle.
onMenuClosed
Event is called when app menu is closed.
onPlaylistChange
Event is called when playlist is changed.
Event Payload:
-
playlist
Playlistchanged Playlist
onSettingsChange
Event is called when settings were changed
onTrackModified
Event is called when new track is modified and changes are commited
Event Payload:
-
track
Trackmodified track
onTrayIconEvent
Event is called when app is received any command from taskbar icon. Possible event names are 'click', 'dblclick', 'mousedown', 'mouseup', 'mousemove', 'mouseenter', 'mouseexit', 'hintshow', 'hinthide', 'hinttimeout', 'hintclick'.
Event Payload:
-
eventName
Stringname of the event
-
button
Integerbutton index
-
x
Integerx mouse position
-
y
Integery mouse position