I didn’t do much game programming this month, but it wasn’t a complete waste of time. In fact, I started my first open-source project on sourceforge! It’s called DiscInsert, which is just about the most uncreative name I could come up with, but hopefully it will serve some people well.
I wanted a program that could rip DVDs to my HTPC as soon as they were inserted—without any interaction from the user. It seemed simple enough to me, really. It would just need to have a set of ripping locations defined, and be able to connect to the Internet and download the title of the inserted DVD from some database. Then, when it comes time to rip a DVD, it chooses the first output location available with enough free space, appends the DVD title to it, and passes it all off to a command-line DVD ripper. It would also be nice if the program could display a “Play” button as well for a little bit, just in case you only want to play the DVD instead of ripping it. And since this application would be so well-suited for an HTPC, why not show the box art of the DVD and do it all with a nice and easy-to-use 10ft interface?
So that’s what I did. The only hard part really was finding a way to retrieve the DVD info from some online database. IMDB has no interface or API for this, Amazon is finicky and doesn’t always get the right DVD info, and there’s no open-source database for DVDs like there’s freedb for CDs. Then it dawned on me: Windows Media Player retrieves DVD info somehow, and there’s a Windows Media Player COM object. Why not check that out and see what it can do? Sure enough, Microsoft is apparently letting developers utilize their DVD database through the WMP dll.
Unfortunately, I couldn’t find a way to retrieve box art using the Media Player object. It seems like it should be able to since Windows Media Player can, but as far as I could tell there just isn’t a way (let me know if you’ve found one!). Box art is just eye candy anyways, though. It’s not really essential to get the right box art like it is to get the right DVD title, so I figured it was acceptable to pass this off onto Amazon. So once the correct DVD title is retrieved with WMP, DiscInsert uses it to do an Amazon search and retrieve the DVD box art. It works pretty well most of the time, and who really cares if you get the box art for the Kill Bill Box Set when you put in Kill Bill Vol. 1 anyways?
After the DVD info is retrieved, the program displays it along with nice, big and shiny “Rip” and “Play” buttons. You can also configure a timeout so the DVD will just automatically start ripping or playing after a certain amount of time.
The actual ripping and playing are passed off to whatever programs you want. You just configure a command line to be executed, and include placeholders for things like the retrieved DVD title, the first output location with enough free space, the letter of the DVD drive, etc.
Configure Windows to use DiscInsert as the DVD AutoPlay handler, and voila! You can now rip a DVD just by inserting it, with no other interaction whatsoever. You don’t even need to have your monitor or TV on!
I also decided to make DiscInsert open-source and put it up on sourceforge.net. It’s nice to give a little something back to the open-source community when I’ve gotten so much from it already, and I was really impressed with how much sourceforge provided for me at no cost. As soon as my project was approved, I had free web-hosting, a subversion repository, forums, support/bug ticket trackers, a task manager, a news server, MySQL databases, and shell access to a linux server—all setup and ready to go, and all for free.
The only hard part about making DiscInsert open-source was understanding, choosing, and implementing an open-source license. I ended up going with the GPL, and it all makes pretty good sense now that I’ve gone through it all. It was just a little time consuming for something I had never put much thought into before.
Anyway, so that’s what I’ve been doing with my spare minutes this month. Sorry no more updates on game development stuff, but hopefully you’ll find DiscInsert useful! Give it a look over on sourceforge!
Recent Comments
No comment yet...