Muxman MXP Examples
Random / Shuffle / Emulated Random

First, what are they? Random playback plays the number of cells you want in a random order, and may repeat the same cell before playing them all. Shuffle playback keeps track of which cells have been played, and will not repeat a cell until all the cells have been played. Notice that both Random and Shuffle PGCs can have only one program, but with as many as 255 cells in that program. Random and Shuffle PGCs have no time map, so you cannot seek by time, and the front panel time display starts at 00:00:00 for each cell.
Emulated random playback uses commands to choose the next cell or program for playback. Since it is a Sequential playback PGC, it does have a time map, and time starts at 00:00:00 only on the first cell. It may also have more than one program, and chapters.

Random and Shuffle are so simple it's really not necessary to show an entire script, just a part of the title PGC will do.
For a normal (Sequential) playback PGC there are two lines that read

	PG Playback Mode=Sequential Playback
	Repeat Times=0
Let's say we want a random PGC that will play 10 cells and then stop, these two lines get changed to
	PG Playback Mode=Random Playback
	Repeat Times=10
If you want to make sure each cell gets played before any cell is played again, then change the word "Random" to "Shuffle"

But emulated random is another story. Here we will use the Rnd set command to choose a number between 1 and the number of places to start playback (could be cells, programs, or a combination since we can use whatever Link command is appropriate). After that a series of commands to test the value and Link to the point of playback. We'll do this in the pre commands so the PGC will choose a random cell on entry. After each cell plays we'll use a cell command to restart the PGC.
The following PGC uses 4 cells all in one program.

Item=PGC
{
	Name=VTS01_TTL01_PGC1
	Menu ID=Title Entry
	Uop=00000000
	Next PGC=
	Prev PGC=
	GoUp PGC=
	PG Playback Mode=Sequential Playback
	Repeat Times=0
	PGC Still Time=0
	Palette=DefaultPalette
	Item=Pre Commands
	{
		Rnd gprm1, 4
		if ( gprm1 == 1 ) LinkCN VTS01_TTL01_cell1
		if ( gprm1 == 2 ) LinkCN VTS01_TTL01_cell2
		if ( gprm1 == 3 ) LinkCN VTS01_TTL01_cell3
		LinkCN VTS01_TTL01_cell4
	}
	Item=Post Commands
	{
	}
	Item=Cell Commands
	{
		cell1:	LinkTopPGC
	}
	Item=Program List
	{
		Item=Program
		{
			Name=VTS01_TTL01_pg1
			Item=Cell
			{
				Name=VTS01_TTL01_cell1
				Linked Scene=Segment_1_scn1
				Command=cell1
				Cell Still Time=0
				Access Restriction Flag=Permitted
			}
			Item=Cell
			{
				Name=VTS01_TTL01_cell2
				Linked Scene=Segment_1_scn2
				Command=cell1
				Cell Still Time=0
				Access Restriction Flag=Permitted
			}
			Item=Cell
			{
				Name=VTS01_TTL01_cell3
				Linked Scene=Segment_1_scn3
				Command=cell1
				Cell Still Time=0
				Access Restriction Flag=Permitted
			}
			Item=Cell
			{
				Name=VTS01_TTL01_cell4
				Linked Scene=Segment_1_scn4
				Command=cell1
				Cell Still Time=0
				Access Restriction Flag=Permitted
			}
		}
	}
}
Muxman home page MXP documentation index DVD-Video info home
Copyright © 2005 - 2012 MPUCoder, all rights reserved.