One of the things I've always felt is great about Songbird is how quickly you can prototype something and flesh it out into a full feature. The SHOUTcast extension that is now bundled with Songbird is a great example of this, with its core functionality being developed over two days followed by about a week's worth of bug fixing. ;-)
First, make sure you Matt's excellent Songbird Developer Tools extension installed. I then used the Extension Wizard to create a new extension to let it setup all the framework for me. I didn't need any display panes, media views, menu items, or anything. The only option I enabled was to have it auto-generate me a preferences pane.
This article will take a look at the different components of the SHOUTcast extension's functionality (from the end-user's perspective) and will attempt to break it down and explain how each piece was developed.
We can't go into specifics on this since the APIs aren't open; but they've been documented in a thread by a SHOUTcast/Nullsoft developer on the Winamp Forums. All the code that is covered by the SHOUTcast partner agreement is contained within shoutcast.js. Since you can't legally look at that file, we'll summarise it here. It implements a ShoutcastRadio object that has two methods:
var ShoutcastRadio = {
// Given a SHOUTcast station ID, returns the URL to the .pls to tune in to the
// station
getListenerURL : function(id) { }
// Synchronously fetches the station list from SHOUTcast.com and returns the XML
// DOM of 'station' elements. If the genre is 'sbITop', then it will return the
// the top stations across all genres.
getStationList : function(genre) { }
}
| Images 0 | ||
|---|---|---|
| No images to display in the gallery. |