INTERACT FORUM
Windows => Third Party Plug-ins, Programs, and Skins => Topic started by: chrisjj on February 09, 2013, 08:39:18 am
-
I'd be interested to know why the automatic objects's names don't accord with the documentation at http://wiki.jriver.com/index.php/Media_Center_Automation#Automation_Objects . E.g. there is an object [EDIT:] named IMJPlaylistsAutomation , but documentation refers only to MJPlaylistsAutomation (no initial "I"). Were the objects renamed at some point? Or are the documentated names available via some other interface? Thanks.
-
The object (the class) inside MC itself is called MJPlaylistsAutomation.
The class's interface is called IMJPlaylistsAutomation. They are defined separately, and the interface is named I+<class name> as is the custom in Object Oriented Programming (or at least C-style).
That way, JRiver can change the implementation of the Class itself (the name, code, everything) completely, and as long as you call the interface from your code (IMJPlaylistsAutomation) and the Class still properly implements the Interface, your code will still work.
When you instantiate an object of an external class, you should instantiate via the interface, to ensure that your code will work with future changes to MC. Therefore, they don't need to expose the actual classes via the SDK, only the interfaces. The rest, you can get from the "core" MJAutomation object.
PS. This should probably be on the development board instead of here if someone wants to move it.
-
Thanks for the explanation Glynor. That leaves me wondering why the documentation for API users lists the names that the user cannot access, rather than the names that he must. But that's a mystery I can live with :)
To help any future user searching for the accessible names, here's the full list of MediaCenter namespace members (obtained by inspecting the type library MediaCenter.tlb):
Interfaces
IMJCDDVDAutomation
IMJCurPlaylistAutomation
IMJFieldAutomation
IMJFieldsAutomation
IMJFileAutomation
IMJFilesAutomation
IMJInternetAutomation
IMJMixerAutomation
IMJPlaybackAutomation
IMJPlaylistAutomation
IMJPlaylistsAutomation
IMJSchemeAutomation
IMJTaskAutomation
IMJVersionAutomation
IMJViewItemAutomation
IMJZoneAutomation
IMJZonesAutomation
Classes
MCAutomation
Enums
MJImageFileFlags
MJPlaybackStates
Also, I notice that the all-important class MCAutomation is not documented. Rather than edit the wiki assuming MCAutomation is the same as the MJAutomation class that is documented, I'll leave this to any expert who feels motivated to make a remedy.
PS. This should probably be on the development board instead of here if someone wants to move it.
I didn't write there because it says "This board is only for developers who want to build Media Jukebox/Media Center plug-ins.", and I am not one. If I have misinterpreted that notice, please do correct me.
-
You can also look in the Object Browser in Visual Studio, once you add the reference to MediaCenter.
-
You can also look in the Object Browser in Visual Studio, once you add the reference to MediaCenter.
Indeed - VS is what I used to make that type library inspection.