scripting - user definable loops

Posted by Ronald Golec 
scripting - user definable loops
April 20, 2006 10:47AM
My DVD has multiple short videos on it. Each video button can be selected and played, when finished returns to the main menu, very straight forward.

I wish to add an interactive menu allowing the viewer to select any number of available videos by way of a multiple choice method ( radio buttons ) and have these selected videos play in an indefinte loop.

Can anybody help?

Thank you!

Ron
Re: scripting - user definable loops
April 27, 2006 11:17AM
Ron - I have been doing exactly that just this morning.

There are some limits to consider, though.

The more possible clips to choose from that you have got, the less the total number that you can choose. If you have 24 clips you can choose up to nine easily enough. If you have ten clips possible you can choose all ten if you want. This all comes down to the amount of room you have got in your GPRMs. If you want to be able to select up to fifteen clips you would need fifteen sets of four bit groups to store the selections in. This itself would take up nearly four GPRMs in total, (there are sixteen bits in a register) leaving you just three GPRMs to hold a counter and to do the necessary calculations.

If you want the user to choose from more than fifteen clips, then you have to allow for more bits to hold the choice - if they can choose clip 36 (the maximum number of buttons on a menu) then in binary that equates to a six bit number (001001).

If you use six bits to store a value, you can only fit two such values in a register, leaving four bits spare. I guess you could use those four bits for something, but you couldn't store a large number in there (up to 15, in fact). I'm pretty sure you could juggle four bits from one register and add two bits from another, but ultimately you need to ask if it is worth the while doing so.

If you are using six bit numbers and you need a counter and a place to do calculations, then your user could only ever choose up to 12 clips to play from the 36.

As luck would have it, in DVDSP 4 you can split a register into different pieces, and use each piece like an additional register. However, the more pieces you have got, the lower the number you can store in them. In DVDSP3 you have to use bitwise operations to solve the problem. If you can think of a way to remember the order of the user choices as the registers get filled then you can most certainly play them back in the same order they were chosen.

Personally, I think choosing up to 8 clips seems to be enough - more than that and it is tricky for the user to remember what they selected themselves.

Eight is a four bit number, you can fit four lots into a register with no spaces. Two registers would be needed to hold the user choices, one for calculating the order and one for keeping count of how many were chosen or played back.

That's a lot of words for a starter! have a look here:

[homepage.mac.com]

and look for the folder called Playlist projects. In there you'll find a jukebox system I created in DVDSP3 a while back, plus the same thing but which randomises the playback. You'll also find Alex Alexzander's DVDSP2 version that takes a slightly different approach to mine.

In order to adapt these for continuous playback, you'll need to remove the jumps that clear the registers at the end of the playback and simply return to the beginning of the scripts instead.

It's a mind bender for sure, but totally possible if you don't want the user to choose massive amounts each time.
Re: scripting - user definable loops
May 11, 2006 09:41AM
Hal,

Total mind bender indeed!
The DVD i'm authoring that would include a maximum of eight movies for the user to multi-select for loop playback.

After analyzing your file and it's five internal scripts,
i've introduced a 'Jump playback_control' on line 27 of the 'Menu_JumpIf' script in order to bypass the resetting of the GPRM registers to zero.

Upon Simulate, produces an initial successful loop but a repeat of only the first three selected buttons results in a continuous loop afterwards.
i.e. pressing menu buttons 6,5,4,3,2,1, play, will result a loop playback of : 6,5,4,3,2,1,6,5,4,6,5,4,6,5,4, etc...

Any help?

Thanks!
Re: scripting - user definable loops
May 11, 2006 11:20AM
Don't forget that some of those GPRMs are holding values from calculations... if you don't clear these then it will introduce errors on subsequent loops through the script (a lot of statements depend on there being a value in place... if you don't re-set it and allow a valid number to be stored then that line is effectively skipped).

You'll need to look at which are storing user choices and which are storing calculations... clear the calculating spaces to zero and then go through the script again.
Sorry, you do not have permission to post/reply in this forum.
 


Google
  Web lafcpug.org

Web Hosting by HermosawaveHermosawave Internet


Recycle computers and electronics