(Page 35 of 40 in this chapter)


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. Valid values are:
VCE_SEEK_SET
Absolute position.
VCE_SEEK_CUR
Relative position (+ or -).
VCE_SEEK_END
Backward from end.

actual Pointer to returned new position.

Return Values

Events

Details

This function changes the current position in the current message for the CTA 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.

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 35 of 40 in this chapter)


tech_support@nmss.com
Copyright © 1999, Natural MicroSystems, Inc. All rights reserved.