Available COM interface

Post a reply

Visual Confirmation

To prevent automated access and spam, you are required to confirm that you are human. Please place a check mark next to all images of monkeys or apes. If you cannot see any images, please contact the Board Administrator.

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Topic review
   

Expand view Topic review: Available COM interface

Re: Available COM interface

Post by Barry4679 » Wed Jan 17, 2018 9:00 pm

Thanks for responses.

To clarify. I have no trouble using Mediamonkey|COM|Python.

I was requesting that you add (at least part of) SDBPlayList to your COM implementation plans for MM5.

Use Case: The contents of a static playlist may be obtained by a simple ExecSQL, but a autoplaylist would require reverse engineering in MM5 to get exactly the same track inclusion criteria and sort sequence.

I made several suggestions:
* implement the readonly members from SDBPlayList, and PlayListByTitle & PlayListByID from SDBApplication
* or provide a COM method to populate a named static playlist with the current contents of a named autoplaylist
* or a COM method to return the sql criteria for a named static playlist
* or anything that you may suggest

PetrCBR responded with a comment about a new method SDB.fromJSON

? "SDB.fromJSON (currently just SongList is supported)" ... I am not sure what this means? .. I will be able to get the tracklist of an autoplaylist?
? what language was his code example? ... I guessed Visual Basic ... or was it JS? ... I was meaing did he have a code sample (in that language) which obtained the contents of a specific autoplaylist
? the new method is available in 2088, or the next build?

Apologies if my question was worded poorly and caused confusion.

Re: Available COM interface

Post by jiri » Wed Jan 17, 2018 4:30 am

Hi Barry,

I also haven't tried to work with MM COM from Python, but I suppose that it shouldn't be much different than the sample code above, i.e. if you already have the SDBApplication object, you only need to get the tracklist through the generic runJSCode() function and then convert it to a MM COM API object using fromJSON().

Jiri

Re: Available COM interface

Post by PetrCBR » Mon Jan 15, 2018 2:28 am

Sorry, but i''ve used python in linux only (just for basic things).

Re: Available COM interface

Post by 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.

Re: Available COM interface

Post by PetrCBR » Sun Jan 14, 2018 5:37 am

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

Re: Available COM interface

Post by 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?

Re: Available COM interface

Post by 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)

Re: Available COM interface

Post by Barry4679 » Sun Dec 10, 2017 6:28 pm

The new documentation looks sweet.

I haven't yet figured out how it relates to the COM facilities.

You would need to also make sure that the PlaylistByID method was implemented
http://www.mediamonkey.com/wiki/index.p ... aylistByID

These would be good also

SDBApplication.PlaylistByTitle
SDBApplication.Database.Path
SDBApplication.IniFile.Path

http://www.mediamonkey.com/wiki/index.p ... istByTitle
http://www.mediamonkey.com/wiki/index.p ... base::Path
http://www.mediamonkey.com/wiki/index.p ... File::Path

SDBApplication.VersionHigh is on your list but should be VersionHi.
VersionRelease is also on the list, but returns a blank. ? because MM5 not released?

Re: Available COM interface

Post by Barry4679 » Sun Dec 10, 2017 5:15 pm

Ludek wrote:Just keep in mind that COM interface in MM5 will never be so powerful and so maintained as the native scripting interface (and won't be cross platform)


Just trying keep something running on MM5, something which already exists.

Thanks for considering this.

Re: Available COM interface

Post by Ludek » Sun Dec 10, 2017 5:55 am

OK,
at first I don't know your reasons why you are not using the native MM5 scripting engine and its method getTracklist ( http://www.mediamonkey.com/webhelp/MM5P ... tTracklist )

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.

Just keep in mind that COM interface in MM5 will never be so powerful and so maintained as the native scripting interface (and won't be cross platform)

Re: Available COM interface

Post by Barry4679 » Fri Dec 08, 2017 9:52 pm

Ludek wrote:Hi, why do you need this?

You can just get the tracklist of the auto-playlist to get the content, isn't it?


How?

I know how do it via the UI, but how do I do it via an application attached to your db via COM?

ie. The track list is|was a member in SDBPlayList, and you haven't said that you will implement that.

The definition of an autoplaylist is in the QueryData column of the Playlist table, but it is in a propriety format. It is not very robust to reverse engineer this.

I was hoping for a COM call which would populate a target static playlist from the autoplaylist definition, ie populate the current playlist entries into a target static playlist in the Playlist & PlayListSongs tables.

Or have something which triggered output like ExecSQL; ie. I passed it the ID of a autoplaylist, then you generated the sql from your priopriety QueryData definition, ran the query, then passed back the track rows in something like PlayListSongs format.

Or pass back the sql statements, so I could run the query myself

Re: Available COM interface

Post by Ludek » Fri Dec 08, 2017 9:12 am

Hi, why do you need this?

You can just get the tracklist of the auto-playlist to get the content, isn't it?

Re: Available COM interface

Post by Barry4679 » Tue Dec 05, 2017 1:03 am

Could you please consider a COM call to return the current result contents of a specified MM auto-playlist?

Either something where I passed the IDPlaylist or PlayListName of an autoplaylist, and a target playlist name, and the call exported a static playlist into PlaylistSongs,

Or return a rowset with the current content of the passed autoplaylist, with columns as per PlaylistSongs.

?

Re: Available COM interface

Post by PetrCBR » Thu Jul 27, 2017 8:57 am

No we do not have such a list.

Re: Available COM interface

Post by pgrimmer » Thu Jul 27, 2017 8:42 am

Thanks. Is there somewhere I can go to find out what COM is planned to be included and what is going to be excluded (at least v4 things that won't be available in v5)? Thanks.

Top

cron