Page 1 of 1

player.getFastNextTrack() causes crash

Posted: Mon Nov 02, 2020 10:34 am
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.**

Re: player.getFastNextTrack() causes crash

Posted: Tue Nov 03, 2020 9:24 am
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).

Re: player.getFastNextTrack() causes crash

Posted: Tue Nov 03, 2020 9:53 am
by drakinite
Ah, I see, thanks for the info.