HydrogenAudio

Digital Audio/Video => General A/V => Topic started by: batfastad on 2011-04-04 13:58:14

Title: Windows. A media playback/control API?
Post by: batfastad on 2011-04-04 13:58:14
Hi everyone

I've had a custom-build HTPC connected to my HDTV and surround sound receiver for a few years now. For the past 3 years it's been a mini-ITX box with a Zotac Ion board/Intel Atom CPU which is perfect. Has just enough grunt to do everything I need but with really low power consumption.

The problem is controlling the thing - I've been meaning to find a decent solution to this for years.
Currently I have a Keysonic wireless keyboard/touchpad attached so I can operate it from a sofa distance away but if I need to pause/play/stop/skip next/skip previous/volume up/volume down it really depends on what application is currently playing media as to how I go about pausing it.
I really like the idea of getting a customisable ir remote or ideally using a Wiimote controller to control it rather than using a wireless keyboard.

For video I use Media Player Classic Homecinema or VLC
For audio foobar2000 or very occassionally Winamp basic/light
So to pause video I need to press space or esc. For audio I either need to press P for foobar or C for Winamp.
I realise I could just change the keyboard shortcuts to be the same in all applications but that still feels like a bit of a cop out.

Does Windows offer some sort of central API for media control that these applications tie in with?
So I could send a pause event to the API, and any/all media clients connected to that API would receive that pause signal and instantly pause playback.

I thought of doing something in AutoIt/AutoHotKey to detect which windows were open and send the relevant keyboard commands to each media window that's open... but that seems like a horrible kludge. There must be a better way.

For example, how do media controls on keyboards and ir remotes usually work? I have a logitech keyboard at work which seems to be able to pause everything in one button press. No crazy flickering of windows whilst it triggers pause commands to each window.

If I can get a Wiimote running I'd like to build my own media player overlay with large buttons to aim at for common media operations. As well as supporting the other buttons on the Wiimote for various tasks.
The control buttons on foobar2k and other media programs are far too small to operate at any sort of distance so a Wiimote would be ideal.
I'd like my media overlay to be a global solution, without the need for program-specific settings or plugins.

Anyone know if there's some sort of media control API in windows?
Or any other methods for global control of media programs?
I'm running Windows XP and don't really want to switch to Windows Media Centre or Vista/7. And I really don't want iTunes anywhere near me as it's an embarassment to computing.

Cheers, B