The wimp messages should be used in preference to this mechanism
for monitoring PlayIt.

When bit 1 of R1 is set when calling PlayIt_ClientOp 0, PlayIt allocates a poll word for the client to enable it to be informed of various events that PlayIt may generate without the client having to poll explicitly. This SWI returns in R2 a pointer to this allocated poll word which the client then passes to Wimp_Poll in R3. If bit 22 of the Wimp_Poll mask is set then the Pollword non-zero reason is returned when PlayIt sets the pollword to non-zero.

When an event occurs within PlayIt with the corresponding enable bit set in the event mask (R2) then PlayIt sets the sit in the poll word. The bits are:

bit | Event monitored

bit 0 | Change in volume (PlayIt_Volume )
bit 1 | Change in balance (PlayIt_Balance )
bit 2 | Change in hardware driver (PlayIt_LoadDriver )
bit 3 | Change in playback status (open,
play, stop, pause)
bit 4 | The pointer has been moved (PlayIt_SetPtr )
bit 5 | The pause point has been moved (PlayIt_PauseAt )
bit 6 | The loop parameters have changed (PlayIt_SetLoop )
bit 7 | The queue has changed (PlayIt_Queue )
bit 8 | A new file has been opened (PlayIt_Open )

Setting bit 3 will detect when a sample is opened, closed, paused, started or stopped. ie PlayIt_Status will return a different sets of bits. In fact PlayIt sets bit 3 in exactly these circumstances.

If a sample is playing when the client registers and bit 8 is enabled then that event will be returned immediately to allow clients to immediately enter play monitoring mode if required.

eg to be informed when the volume or balance changes, bits 0 and 1 of R2 should be set (ie R2=0x03). PlayIt will then only ever set bits 0 and/or 1 in the poll word when their respective events occur. The client will most likely have to interrogate PlayIt with various status SWIs to find out the effect of the event (eg what the new volume actually is).

The client should set the poll word to zero when it has processed the reason to stop the Wimp returning the same reason when no events have actually occurred. To minimise dead time the recommended approach is to make a copy of the poll word and clear the original as soon as possible then test bits in the copy and take actions as appropriate.

There is no way to tell if multiple events of any given type have occurred so the bit essentially means this has occurred at least once. The superseding nature of the events means this usually isn't a problem.

[ Parent ] [ Manual root ]