PDA

View Full Version : Playing a vew scheme from Lua



avid
April 1st, 2006, 09:28 PM
A simple question I hope.

How can I play a particular view scheme from Lua?

When I execute
NetRemote.ExecuteAction(-10,2,255,"X PLAY Media Library\\Audio\\RandomHour" ); it jumps back to the start of the current track and does not give me a new random selection.

So what am I doing wrong? Wrong command? Need quotes?

Brian

Jlee
April 2nd, 2006, 01:09 AM
X PLAY? Shouldn't that be LX PLAY? Also you need some other bits at the end so try this:


NetRemote.ExecuteAction(-10,2,255,"LX PLAY Media Library\\Audio\\RandomHour -1",1 )

avid
April 2nd, 2006, 01:48 AM
Thanks jlee,

Firstly I am totally confused about "X" vs "LX". For PLAYFILE, Ben originaly said "LX" then corrected it to "X" (which *does* work). What (if anything) is the meaning of "X" and "LX"??

Anyway, when I tried those changes, it fails with the MB log showing

MediaBridge: Received command : LX PLAY Media Library\Audio\RandomHour -1 from 192.168.0.253:1037
Entered LX
MediaBridge: Exception when handling LX (5) : System.String[] : Input string was not in a correct format. at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at com.Promixis.MediaBridge.ClientHandler.HandleComma nd(String[] parts)
Exception handling client socket : Input string was not in a correct format. at com.Promixis.MediaBridge.ClientHandler.HandleComma nd(String[] parts)
at com.Promixis.MediaBridge.ClientHandler.MessagePend ing()
at com.Promixis.NetworkShared.PSocketClient.Handle()
Removing client 192.168.0.253:1037 from list

I thought maybe quoting might help - but no:
MediaBridge: Received command : LX PLAY 'Media Library\Audio\RandomHour' -1 from 192.168.0.100:20837
Entered LX
MediaBridge: Exception when handling LX (5) : System.String[] : Input string was not in a correct format. at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at com.Promixis.MediaBridge.ClientHandler.HandleComma nd(String[] parts)
Exception handling client socket : Input string was not in a correct format. at com.Promixis.MediaBridge.ClientHandler.HandleComma nd(String[] parts)
at com.Promixis.MediaBridge.ClientHandler.MessagePend ing()
at com.Promixis.NetworkShared.PSocketClient.Handle()
Removing client 192.168.0.100:20837 from list


And then NR was not happy about the premptory disconnection and locked up!

Brian

Jlee
April 2nd, 2006, 03:20 AM
I've no idea what X Play I for but LX Play is working fine for me. There are numerous examples in my LUA File...

http://www.promixis.com/phpBB2/download.php?id=3013

avid
April 2nd, 2006, 03:38 AM
@Ben:

I can't see what I am doing different from jlee. Has something changed in a recent MB? Can you explain the error being reported?

And what is the interpretation of "X" vs "LX"?

Brian

Ben S
April 2nd, 2006, 06:37 AM
Sure.

1. Although you can use any style quoting in Lua, MB requires double quoting (") versus ('). So LX PLAY "Media Library\Audio\Album" -1 would work.

2. X is execute a command of some kind. PLAY, PLAYFILE (which may not be in the library), NEXT, PREV, etc. LX is a Library execute, where you're doing something with the library.

There are actually some decent docs of this on the wiki here (http://www.netremote.org/pmwiki/index.php?n=Docs.MediaBridge)

avid
April 2nd, 2006, 07:15 AM
Thanks Ben,

Double quotes did the trick. And I had (again) forgotten about the wiki. That would have explained the LX bit for me.

Brian