Wednesday, August 15, 2007

One area in which iTunes is sorely lacking is the ability to automatically recognize changes to the physical song files within the library and update itself accordingly. Windows Media Player (and most other media players on the face of the planet) do this naturally. A new file arrives somewhere under C:\Users\Kevin\Music and WMP automatically updates the library to reflect the addition. Likewise when deleting files. 

I recently equipped all members of Casa dé Hambone with iPods of some fashion. The kids each received an iPod Shuffle. Mrs. Hambone received an iPod Nano. And I traded in a non-working 40GB iPod for an iPod Nano as well.

My challenge was to automate the process of importing songs into a secondary iTunes library. I wanted to rip CDs from the comfort of my desk and have the songs automatically appear within iTunes on my wife's computer. Furthermore, I wanted to rip the CDs to WMA using Windows Media Player and have iTunes convert them to AAC on the import.

Oddly enough, Apple provides an entire COM-based iTunes SDK that enables you to extensively automate iTunes, including the conversion process. I must say that I'm really impressed that Apple has gone to this extent, especially on a Windows system.

For my purposes, the iTunesAppClass.ConvertFiles2 method seemed like just the method to use. As you can drag and drop an entire list of WMAs into iTunes, and iTunes will gracefully begin a batch conversion process, it only made sense that this method was exactly the thing for which I was looking. The only "problem" was the ConvertFiles2 method signature:

iTunesConvertOperationStatus ConvertFiles2(ref object filePaths)

Huh? It would make sense that ConvertFiles2 would take an array of strings, but a ref object? Attempting to pass an array of strings to ConvertFiles2 - as if I by sheer willpower I expected this to work - results in a "cannot convert from string[] to ref object" error at compile time:

string[] files = new string[] { ... };
iTunes.ConvertFiles2(files);

And trying to cast an array of strings to a ref object on method call results in "A ref or out argument must be an assignable variable" at compile time:

string[] files = new string[] { ... };
iTunes.ConvertFiles2(ref ((object) files));

Not a good sign.

So what to do? Well, it turns out that with casting prior to the method call, we can coerce an array of strings into an object and then pass a reference to that object:

string[] files = new string[] { ... };
object filesAsObject = (object)files;
iTunes.ConvertFiles2(ref filesAsObject);

In this instance, I believe I'm fortunate that ConvertFiles2 does not actually modify its incoming list of files. Instead, we see a less-than-stellar method signature resulting from COM interop and there's not much we can do about it, but it does work.

The result is a Windows application which sits politely in the Taskbar Notification Area waiting for new WMA files to arrive and then, en masse, hands them over to iTunes for conversion to AAC. I can now rip kid-friendly music from my comfy chair to a shared drive on the casadehambone.com network and have it magically appear within iTunes on my wife's computer where it is then synchronized down to the kids iPods.

Near nirvana.

I'll gladly post the application and its source code as soon as I can come up with a name for this handy little application. All of the usual suspects (iTunesCommander, iTunesImporter, iTunesAgent) seem to already exist. Any ideas?

Technorati Tags: , , , ,
Wednesday, August 15, 2007 12:11:51 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [1]  | 
 Thursday, August 09, 2007

I've been monitoring the DasBlog developers discussion list the past few days and the topic of which AJAX platform to choose for use with DasBlog came up.

Why? Why does a blog site need AJAX? What is it that causes people these days to embrace AJAX - even just a little - for all sorts of causes that really don't need AJAX?

Don't get me wrong. I'm not saying that there is no need for AJAX or that you shouldn't use AJAX for creating "new and compelling" Web sites. Facebook is a good example of a site that uses AJAX in what I feel is a proper amount to make the user experience better, but it does not sell out in favor of doing AJAX for everything just because they can.

There are clearly places where I don't think the AJAX model provides a lot of benefit. For example, consider "live comment preview." You can see an example of it by leaving a comment on Scott's blog. Again why? Is the fact that I'm typing in a text box and likely reading what I'm typing insufficient? Do I really need to spend time formatting my comments with angle brackets and attributes? What benefit is there to me seeing in two places on the same screen the information that I'm typing?  Certainly there is a place for WYSIWYG editing on a web page, but I don't believe that comments are where it's at.

When you consider a blog, your objective as the consumer is to primarily read information and occasionally comment on information. There's really nothing in that interaction that benefits from AJAX. In this capacity a blog is a "read mostly" site. +1 if most of your readers use some sort of aggregator. If you're the blog owner you may be inclined to add posts via the web rather than a client such as Windows Live Writer or Word 2007. Even so, I firmly believe that AJAX has limited benefit to you as the primary - and oftentimes sole - contributor  to the blog. Can you really not live with a full page post back?

Now when you consider applications such as Outlook Web Access, Hotmail, Gmail, Google Reader, Virtual Earth, Google Maps, etc., a compelling case for AJAX is easily made. Certainly the focus of these applications benefits greatly from AJAX. But incorporating AJAX into a site just because its the cool Web 2.0 thing to be doing doesn't mean you should.

Technorati tags:
Thursday, August 09, 2007 1:11:54 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Wednesday, August 08, 2007

To date, I've avoided social networking sites like My Space, twitter and, until recently, facebook. However, that all changed today with me joining facebook and incorporating iLike into my facebook page for the sole purpose of discovering new music.

Finding New Music

Today Dave and I were discussing the difficulty of finding new music that I like. My current usage pattern is that I use the iTunes store to find music, typically by browsing by genre, and then I head over to Zune Marketplace to actually purchase the music. But when I think socially about how I explore music, it's usually through friends, coworkers and customers that mention in passing some piece of music they have really enjoyed - and is typically the more accurate method of finding stuff I really like.

In both cases, my Zune Pass makes it really easy to sample the music and listen to it indefinitely on my Zune or purchase it outright if I want to keep it forever.

And, in both cases, neither is ideal. Maybe social networking in a Web 2.0 world is the right answer ...

Enter iLike

In the context of my conversation with Dave and one of the members of the Zune team, the subject of facebook and iLike came up. iLike is a social networking site that works with the published favorites of others to cross-sell recommendations on music for you. And it plugs directly into facebook. iLike links directly to the iTunes store so you can purchase the music directly and is fantastic if you're an avid purchaser of music from iTunes. Unfortunately, there's no support for Zune Marketplace ... but just the discovery of music relationships via artists, albums and songs is sufficient for me to find the music on Zune Marketplace and expand my personal library.

Join Me on facebook

So, come on over and join me on facebook! Make sure to add the iLike application to your facebook page and let's share our music preferences. I'm anxious to see what else is out there that I'm missing.

Technorati Tags: ,
Wednesday, August 08, 2007 4:55:16 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Wednesday, August 01, 2007

image Either I'm an idiot, have reached the pinnacle of male pattern blindness or the designers of the URGE interface for Windows Media Player have made it next to impossible to stop the download process.

I started downloading a playlist and watched URGE and Windows Media Player respond to my request, filling my Music folder with more than 300 songs. About 50 songs into the process, I decided that I did not want to pollute my library with a ton of random songs and figured I'd just stop the downloading process. Except by now, I had navigated away from the downloading playlist and could not find anything in Windows Media Player or URGE to tell me what was downloading so I could cancel it. All I could do was watch my Music folder continue to fill up.

imageNavigating back to the playlist in URGE I found displays that the tracks are downloading - so it would seem that as long as I can remember where I started, I can find out what I'm bringing down ... but there is no option I can see to stop the process! Near as I can tell, I'm held hostage to the downloading process and now that it is (finally) finished, I can begin the process of cleaning up my Music folder.

Am I completely clueless and overlooking some simple option here?

image I have to give Zune props in this department, as marketplace provides an active downloads list and right-clicking on any active download provides a Cancel Download option. But try as I might, no amount of right-clicking, head banging, screaming or yelling could get URGE to stop the pollution of my Music folder.

Right now, my urge is to cancel URGE and continue to use Zune - as much as I hate the idea of yet-another-media-player on my machine.

Wednesday, August 01, 2007 10:05:00 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |