INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Linux /MCC and other commandline controls?  (Read 3593 times)

Hilton

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1291
Linux /MCC and other commandline controls?
« on: April 18, 2015, 06:27:15 am »

Is there any support for /MCC or commandline to control MC playback volume etc from scripts?
I'm remapping some Bluetooth remote keys with Xbindkeys to make MC on Pi controllable via BT remote.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 71498
  • Where did I put my teeth?
Re: Linux /MCC and other commandline controls?
« Reply #1 on: April 18, 2015, 07:05:29 am »

It should be working.  It's documented here:
http://wiki.jriver.com/index.php/Web_Service_Interface
Logged

Hilton

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1291
Re: Linux /MCC and other commandline controls?
« Reply #2 on: April 18, 2015, 07:07:47 am »

Thanks Jim but Im trying to remap keys on the Linux desktop to send MC20 /mcc commands in Linux and there doesn't appear to be a MC20.exe like there is in windows. Unfortunately MCWS doesn't help me.

Logged

Hilton

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1291
Re: Linux /MCC and other commandline controls?
« Reply #3 on: April 18, 2015, 07:32:25 am »

This is what I'm trying to do to get a Bluetooth remote to control MC20 on Linux because the default media keys aren't being picked up.

XF86Audio is an industry default for media playback keys across platforms from my understanding.

I can scan and get the keypress showing up I just want to remap it to native MC20 commands.
I've included one example of what it might look like if it was available.  I tried using MCWS web commands but they don't work unfortunately. I need to use commandline driven commands which is what MC20.exe exists for in windows with the /mcc switch.

If there's another way to do this I'd love to know!


Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 71498
  • Where did I put my teeth?
Re: Linux /MCC and other commandline controls?
« Reply #4 on: April 18, 2015, 07:41:49 am »

I don't know the answer, but search for the other MC binary executables.  It is possible one is in a directory like /bin or /usr/bin.  Bob will know, but he's probably sleeping.
Logged

Hilton

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1291
Re: Linux /MCC and other commandline controls?
« Reply #5 on: April 18, 2015, 07:47:47 am »

Thanks Jim

mediacenter20 is under /usr/bin but there's no sign of a mc20 executable.
My guess is it's a little more complicated on Linux or the guys just haven't gotten around to it.

Cant use the mediacenter20 as it segfaults and isn't designed to send commands to another instance already running.

I'll leave it with the guys I don't think there's much I can do. Maybe they could just enable media controls in Linux so I don't have to do this workaround? :)
Logged

Hilton

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1291
Re: Linux /MCC and other commandline controls?
« Reply #6 on: April 18, 2015, 08:42:37 am »

I ran xev on the Pi2 to capture the key events from standard media keys on a keyboard directly attached to the Pi2.

I dont know if it helps the guys to implement media keys in Linux but here you go anyway.

http://www.x.org/archive/current/doc/man/man1/xev.1.xhtml

Play

Code: [Select]
KeyPress event, serial 43, synthetic NO, window 0x2a00001,
    root 0x101, subw 0x0, time 4843365, (-795,-90), root:(816,189),
    state 0x0, keycode 172 (keysym 0x1008ff14, XF86AudioPlay), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 46, synthetic NO, window 0x2a00001,
    root 0x101, subw 0x0, time 4843589, (-795,-90), root:(816,189),
    state 0x0, keycode 172 (keysym 0x1008ff14, XF86AudioPlay), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False


Next

Code: [Select]
KeyPress event, serial 46, synthetic NO, window 0x2a00001,
    root 0x101, subw 0x0, time 4855366, (-795,-90), root:(816,189),
    state 0x0, keycode 171 (keysym 0x1008ff17, XF86AudioNext), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 46, synthetic NO, window 0x2a00001,
    root 0x101, subw 0x0, time 4855526, (-795,-90), root:(816,189),
    state 0x0, keycode 171 (keysym 0x1008ff17, XF86AudioNext), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

Prev

Code: [Select]
KeyPress event, serial 46, synthetic NO, window 0x2a00001,
    root 0x101, subw 0x0, time 4857223, (-795,-90), root:(816,189),
    state 0x0, keycode 173 (keysym 0x1008ff16, XF86AudioPrev), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 46, synthetic NO, window 0x2a00001,
    root 0x101, subw 0x0, time 4857463, (-795,-90), root:(816,189),
    state 0x0, keycode 173 (keysym 0x1008ff16, XF86AudioPrev), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

Stop

Code: [Select]
KeyPress event, serial 46, synthetic NO, window 0x2a00001,
    root 0x101, subw 0x0, time 4861703, (-795,-90), root:(816,189),
    state 0x0, keycode 174 (keysym 0x1008ff15, XF86AudioStop), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 46, synthetic NO, window 0x2a00001,
    root 0x101, subw 0x0, time 4861911, (-795,-90), root:(816,189),
    state 0x0, keycode 174 (keysym 0x1008ff15, XF86AudioStop), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False


Vol+
Code: [Select]
FocusOut event, serial 46, synthetic NO, window 0x2a00001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 46, synthetic NO, window 0x2a00001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 46, synthetic NO, window 0x0,
    keys:  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   


Vol-

Code: [Select]
FocusOut event, serial 46, synthetic NO, window 0x2a00001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 46, synthetic NO, window 0x2a00001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 46, synthetic NO, window 0x0,
    keys:  2   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   


Mute

Code: [Select]
KeyPress event, serial 46, synthetic NO, window 0x2a00001,
    root 0x101, subw 0x0, time 4870040, (-795,-90), root:(816,189),
    state 0x0, keycode 121 (keysym 0x1008ff12, XF86AudioMute), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 46, synthetic NO, window 0x2a00001,
    root 0x101, subw 0x0, time 4870184, (-795,-90), root:(816,189),
    state 0x0, keycode 121 (keysym 0x1008ff12, XF86AudioMute), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False
Logged

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13533
Re: Linux /MCC and other commandline controls?
« Reply #7 on: April 20, 2015, 12:46:26 pm »

There isn't a stub executable to send MCC commands for linux.

The media keys could be implemented.
Logged

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13533
Re: Linux /MCC and other commandline controls?
« Reply #8 on: April 20, 2015, 04:27:55 pm »

Looks like volume up and down don't have keysyms?
Logged

Hilton

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1291
Re: Linux /MCC and other commandline controls?
« Reply #9 on: April 20, 2015, 06:17:13 pm »

Yeah I thought the vol keys were strange, the BT remote gave proper XF86AudioVol keysyms though so maybe it's just that keyboard vol is a bit different.

Logged

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13533
Re: Linux /MCC and other commandline controls?
« Reply #10 on: April 21, 2015, 06:24:06 pm »

I'm just about to upload a build with these enabled.
On my xfce desktop, the volume keys are getting intercepted by the window manager.
On the pi2 lxde they pass through to MC.
All of the other keys (play/pause, stop, next, previous) work as expected.
Logged

Hilton

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1291
Re: Linux /MCC and other commandline controls?
« Reply #11 on: April 21, 2015, 06:34:52 pm »

You Da MAN! :)
Logged
Pages: [1]   Go Up