MediaMonkey Automation Categorized: Difference between revisions

From MediaMonkey Wiki
Jump to navigation Jump to search
(Created page with "= MediaMonkey Automation Objects = MediaMonkey's scripts provide two top-level objects that are accessible from a script running within MediaMonkey: <code>SDB</code> and <code>S...")
 
Line 23: Line 23:
=== Songlist properties ===
=== Songlist properties ===
Related to MainTracksWindow and MainTree are these properties, each of which yields an [[SDBSongList]] that can be queried for Count and individual Items, and other information.
Related to MainTracksWindow and MainTree are these properties, each of which yields an [[SDBSongList]] that can be queried for Count and individual Items, and other information.
* AllVisibleSongList is the list of songs visible in the MainTracksWindow
* [[ISDBApplication::AllVisibleSongList|SDB.AllVisibleSongList]] is the list of songs visible in the MainTracksWindow
* SelectedSongList is the list of ''selected'' songs in either the MainTracksWindow or the Now Playing pane, depending on which has focus.
* [[ISDBApplication::SelectedSongList|SDB.SelectedSongList]] is the list of ''selected'' songs in either the MainTracksWindow or the Now Playing pane, depending on which has focus.
* CurrentSongList is the same as either AllVisibleSongList (if the focus is on the MainTree) or SelectedSongList (if the focus is on the MainTracksWindow or the Now Playing pane).
* [[ISDBApplication::CurrentSongList|SDB.CurrentSongList]] is the same as either AllVisibleSongList (if the focus is on the MainTree) or SelectedSongList (if the focus is on the MainTracksWindow or the Now Playing pane).


=== [[ISDBApplication::UI|UI]] is an [[SDBUI]] object ===
=== [[ISDBApplication::UI|UI]] is an [[SDBUI]] object ===

Revision as of 19:35, 7 September 2014

MediaMonkey Automation Objects

MediaMonkey's scripts provide two top-level objects that are accessible from a script running within MediaMonkey: SDB and Script. In an external program (such as C#) or script (such as Python), these objects can be accessed by instantiating COM instances of the type shown.

SDB

SDB is a SongsDB.SDBApplication object. It is the main point of access for MediaMonkey's internals. It has numerous properties which yield objects modeling various components of the program; other properties which yield strings, integers, or flags; and some methods that perform various actions.

SDB is an "evented" object, which means scripts can register functions (callbacks) that will be called when certain events occur within MediaMonkey. This allows the script to respond without having to poll MediaMonkey repeatedly for conditions.

The members of SDB are:

Player

SDB.Player is an SDBPlayer object. It allows access to the player functions: starting, stopping, pausing, skipping and so forth. The player also generates events, which are part of the SDB's event notifications. Only the simplest scripts to control playback will not need to use events.

MainTracksWindow

SDB.MainTracksWindow is an SDBTracksWindow object. It gives access to the track entries shown in MediaMonkey's main window.

MainTree

SDB.MainTree is an SDBTree object. It gives access to the nodes in the tree in MediaMonkey's main window.

Songlist properties

Related to MainTracksWindow and MainTree are these properties, each of which yields an SDBSongList that can be queried for Count and individual Items, and other information.

  • SDB.AllVisibleSongList is the list of songs visible in the MainTracksWindow
  • SDB.SelectedSongList is the list of selected songs in either the MainTracksWindow or the Now Playing pane, depending on which has focus.
  • SDB.CurrentSongList is the same as either AllVisibleSongList (if the focus is on the MainTree) or SelectedSongList (if the focus is on the MainTracksWindow or the Now Playing pane).

UI is an SDBUI object

Tools is an SDBTools object

SDB.Tools is a utility object which contains a number of methods and a few properties of use to scripts. SDB also has a few properties of its own which are similar to those in Tools:

  • PlaylistByTitle
  • PlaylistByID

Device is an SDBDevice object

SDB.Device is the object used to access "portable devices" in the system. It does not correspond to a single device itself, but can be queried for individual devices which can then be operated on.


System Control

IniFile Registry Database

CursorType

ShutdownAfterDisconnect ComServerUIActive

Objects


Status properties

IsRunning InPartyMode RunningAsService

Path properties

ApplicationPath EqualizerPath IconsPath PluginsPath ScriptsPath SkinsPath MyMusicPath TemporaryFolder CurrentAddonInstallRoot ScriptsIniFile

Version properties

VersionHi VersionLo VersionRelease VersionBuild VersionString

Script is a SongsDB.SDBScriptControl object