home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Directions 2000
/
ILP_Directions2000.iso
/
_french
/
_armovie
/
replaydoc
< prev
Wrap
Text File
|
1993-08-16
|
8KB
|
226 lines
The programmer's view of Acorn Replay
=====================================
Introduction
------------
The software for replaying movies resides in the directory !ARMovie (think of
it like a rather large system directory - currently about 640KBytes). The !Boot
file for !ARMovie sets up the computer to play movies:
- loads the iconsprites for the AE7 filetype
- sets File$Type for AE7
- sets the RunType alias for AE7 to point to the Player program
- sets ARMovie$Dir so that the Player program knows where it is
(there are dither tables and sound code in the directory)
- ensures the computer has ColourTrans loaded (from the system directory -
any version will do)
After this, double clicking on an Acorn Replay Movie will play the movie on the
desktop. Just running the program at the cli will play it. A program can do:
SYS"Wimp_StartTask","movie file name"
to play the movie.
The program attached to !ARMovie is a minimal desktop viewer for
replay files - it can display the helpful sprite and allows desktop control of
a few of the capabilities of the Acorn Replay Player program.
Note that the Player program has to take over the entire machine in order to
get its work done. It consists of 4 independant interrupt run processes:
- file chunk loader
- video decompressor
- video frame refresh and dither
- sound player
The video sections of this code are custom assembled to suit the particular
screen mode etc.
The interrupt run processes are communicating using shared memory in the
ordinary virtual address space - a wimp task swap would be fatal... A large
amount is memory is required:
- double buffer for the file I/O (odd and even chunk size given in the
AE7 file header)
- double buffered queue of decompressed frames
- queue of sound chunks
The amount of memory required is at least:
"odd" chunk size + "even" chunk size + 320K
+ 120K if sound is to be played
+ 32K to 128K for dithering tables
The Player program can use more memory if it is available! It will (by default)
return with a textual error if there isn't enough memory.
A major limitation of the video frame refresh and dither section of the
program is that it uses word addressing in order to paint on the screen:
this results in the displayed section be somewhat to the left of the desired
position. With 16bpp it can be 1 pixel out, 8 bpp 4 pixels, 4bpp 8 pixels,
2bpp 16 pixels, 1bpp 8 pixels.
Simple Control
--------------
The Player program has some controls hard wired into it:
Esc
The Esc key terminates a display sequence.
Menu (Mouse middle button)
The Menu button (also) terminates a display sequence.
Adjust (Mouse right button)
The Adjust button pauses video and sound while it is held down.
Other capabilities may be provided as icons by the calling program.
Parameters
----------
The Player program also accepts a list of parameters on the command line after
the Acorn Replay movie file. These are
-At <Number>,<Number>
Specifies the position of the bottom left corner of the replayed movie in
OS units x,y. Player will move the output display such that it is entirely
on screen. Note the comments above about precision of positionning the
output.
-Big
If the movie is <=160 X, <=128 Y, then Player will play it on a Mode 13
320 by 256 pixel screen filling the screen.
-Leave
By default, Player removes the output from the display. If -Leave is
specified it will leave the output on the display when the program is
left (either by getting to the end or Escape/Menu).
-Loop
Player will loop back to the start of the movie when it gets to the end,
thus playing for ever.
-NoError
Suppresses all possible textual errors from the Player program. The
variable ARMovie$ReturnCode will contain the error.
-PlayFor <Number>
<Number> represents a time in centiseconds: this amount of the movie is
played and the program exits. Note that Pause, fast forward, half speed
etc. do not affect this time limit - it represents a duration in frames
(or feet of the original film) rather than a time in the future.
-Quiet
Disables the sound.
-Startat <Number>
<Number> represents a time in centiseconds: the movie is played from this
point. It can be very time consuming to reach a random point in a none
key frame movie, but Player can do it if necessary. Key frame movies
should only take a few seconds to start playing at any point.
In addition to those parameters, the calling program can specify the positions
of control buttons on screen. The Player program caters for buttons with the
following functions:
exit
pause
single frame advance when in pause mode
fast forward
half speed
quiet (no sound)
loud (sound back on)
By default no button definitions exist except for pause, defined as the
whole screen: so by default a left click will pause the movie and another
will restart it. Buttons are defined with the initial character followed by
the bottom left corner i.e. E10,40 - this gives a default sized button of 32
OS units. E10,40;50 gives a square button of 50 OS units. E10,40;50,25 gives
a rectangular button 50 OS units wide, 25 tall.
A typical command line might be:
<movie name> -loop -leave -startat 2000 -playfor 2000 -quiet H640,512 P0,0:0
case is irrelevant.
System Variables
----------------
There are several system variables which affect the Acorn Replay player program:
ARMovie$Place
Contains the position on screen where the player will put the movie as
<leftx> <bottomy> - for example *set ARMovie$Place 640 512
Controlling programs must set this immediately before running the movie.
Value is only used if -At parameter is not given.
ARMovie$PrefMode
Used by the machine's owner to get the movie to display in a different
mode to the current one. For example, a user may like working in a very
high resolution mode with a low number of colours. Player can display
movies in such modes but they don't look good, so the user can set
ARMovie$PrefMode to an alternative mode. Note that the user won't be able
to see the buttons. (Currently ARMovie$PrefMode is the only way to get
playback in 16 bit per pixel modes, since the desktop doesn't operate
in those modes).
If ARMovie$PrefMode is 13, then -Big is assumed.
[Aside: minimal mode if 0]
ARMovie$Suffix
Used by the machine's owner to preselect different versions of the
movie if they are available. For example, if one knows that one's machine
can only manage 12.5fps movies, *set ARMovie$Suffix to 2 and Player will
preferentially play the 12.5fps movies. See the file on AE7 file naming
conventions.
Some system variables are used by Player to return information to the calling
programs:
ARMovie$Return
Player sets this to the actual position on screen of the video information.
If -leave has been set, this is the section that has been 'dirtied' and
should be repainted by the window manager. It is set to
<leftx> <bottomy> <rightx> <topy>
ARMovie$ReturnCode
If -NoError has been set, this will contain the textual error message.
It will be null if there was no error.
ARMovie$Time
Player sets this to the number of centiseconds of movie which have been
played. Note that (like -playfor) this refers strictly to the amount of
the movie, not the total elapsed time: playing a movie and playing the
movie pausing every frame for an hour will end up with the same value
for ARMovie$Time.