Author Topic: remote control xmplay from android phone  (Read 2850 times)

nod5.

  • Guest
remote control xmplay from android phone
« on: 9 Mar '11 - 23:41 »
I just got it working. Here's how:

1. install premotedroid on android phone
https://market.android.com/details?id=org.pierre.remotedroid.client
2. install premote server on computer http://code.google.com/p/premotedroid

3. in premotedroid on phone, set up new wifi connection (enter your wifi details)

4. in xmplay > options > shortcuts, create some unusual keyboard combination shortcuts for 5 actions. For example:

(make the shortcuts global)
ctrl+alt+shift+y  -- current track - play pause
ctrl+alt+shift+u  -- change track - prev
ctrl+alt+shift+i  -- change track - next
ctrl+alt+shift+o  -- DSP - vol up
ctrl+alt+shift+p  -- DSP - vol down

5. install the scripting language autohotkey
http://www.autohotkey.com/

6. save the below code as premote.ahk (if you added other shortcuts keys in xmplay then first edit the sendinput code; see http://www.autohotkey.com/docs/commands/Send.htm ). The script, when running, "reroutes" all mouse clicks/scrolls to instead send the xmplay shortcuts keyboard combinations.
Code: [Select]
LBUTTON:: sendinput !^+y ;PAUSE
MBUTTON:: sendinput !^+u ;PREV
RBUTTON:: sendinput !^+i ;NEXT
WheelDown:: sendinput !^+o ;VOL DOWN
WheelUp:: sendinput !^+p ;VOL UP
^escape:: exitapp ;control esc to exit
7. run xmplay, turn on wifi, run premotedroid server, run premote.ahk (doubleclick).

Now you can control xmplay with the mouse buttons + scrollbar (right edge of of the screen in premotedroid on the phone).

note: to exit script and restore standard mouse button functionality on the computer do ctrl+escape on the computer keyboard. Or ctrl+rightclick the scripts trayicon and ctrl+leftclick "exit".

raina

  • Posts: 1163
Re: remote control xmplay from android phone
« Reply #1 on: 10 Mar '11 - 07:34 »
Haha, wow. Seems like quite a hack but also pretty cool. Sadly no wi-fi on the PC so can't try it at the moment.

Ian @ un4seen

  • Administrator
  • Posts: 20437
Re: remote control xmplay from android phone
« Reply #2 on: 10 Mar '11 - 16:06 »
I think it should be possible to implement that without needing to setup funky global shortcuts, by instead posting messages to XMPlay. Something like this should do it...

Code: [Select]
LBUTTON:: PostMessage 0x41a, <key>, 0,, ahk_class XMPLAY-MAIN
...

Where "<key>" is one of the shortcut codes, a list of which can be found here...

   http://support.xmplay.com/article.php?id=17

nod5.

  • Guest
Re: remote control xmplay from android phone
« Reply #3 on: 10 Mar '11 - 16:42 »
Nice, that simplifies things. Step 4 can now be skipped by using this updated code for step 6:
Code: [Select]
LBUTTON:: PostMessage 0x41a, 80, 0,, ahk_class XMPLAY-MAIN ;PAUSE
MBUTTON:: PostMessage 0x41a, 129, 0,, ahk_class XMPLAY-MAIN ;PREV
RBUTTON:: PostMessage 0x41a, 128, 0,, ahk_class XMPLAY-MAIN ;NEXT
WheelDown:: PostMessage 0x41a, 513, 0,, ahk_class XMPLAY-MAIN ;VOL DOWN
WheelUp:: PostMessage 0x41a, 512, 0,, ahk_class XMPLAY-MAIN ;VOL UP
^escape::exitapp

raina: premotedroid also has bluetooth support but I haven't tried it.

nod5.

  • Guest
Re: remote control xmplay from android phone
« Reply #4 on: 10 Mar '11 - 18:31 »
one more update:
Code: [Select]
LBUTTON & WheelUp:: PostMessage 0x41a, 82, 0,, ahk_class XMPLAY-MAIN ;longpress lbutton then scroll up to fast forward in track
LBUTTON & WheelDown:: PostMessage 0x41a, 83, 0,, ahk_class XMPLAY-MAIN ;longpress lbutton then scroll down to rewind in track

Premotedroid also can show screen captures of the PC screen. So you can see the Xmplay playlist window.