Monday, October 6, 2008

Media Devices Applet

To control connection/disconnection of media devices, along with advanced functionality such as the stale-and-orphaned feature for iPods in Amarok 1.4, some kind of GUI is needed. One of the discussed long-term ideas is to add functionality into the root item of a treeview, which has its merits in terms of simplicity. However, imagine that you plug in your device, and want to connect to it. The collection would have to be present in a kind of dormant state in the collection browser until you hit connect in the root item. This could work, but it's admittedly odd to have a "dead" collection sitting around.

Since modifying the root item of a treeview was beyond my current knowledge, I wanted to play with plasma a bit, and it gave me more leeway, both in terms of creativity and space, I decided, at least for now, on a Media Devices applet. Some of you may have seen the ghost of this thing in svn and wondered what the dickens it is, so I'll explain to you its current functionality first, and then some of my visions for it.

This first screenshot shows the applet blank since nothing is plugged in (eventually I want it to say "no devices"). Then, for instance, you plug in your iPod (and for now, mount it outside of Amarok) and bam!

Notice a row has been added for the iPod, representing an icon for what the device is, a connect button, a disconnect button, and its mount point. Then you click the connect button and...

You guessed it, it connects (notice the iPod collection on the left). After this, you can work with it like usual, or click the disconnect button and the collection will poof away back to things as you see them in the 2nd screenshot, allowing you to eject the iPod.

The Obvious:

- This is what I would call alpha. Yes, the icons are a bit inappropriate and admittedly borrowed, but I'm sure I can get someone magnificent to create beautiful specialized icons later on (*wink wink*)
- There are still advanced features missing (like showing battery % etc.), but again, this can come later without much trouble once the base concept gets off the ground
- Usability! How will people know to go open the media devices applet the first time they try out Amarok with their device? I'm thinking to have the applet open itself on detecting a compatible device for the first time and getting focus to get the user's attention

The Vision:

So back to the stale and orphaned concept. In 1.4, you had to look at orphaned/stale tracks along with your "normal" tracks in the media browser. Now, you could have a scrollable list each of the stale and orphaned tracks, with the same functionality as before, but now it's not in your way! You can continue to browse through your iPod tracks and the orphaned/stale tracks at the same time.

The conclusion:

Well this all sounds quite well and dandy, but if I have a good idea of how this is going to work, and basic functionality for connect/disconnect is already implemented on my personal box, why don't I commit and get all the rest of the bells and whistles going? The same lame excuse: life is busy. Also I'd like to commit it in a slightly prettier more usable form with less of the obvious bugs in there.

That said, if anyone out there wants to help out with this, let me know, and I can even guide you through the code to get you going. For now though, I'll chug away at it in my spare hours.