From JRiverWiki
Revision as of 11:01, 19 December 2007 by Gateley (talk | contribs)

Jump to: navigation, search

core object... provides access to all other objects


MJPlaybackAutomation * GetPlayback()

Description: gets a MJPlaybackAutomation interface
Return Value: MJPlaybackAutomation interface

MJFilesAutomation * Search(string strSearch)

Description: gets a MJFilesAutomation interface for the files matching the specified search

  • strSearch: the search string to use... can be any search accepted by Media Center

Return Value: MJFilesAutomation interface

MJCurPlaylistAutomation * GetCurPlaylist()

Description: gets a MJCurPlaylistAutomation interface
Return Value: MJCurPlaylistAutomation interface

MJPlaylistsAutomation * GetPlaylists()

Description: gets a MJPlaylistsAutomation interface for all of the existing playlists
Return Value: MJPlaylistsAutomation interface

MJSchemeAutomation * GetViewScheme(string strPath)

Description: gets a MJSchemeAutomation interface for the given library path

  • strPath: the path to the view scheme delimited by backslashes. (i.e. "Media Library\Artist/Album\Metallica")

Return Value: MJSchemeAutomation interface

MJMixerAutomation * GetMJMixer()

Description: gets a MJMixerAutomation interface
Return Value: MJMixerAutomation interface
C# Example:

// Use this in the Init of MC
private void setEQOnOff ()
     this.checkBoxEQOnOff.Checked = mcRef.GetMJMixer ().EQOn;
// The 'checkBoxEQOnOff_CheckedChanged' is automatically generated by Visual Studio 2005 upon doubleclick
private void checkBoxEQOnOff_CheckedChanged ( object sender, EventArgs e )
    mcRef.GetMJMixer ().EQOn = checkBoxEQOnOff.Checked;

MJVersionAutomation * GetVersion()

Description: gets a MJVersionAutomation interface.
Return Value: MJVersionAutomation interface

MJFileAutomation * GetFile(string strFilename)

Description: gets a MJFileAutomation interface for the given file.

  • strFilename: the path to the file.

Return Value: MJFileAutomation interface

MJFileAutomation * GetFileByKey(number nKey)

Description: gets a MJFileAutomation interface for the file denoted by the key.

  • nKey: the key of a file.

Return Value: MJFileAutomation interface

void EnableSkinning(number bEnable)

Description: Enables and disabled Media Center skinning. Useful in case when MC could not skin plug-in window correctly.

  • bEnable: TRUE - enable skinning, FALSE - disable.

void SkinWindow(number nWindowHandle, boolean bSkin)

Description: Skins or removes skinning from the specified window.

  • nWindowHandle: handle to the specific window (convert HWND to long)
  • bSkin: TRUE - enables skinning of the specified window, FALSE - disables skinning for the window.

Skinning is permanently disabled for many windows created outside of C++ (such as Visual Basic, C# or .NET). If this function appears to have no effect, that is probably the cause.

MJInternetAutomation * GetInternet()

Description: gets a MJInternetAutomation interface.
Return Value: MJInternetAutomation interface

number GetSkinInfo(string strItem, string strAttribute)

Description: Retrieves information about current skin. The Item and Attributes are described in MEGAMorphis.

  • strItem: item name
  • strAttribute: attribute name.

Return Value: value of the specified skin item. -1 if the info was not found.

GetSkinInfo("Tree", "TextColor");
GetSkinInfo("StatusBar", "BackColor");

C# Example: translating a MC Color into a Color Object:

private Color getColor(String strItem, String strAttribute)
    int intColor;
    int intR;
    int intG;
    int intB;

    intColor = mcRef.GetSkinInfo ( strItem, strAttribute );

    if (intColor != -1)
        intR = intColor & 255;
        intG = (intColor >> 8) & 255;
        intB = (intColor >> 16) & 255;

        return Color.FromArgb ( intR, intG, intB );
        // Return a default Color if not found!

        return Color.LightGray;


     Panel.BackColor = getColor ( "Tree", "BackColor" );

number IsPurchased()

Description: Retrieves registration information
Return Value: if Media Center is purchased return value will be -1. The value will be equal to 0 if trial period expired but the program was not purchased. If the value > 0 the function returned number of days left in the trial period.

MJViewItemAutomation * GetViewItem(string strPath)

Description: gets a MJViewItemAutomation interface for the given file.

  • strPath: the path to a view item.

Return Value: MJViewItemAutomation interface

number GetWindowHandle()

Description: Retrieves handle to Media Center's main window
Return Value: HWND to main application window.

void ShowProgram(number bShow)

Description: Changes visibility state of the program.

  • bShow: 1 - show the app, 0 - hide.

MJFileAutomation * ImportFile(string strFilename)

Description: imports a new file into Media Center

  • strFilename: the path to the file.

Return Value: MJFileAutomation interface

void SetGlobalFocusedWindow(number hwndNew, number bInvalidateNew)

Description: Sets the focus to the new window.

  • hwndNew: the handle of the window
  • bInvalidateNew: Invalidate the new window so it knows the focus changed

MJFieldsAutomation * GetFields()

Description: gets a MJFieldsAutomation interface
Return Value: MJFieldsAutomation interface

MJZonesAutomation * GetZones()

Description: gets a MJZonesAutomation interface
Return Value: MJZonesAutomation interface

MJFilesAutomation * CreateFiles()

Description: gets a MJFilesAutomation interface with no files
Return Value: MJFilesAutomation interface

MJTaskAutomation * GetTask(string strTask)

Description: gets a MJTaskAutomation interface.

  • strTask: the name of the task.

Return Value: MJTaskAutomation interface

MJServicesAutomation * GetServices()

Description: gets a MJServicesAutomation interface.
Return Value: MJServicesAutomation interface

void ReportEvent(string Name, string Data)

Description: Reports an event.

  • Name: the name of the event
  • Data: extra data.

IMJPlaylistAutomation *GetPlaylistByID(number nID)

Description: Gets a playlist

  • nID: the ID of the playlist

Return Value: MJPlaylistAutomation interface (see below)

void RegisterWindowWithRouter(number hwndRegister, number nRegisterState)

Description: Register or unregister a window with the router

  • hwndRegister: Handle of the window to register
  • nRegisterState: TRUE for register, FALSE for unregister

IMJCDDVDAutomation *GetCDDVD()

Description: Gets a CD/DVD Automation interface
Return Value: MJCDDVDAutomation Interface

void GetLibrary(string *Name, string *Path)

Description: Returns the name and directory of the currently loaded library.

  • Name: The name of the library (returned).
  • Path: The directory of the library (returned).

long CreateInterface(string Name)

Description: Returns an interface object, specified by name.

  • Name: The name of the interface.

Returns an interface object. Name must be IVisData or IVisRedrawHelper. See the Display Plug-in SDK for more details.


number IVersion() (read only)

Description: retrieves version of MC Automation interface. (2 is current version)