Posts: 752
Threads: 156
Joined: Aug 2006
Just looking for info/examples on how to create a playlist browser. Have about 20 iTunes playlist and want a simple UI to list the Playlists and queue up whichever one is selected. Just a newb to the media repo stuff and not sure how do to it. Thanks!
Posts: 40,483
Threads: 491
Joined: Aug 2002
Playlist weren't supported in the iTunes repo until the latest beta version. So if you are on 2.2.4, then you won't see them. Once you upgrade, then the playlists will look just like any other collections, though they'll all be in a category called Playlists.
Dean Roddey
Explorans limites defectum
Posts: 752
Threads: 156
Joined: Aug 2006
I'm on 2.2.7, so I belive I'm Ok there.
My problem is very simple. how do I create somethign to just browse a list of playlists? I see the auto-generate for a full media browser but thats much more than what I want to use. Is there a how-to on creating just a simple list browser?
Posts: 40,483
Threads: 491
Joined: Aug 2002
Actually 2.3.0 is now posted, so you should go ahead and upgrade to that, since it included more important iTunes repository driver improvements and fixes.
There's no way to just browse playlists really. Because we get information for repositories other than our own from files that are not guaranteed to remain in the same order each time we load it, there is no way to know the indentifier for a given category.
In our repository, where we create the repository and therefore all the ids of things stay the same, you could just create a category browser and OnLoad yo would send it the category cookie for whatever category you wanted it to show (such as one that you ahve put all your playlists in.) But you cannot do that with other repositories where the cookie for a given category could change any time.
It could be done if was possible in an action to ask for the cookie for a given category, then you could do the lookup in your OnLoad action, but currently that's not available.
Dean Roddey
Explorans limites defectum
Posts: 550
Threads: 27
Joined: Jul 2006
But that should be a pretty easy macro to write. It would just return the category cookie of the category named playlist, if it existed.
nf
Posts: 40,483
Threads: 491
Joined: Aug 2002
Yeh, you could do it that way. I could just ask for the list of categories and look up the cookie and return it via a variable.
Dean Roddey
Explorans limites defectum
Posts: 931
Threads: 38
Joined: Jun 2007
nishan or dean, i am looking to something along this line...have a button that populates cover art browser with all the "playlists" in the "Playlists" category.
can either of u expound upon your solution a bit so i can try to program it? dean's seems easier.
Posts: 40,483
Threads: 491
Joined: Aug 2002
Mine is easier but would require new code to be added to the system. Basically, the CML macro is a way to do that yourself in the meantime. So here is a macro pack you can use to do this:
http://www.charmedquark.com/Web2/Downloa...CMacroPack
You will have to be on the 2.3.x versions before you can import this. It will create a macro called \User\FindCatCookie. You would call it like this:
Code:
If (MacroEng::RunMacro(MEng.User.FindCatCookie, iTunesRepo, Music, LVar:Cookie))
// Send the LVar:Cookie to the cat browser
EndIf
You pass it the repository driver moniker, the name of the playlist, the media type, and a variable for it to put the cookie in if it finds it.
Dean Roddey
Explorans limites defectum
Posts: 931
Threads: 38
Joined: Jun 2007
i think i am close, but not close enough.
my music repo is called iTunesCDLibrary and i am looking for the category called Playlists which shows up in the category browser. here is my code
Code:
MacroEng::RunMacro
P1=MEng.User.FindCatCookie
P2=iTunesCDLibrary, Playlists, Music, LVar:Cookie
// sort by title so names of playlists show up
ArtBrowser::SetSortOrder
P1=By Title
// send the cookie to the coverart browser so it can display the names of the playlists
ArtBrowser::SetCategory
P1=%(LVar:Cookie)
End
invoking the above from a command button gives me an error message that says
can u see where the error is?
Posts: 40,483
Threads: 491
Joined: Aug 2002
No commas on the parameter line.
Dean Roddey
Explorans limites defectum