Display Plug-in SDK: Difference between revisions
No edit summary |
No edit summary |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
==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. |
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. |
||
[http://www.jriver.com/DevZone/MediaCenterSDK.rar Download the SDK] |
|||
The SDK consists of three files: IMenuEx.h, VisPlugin.h, and MCPLayerLib.tlb, and of one example plug-in: ImpactFill. |
|||
==Writing a plug-in== |
==Writing a plug-in== |
||
Line 19: | Line 21: | ||
''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. |
''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 |
Some Considerations |
||
==Variable Substitution== |
|||
* ARTIST - The artist |
|||
* ALBUM - The album |
|||
* NAME - The name of the track |
|||
* PN_POSITION - The position of the track in Playing Now |
|||
* PN_TRACKS - The total number of tracks. |
|||
* YEAR |
|||
* SAMPLE_RATE |
|||
* CHANNELS - MC 12.0.405 or later |
|||
* BITRATE |
|||
* ELAPSED_TIME |
|||
* REMAINING_TIME |
|||
* TOTAL_TIME |
|||
* LYRICS |
|||
* NOTES |
|||
==Miscellaneous Comments== |
==Miscellaneous Comments== |
||
Here are just a few things to remember when writing components: |
Here are just a few things to remember when writing components: |
||
* The example plug-in was made with Microsoft Visual Studio .NET. |
* The example plug-in was made with Microsoft Visual Studio .NET. |
||
* You must link to the library VisPlugin.lib to use the helpers |
|||
* You can use the MJAutomation interface to access the Media Center library. |
* You can use the MJAutomation interface to access the Media Center library. |
||
[[Category:Developer]] |
|||
[[Category:Display Plugins]] |
Latest revision as of 11:27, 4 May 2015
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.
The SDK consists of three files: IMenuEx.h, VisPlugin.h, and MCPLayerLib.tlb, and of one example plug-in: ImpactFill.
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
Variable Substitution
- ARTIST - The artist
- ALBUM - The album
- NAME - The name of the track
- PN_POSITION - The position of the track in Playing Now
- PN_TRACKS - The total number of tracks.
- YEAR
- SAMPLE_RATE
- CHANNELS - MC 12.0.405 or later
- BITRATE
- ELAPSED_TIME
- REMAINING_TIME
- TOTAL_TIME
- LYRICS
- NOTES
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.