RPN Questions: Recursing a dir or reading an m3u W/O playing

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
mojojo
New Cone
New Cone
Posts: 3
Joined: 05 Jan 2007 22:35

RPN Questions: Recursing a dir or reading an m3u W/O playing

Postby mojojo » 05 Jan 2007 23:40

I'm having a love/hate relationship with the RPN macros.

When you add a directory or m3u file to the playlist via the RPN ... it puts it in the playlist un-recursed. Not until you "play" it does VLC do the recursion action on the directory or the parsing action on the playlist. Then of course it plays the first item in that newly created sub-node.

Service Discovery does it the right way. When you trigger SD with the RPN it adds it to the playlist but does not immediately play the first item.

I would like to be able to add an item to the playlist and tell VLC to read it but not play it. I've looked through the source a bit (I'm barely C literate) .. but I haven't found a trick.

If you play then immediately stop, VLC seems to interpret the stop against it's recursion actions as well. And there's no "delay" function in the RPN to give VLC time to spin up it's directory search or playlist parser.

(Unfortunately, I'm not the dev of the code on the other end sending the commands ... so I'd prefer not to rely on him to call play, then call stop.) This is also a transcode/streaming scenario and he hasn't sent sout strings yet so it's preferable to not hit the default display with anything. Who knows what the user might be trying to play. :-)

There's also no RPN way to have a polling loop to "wait" for a specific action or variable to be set in the core (that I can find).

So does anyone know a way via RPN to either ...

1) Trigger VLC to process a file/directory without playing?

2) "Delay" some amount of time before moving to the next command. (And not crash VLC with some kind of wacky foreach loop)

or
3) "Wait" on a specific change in variable or state before moving to the next command. (Maybe by changing the value of what "foreach" sees from underneath it's feet? Anyone with enough C skill to read if that's doable?)

Any of those three should let me do what I want ...

This is particularly messy it seems when VLC is processing large recursed directories and/or long playlists. Feeding VLC commands during this time seems to be crash prone.

Thanks for any assistance

P.S --

In a previoust thread someone asked if there's a way to figure out which RPN accessible object a particular core variable is from ... I'd love to know that as well ... I'm specifically trying to hunt down "sout" ...

I want to change it from directly in my RPN so that the display is defaulted off before someone specifically sends my script some transcode parameters.

This will also be necessary if there really is a way to poll a var and wait for it to change before doing something.

P. P. S --

A gift to anyone who needs it ... You can use the "include" feature in RPN to create recursion. An include file can call itself. I used it to write my own directory walk feature.

Of course if you screw it up VLC explodes beautifully.

One awful caveat and the reason why I hate the trick is that to create no impact to the output stream ... the included file needs to all be one line with no spaces between the vlc tags! RPN is already painful enough to write as it is ... try debugging an 8K script that's all one line.

In my case if you send extra spaces and returns in the input stream, the far end device (A PSP) ... explodes beautifully.

Edit:

P.P.P.S. --

Variable wise I'm also looking for (for some advanced hackitude) ...

-- the variable where RPN's output is stored before being sent back up to the browser. So that maybe I can wipe it before I actually need output so that I don't end up with extraneous carriage returns et al heading back to the browser. (I'm not using RPN from within an HTML page.)

-- the information used by the embedded players "autosize window" feature. Would like to get the size it thinks to feed my own "autosize stream" feature. Thinking I could let the player have a few frames on the display before pausing it, grabbing the size it made ... crafting the appropriate sout line ... stopping ... then sout'ing

mojojo
New Cone
New Cone
Posts: 3
Joined: 05 Jan 2007 22:35

Crawling the object list with a foreach loop

Postby mojojo » 06 Jan 2007 03:18

I found an undocumented "foreach" loop type in the source that seems like it crawls through the object list to find objects ... but I haven't been able to figure out what to feed to the stack to make it spit something out.

Just from the var name in the object creating thingy it seems like it takes "capability"

Anyone know if it can be used to hunt for objects/vars?


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 0 guests