Japanese
PROGRAMMER'S GUIDEStream system library
BackForward
stream system library


6.1 Basic data


 one
View
table
 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 type 4-byte integer (takes logical constant as value)

(2) Logical constant
Use as a logical type (Bool) value.
 constant name
 value
 explanation
 FALSE
 0
 represents a logical false value
 TRUE
 1
 represents the truth of a logical value

(3) Others
 constant name
 value
 explanation
 NULL
 ((void *)0)
 NULL pointer


6.2 Constants


 one
View
table
 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 


 one
View
table
 Title

data specifications

 Data

Stream access state

 Data Name

StmAcStat

 No

2.2

(1) Stream access state
 constant name
 explanation
 STM_EXEC_COMPLETED
 Access ended
 STM_EXEC_PAUSE
 Access is temporarily suspended
 STM_EXEC_DOING
 Accessing
 STM_EXEC_WAIT
 Waiting for transfer
 STM_EXEC_TSKEND
 Immediate return type function termination

(2) Waiting for transfer status
If the stream cannot be accessed due to the following situations, STM_EXEC_WAIT will occur.
 transfer gate
 situation
 is open
 - When the transfer area becomes full.
・ If the CD buffer runs out of free space before the transfer start FAD is reached.
 Closed/
Transfer area not registered
・When reading the stream is finished.
・ If the CD buffer is full.


 one
View
table
 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 


 one
View
table
 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
 Bad file identifier
 STM_ERR_HNDL
 Invalid 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 in operation
 STM_ERR_TMOUT
 timeout
 STM_ERR_CDOPEN
 tray is open
 STM_ERR_FATAL
 CD drive< FATAL> situation


6.3 Data types


 one
View
table
 Title

data specifications

 Data

library handle

 Data Name

StmGrpHn,StmHn

 No

3.1

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


 one
View
table
 Title

data specifications

 Data

stream key

 Data Name

StmKey

 No

3.2

Used to specify and obtain stream keys.

(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

After each submode and coding information are ANDed with the mask pattern, it is determined whether they are equal to the comparison value.

conditional expression
→(Subcode & SMMSK) == SMVAL
→(Coding information & CIMSK) == CIVAL

(2) Special constants for stream keys
 constant name
 explanation
 STM_KEY_NONE
 Ignore each stream key selection. file number,
Masking channel numbers, submodes and coding information
Specify the pattern.

(3) Submode
bit 7   6   5   4   3   2   1   0
   [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] 
    |   |   |   |   |   |   |   |   (same as CD-ROM XA subcode byte)
    |   |   |   |   |   |   |   |
    |   |   |   |   |   |   |   +---- STM_SM_EOR       1:Last sector of 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


 one
View
table
 Title

data specifications

 Data

Stream playback range

 Data Name

StmFrange

 No

3.3

Used to specify and retrieve the playback range of the stream.

(1) Stream playback range
StmFrange *frange
 access macro
 mold
 explanation
 STM_FRANGE_SFAD(frange)
 Sint32
 Playback start FAD
 STM_FRANGE_FASNUM(frange)
 Sint32
 Number of sectors played

(2) Constant for stream playback range
 constant name
 explanation
 STM_FAD_CDTOP
 Indicates the beginning of the disc (specified as playback start FAD)
 STM_FAD_CDEND
 Indicates the number of sectors to the end of the disk
(Specify the number of sectors to be played)


 one
View
table
 Title

data specifications

 Data

Sector information

 Data Name

StmSct

 No

3.4

Used to obtain 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 


 one
View
table
 Title

data specifications

 Data

error condition

 Data Name

StmErrStat

 No

3.5

Used to hold and retrieve error status.

(1) Error condition
StmErrStat *err
 access macro
 mold
 explanation
 STM_ERR_CODE(err)
 Sint32
 Error code
 STM_ERR_WHERE(err)
 Sint32
 Error occurrence location (function ID)
 STM_ERR_FUNC(err)
 StmErrFunc
 Function to call when an error occurs
 STM_ERR_OBJ(err)
 void*
 1st argument of error function 


 one
View
table
 Title

data specifications

 Data

Buffer size monitoring function

 Data Name

StmCdbufFunc

 No

3.6

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

 one
View
table
 Title

data specifications

 Data

transfer function

 Data Name

StmTrFunc

 No

3.7

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

 one
View
table
 Title

data specifications

 Data

error function

 Data Name

StmErrFunc

 No

3.8

Format
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