Control Windows Media Player over Velbus

I just updated my Velbus Flex Socket with a Media Player module.

http://www.stogo.net/varia/velbus/velbus_playlist.jpg

This lets me scoll through my Media Player playlists, play a playlist, control the volume of my receiver and show the status (playlist name + current playing artist and song name) on the display of the VMB4PD.

See this video for a demo.

To let this work I had to connect some tools:

[ul]
]To connect to the Velbus I start Velbuslink.exe in Server mode (Velleman, please help me out with this issue:frowning: ). /:m]
]I wrote an Adobe Flex tool that connects to this server using a socket connection. This tools listens the buttons of my 2 VMB4PD’s. (details further on)/:m]
*]Alll settings are stored in an xml file:

<playlist> <extension>wpl</extension> <folder>D:/Documents of Gert/Music/Playlists/</folder> <empty>D:/Documents of Gert/Music/Playlists/No Audio.wpl</empty> <mediaPlayer>C:/Program Files/Windows Media Player/wmplayer.exe</mediaPlayer> <statusInfo>C:/Program Files/Windows Media Player/plugins/Now Playing/data.xml</statusInfo> <displays> <playlistNameInfo address="10" lcdLineNr="3" lcdMask="|@@@@@@@@@@@@|+" /> <nowPlayingInfo address="10" lcdLineNr="4" lcdMask="o|@@@@@@@@@@@@|-" /> <playlistNameInfo address="11" lcdLineNr="3" lcdMask="|@@@@@@@@@@@@|+" /> <nowPlayingInfo address="11" lcdLineNr="4" lcdMask="o|@@@@@@@@@@@@|-" /> </displays> </playlist> /*:m]
]First it scans for a folder to find all playlists/:m]
]One playlist is an empty one and is ‘played’ to stop the audio/:m]
]To show the current playing artist/song I read out an xml file that is kept up to date by a WMP plugin called “Now Playing”. (url) It’s not free, but it does it’s job quite good for only 15$./:m]
]To update the right parts of the display I added a masking system which specifies what LED chars need to be updated. /:m]
*]The settings part that specifies the actions for the buttons looks like this:

<commands address="10" buttonNr="4" press="true" repeatOnLongPress="false"> <command type="run" showWindowFlag="0"><![CDATA["C:\Program Files\IRTrans\IRClient.exe" localhost gert "input video1"]]></command> <command type="playlist">nextPlaylist</command> </commands> <commands address="10" buttonNr="5" press="true" repeatOnLongPress="true"> <command type="run" showWindowFlag="0"><![CDATA["C:\Program Files\IRTrans\IRClient.exe" localhost gert "vol up"]]></command> </commands> <commands address="10" buttonNr="6" press="true" repeatOnLongPress="false"> <command type="run" showWindowFlag="0"><![CDATA["C:\Program Files\IRTrans\IRClient.exe" localhost gert "receiver off"]]></command> <command type="playlist">loadEmptyPlaylist</command> </commands> <commands address="10" buttonNr="7" press="true" repeatOnLongPress="true"> <command type="run" showWindowFlag="0"><![CDATA["C:\Program Files\IRTrans\IRClient.exe" localhost gert "vol down"]]></command> </commands> /*:m]
]As you can see I also use a tool called IRTrans (url) to send IR commands to my receiver: to put the receiver on/off, set the input channel to PC, and to increase/decrease the volume. This tool, combined with its corresponding usb device does a really excelent job for about 120$. /:m]
]To controll the volume I added a parameter repeatOnLongPress=“true”. This will keep sending the command if a button is pressed and hold. Very usefull to control the volume./:m]
]The parameter showWindowFlag=“0” can be set to visible(1) or unvisible(0) and will show/hide the program that is executed. Eg: executing the command IRTrans.exe pops up a DOS prompt, so so showWindowFlag=“0” is used to hide the DOS box./:m]
]I still have to tweak some things: display updates are rather slow (writing to velbus module memory), so I’ll have to find an alternative there./:m][/ul]

That’s about it. As always I will share the code at Google Code within some days.

Nice application…

The source code and downloadable exe is now available on Google Code at code.google.com/p/flexvelbussocket/