Japanese
PROGRAMMER'S GUIDEStream system library
BackForward
stream system library

7.Function specification-7


7.7 Stream server execution


 one
View
table
 Title

function specification

 Function

Specifying server execution group (immediate return)

 Function name

STM_NwSetExecGrp

 No

7.1

Format
Bool STM_NwSetExecGrp(StmGrpHn grp)
input
grp: stream group handle
output
none
function value
 TRUE
 : If the process is accepted
 FALSE
 : If the process is not completed
function
Specifies the stream group that the stream server should run. Since the return is immediate, a server function must be called.
remarks

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

  2. If you specify NULL to use a file system, call the GFS function after confirming that the drive is in a paused state using the steps below.

    .
    .
    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 go to STM_EXEC_PAUSE via STM_EXEC_TSKEND. Be sure to continue calling the server function until STM_EXEC_TSKEND is reached.

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

  5. When you resume accessing the stream group, it will read from the stopped position.


 one
View
table
 Title

function specification

 Function

Specifying server execution group (completion return)

 Function name

STM_SetExecGrp

 No

7.2

Format
Bool STM_SetExecGrp(StmGrpHn grp)
input
grp: stream group handle
output
none
function value
 TRUE
 : If the process 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. This function waits until the drive enters the pause state.

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

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

  4. When you resume accessing the stream group, read from the stopped position.


 one
View
table
 Title

function specification

 Function

Running the server

 Function name

STM_ExecServer

 No

7.3

Format
Sint32 STM_ExecServer(void)
input
none
output
none
function value
Stream access status (StmAcStat)
If an immediate return type function is being executed, the function ID (StmFuncId)
In case of error, error code (StmErrCode)
function
Run the stream server.
remarks
Please call this function at least once per second.

 one
View
table
 Title

function specification

 Function

Setting the playback position

 Function name

STM_MovePickup

 No

7.4

Format
voidSTM_MovePickup(StmHn stm, Sint32 ofs)
input
 stm
 :Stream handle
 ofs
 : Offset from the beginning of the stream (in sectors)
output
none
function value
none
function
Set the playback position of the stream group to which the stream belongs.
remarks

  1. Destination FAD = stream start FAD + offset.

  2. The pickup position is moved by executing STM_ExecServer.


 one
View
table
 Title

function specification

 Function

Specifying loop start stream

 Function name

STM_SetLoop

 No

7.5

Format
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 if first stream)
 loopmax
 : Number of loops (STM_LOOP_ENDLESS for infinite times)
output
none
function value
 TRUE
 : If the settings were made correctly
 FALSE
 : For resident stream
function
Specify the loop start stream and loop count for the stream group.
remarks

  1. The default loop start stream is the forwardmost stream. The loop number is infinite.

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

  3. The loop counter is initialized.

  4. A resident stream cannot be specified as a loop start stream.


 one
View
table
 Title

function specification

 Function

Get loop counter

 Function name

STM_GetLoopCnt

 No

7.6

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

 one
View
table
 Title

function specification

 Function

Get execution status

 Function name

STM_GetExecStat

 No

7.7

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

 one
View
table
 Title

function specification

 Function

Check for end of stream access

 Function name

STM_IsComplete

 No

7.8

Format
Bool STM_IsComplete(StmHn stm)
input
stm: stream handle
output
none
function value
 TRUE
 : If stream access has ended
 FALSE
 : If stream access is not finished
function
Checks whether the specified stream has been accessed.
remarks
The timing at which stream access ends is as follows.
 transfer gate
 timing
 closed
 When loading is finished
 is open
 When the transfer ends 

 one
View
table
 Title

function specification

 Function

Stream data transfer

 Function name

STM_ExecTrans

 No

7.9

Format
Bool STM_ExecTrans(StmHn stm)
input
stm: stream handle
output
none
function value
 TRUE
 : Transfer started
 FALSE
 : Transfer was not started
function
Retrieve the data of the specified stream from the CD buffer section and transfer it.
remarks

  1. Always FALSE if 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 no longer in progress using STM_IsTrans.


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