Get all titles in the library

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: Get all titles in the library

Re: Get all titles in the library

by asaf-g » Mon Oct 06, 2008 4:42 pm

I think they support triggering the sync yourself somehow, but not signing up for the event.

Re: Get all titles in the library

by Bex » Mon Oct 06, 2008 4:37 pm

No sorry, I haven't written any sync scripts so I never investigated how the SDBDevice members works. But there was a post recently which claimed that they missed a start sync event, so it seems that it is missing...

Re: Get all titles in the library

by asaf-g » Mon Oct 06, 2008 4:23 pm

Works!
And do you happen to know how to start a sync?
There's SDBDevice::StartSynch who gets a SDBSongList, but I can't find a code example that uses it, and have't successfully manage to do it myself.

Re: Get all titles in the library

by Bex » Mon Oct 06, 2008 4:19 pm

The key is to use QuerySongs which returns songdata objects which you can add to a SongList.
You can do something like this: (Not tested)

Code: Select all

Set List = SDB.NewSongList
Set iter = SDB.Database.QuerySongs("ID> 0")
Do While Not iter.EOF
  List.Add iter.Item
  iter.Next
Loop
Set iter= Nothing

Re: Get all titles in the library

by asaf-g » Mon Oct 06, 2008 4:06 pm

I want to do exactly what you said, without the need to manually select the songs.

Re: Get all titles in the library

by raybeau528 » Mon Oct 06, 2008 4:04 pm

What exactly are you trying to do and what (code) have you tried so far?

A simple way to get all tracks in the library is to select the 'title' node, ctrl-a to select all tracks and in a script you call use this code

Dim list : Set List = SDB.CurrentSongList ' Method to process each track in a selection
Dim i
For i = 0 to list.count-1

' do some processing here

next

It also works for any selection of tracks.

Ray

Re: Get all titles in the library

by asaf-g » Mon Oct 06, 2008 2:05 pm

and is there a way to start the sync process ? (Simulate clicking on the sync button)

Get all titles in the library

by asaf-g » Mon Oct 06, 2008 11:42 am

Hi all,
Is there an easy way using the API, to get an object that holds a list of all the tracks I have in my library?

Thanks!

Top