player.getFastNextTrack() causes crash

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

Moderators: jiri, drakinite, Addon Administrators

drakinite
Posts: 965
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
I uploaded many addons to MM's addon page, but not all of those were created by me. "By drakinite, Submitted by drakinite" means I made it on my own time. "By Ventis Media, Inc., Submitted by drakinite" means it may have been made by me or another MediaMonkey developer, so instead of crediting/thanking me, please thank the team. You can still ask me for support on any of our addons.
MiPi
Posts: 867
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: 965
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
I uploaded many addons to MM's addon page, but not all of those were created by me. "By drakinite, Submitted by drakinite" means I made it on my own time. "By Ventis Media, Inc., Submitted by drakinite" means it may have been made by me or another MediaMonkey developer, so instead of crediting/thanking me, please thank the team. You can still ask me for support on any of our addons.
Post Reply