Select only one track

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Select only one track

Re: Select only one track

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!!!!!!!!!!!

Re: Select only one track

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?

Select only one track

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.

Top