home *** CD-ROM | disk | FTP | other *** search
- !playAVI (AVI film player) v1.4
- © Paul Gardiner (31 July 1994).
-
- Some versions of PlayAVI can be controlled via a SWI interface. These
- versions include in the application directory a module called AVIControl. To
- obtain normal interactive behaviour, comment out from the !Run file the line
- that loads AVIControl. (WARNING: your version may have been compiled to
- prohibit interactive use.)
-
- Most of the SWIs have no immediate effect. Instead they leave a message with
- the control module, which the player will act upon when the controlling
- program returns to its poll loop. The SWI that validates a file is an
- exception, in that it analises the file immediately, delivering its report on
- return. AVI_On also acts immediately.
-
- Here are two ways to use the interface that should avoid problems:
-
- Method 1.
-
- * call AVI_On and AVI_Run
- * for each film
- * check film with AVI_Validate, which returns the picture size
- * set position with AVI_Place
- * load film with AVI_Load
- * enter poll loop monitoring AVI_Status, waiting for not busy
- * call AVI_Off when you've seen enough films
-
- Method 2.
-
- * call AVI_On and AVI_Run
- * take a film
- * check film with AVI_Validate, which returns the picture size
- * set position with AVI_Place
- * load film with AVI_Load
- * return to poll loop, forgetting about the playing film
- * when you feel like playing another film
- * check film with AVI_Validate, which returns the picture size
- * ensure the players operational and empty with AVI_On and AVI_Eject
- * set position with AVI_Place
- * load film with AVI_Load
- * return again to poll loop, forgetting about the playing film
- * call AVI_Off when you've had enough
-
- Before attempting to use the SWI interface, the main application should be
- invoked, by callin the !Run file. This will load the module and also run
- momentarily a program that primes the module. After this the SWIs listed
- below are available. Each one preserves all registers except those specified
- to return a result.
-
- AVI_On &484C0 Load the player
-
- A call to this SWI is necessary before most of the other SWIs will work.
- The main application is loaded with a default, comfortable setting of
- the volume, the film rack empty (of course), and the player not running.
- Multiple calls to AVI_On are safe in that they do not cause multiple
- copies of the player to be loaded.
-
-
- AVI_Off &484C1 Quit the player
-
- This can be called at any stage of playing films. It is wise to call
- it when the player is not to be used fo a while, since the death of the
- main application returns the most significant part of the used memory
- to the WIMP. It is planned at some stage to make the player kinder in
- its use of memory, where upon it will be unnecessary to call AVI_Off
- until the controlling application has no further use for it.
-
-
- AVI_Validate &484C2 Interogate a film
-
- On entry: R0 - pointer to the filename, represented as a control
- terminated string.
-
- R1 - 36 byte buffer for returned record.
-
-
- On exit: !(R1 + 0) report code
- !(R1 + 4) 4 byte compressor code
- !(R1 + 8) 4 byte format code
- !(R1 + 12) planes info (two 16 bit words)
- !(R1 + 16) Width in pixels
- !(R1 + 20) Height in pixels
- !(R1 + 24) Frame rate expressed in time units (see next word)
- !(R1 + 28) Number of time units in a second
- !(R1 + 32) Number of frames
-
- The report code may be 0 - Playable
- 1 - NotSupported
- 2 - NotRecognised
- 3 - NotOpenable
-
- xsize and ysize should be multiplied by 4 to give OS units.
-
-
-
- AVI_Load &484C3 Load a named film into the rack
-
- On entry: R0 - pointer to the filename, represented as a control
- terminated string.
-
- There is some difficulty involved in loading more than a single film.
- If AVI_Load is called several times by the controlling program between
- polling the WIMP, then only the last call is acted upon. Worse is the
- fact that a single poll of the WIMP may not be sufficient for the
- player to be allowed to act on a request. It is probably best when
- using this current version to work with one film at a time. Calls
- to AVI_Status can determine if the rack is empty or not.
-
- AVI_Eject &484C4 Empty the rack
-
- This SWI will eject all films. You may have no cause to call this SWI
- because films are automatically ejected when the rack of films has run
- to completion. If AVI_Load and AVI_Eject (in either order) are called
- without an intermediate poll of the WIMP, the rack will be left
- containing just the one film specified by the load.
-
-
- AVI_Place &484C5 Position the top, left corner of the viewing
- window.
-
- On entry: R0 - x coordinate in OS units.
- R1 - y coordinate in OS units.
-
- The new position is maintained until this SWI is called again or until
- the next call to AVI_Off, which ever is the sooner.
-
-
- AVI_Volume &484C6 Set the volume.
-
- On entry: R0 - volume from 1 to 127
-
- The new volume is maintained until this SWI is called again or until
- the next call to AVI_Off, which ever is the sooner.
-
-
- AVI_Run &484C7 Set the player running.
-
- This call can be made before or after loading a film. All subsequently
- loaded films will play immediately, until a call is made to AVI_Stop
- or AVI_Off.
-
-
- AVI_Stop &484C8 Countermand AVI_Run.
-
-
- AVI_SingleTask &484C9 Move between desktop and singel-task modes.
-
- On entry: R0 - 0 for desktop mode
- - nonzero for single-task mode
-
-
- AVI_Status &484CA
-
- On exit: R0 - operational flag (the main application is operating)
- R1 - busy flag (there is a film currently loaded)
- R2 - running flag (the player is running, or would if it
- had a film in it)
- R3 - volume (value from 1 to 127)
-
- If waiting for a film to stop, look at the busy flag.
-