Available COM interface

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

Moderators: jiri, drakinite, Addon Administrators

Barry4679
Posts: 2408
Joined: Fri Sep 11, 2009 8:07 am
Location: Australia
Contact:

Re: Available COM interface

Post by Barry4679 »

Thanks for the JSON string, and for the general advice re debugging COM calls.

I can now get going with some confidence.
PetrCBR wrote: Your example does not work because you didn't returned value from getStringValue. app.getIniFile is asynchronous operation so you want to return value using runJSCode_callback (since MM5 2090).

Code: Select all

SDB.runJSCode("(function() { app.getIniFile().then(function(iniFileAccess) { runJSCode_callback(iniFileAccess.getStringValue('System','DBName'))   }); }); ()", True)
I would not have predicted that reading a value from an ini file would have been implemented as an async function ... nothing wrong with that of course, but in many cases one wouldn't want a program starting too much until the ini file had been validated.

Is there any way to predict, from the documentation, which calls have been implemented as async?
Want a dark skin for MM5? This is the one that works best for me .. elegant, compact & clear.
PetrCBR
Posts: 1763
Joined: Tue Mar 07, 2006 5:31 pm
Location: Czech
Contact:

Re: Available COM interface

Post by PetrCBR »

Typically almost all methods returning any list with data is async and you need call whenLoaded before use.
Like:

Code: Select all

app.player.getSongList().getTracklist().whenLoaded().then(function(list) { ... fully loaded list can be used here });
How to make a debuglog - step 4b: viewtopic.php?f=30&t=86643
Post Reply