Author Topic: using payloads with version 0.79 of Vox Commando  (Read 3478 times)

0 Members and 1 Guest are viewing this topic.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
using payloads with version 0.79 of Vox Commando
« on: August 03, 2010, 10:34:02 AM »
because VoxCommando now lets you create multi action macros for a single command, we now have to be explicit about how to use payloads.

We inject payloads into any command with the following syntax:

 {n}

where n is the number of our payload.  so if we created a command with:

 phrase "move"
 payload list "up, down, left, right"
 payload range (1,20)

if we then say:  "move up 15"

we would be able to inject the up into any action using {1}
we would be able to inject the 15 into any action using {2}

and you can reuse these "variables" in multiple actions within the command macro.  so you could send the 'up' keypress fifteen times1 and get the TTS to say "moving {1}, {2} times" and you would hear her say "moving up 15 times"

note: using optional payloads could cause problems here... needs more testing.

1: actually doing an action 15 times is not yet possible but soon!

Shodan

  • Jr. Member
  • **
  • Posts: 8
  • Karma: 0
    • View Profile
Re: using payloads with version 0.79 of Vox Commando
« Reply #1 on: August 15, 2010, 10:26:05 PM »
I can not get the move payload to work correctly. I can get it to send out the command ie XBMC:move(down, 3) but I just get a html error.

sending this command to xbmc: http://192.168.1.101:8080/xbmcCmds/xbmcHttp?command=move(down, 3)
XBMC: <html><li>Error</html>

regards

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: using payloads with version 0.79 of Vox Commando
« Reply #2 on: August 15, 2010, 10:48:54 PM »
I think the only move command for the xbmc http api is for moving a zoomed image in the slideshow mode:

Move(deltaX, deltaY)

see this reference:

http://wiki.xbmc.org/index.php?title=Web_Server_HTTP_API

if you want to move the cursor (with the same effect as hitting arrow keys on your keyboard or remote) you need to send action(#)

if you are using a web browser you would use this:
http://192.168.1.101:8080/xbmcCmds/xbmcHttp?command=action(4)

if you are creating an action in VoxCommando (version 0.79 or higher) you select xbmc from the dropdown, and then just enter the text:    action(4)

you can see all(?) the action codes for xbmc here:
http://trac.xbmc.org/browser/branches/linuxport/XBMC/guilib/Key.h?rev=16176

the ones for moving are:

Code: [Select]
#define ACTION_MOVE_LEFT               1
#define ACTION_MOVE_RIGHT              2
#define ACTION_MOVE_UP                 3
#define ACTION_MOVE_DOWN               4
which version are you using?

currently you can't use up,4 but I am working on a method to allow actions to be repeated (x) times where (x) is a payload value.  Coming SOON!