DeskMovie  -  Desktop Replay file player

by Alan Wrigley

DeskMovie is a simple application which is designed to illustrate the techniques of displaying Replay movies from within your own programs, as described in the Wimp Topics article in this month's magazine.

The program can be run from the RISC User menu system or by double-clicking on its icon in a Filer window. An icon is installed on the icon bar. The icon bar menu has two options: Info and Quit.

Clicking Select on the icon bar icon opens the main program window. At the top right-hand side there are three radio buttons which allow you to choose the shape in which the movie will be played: rectangular, circle or tall film. The program assumes that you have the relevant shape and trajectory files in your !ARMovie directory (they are normally supplied with ARMovie, and if not you can usually obtain them fairly easily from PD libraries etc.). To play a movie using the circle shape you need to have a file called Circle in the !ARMovie.Shapes directory, while to play a tall film (which appears to 'roll' the frames down the screen as if passing through a movie projector) you will need a file RollTFilm in the !ARMovie.Trajectory directory as well as a set of shapes in the TallFilm subdirectory within the !ARMovie.Shapes directory.

Dragging a Replay file (type &AE7) to the icon bar icon or to the window will start the movie playing in the window, and if it has a title this will be displayed in the title icon. At the top left are control buttons; the Stop button will stop the movie but leave the most recent frame displayed in the window; while the Pause button toggles play on or off. Once the movie has been stopped it can be started again by clicking the Play button.

Technical details
The process of displaying Replay movies is explained in this month's Wimp Topics article. The information in the article together with a careful study of the !RunImage file should enable you to incorporate the facility into your own programs.

When a Replay file is loaded, PROCload is called. This first of all reads certain information from the movie header, namely the title and the size. The header consists of a set of text strings; the header is the second string in the file and the x and y sizes (in pixels) are the sixth and seventh strings respectively. Replay files are normally played at a scale of 2:1, and so the pixel sizes given must be multiplied by two to get the actual size of the image on the screen.

When a movie finishes playing, the last frame may remain displayed or it may be removed, depending on the command parameters given when running the movie. If you choose to leave the last frame displayed, as DeskMovie does, you must grab a sprite of the image, otherwise it will be erased next time the window is redrawn. Before the movie is played, therefore, memory is claimed (using the RISC User Heap Manager) for a sprite area to hold the sprite which will be grabbed when the movie stops.

The movie is actually played by using SYS "Wimp_StartTask" followed by the filename and then by any parameters which modify the action of the player. The most important of these parameters are described in the Wimp Topics article in this month's magazine. For details of all the other commands, you should refer to the Replay User Guide which is available as part of the Replay Starter Kit.

In the DeskMovie program, the parameter string is set up in FNparam. The parameters used are:
-at x,y:  specifies the screen coordinates
-leave:  leaves the last frame displayed
-nomenu:  disables the Menu button
C x,y,w:  specifies a Capture Exit button
P x,y,w:  specifies a Pause button
The C and P parameters specify areas of the screen which will act as Capture Exit and Pause buttons (the Capture Exit button stops the movie and leaves the most recent frame displayed). The x and y parameters specify the x and y coordinates of the bottom left-hand corner, while the w parameter specifies the width and height of the icon.

If the circle or tall film shape has been selected, a further parameter is added to the command string. For a circle (which is a straightforward shape), the following is added:
-shape <ARMovie$Dir>.Shapes.Circle
while for a tall film, which requires a trajectory file together with shape files specified in the trajectory, you need the following:
-follow <ARMovie$Dir>.Trajectory.RollTFilm
As mentioned above, these commands assume that the relevant files are available within your !ARMovie directory.

You can experiment with different command parameters by altering the command string.

 Copyright RISC User Magazine 1996
