Creating true mix CDs in Banshee

I’ve been wanting to implement a “CD Creator” source in Banshee for almost a year now, and just a few weeks ago I finally started to do so. However, upon starting with the new source I realized that we needed some lower-level functionality in Banshee to encapsulate optical/CD hardware.

In a number of places in Banshee I use HAL directly to get disc information. The old/current CD burning layer uses libnautilus-burn directly (and some HAL). While this worked fine, there was a lot of duplication and it’s not very portable (think, ah, Windows).

There are now a number of new interfaces in the Banshee.Cdrom namespace: IDriveFactory, IDrive, IRecorder. Most of this is modeled after the libnautilus-burn API, and I have so far a full Banshee.Cdom.Nautilus implementation that uses libnautilus-burn. Without saying too much, it all boils down to easy-to-handle optical disc functionality that should be very portable.

So without much more boring jibba-jabba, the new CD burning functionality works like this: the CD burning source allows you to create CDs with full control over the ordering of the tracks, and supports tracks coming from multiple sources. The old method only burned a selection. Quick selection burning is still supported however.

CD Burning

Each CD burning source allows for selecting the format of the disc (Audio, MP3, Data) and the drive. In other words, settings are bound to the source, not globally (like the previous method). This means that the CD Burning preferences page is completely gone. The options are also now very simplified.

Disc Options Disc Options

If you have only one drive, no drive combo is shown. If you plug a drive in, a drive selection combo will appear automagically. When you insert or change media in the bound drive, usage information will update accordingly. If you insert a blank CD, a CD burning source is created for you… just drag tracks to it and go.

Some of the UI and behavior is still under debate and may change, but I’m open to ideas. If you’re using HEAD, update your checkout and give the new functionality a test drive. This is a really big change, but a lot of the existing code was reused when it comes to verifying, preparing, and actually burning the CD. Nevertheless, there may be new bugs, so file away.