Author Topic: API - NowPlayingList Size  (Read 6367 times)

Spicefly

  • Newbie
  • *
  • Posts: 12
Hi

I'm adding tracks and trying to limit the size of the NowPlayingList to remove older played tracks.

I had a look at mbApiInterface.NowPlayingList_IsAnyPriorTracks() but this just return true/false and I can't seem to find a function to return the size of the list?

Thanks in advance

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34346
There is a way:
NowPlayingList_GetNextIndex(Integer.MaxValue) will return the count
Last Edit: December 12, 2020, 10:44:48 PM by Steven

Spicefly

  • Newbie
  • *
  • Posts: 12
Thanks for your help, in the end I used the following code which initial fiddling around seems to work and keeps the tracks being the current playing position in check;

Code
                      // Keep Queue trimmed down
                                while (mbApiInterface.NowPlayingList_GetCurrentIndex() > 5)
                                {
                                    mbApiInterface.NowPlayingList_RemoveAt(0);
                                }

All the best