A smarter audio manager

Here's what I typically do in the course of a day.

  • Start iTunes, play some new songs while I code, read email, and surf the web

  • About every 15min or so, I run across a youtube video, mp3 link, or vimeo post that I want to watch, so I...

  • pause iTunes, let the video/music play in my browser, then return back to what I was doing

Here's the rub: anywhere from 10 minutes to 2 hours later, I'll realize I've been sitting in a room wearing headphones with nothing coming out of them. I don't mind it, but I do wish I could have an app that could manage iTunes automatically for me.

This is my wish: I start playing iTunes music, surf along while some magical app watches my sound output. When something else sends output to the soundcard (I'd have to disable iChat message alerts), hit pause in iTunes for me, then when the soundcard is clear, push play on iTunes automatically (maybe with a bit of cross-fading to bring it up smoothly).

Is this impossible? I think I've seen something like this before -- it doesn't seem like it'd be impossible for a computer to manage for me.