Sunday, October 09, 2011

Screen Switching Custom Remote for Unified Remote


Screen Switching Custom Remote for Unified Remote
Before you do anything else have a look at the video below. If you like what you see you should read on.


The Setup
I have a setup where the computer in our study is also serving as a media PC in our bedroom.
In the study it has two screens and the third screen is the bedroom 42" LCD TV connected via HDMI.

The sound moves automatically between the study and the bedroom when switching screens since I have set the main sound source in windows 7 to be the HDMI sound source in the TV. This means that as soon as HDMI is activated the default sound source changes from the analogue source in the study to the HDMI source in the bedroom TV. I am using an ATI card so I don't know if it works the same way for Nvidia cards.

We are using http://www.unifiedremote.com/ to control the PC from my Android phone. http://www.boxee.tv/ serves as our media centre.

The Problem
In study mode the two screens are used in extended mode. When moving the to the bedroom TV we are running in single HDMI screen mode. To move the picture from the study to the bedroom I use the Windows 7 command "win + p" and after that I need to pick the "computer only" mode. To move it back to the study again I need to do the same but pick the option "projector only". This is all quite confusing if you don't know how it works and do it every day. Sometimes I forget to move the output from the study to the Bedroom and I have to go back up in to the study to move the output over to the bedroom TV before we can start watching a film. 

The solution
Recently Unified Remote released custom remote functionality http://www.unifiedremote.com/custom. This means that you can create your own remote control profiles utilising XML files and png images. That looked like the perfect solution to my problem.

So here is how it is done:
  1. Create a custom icon for the screen switching remote profile in Unified remote. You can find the icons for unified remote here http://wiki.unifiedremote.com/w/index.php?title=Remotes:Icons just pick one and edit it in your favourite image editor. Save it with a new name in the folder C:\Program Files (x86)\Unified Remote\Remotes\Custom. 
  2. Create the XML file for the screen switching remote profile. First make sure you have a decent XML editor. I use the built in one for Eclipse Indigo. It might be overkill but since I use it for my normal development so it will do just fine. 
The best way to do this is to start from the template remote http://www.unifiedremote.com/Downloads/v2/custom/Template.xml.


The only problem I had was that the command I was running in the actions did not execute properly. This was because the commands were fired off without a pause in between. Unified remote solved that nicely by giving us the option to use the pause utility. I set it to 500 milliseconds and it seems to work just fine.


If you decide to download the code and copy it in to your custom remote folder you need to restart the Unified remote server before it appears in your list of remotes.

I hope you like it and you find it useful.

1 comment:

  1. Hi, I'm unsure if you are still involved with Unifiedremote, but I am using it to control both my PLEX app and EyeTV app which are installed on my Mac Mini in the Home Theater. As you seem very well versed in coding, I was hoping you can answer a couple of questions if you would not mind. I do realise there are remotes for both mentioned above but what I was wanted to do was a simplified version of both whereby buttons could direct me to either app.

    In addition, I wanted to incorporate a filed whereby one line comes up with the name of the program being played, and another line showing the progress of the episode as it is being played. I have manged to recode the remotes to what I want them to look like and action them, but I cannot work out how to add the additional, or even if it is possible. I am new to this, old, but very interested in giving it a go.

    Lastly, I also cannot work out how to increase either the text or icon size. I use a iPad, and they seem small. I did try making vector images and saved as .png file, then pointed to those in the code, but the vector image comes out the size of the text. Is there no way to increase the styling of the text.

    I know this is a note out of the blue, but someone like you with good knowledge can tell me if I am just wasting my time with .kml code in order to achieve what I want.

    Hoping to hear from you

    Mike

    ReplyDelete