View Full Version : [Scenarist] - [Creator] Random Play
mrsmile
5th April 2004, 18:25
Hi all !
I'm working on a DVD that has 20 music videos on it.
I want to be able to play each video separatly, or in a row or on a random mode.
Everything works fine but I can't find the trick to avoid playing twice (or more) the same track then going back to my menu when all the 20 tracks have been played.
If someone has an idea, I'd be gratefull. :D
;)
Dezil
6th April 2004, 11:27
Possibly (i havent tried to test this) but you could at the end of each video, add a counter somewhere, ie add to a GPRM. and then check if that is 20 (the number of videos).
So basically it will count up each time it has displayed a video, and if its played all 20 will go to the menu. if it has played less than that it will just play another.
Im not sure how viable this is but it should work!
influenza
6th April 2004, 12:37
It should be possible of course. I would do a layout like this:
Create a pgc with all songs in it and use this one as the play all. Set the end command of this pgc to go back to the menu.
Create an other pgc with the same tracks in it (since you use the same tracks this won't take extra space).
No you need seperate buttons of course, one random play button and buttons for single songs (like chapter selection).
I would create all songs a a seperate chapter.
Set the end command of the chapter cell to jump back to the menu based on some GPRM value.
So for example set the chapter button to a certain GPRM and let the cell command check that (so if the GPRM value is matched jump back to the menu).
As for the random play: I'm not sure for scenarist, but in maestro you can set a command to play a random chapter based on a GPRM value. I would be surprised if this isn't possible in scenarist. And again: set an end command to jump back to the main menu based on a GPRM comparison.
Other possibility for the seperate songs (if the one above is not available). Make 20 seperate PGCS, one for each song, set the button to jump to it and set the end command of the pgcs to jump back to the menu.
mrsmile
6th April 2004, 17:24
Thanks for your advices. :)
The trick is that I'm working on Creator (Mac OS 9) for this project and (unlike Scenarist) when I add twice the same video in a VTS, it doubles the media !
This is one of the major lack in Creator. :scared:
So, as my bit budjet is very tight, I can't double my 20 videos.
Here's what I have done so far :
Each video is in an individual linked PGC (allowing to use the "next button").
I use two GPRM : one to define the wich video to play (0 = play all, 1 = video 1, 2 = video 2...) and one to set the random mode on/off (0 or 1 in the GPRM 1).
I have one dummy "Random" PGC with the pre-commands :
1/ Set GPRM 0 (aka the "videos" GPRM), random 20
2/ Link PGC "Video1" if GPRM 0==1
3/ Link PGC2 "Video2" if GPRM 0==2, and so on until 20.
Each one of the 20 videos PGC have in post-command:
1/ Link PGC "Random" if GPRM 1==1
2/ Call System VTS Menu Root if GPRM 0=>0
The Title Entry PGC (Video n°1) has the pre-commands :
1/ Link PGC 2 "VVideo2" if GPRM 0==2
1/ Link PGC 3 "VVideo3" if GPRM 0==3, abd so on til 20
At least, in my menu
The pre-commands of the menu set the GPRM 0 & 1 to 0
- The Video n°1 button sets GPRM to 1 and jumps to the VTS1
- The Video n°2 button sets GPRM to 2 and jumps to the VTS1, and so on...
- The "Play all" button sets GPRM 0 to 0 and jumps to VTS1
- The "Random Play" sets the GPRM 1 to 1 and jumps to the dummy "Random" PGC.
So, everything works perfectly except that my "random play" runs infinitly and (logically) several times the same videos.
What I want is "only" to play all of my 20 videos once in the random play mode and go back to my menu when it's done.
I guess I must use a counter mode to count the videos... :confused:
But I can't figure out how to register each played video to avoid playing it twice (or more !).
Some people told me to use the "BITWISE" function, wich I don't really don't know how to use... :scared:
I hope that my explanation is clear. I'm sure there must be a way to solve this problem a bit too tough for my brain :p
So, if you feel inspired...
;)
violao
7th April 2004, 11:59
Originally posted by mrsmile
Some people told me to use the "BITWISE" function, wich I don't really don't know how to use...
I believe they referred to SetGPRM commands (http://www.dvd-replica.com/DVD/setgprm.php?p=30) and using AND and OR operators on bits of GPRM value as a flags for status of your tracks. Only problem is GPRM is 16 bits and you have 20 tracks :(
As for doubling of vobs, I think you can tweak your (doubled) result with IfoEdit and change VOB/CELL ID of duplicate programs to the single VOB/CELL ID. After that you can safely strip off redundant duplicate vobs, also with IfoEdit.
mrsmile
7th April 2004, 14:30
Thanks but unfortunatly this projet is made in a Mac only environement. There is no PC around. So I can't use IfoEdit or any other usefull PC tools.
It looks like I'm in a dead end... :eek:
The only issue I thought about was making up some fake random playlist (about 10).
The random command picks among 10 possibilities then I have a post-command at the end of each clip saying :
if GPRM 1 == 1 link pgc 5
if GPRM 1 == 2 link pgc 19
if GPRM 1 == 3 link pgc 12
and so on...
It's a bit long and doesn't authorize any mistake in the programming of the post commands but I might work.
This could solve my problem for the moment and allowing me to end this project.
So I can have some extra time to think about it, in case this kind of configuration shows up again.
;)
violao
7th April 2004, 15:21
Originally posted by violao
Only problem is GPRM is 16 bits and you have 20 tracks
You could of course use 2 GPRM registers for up to 32 tracks. It will complicate things a little. If you don't understand bitwise functions here is what I think you should do (assuming you use GPRM 5 & 6):
in post of track x (1-16):
SetGPRM 5 OR 2exp(x-1)
for example:
track 1: SetGPRM 5 OR 1
track 2: SetGPRM 5 OR 2
track 3: SetGPRM 5 OR 4
and so on
in post of track x (17-20):
SetGPRM 6 OR 2exp(x-17)
This will set x-th bit of register after playing a track. Finally, the last post command should jump to your random PGC.
Then in your random PGC:
1. check whether all tracks were played:
IF GPRM 5 == 65535 and GPRM 6 == 15 then reset GPRM 5 and 6 to 0 and stop playback
2. calculate random track number x
3. check if x was played already:
(for 1-16) IF GPRM 5 AND 2exp(x-1) == 0 then jump to track
(for 17-20) IF GPRM 6 AND 2exp(x-17) == 0 then jump to track
ELSE goto 2
You can also move track status check to pre commands of that track but I think it will slow things down.
mrsmile
9th April 2004, 14:38
Thank you for your help.
I will resume my work on this project next week. I'll try what you suggested violao.
Do you know where can I find some extra informations about the bitwise functions (others that dvd-replica et Sonic's user's guide, wich I already know) ?
;)
violao
9th April 2004, 22:59
Originally posted by mrsmile
Do you know where can I find some extra informations about the bitwise functions (others that dvd-replica et Sonic's user's guide, wich I already know)
Well, I use dvd-replica, I think they are very comprehensive. For bit operands I think you should check some programming sites/forums. These are rather simple, they operate on bits of their arguments, using logical operations: AND, OR and XOR. Basically when you want to set a certain bit you use OR and when you check you use AND with a mask, for example:
1. set bit 3 in register 5 (counting from LSB - least significant bit):
SetGPRM 5 OR 4 (here mask is 4, using binary notation: 100 - 3rd bit from right)
2.check bit 4 in reg 5:
2.a) store temp in reg 10
MovGPRM 10, GPRM 5
2.b) mask reg 10 with 4th bit:
AndGPRM 10, 8 (mask is 8, binary 1000, 4th bit)
2.c) compare and link to another PGC:
If (GPRM10 == 0) LinkPGC #<whatever>
If GPRM10 is 0 in 2.c) it means that 4th bit was not set.
Hope that helps.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.