Page 1 of 1

Select only one track

Posted: Thu Sep 11, 2014 10:00 am
by uziubalmy
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.

Re: Select only one track

Posted: Thu Sep 11, 2014 1:16 pm
by trixmoto
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?

Re: Select only one track

Posted: Fri Sep 12, 2014 7:48 am
by uziubalmy ... ::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!!!!!!!!!!!