player.getFastNextTrack() causes crash

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

Moderators: jiri, drakinite, Addon Administrators

drakinite
Posts: 301
Joined: Tue May 12, 2020 10:06 am
Contact:

player.getFastNextTrack() causes crash

Post by drakinite »

I'm trying to access the next-playing track; and the API reference says that I should pass an object to player.getFastNextTrack().
https://www.mediamonkey.com/webhelp/MM5 ... tNextTrack

But when I do that, MM crashes.

Code: Select all

var x = {};
app.player.getFastNextTrack(x);
Log ID is 8E41A144

** Passing an undefined variable seems to work, but passing an empty object causes the crash.**
Image
Student electrical-computer engineer, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
MiPi
Posts: 681
Joined: Tue Aug 18, 2009 2:56 pm
Location: Czech Republic
Contact:

Re: player.getFastNextTrack() causes crash

Post by MiPi »

This function accepts variable containing undefined value or already value with track object, nothing else (like empty object). "Fast" functions are made for situations, where speed is crucial, it is significantly faster to refill existing JS object with another data of the same type (like track in this case), instead of creating whole new large object from scratch.
Anyway, this function will be probably removed soon, fast version is not needed here. It is good when processing many objects of one type, but it has disadvantage, the contents persist only for a while, so it cannot be saved and used later, it can already contain different data. I will introduce function getNextTrack instead, returning track object or undefined value, when next track is not known (end of playing list or when shuffle is active).
drakinite
Posts: 301
Joined: Tue May 12, 2020 10:06 am
Contact:

Re: player.getFastNextTrack() causes crash

Post by drakinite »

Ah, I see, thanks for the info.
Image
Student electrical-computer engineer, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
Post Reply