PROGRAMMER'S GUIDEStream system library
BackForward
Stream system library

7. Function specifications-7


7.7 Stream server execution


 List
 Title

Function specifications

 Function

Specifying the server execution group (immediate return)

 Function Name

STM_NwSetExecGrp

 No

7.1

Form
Bool STM_NwSetExecGrp (StmGrpHn grp)
input
grp: stream group handle
output
none
Function value
 TRUE
 : When processing is accepted
 FALSE
 : If the process is not completed
function
Specifies the stream group that the stream server should run. Since it is an immediate return, you need to call the server function.
remarks

  1. After registering the process, it will return immediately.

  2. If NULL is specified to use the file system, check that the drive is paused by the following procedure, and then call the GFS function.

    ..
    ..
    tsk = STM_NwSetExecGrp (NULL);
    if (tsk == FALSE) return;
    do {
    	stat = STM_ExecServer ();
    	user ();
    } while (stat! = STM_EXEC_TSKEND);
    ..
    ..
    

  3. If NULL is specified, the stream server will be STM_EXEC_PAUSE via STM_EXEC_TSKEND. Be sure to keep calling the server function until STM_EXEC_TSKEND.

  4. When using a file system, specify NULL and stop it.

  5. When the access of the stream group is resumed, it will be read from the stop position.


 List
 Title

Function specifications

 Function

Specifying the server execution group (returning to completion)

 Function Name

STM_SetExecGrp

 No

7.2

Form
Bool STM_SetExecGrp (StmGrpHn grp)
input
grp: stream group handle
output
none
Function value
 TRUE
 : When processing is accepted
 FALSE
 : If the process is not completed
function
Specifies the stream group that the stream server runs. Since it is a completion return, this function will not end until the processing is completed.
remarks

  1. Wait for the drive to pause in this function.

  2. If NULL is specified, the stream server will be STM_EXEC_PAUSE.

  3. When using a file system, specify NULL and stop it.

  4. When resuming access to the stream group, read from the stop position.


 List
 Title

Function specifications

 Function

Server execution

 Function Name

STM_ExecServer

 No

7.3

Form
Sint32 STM_ExecServer (void)
input
none
output
none
Function value
Stream access state (StmAcStat)
Function ID (StmFuncId) when executing an immediate return function
In case of error, error code (StmErrCode)
function
Run the stream server.
remarks
Call this function at least once per second.

 List
 Title

Function specifications

 Function

Playback position setting

 Function Name

STM_MovePickup

 No

7.4.

Form
voidSTM_MovePickup (StmHn stm, Sint32 ofs)
input
 stm
 : Stream handle
 ofs
 : Offset from the beginning of the stream (in sector units)
output
none
Function value
none
function
Sets the playback position of the stream group to which the stream belongs.
remarks

  1. Destination FAD = Stream head FAD + offset.

  2. The pickup position is moved by running STM_ExecServer.


 List
 Title

Function specifications

 Function

Specifying the loop start stream

 Function Name

STM_SetLoop

 No

7.5 7.5

Form
Bool STM_SetLoop (StmGrpHn grp, StmHn loopstm, Sint32 loopmax)
input
 grp
 : Stream group handle
 loopstm
 : Loop start stream
(NULL if not looping. STM_LOOP_DFL for first stream)
 loopmax
 : Number of loops (STM_LOOP_ENDLESS for infinite times)
output
none
Function value
 TRUE
 : If it can be set correctly
 FALSE
 : For resident streams
function
Specify the loop start stream of the stream group and the number of loops.
remarks

  1. The default loop start stream is the frontmost stream. The loop times are infinite.

  2. If you close the loop start stream, the first stream becomes the loop start stream.

  3. The loop counter is initialized.

  4. The resident stream cannot be specified as the loop start stream.


 List
 Title

Function specifications

 Function

Get loop counter

 Function Name

STM_GetLoopCnt

 No

7.6

Form
Sint32 STM_GetLoopCnt (StmGrpHn grp)
input
grp: stream group handle
output
none
Function value
Loop counter
function
Gets the number of loops.

 List
 Title

Function specifications

 Function

Get execution status

 Function Name

STM_GetExecStat

 No

7.7

Form
Sint32 STM_GetExecStat (StmGrpHn grp, Sint32 * fad)
input
grp: stream group handle
output
fad: FAD being played
Function value
Stream access state (StmAcStat)
function
Gets the execution status of the specified stream group.

 List
 Title

Function specifications

 Function

Checking the end of stream access

 Function Name

STM_IsComplete

 No

7.8

Form
Bool STM_IsComplete (StmHn stm)
input
stm: stream handle
output
none
Function value
 TRUE
 : When stream access is finished
 FALSE
 : When stream access is not finished
function
Checks if the specified stream has been accessed.
remarks
The timing when stream access ends is as follows.
 Transfer gate
 timing
 Closed
 When reading is finished
 is open
 When the transfer is complete 

 List
 Title

Function specifications

 Function

Stream data transfer

 Function Name

STM_ExecTrans

 No

7.9

Form
Bool STM_ExecTrans (StmHn stm)
input
stm: stream handle
output
none
Function value
 TRUE
 : Transfer started
 FALSE
 : Did not start transfer
function
Extracts the data of the specified stream from the CD buffer partition and transfers it.
remarks

  1. Always FALSE when the transfer gate is closed.

  2. The set transfer mode and maximum number of transfer sectors are valid.

  3. If DMA transfer is specified, call this function repeatedly until the transfer is stopped by STM_IsTrans.


BackForward
PROGRAMMER'S GUIDEStream system library
Copyright SEGA ENTERPRISES, LTD., 1997