PROGRAMMER'S GUIDEStream system library
BackForward
Stream system library


6.1 Basic data


 List
 Title

Data specifications

 Data

Basic data

 Data Name
 No

1.0

(1) Basic data type
 Model name
 explanation
 Uint8
 Unsigned 1-byte integer
 Sint8
 Signed 1-byte integer
 Uint16
 Unsigned 2-byte integer
 Sint16
 Signed 2-byte integer
 Uint32
 Unsigned 4-byte integer
 Sint32
 Signed 4-byte integer
 Bool
 Logical 4-byte integer (takes a logical constant as a value)

(2) Logical constant
Used as a Boolean value.
 Constant name
 value
 explanation
 FALSE
 0
 Represents false logical value
 TRUE
 1
 Represents the truth of a logical value

(3) Other
 Constant name
 value
 explanation
 NULL
 ((void *) 0)
 NULL pointer


6.2 Constant


 List
 Title

Data specifications

 Data

Reload specification during loop playback

 Data Name

StmLoopRead

 No

2.1

(1) Reload specification during loop playback
 Constant name
 explanation
 STM_LOOP_READ
 Reload during loop playback
 STM_LOOP_NOREAD
 Do not reload during loop playback 


 List
 Title

Data specifications

 Data

Stream access status

 Data Name

StmAcStat

 No

2.2

(1) Stream access status
 Constant name
 explanation
 STM_EXEC_COMPLETED
 Access end
 STM_EXEC_PAUSE
 Access is suspended
 STM_EXEC_DOING
 Accessing
 STM_EXEC_WAIT
 Waiting for transfer
 STM_EXEC_TSKEND
 Immediate return type function termination

(2) Waiting for transfer
If the stream cannot be accessed due to the following situations, it will be STM_EXEC_WAIT.
 Transfer gate
 Status
 is open
 -When the transfer area is full.
-When there is no free space in the CD buffer before the transfer start FAD is reached.
 Closed /
Transfer area unregistered
 -When the reading of the stream is completed.
-When the CD buffer is full.


 List
 Title

Data specifications

 Data

Function ID (1/2)

 Data Name

StmFuncId

 No

2.3

 Constant name
 Corresponding function
 STM_INIT
 STM_Init
 STM_OPENGRP
 STM_OpenGrp
 STM_CLOSEGRP
 STM_CloseGrp
 STM_GETSTMNUM
 STM_GetStmNum
 STM_GETSTMHNDL
 STM_GetStmHndl
 STM_SETCDBUFFUNC
 STM_SetCdbufFunc
 STM_OPENFID
 STM_OpenFid
 STM_OPENFRANGE
 STM_OpenFrange
 STM_OPENRESI
 STM_OpenResi
 STM_CLOSE
 STM_Close
 STM_SETKEY
 STM_SetKey
 STM_GETINFO
 STM_GetInfo
 STM_SCTTOWORD
 STM_SctToWord
 STM_WORDTOSCT
 STM_WordToSct
 STM_SETALIAS
 STM_SetAlias
 STM_UNSETALIAS
 STM_UnsetAlias
 STM_SETTRBUF
 STM_SetTrBuf
 STM_SETTRFUNC
 STM_SetTrFunc
 STM_STARTTRANS
 STM_StartTrans
 STM_SETTRGATE
 STM_SetTrGate
 STM_SETTRPARA
 STM_SetTrPara
 STM_SETTRFAD
 STM_SetTrFad
 STM_SETTRMODE
 STM_SetTrMode
 STM_RESETTRBUF
 STM_ResetTrBuf
 STM_GETNUMCDBUF
 STM_GetNumCdbuf
 STM_GETSCTINFO
 STM_GetSctInfo
 STM_GETLENTRBUF
 STM_GetLenTrBuf
 STM_ISTRBUFFULL
 STM_IsTrBufFull
 STM_ISTRANS
 STM_IsTrans
 STM_SETEXECGRP
 STM_SetExecGrp, STM_NwSetExecGrp
 STM_EXECSERVER
 STM_ExecServer
 STM_MOVEPICKUP
 STM_MovePickup
 STM_SETLOOP
 STM_SetLoop
 STM_GETLOOPCNT
 STM_GetLoopCnt
 STM_GETEXECSTAT
 STM_GetExecStat
 STM_ISCOMPLETE
 STM_IsComplete
 STM_EXECTRANS
 STM_ExecTrans
 STM_CONNECTCDBUF
 STM_ConnectCdbuf
 STM_MOVECDBUF
 STM_MoveCdbuf 


 List
 Title

Data specifications

 Data

Error code

 Data Name

StmErrCode

 No

2.4

The value of STM_ERR_OK is 0. Other error codes have negative values.
 Constant name
 explanation
 STM_ERR_OK
 normal termination
 STM_ERR_CDRD
 CD read error
 STM_ERR_CDNODISC
 CD is not set
 STM_ERR_FID
 Illegal file identifier
 STM_ERR_HNDL
 Illegal handle
 STM_ERR_NUM
 Negative number of sectors and words
 STM_ERR_PARA
 Illegal mode
 STM_ERR_NOHNDL
 There is no space in the handle
 STM_ERR_PUINUSE
 Pickup is in operation
 STM_ERR_TMOUT
 time out
 STM_ERR_CDOPEN
 The tray is open
 STM_ERR_FATAL
 CD drive is in <FATAL> state


6.3 Data type


 List
 Title

Data specifications

 Data

Library handle

 Data Name

StmGrpHn, StmHn

 No

3.1 3.1

Used for stream group and stream operations.
 Model name
 explanation
 StmGrpHn
 Stream group handle
 StmHn
 Stream handle 


 List
 Title

Data specifications

 Data

Stream key

 Data Name

StmKey

 No

3.2

Used to specify and get the stream key.

(1) Stream key
StmKey * stmkey
 Access macro
 Mold
 explanation
 STM_KEY_FN (stmkey)
 Sint16
 File number
 STM_KEY_CN (stmkey)
 Sint16
 Channel number
 STM_KEY_SMMSK (stmkey)
 Sint16
 Submode mask pattern
 STM_KEY_SMVAL (stmkey)
 Sint16
 Submode comparison value
 STM_KEY_CIMSK (stmkey)
 Sint16
 Coding information mask pattern
 STM_KEY_CIVAL (stmkey)
 Sint16
 Coding information comparison value

The submode and coding information are determined to be equal to the comparison value after being ANDed with the mask pattern.

Conditional expression
→ (Subcode & SMMSK) == SMVAL
→ (coding information & CIMSK) == CIVAL

(2) Stream key special constant
 Constant name
 explanation
 STM_KEY_NONE
 Ignores each stream key selection. File number,
Specify the mask pattern for the channel number, submode, and coding information.

(3) Sub mode
bit 7 6 5 4 3 2 1 0
   [] [] [] [] [] [] [] [] 
    | | | | | | | | (Same as subcode bytes on CD-ROM XA)
    | | | | | | | |
    | | | | | | | + ---- STM_SM_EOR 1: Last sector of the record | | | | | | + -------- STM_SM_VIDEO 1: Video sector | | | | | + ----- ------- STM_SM_AUDIO 1: Audio sector | | | | +---------------- STM_SM_DATA 1: Data sector | | | + -------- ------------ STM_SM_TRIG 1: Trigger on | | + ------------------------ STM_SM_FORM 1: Form2 0: Form1
    | + ---------------------------- STM_SM_RT 1: Real-time sector + -------------- ------------------ STM_SM_EOF 1: Last sector of file 


 List
 Title

Data specifications

 Data

Stream playback range

 Data Name

StmFrange

 No

3.3

It is used to specify and acquire the playback range of the stream.

(1) Stream playback range
StmFrange * flange
 Access macro
 Mold
 explanation
 STM_FRANGE_SFAD (frange)
 Sint32
 Playback start FAD
 STM_FRANGE_FASNUM (frange)
 Sint32
 Number of playback sectors

(2) Stream playback range constant
 Constant name
 explanation
 STM_FAD_CDTOP
 Indicates the beginning of the disc (specified in the playback start FAD)
 STM_FAD_CDEND
 Indicates the number of sectors to the disk end
(Specify the number of playback sectors)


 List
 Title

Data specifications

 Data

Sector information

 Data Name

StmSct

 No

3.4 3.4

Used to get sector information.

(1) Sector information
StmSct * sct
 Access macro
 Mold
 explanation
 STM_SCT_FAD (sct)
 Sint32
 Frame address
 STM_SCT_FN (sct)
 Sint32
 File number
 STM_SCT_CN (sct)
 Sint32
 Channel number
 STM_SCT_SM (sct)
 Uint8
 Submode
 STM_SCT_CI (sct)
 Uint8
 Coding information 


 List
 Title

Data specifications

 Data

Error status

 Data Name

StmErrStat

 No

3.5

It is used to hold and get the error status.

(1) Error status
StmErrStat * err
 Access macro
 Mold
 explanation
 STM_ERR_CODE (err)
 Sint32
 Error code
 STM_ERR_WHERE (err)
 Sint32
 Error location (function ID)
 STM_ERR_FUNC (err)
 StmErrFunc
 Call function when an error occurs
 STM_ERR_OBJ (err)
 void *
 First argument of the error function 


 List
 Title

Data specifications

 Data

Buffer size monitoring function

 Data Name

StmCdbufFunc

 No

3.6

Form
void (* StmCdbufFunc) (void * obj)
input
obj: Registered object
output
none

 List
 Title

Data specifications

 Data

Transfer function

 Data Name

StmTrFunc

 No

3.7

Form
Sint32 (* StmTrFunc) (void * obj, StmHn stm, Sint32 nsct)
input
obj: Registered object stm: Stream handle nsct: Number of transfer sectors
output
none

 List
 Title

Data specifications

 Data

Error function

 Data Name

StmErrFunc

 No

3.8

Form
void (* StmErrFunc) (void * obj, Sint32 ec)
input
obj : Registered object
ec :Error code
output
none

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