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!
Get all titles in the library
Re: Get all titles in the library
and is there a way to start the sync process ? (Simulate clicking on the sync button)
-
raybeau528
- Posts: 401
- Joined: Thu Sep 27, 2007 4:19 pm
- Location: Connecticut
Re: Get all titles in the library
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
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
I want to do exactly what you said, without the need to manually select the songs.
Re: Get all titles in the library
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)
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= NothingAdvanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!
All My Scripts
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!
All My Scripts
Re: Get all titles in the library
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.
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
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...
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!
All My Scripts
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!
All My Scripts
Re: Get all titles in the library
I think they support triggering the sync yourself somehow, but not signing up for the event.