iTunes event handling

I’m looking for some functionality within either AppleScript, Cocoa, or Carbon that will allow me to do some event handling for iTunes. Essentially, I would like to know when iTunes plays or stops so that I can use iTunes as a front-end for music on my linux machine. I have gone through the iTunes dictionary, as well as the Python module generated by in MacPython, but haven’t found anything. I know that there must be some sort of a message/event because iTunes has to let the visualizer know when it starts or stops. Running AE Monitor has not provided any information either.

In short: is there an equivalent to OnPlayerPlayEvent and OnPlayerStopEvent from the iTunes COM SDK for Windows? I’ve looked at some scripts that have similar behavior (activation on play/stop) but these seem to sample the iTunes player status at some interval, which seems like a very inefficient way of doing it.

This is the only way actually, though beta, unless you are a geek and able to hack iTunes: