1839 Workaround for incredibly slow SDBSongList.Item()?

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
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: 1839 Workaround for incredibly slow SDBSongList.Item()?

1839 Workaround for incredibly slow SDBSongList.Item()?

by chrisjj » Fri Oct 14, 2016 10:21 pm

Anyone know a faster way of finding the total duration of an SDBSongList (e.g. playlist) than loop around:

Code: Select all

 dur = dur + SDBplaylistobject.Tracks.Item(i).SongLength / 1000 '' ms per s
I'm finding SDBSongList.Item() taks about 15ms on a 150-track list but this soars to ~200ms with around 5000 tracks. (Source: timestamps here http://pastebin.com/nLg85xA4 )

So looping through all tracks is far too slow.

I guess MM itself must have a better way since it shows the total duration in the status bar within moments of that being changed by addition of a new track. But it seems not exposed to scripting.

FWIW, 1708 is the same.

Top