Also not meaning to be a jerk, but that file has a thousand line switch statement. For the love of all that is holy, won't someone think of the children?!
In due course, I'll probably re-write large parts of it, and make it more... "clean", but this really was a quick project hacked out in my spare time over a couple of weeks.