Log in

View Full Version : Split GPRM Updated


matrix
17th November 2007, 20:43
I made a play list, for now just a demo, each track is just a pic displaying some text like song1, song2 etc.
There are 30 of them, and they can be played back in any order you select them in.
But I have one big problem. If I select an odd number of tracks, it never plays the last one, instead it plays the first track #1.
If I select all, or an even number of tracks, then it plays them as it should.
The structure is something like this
A main menu with all 30 buttons and a play list button.
The 30 buttons link to a dummy menu witch sets the registers. The pre commands in that menue

1: if (GPRM1 !=0) GoTo 5
2: Mov GPRM1, SPRM8
3: Div GPRM1, 256
4: LinkPGCN Menu
5: if (GPRM0>=1) GoTo 10
6: Or GPRM1, SPRM8
7: Div GPRM1, 4
8: Mov GPRM0, 1
9: LinkPGCN Menu
10: if (GPRM2!=0) GoTo 14

And so on. I use GPRM0 to be able to skip what has already been set, and I reset it to 0 at the end.
Then the play button links to another dummy (navigation)menu with these commands

1: if (GPRM1!=0) LinkPGCN Gprm1
...........................................
15: if (GPRM15!=0) LinkPGCN Gprm15
16: if (GPRM15==0) LinkPGCN Menu

There is one dummy for each register 1 to 15

First dummy
1: Mov GPRM0, GPRM1
2: And GPRM0, 255
3: if (GPRM0==1) GoTo 33
........................
33: JumpVTS_TT Title_1

And so on for each of them. Just the first line changes.

Now the post commands of each track are

1: if (GPRM14==0) Div GPRM15, 256
2: if (GPRM13==0) Div GPRM14, 256
.........................
14: if (GPRM1==0) Div GPRM2, 256
15: Div GPRM1, 256
16: CallSS RSM=1, AudioMenu. This is the navigation menu.

So can somebody please tell me what I did wrong?
What can I do to be able to play them as they should?

Thanks for any information.

Edit

When I try to play just one track, if the track corresponds with one of the first 7 buttons, it acts like this.
For example if button 1, is pressed, looking at the gprm1 in the simulation window (I'm using Scenarist BTW), it has a value of 4, so it plays track 4.
If button 7 is pressed, the gprm1 is 28, so it plays track 28. If the gprm is more than 30, then it just plays track 1
I got over this by making another dummy with these commands.
1:if (GPRM1==4) Div GPRM1, 4
2:if (GPRM1==8) Div GPRM1, 4
....................................
30:if (GPRM1==120) Div GPRM1, 4
But that only works for gprm1
I tried doing it for all the registers, but it still messes it up.

Anybody?
I'd really appreciate any help.
Thank you.

matrix
24th November 2007, 05:38
Never mind that. I finally got it working.

PhillipWyllie
27th November 2007, 09:48
Why are you making it so complicated. I assume you're using Scenarist or something like that. If so you can make as many PGCs (in a title), or titles in a VTS(in the same VTS) from the available assets and they'll only be used on the disc once(ie not taking up extra space). One title would be playall, even tracks, and odd tracks. You could even have a playlist of your favourite tacks. One caveat is that there can only be(I think) 99 PGCs in a title, 99 title in a VTS, and 99 VTSs in a DVD volume.

matrix
29th November 2007, 02:00
I know everything you said there, but I think you don't understand what I was trying to do (what I did actually).
You have there 30 songs, videos, whatever, and you can select any or as many as you like, from that list, and play them back in the order you selected them in.
So you make a play list on the fly, from those 30, and that is not such an easy task.

Give it a try. And if you find a not so complicated way, let me know.

Thanks for bothering though.

matrix
26th December 2007, 19:59
Mabe everybody knows how to do this, and I just discovered recently how to do it.
I don't know.

But just in case anybody else is interested in this kind of stuff, here's another way of doing it. It's more efficient and not so complicated.
So you can make your own playlist out of a total of 30 tracks.
This time I split each register into 3, so there's three selections per gprm.
Ten registers for 30 selections, one holds temporary values, and two more for playback, and still have three gprms free, that can be used anywhere else in the project.


Same as before, there's the playlist menu, with 30 buttons for the tracks, a play button, and eventually a cancel button, in case you make a mistake and want to start over.
The 30 buttons lead to a dummy which stores them in the right order.

The pre commands of this dummy, I call it SetGprm, are as follows
1: Add GPRM0, 1 each time it comes here, adds 1 to gprm0 so it can skip what is set already.
2: Mov GPRM11, SPRM8 ______Gprm11 takes the value of sprm8 which is the highlight button and stores it until we add it to a long time storage register.
3: if ( GPRM0== 1 ) GoTo 33
4: if ( GPRM0== 2 ) GoTo 36
5: if ( GPRM0== 3 ) GoTo 39
6: if ( GPRM0== 4 ) GoTo 41
7: if ( GPRM0== 5 ) GoTo 44
..................
32: if ( GPRM0== 30 ) GoTo 111
33: Div GPRM11, 1024 ______this shifts the bits from the original position to the beginning of gprm11. first 5 bits.
Suppose you pressed button 23, if you take a look at gprm11 with the value from sprm8, it will look like this: 0101110000000000 the right side being the beginning, bits 10, 11, 12, and 14 on, counting the first one as bit 0.
When divided by 1024, it will look like this: 0000000000010111, the same formation of bits, only in a different position in the register. 0, 1, 2 and 4 on.
34: Add GPRM1, GPRM11 ______this adds the value from the temp reg gprm11 to gprm1 which will hold it for the total duration.
35: LinkPGCN Menu_1-pgc ______this is the playlist menu.
36: Div GPRM11, 32 ______this shifts the bits from 10, 11, 12, 13, 14 to the next 5 bits, that is bits 5, 6, 7, 8 and 9. before div, 0101110000000000 and after 0000001011100000.
37: Add GPRM1, GPRM11
38: LinkPGCN Menu_1-pgc
39: Add GPRM1, GPRM11 ______this time the bits stay where they are.
40: LinkPGCN Menu_1-pgc

So far, the first three selections are all stored in gprm1
Line 41 starts all over again, storing the next 3 selections in gprm2, then gprm4 and so on until gprm10.

41: Div GPRM11, 1024
42: Add GPRM2, GPRM11
...................................
111: Add GPRM10, GPRM11
112: LinkPGCN Menu_2-pgc ______The last line, after all 30 selections are made, can lead to a different menu which will tell the user that the maximum number of selection were made so they don't try to store more than that.
This new menu can have only 2 buttons, play and cancel which will reset all the registers to 0, and go back to the playlist menu to start all over again if they want.
The Play buttons on both menus can either lead to another dummy with just a few pre commands, or can link to its post command that will have these commands in it.
1: Move GPRM12, GPRM0 ______gprm12 takes the value form gprm0, and will count back until it reaches 0 when will stop the playback.
2: Add GPRM12, 1
3: Mov GPRM0, 1
4: LinkPGCN Navigation
this is another dummy that leads to more dummies, the right ones to play the selections in the order they were made in the first place.

The dummy, Navigation, has the following pre commands.
1: Sub GPRM12, 1 ______each time this dummy is accessed, subtracts 1 until it reaches 0.
it took the value from gprm0, so if you selected say 5 tracks, it would be 5 the first time and subtracts one each time, till it is 0 and then goes to line 63 which resets all the registers to 0 and jumps to the playlist menu.
2: if ( GPRM12== 0 ) GoTo 63
3: if ( GPRM0== 1 ) GoTo 33
4: if ( GPRM0== 2 ) GoTo 34
.......................................
33: LinkPGCN Playback1
34: LinkPGCN Playback2
.....................
62: LinkPGCN Playback30
63: Mov GPRM0, 0
64: Mov GPRM1, 0
..................
75: Mov GPRM12, 0
76: LinkPGCN Menu_1-pgc
at the end of playback, after the last selection has played, resets all the registers to 0 and goes back to the playlist menu.

Then there are all these last dummies, (there has to be one for each track in the list) which are very similar to each other.

Pre commands of Playback1

1: Add GPRM0, 1
2: Mov GPRM11, GPRM1
3: And GPRM11, 31 ______gprm11, used throghout the project,as a temporary register, takes the value form gprm1 and performs a logical And with a mask, that will show only the first 5 bits of the register.
A mask of 31, looks like this: 0000000000011111
4: if ( GPRM11== 1 ) GoTo 34
5: if ( GPRM11== 2 ) GoTo 35
...................
33: if ( GPRM11== 30 ) GoTo 63
34: JumpVTS_PTT title1-t-scn-pgc@Title_1
.........................
63: JumpVTS_PTT title30-t-scn-pgc@Title_1
64: LinkPGCN Navigation
it goes back to navigation dummy to search for the next selection.

Playback2 pre commands, very similar to playbac1,s

1: Add GPRM0, 1
2: Mov GPRM11, GPRM1
3: And GPRM11, 992 ______here uses a different mask, 0000001111100000 to show only the next 5 bits of the register, and then it has different values to look at.
4: if ( GPRM11== 32 ) GoTo 34
5: if ( GPRM11== 64 ) GoTo 35 ____ each one is a multiple of 32
..............................
33: if ( GPRM11== 960 ) GoTo 63
Next ones are just like playback1, jump to the tracks, and at the end goes to the navigation dummy.
If you wonder where these values come from.
In the beginning, when we stored the selections, first time we divided gprm11 by 1024 to shift the bits, 1024 divided by 1024 is 1, so in playback1 we have values of 1,2,3,...30
Second time we divided it by 32. So if you take the first button, 1024 divided by 32 is 32, button 2 is 2048 divided by 32 is 64 and so on.
Third time we didn't divide at all, so the values are the original ones, as you can see next.

Playback3 uses a mask of 31744, 0111110000000000 and then of course, we have other values in there.

1: Add GPRM0,1
2: Mov GPRM11, GPRM1
3: And GPRM11, 31744
4: if ( GPRM11== 1024 ) GoTo 34
5: if ( GPRM11== 2048 ) GoTo 35 _____multiple of 1024
..........................
33: if ( GPRM11== 30720 ) GoTo 63

The next three dummies are exactly like the first three ones, only gprm11 takes the value from gprm2 this time, then next 3 take the value form gprm3 and so on until the last three playback dummies which take the value form gprm10.


This is to store three selection in one gprm, up to a maximum of 30 selections.
If you have up to 15, each gprm can be split into 4, and store 4 selections per register.
15 is the last 4 bit number, 16 to 31 are 5 bits and 32 and up are 6 bits or more.
But up to 15, (12 is better, takes 3 full registers) can be done in a similar manner as the last one.
first time we divide by 1024, taking 11 as an example
gprm11 is 0000000000001011
second we divide by 64
gprm11 is 0000000010110000
third divided by 4
gprm11 will look like this 0000101100000000
and last time we multiply to shift the bits to a higher position in the register
so it looks like this 1011000000000000

And then in the playback dummies, we have 4 per register, so we use four masks:
first 15, 0000000000001111, second 240, 0000000011110000, third 3840, 0000111100000000, and 61440, 1111000000000000
and you can figure out the values.


I know this is a very long post, but as I said before, in case somebody is interested in this kind of things, they might find this thread useful.