Select only one track

This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey.

Moderator: Gurus

uziubalmy
Posts: 28
Joined: Thu Jun 07, 2012 5:01 pm

Select only one track

Post by uziubalmy » Thu Sep 11, 2014 10:00 am

with ISDBTracksWindow.set_selected(index, true) i can select a track. The problem is that the selection is multiple, and when set_selected is used if there are already other tracks selected they remains selected.

How can clear the selection before select a new track?

for example ISDBTracksWindow.set_selected(index, false) can delesect the tracks already selected but I don't know how many they are, their index or their ids.
if the trackswindow has thousend of tracks, I' have to iterate all of them and foreach of them use set_selected(index, false). this is Crazy becouse is really, really slow.

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK
Contact:

Re: Select only one track

Post by trixmoto » Thu Sep 11, 2014 1:16 pm

I can't see anything in the SDB.TracksWindow API that might help. Then again, I can't see that method in there either! :-?

Maybe you can use SDB.SelectedSongList you can?
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

uziubalmy
Posts: 28
Joined: Thu Jun 07, 2012 5:01 pm

Re: Select only one track

Post by uziubalmy » Fri Sep 12, 2014 7:48 am

http://www.mediamonkey.com/wiki/index.p ... ::Selected

Property Get/Let Selected( Index As Long) As Bool

it's the same of

bool get_Selected(int Index);
void set_Selected(int Index, bool Value);

it's so stupid make a property Selected (or get_Selected) that return a bool becouse I've to pass an Index and check one per one every track.
It's better an array of int that contains the indexes of the tracks selected! like int[] Selected; or int[] get_Selected() with no param!
(or more better just return a collection of song... all the apis are with this indexes...)

with SelectedSongList I can't do nothing. It's another songlist. I'm using MainTracksWindow that have a list of tracks with an index that correspond to the index of AllVisibleSongList. So if I have to select a track in the MainTracksWindow, and there are already one or more tracks selected, I've to iterate all the AllVisibleSongList (that can take also 20 mins with 80000 tracks) to make for every track

if(MainTracksWindow.Selected[trackIndex]) // is selected???
MainTracksWindow.Selected[trackIndex] = false

80000 times!!!!!!!!!!!

Post Reply