Feeds

Serve up iTunes with Apple's media browser

Give your software some soul

Beginner's guide to SSL certificates

This returns an array of ILMediaGroup objects corresponding to the available playlists. An ILMediaGroup object encapsulates all sorts of different groups such as albums, recently played, recently added, and so on. If you want to filter this stuff, the simplest thing to do is use the type method to figure out what kind of group you're looking at. Turn on the DEBUG flag in my code - below - and you'll see all the different type numbers after each group name.

While on the subject of groups, it's also worth pointing out that one group can potentially contain subgroups. This functionality isn't directly supported by the iTunes user interface, but it is programmatically accessible.

OK, so we've got a list of playlists. Via the mediaObjects method, ILMediaGroup provides access to another array containing all the media objects in the group. Each object is of type ILMediaObject. Here's where things get really interesting: different methods give you access to information such as the name (song title), artist, play duration, and the fully qualified path of the media file itself.

iTunes library through the Mac browser

Methods access music information

Play it again...

For the sake of completeness, my demo application includes the ability to play a track: just double-click an item in the right-hand list and it will start playing. This is done by making use of the ILMediaBrowserAudioPlayer class that, once again, forms a part of the iLifeMediaBrowser library: it's what's used by the Apple browser when previewing a selected audio file. In essence, this class is a simple wrapper around QTMovie that forms part of the QuickTime framework.

If you want to make more sophisticated use of ILMediaBrowserAudioPlayer, you should be aware that it posts a number of undocumented notifications while it's working. These notifications - the meaning of each should be obvious from the name - are listed here:

  

MediaBrowserAudioPlayerWillBeginPlaying
MediaBrowserAudioPlayerDidBeginPlaying
MediaBrowserAudioPlayerDidBeginNextSong
MediaBrowserAudioPlayerDidFinishPlaying

You can listen out for these notifications in the usual way and take the appropriate action as required. In fact, even if you don't use any of the classes mentioned but simply use the standard media browser as described last time, these notifications will still be generated and can be exploited in the host application.

That's all we've got room for this time. You can download the demo application and source code that I mentioned earlier here. More undocumented naughtiness next time.®

Protecting users from Firesheep and other Sidejacking attacks with SSL

More from The Register

next story
New 'Cosmos' browser surfs the net by TXT alone
No data plan? No WiFi? No worries ... except sluggish download speed
'Windows 9' LEAK: Microsoft's playing catchup with Linux
Multiple desktops and live tiles in restored Start button star in new vids
iOS 8 release: WebGL now runs everywhere. Hurrah for 3D graphics!
HTML 5's pretty neat ... when your browser supports it
Mathematica hits the Web
Wolfram embraces the cloud, promies private cloud cut of its number-cruncher
Mozilla shutters Labs, tells nobody it's been dead for five months
Staffer's blog reveals all as projects languish on GitHub
'People have forgotten just how late the first iPhone arrived ...'
Plus: 'Google's IDEALISM is an injudicious justification for inappropriate biz practices'
SUSE Linux owner Attachmate gobbled by Micro Focus for $2.3bn
Merger will lead to mainframe and COBOL powerhouse
iOS 8 Healthkit gets a bug SO Apple KILLS it. That's real healthcare!
Not fit for purpose on day of launch, says Cupertino
prev story

Whitepapers

Secure remote control for conventional and virtual desktops
Balancing user privacy and privileged access, in accordance with compliance frameworks and legislation. Evaluating any potential remote control choice.
WIN a very cool portable ZX Spectrum
Win a one-off portable Spectrum built by legendary hardware hacker Ben Heck
Storage capacity and performance optimization at Mizuno USA
Mizuno USA turn to Tegile storage technology to solve both their SAN and backup issues.
High Performance for All
While HPC is not new, it has traditionally been seen as a specialist area – is it now geared up to meet more mainstream requirements?
The next step in data security
With recent increased privacy concerns and computers becoming more powerful, the chance of hackers being able to crack smaller-sized RSA keys increases.