(Page 36 of 41 in this chapter) Version
vceSetPosition
Description
- Sets the current position in the current message.
Prototype
- DWORD vceSetPosition ( CTAHD ctahd,
int msec,
unsigned seekmode,
unsigned *actual)
- ctahd Handle returned by ctaCreateContext.
- msec Number of milliseconds to reposition.
- seekmode Type of repositioning.
Refer to Details for acceptable values.
- actual Pointer to returned new position.
Return Values
Events
Details
- This function changes the current position in the current message for the context specified by ctahd. The new position is returned in actual, unless actual is NULL.
- The msec argument may be negative when seekmode is VCE_SEEK_CUR. For other modes, msec should be positive.
- Valid values for seekmode are:
- Use this function when preparing to use functions that operate at the current position, including vcePlay, vceRecord, vceErase
, vceRead, and vceWrite.
- You cannot change the position while play or record is active.
- To query the current position without changing it, set msec to zero (0) and seekmode to VCE_SEEK_CUR. This is allowed even when there is an active function.
Note: During play or record, the current position is updated as each buffer is internally submitted for play or completed for record. When play ends, the values may be adjusted downward if not all of the bytes submitted to the device were actually played.
- If you attempt to seek beyond the end or beginning of the current message, SUCCESS will be returned. The new position will be set to the current size if seeking beyond the end, or to zero (0) if seeking to before the beginning.
See Also
- vceErase
, vcePlay, vceRead, vceRecord, vceSetCurrentList, vceSetCurrentMessage, vceWrite
Example
/* Report the current position in the current message.*/
unsigned MyTell (CTAHD ctahd)
{
unsigned position;
if (vceSetPosition (ctahd, 0, VCE_SEEK_CUR, &position) != SUCCESS)
return 0;
return position;
}
(Page 36 of 41 in this chapter) Version
Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2001, Natural MicroSystems, Inc. All rights
reserved.