When you press e.g. the pause key, the Mac OS will send that to whichever running application is playing media. How can I programmatically find out what application this is? And is there any other information available, such as the name of the currently playing media?
I'm looking for a command line tool, an API, or a scripting interface; I'm not picky.