Display Plug-in SDK

From wiki.jriver.com
Jump to navigation Jump to search

Introduction

This SDK contains everything you need to create your own display plug-ins for Media Center. A display plug-in is a COM control that Media Center displays during playback. Typically, it uses the currently playing audio data to dynamically adapt the display, but in theory, it could be anything.

Writing a plug-in

The plug-in is simply a COM control, so first create a new COM control. (MSVC wizard type "Full Control") Then, in the "DllRegisterServer" function, insert the code to register your plug-in with Media Center. (see the sample(s) for an example) After that, make your COM control display whatever you want. Note that you should forward right mouse down event to the parent window for seamless integration with Media Center.

You must implement the Init function in the COM interface. This gives you the MC automation object, which is needed for the IVisRedrawHelper and IVisData included helper classes.

Included helpers

To create objects of these two helper classes, call the Media Center automation object function "Create Interface" with the name of the class as an argument.

IVisRedrawHelper - this class will create a "refresh" thread and fire "RedrawWindow" messages to your window, so you don't have to deal with it. NOTE: (refresh speed is controlled by a registry setting -- will be implemented in the helper at a later date)

IVisData - encapsulates information about the currently playing audio... call GetData() once each frame to update / analyze the data, then simply use the object to get whatever information you need. Some Considerations

Miscellaneous Comments

Here are just a few things to remember when writing components:

  • The example plug-in was made with Microsoft Visual Studio .NET.
  • You can use the MJAutomation interface to access the Media Center library.