[Playlist] Cocoa framework

Tomas Franzén tomas at lightheadsw.com
Wed May 10 16:43:14 UTC 2006


On 10 maj 2006, at 04.23, Lucas Gonze wrote:
> I have never done any Cocoa programming, so I don't know what  
> impact it would have at the XML layer.  From your question, though,  
> I get the idea that it is the standard XML library for Mac apps --  
> is that right?

Cocoa has a new XML API in OS X 10.4 called NSXML [1]. This is what I  
plan to build the XSPF framework upon.

> I think that it would be a good thing.  I don't think that Apple  
> will support XSPF in the forseeable future, and support on Macs is  
> important.
> Also, promoting the use of libraries rather than new  
> implementations from scratch in each application helps to get  
> compatibility.

Yeah. If there is a framework that can be easily plugged into apps,  
then I think app developers are more likely to consider XSPF.

The implementation I'm building consists of two classes; one for  
playlists and another for tracks.
Code to download a playlist from a URL and list its tracks might look  
something like this (when I finish the framework):

XSPFPlaylist *playlist = [XSPFPlaylist playlistWithURL:[NSURL  
URLWithString:@"http://www.example.com/stuff.xspf"]];
NSEnumerator *e = [playlist trackEnumerator];
XSPFTrack *track;
while(track = [e nextObject]){
	NSLog(@"Track %d: %@",[track trackNumber],[track title]);
}


I'll let you all know when I make progress with the framework. :-)

Tomas Franzén
Lighthead Software
http://www.lightheadsw.com/

[1] http://developer.apple.com/documentation/Cocoa/Conceptual/ 
NSXML_Concepts/Articles/NSXMLFeatures.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.musicbrainz.org/pipermail/playlist/attachments/20060510/91abd728/attachment.htm


More information about the Playlist mailing list