INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Automation object name - implementation v documentation  (Read 2014 times)

chrisjj

  • Citizen of the Universe
  • *****
  • Posts: 750
Automation object name - implementation v documentation
« 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.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Automation object name - implementation v documentation
« Reply #1 on: February 10, 2013, 02:39:39 pm »

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.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

chrisjj

  • Citizen of the Universe
  • *****
  • Posts: 750
Re: Automation object name - implementation v documentation
« Reply #2 on: February 11, 2013, 05:14:46 pm »

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):

Code: [Select]
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.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Automation object name - implementation v documentation
« Reply #3 on: February 12, 2013, 02:29:29 pm »

You can also look in the Object Browser in Visual Studio, once you add the reference to MediaCenter.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

chrisjj

  • Citizen of the Universe
  • *****
  • Posts: 750
Re: Automation object name - implementation v documentation
« Reply #4 on: February 12, 2013, 02:34:27 pm »

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.
Logged
Pages: [1]   Go Up