Here are quick instructions to get this done and start using TagLib in your project to manipulate tag data in your music files. I had to pull this together from about 5 different places…

NOTE: This was moved to the wiki, because persistent articles belong on wikis, not blogs! 🙂

Why is this not documented well? I don’t understand why people spend man-years creating great software and then don’t bother to document it – did I just miss it somewhere? Prolly…

The latest reincarnation of Hang The DJ, my music player, is coming along nicely. In the alpha stage, it’s currently an excellent way to stream your massive music collection to your laptop.

It sits atop an open source media streamer called Ampache. I had to extend Ampache to support the more advanced features of Hang The DJ. But this extended version of Ampache still retains its full feature set.

I have plans for a full set of Hang The DJ mobile clients, but they are further down the roadmap.

In the meantime, I can still use Ampache with my iPhone in a couple different ways. There are some Ampache iPhone clients but they are rough and limited. However, Ampache by itself has a nice web interface. You can play your music by downloading, by streaming, or through a bare-bones flash player.

Flash is out on the iPhone. Downloading each song is cumbersome. But the streaming works! It’s not foolproof. The silly Safari browser on the iPhone has a ridiculously short timeout on streaming requests, something like 16 seconds, and I don’t know of any way to adjust it. So for a long time, it just didn’t seem to work for me. But following these rules, I can get to my whole music collection from my iPhone:

  • Make sure you have a decent server. I recently upgraded my server to use a quad core i7 cpu and it seems to help.
  • Make sure your upload bandwidth is sufficient, obviously. I have really crappy crappy “10Mbit” service from CenturyLink, which gives me about 20kbps upload. Hates it. But it’s currently my only option and it’s working.
  • Make sure your iPhone is in a 3G zone. Edge service through AT&T didn’t seem to work. Stupid AT&T.
  • Stream 1 song first. This is your best chance of completing the setup between Apache and Safari before timing out. Once that’s confirmed to work, slowly bump it up until you get timeouts. I can do 3-4 songs but 20 seems to fail consistently.

Yeah it’s not ideal. Just more motivation to get going on the iPhone client! 🙂

In the meantime, shoot me an email if you’re willing to try Hang The DJ out on a desktop or laptop, that would rock. Peace.

I’m using the cross-platform Qt C++ library to write an app for linux, OS X, and Windows. Qt source can be compiled to a wide range of systems and devices, with two obvious omissions that are not likely to be filled any time soon: iPhone and Android. I know I am going to need client code on these devices, and I know that the client code is going to be extremely similar to the Qt client code. How do you design for this?

Applying the concept of separation of concerns, you design your classes into layers. The base layer consists of high level concept classes that perform all fundamental actions using generic data types. Then, the derived layer is used to get the job done, using the most useful and powerful lower level tools at your disposal. Push everything you can into the base layer, until you hit the limit of non-portable information and data types. It’s a beautiful way to code.

To be more specific, in my case, the base class layer will be using C++, including the STL, which gives me tons of power. I will pull in boost if even more horsepower is needed. The derived class layer for the first round of clients will be Qt-powered. The Qt library has a massive amount of real-world usefulness, supporting everything from http to video playback. I have not gotten to the iPhone and Android clients yet so the whole concept may change, but here’s my current plan. The iPhone code will be Objective C with the C++ base class layer linked in. I will attempt to incorporate the C++ base class layer into the Android code using the NDK.

Here’s a quick example of the layer approach, in this case used to quickly set up profiling using Qt’s QTime class at the lower level: (continued…)

msysgit sucks.

Here‘s how to get it to work with your ssh key.

iTunes sucks.  I have much higher ambitions for my own software, but alas I haven’t hit the lottery quite yet.  😛  Anyway, the latest chapter of suckitude is iTunes’ pee-poor handling of remote files on a media file server.  What a $(*#@ basic need.  I can set up a samba share and see all the media files just fine from my MBP laptop.  Then I “Add to library…”, being careful not to copy the GB’s of music down to the laptop by unchecking the iTunes->Preferences->Advanced->[Copy files to iTunes Media folder when adding to library] checkbox.  It takes over an hour to scan the directory (what the HELL), and then iTunes proceeds to lock up my machine, perpetually, trying to perform [Gapless playback detection], even though I have crossfading turned off.  I get to repeat this process every time I add ONE file to my music collection.  Or rather, I don’t, as I refuse to go through ANY of this bullshit ritual.

There was a slight reprieve in the suckitude when I discovered mt-daapd (aka Firefly?), which serves up all your media from a linux fileserver over DAAP, Apple’s sharing protocol.  Wahoo, I’m back to loving you, Apple!  My media server scans regularly, serving up the files with the greatest of ease, and  iTunes is showing all my files under the SHARED tab.  Happy happy joy joy!  Until I try to drag a file to my iPhone.  Strange, it won’t work.  Well, not really strange.  Kind of predictable.  Welcome to the thin Aqua-colored veneer over Apple’s standard corporate behavior.  Puke.

I’m mostly bitter because I certainly should have developed a better way by now.  Shutting up and dusting off the old drawing board…