QMedia Text media commands

QM_AddChapterList

QM_AddChapterList(movieRef; chapterTrackID; refTrackID; chapterTitles; chapterTimes):error
movieRef Longint Movie reference
chapterTrackID Longint Chapter track ID
refTrackID Longint Link track ID
chapterTitles Array string Chapter titles
chapterTimes Array longint Chapter times
error Longint Error result

Creates a chapter list track.

A chapter list is a pop-up menu that appears in the standard movie controller. It gives users a way to quickly get to points in a movie.

Technically, a chapter list is a text track that references another track in the movie. The text samples from the chapter list track are used to build the pop-up menu. When an item is selected from the pop-up menu, the movie controller sets the movie's current time to the point where the corresponding text sample appears. Chapter list tracks are usually disabled.

Parameter movieRef is the reference to the movie instance. The movie reference must have been previously obtained with a call to QM_NewMovieFromFile.

Parameter chapterTrackID receives the ID of the chapter list track.

Parameter refTrackID is the ID of the track that is referenced from the chapter list.

Parameter chapterTitles is a string array that holds the chapter titles. The chapter titles are used by the movie controller to build the pop-up menu.

Parameter chapterTimes is a longint array that holds the time values for the corresponding chapters. These time values must be expressed in the movie's time scale.

Before creating the chapter list, QMedia sorts the chapterTitles and chapterTimes arrays using the contents of chapterTimes as the sort key.

Example

 `Add chapter list with 3 chapters, at 0, 15, 30 seconds
 `Chapter list references track $videoTrack
 
C_LONGINT($timeScale)
$err:=QM_GetTimeScale ($movie;$timeScale) `Get time scale
 
ARRAY STRING(31;$chapterTitles;3)
ARRAY LONGINT($chapterTimes;3)
$chapterTitles{1}:="Chapter 1"
$chapterTimes{1}:=0
$chapterTitles{2}:="Chapter 2"
$chapterTimes{2}:=15*$timeScale
$chapterTitles{3}:="Chapter 3"
$chapterTimes{3}:=30*$timeScale
 
C_LONGINT($chapterTrack)
$err:=QM_AddChapterList ($movie;$chapterTrack;$videoTrack;$chapterTitles;$chapterTimes)
 

QMedia © Escape OE
Generated by QDoc 2.8 on Thu, Nov 24, 2011 18:42:51