Saturday, August 23, 2014

Plex + FLIRC + harmony

Here's my account on how I went about configuring the Plex Home Theater with FLIRC and a harmony ultimate.

I decided to have a look at PLEX since i'm going to be moving to an apartment where the PC will be connected directly to the TV. Since it will be directly connected, I won't be using my streamer, and I thought I should look into using a nice looking media player/server.

Already having a harmony ultimate remote, I looked around for various ways to get it to control the PLEX Home Theater, and i decided on FLIRC.

FLIRC is a cool piece of USB driven hardware that translates IR (Infra-Red) signals to keyboard clicks. Since it does the translating for you, it means the PC/Streamer or whatever you're using it on doesn't need to know anything about IR translation, It gets normal keyboard inputs as if from a regular keyboard.

In order to configure the harmony remote to control PLEX I used the old approach that doesn't include the FLIRC-PLEX profile in the harmony remote. Using this approach, we configure the harmony with a device that has a lot of IR codes that are different from one another. This approach lets me do all sorts of things with keyboard shortcuts, namely using AutoHotKey (AHK) to configure commands not in the PLEX command list.
Here's a word document with my mappings using the Panasonic TC-P65VT30 device in the harmony remote:

About the AHK scripts:
The script that directly affects PLEX, and is aptly named StartPlex.ahk, always runs on the PC (it is in my startup folder) and the extra keyboard shortcuts in it do this:
Alt-Shift-F10 - opens the plex client (theater)
It expects the PLEX Home Theater to be in:
“C:\Program Files (x86)\Plex Home Theater\Plex Home Theater.exe”. if it is not in the same location on your PC, change the ahk file and recompile it to create the executable (literally 2 clicks once you have AHK installed).

other than this one script, i urge you to have a look at my other scripts since they may fit your particular case as they did mine (posted here: http://programming-headbanging.blogspot.co.il/2015/06/awhile-ago-i-wanted-to-find-way-to.html)
. Things such as changing the PC volume automatically when starting PLEX, or changing the PC resolution with a keyboard click.
All my scripts are updated in this post:
 Now, all that's left is to sit back, click the PLEX activity on the remote and watch TV till we drop.


Debugging Tools

Here are a few very useful tools I've run across during my time programming:


Beyond compare (also for MAC, woohoo)
I find beyond compare to be the best compare tool around, so i was ecstatic when i found they finally had a MAC version as well:


Adding colors in XCode debug log


LogExpert. Perhaps the best freeware log tail tool around. Too bad it is only for windows


Using the MAC firewall to block ports/IPs (Up to Yosemite unfortunately)
Blocking port $1:
Sudo ipfw add deny tcp from any to any src-port $1
sudo ipfw add deny tcp from any to any dst-port $1

You will see after each line the rule number. To unblock:
sudo ipfw delete 200
sudo ipfw delete 100


XCode breakpoint in nested projects
How to add breakpoints in XCode for projects included in another project:
1.     Add the breakpoint in the nested project, then go to the breakpoints tab, right click the breakpoint you want, click move to -> user. After this step, the breakpoint will be visible in all projects which are open under "User".
2.     It is also possible to add a breakpoint through the lldb:                        (lldb) b client.m:42


Getting the most out of the MAC's magic mouse
better touch tool for MAC - http://www.boastr.net/


MAC Outlook email attach through a file's context menu


github chrome plugin
https://chrome.google.com/webstore/detail/octotree/bkhaagjahfmjljalopjnoealnfndnagc


Multiple Eclipse instances on a MAC
A plugin for eclipse on MAC that allows you to launch more than one instance:
1.       First install the eclipse marketplace:
2.       Help --> Install new Software… --> Add --> http://download.eclipse.org/mpc/indigo/


3.       Help --> Eclipse MarketPlace --> Search: OS X Eclipse Launcher