Available COM interface

To discuss development of addons / skins / customization of MediaMonkey.

Moderator: jiri

Re: Available COM interface

Postby PetrCBR » Tue Dec 12, 2017 1:52 am

In next build new method will be implemented ... SDB.fromJSON (currently just SongList is supported). In JS we have asJSON property implemented for all of our classes so using SDB.runJSCode you can run any JS code from COM model and return object(s) exported as JSON string. Simple example of getting current now playing tracklist using runJSCode and convert it to SongList object:
Code: Select all
Dim SDB : Set SDB = CreateObject("SongsDB5.SDBApplication")
Dim SLText : SLText = SDB.runJSCode("(function() { return app.player.getSongList().getTracklist().asJSON; })()", True)
Dim SL : Set SL = SDB.fromJSON(SLText)
PetrCBR
 
Posts: 1345
Joined: Tue Mar 07, 2006 5:31 pm
Location: Czech

Re: Available COM interface

Postby Barry4679 » Sat Jan 13, 2018 10:50 pm

Ludek wrote:Anyhow looking into our code you seem to be right that SDBPlayList is not fully implemented, most of the code of the corresponding properties/methods is commented out.
Seems to make sense to add them, going to discuss with other devs and look into it.


Has there been any decision on this request?

I see the following post by PetrCBR. That post doesn't relate to this request does it?
Barry4679
 
Posts: 257
Joined: Fri Sep 11, 2009 8:07 am
Location: Australia

Re: Available COM interface

Postby PetrCBR » Sun Jan 14, 2018 5:37 am

Using code i've sent you can receive any tracklist to your COM.
PetrCBR
 
Posts: 1345
Joined: Tue Mar 07, 2006 5:31 pm
Location: Czech

Re: Available COM interface

Postby Barry4679 » Sun Jan 14, 2018 7:11 pm

PetrCBR wrote:Using code i've sent you can receive any tracklist to your COM.


Sorry, I thought it was a general announcement, and not something in response to my request. ... thanks.

I am programming using Python. ... I don't know Javascript, nor VB ... but I can investigate ... you do expect that this facility will be available to me from Python?

PetrCBR wrote:In next build new method will be implemented


Still a future build? ... or is available in the now current build?

PetrCBR wrote:SDB.fromJSON (currently just SongList is supported). In JS we have asJSON property implemented for all of our classes so using SDB.runJSCode you can run any JS code from COM model and return object(s) exported as JSON string.


I can get the contents of an autoplaylist somehow via SongList? ... or do you plan to add SDBPlayList later?

PetrCBR wrote:Simple example of getting current now playing tracklist using runJSCode and convert it to SongList object:
Code: Select all
...


You wouldn't happen to have a "simple example" initiating this from Python? ... and maybe also getting the contents from an autoplaylist? :roll:

I have an app which does some things with MM static playlists ... I have requests to also extend support to MM autoplaylists ... I can do so with MM4, but don't really want to offer this if it will be broken by MM5, and I have no way to fix it.
Barry4679
 
Posts: 257
Joined: Fri Sep 11, 2009 8:07 am
Location: Australia

Re: Available COM interface

Postby PetrCBR » Mon Jan 15, 2018 2:28 am

Sorry, but i''ve used python in linux only (just for basic things).
PetrCBR
 
Posts: 1345
Joined: Tue Mar 07, 2006 5:31 pm
Location: Czech

Previous

Return to MediaMonkey 5 developer forum

Who is online

Users browsing this forum: No registered users and 2 guests