vceSetCurrentMessage

Defines a new current message.

Prototype

DWORD vceSetCurrentMessage ( VCEHD vh, unsigned message)

Argument

Description

vh

Handle of an open voice object.

message

Message number in opened voice object.


Return values

Return value

Description

SUCCESS

 

CTAERR_FUNCTION_ACTIVE

Playing or recording is already active on the context.

CTAERR_INVALID_HANDLE

vh is not a valid handle to an open voice object.

CTAERR_SVR_COMM

Server communication error.

VCEERR_INVALID_MESSAGE

message is out of range for the specified voice object.


Details

vceSetCurrentMessage defines the current message for the context that vh implied. It is a special case of vceSetCurrentList where the list consists of one message.

Use this function to select a message prior to using position-oriented functions that include vceSetPosition, vcePlay, vceRecord, vceErase, vceRead, and vceWrite.

vceSetCurrentMessage returns SUCCESS for a message number that is valid for the file type of vh. Otherwise, the return code is VCEERR_INVALID_MESSAGE.

To define the current message as all messages in vh, concatenated in numerical order, specify VCE_ALL_MESSAGES as the message number.

You cannot set the current message while play or record is active.

Use vceGetCurrentList to query the current message.

Example

/* Play the first 5 seconds of the specified message */

void myPreviewMessage (CTAHD ctahd, VCEHD vh, unsigned message)
{
    CTA_EVENT event;

    vceSetCurrentMessage (vh, message);
    vcePlay (ctahd, 5000, NULL);
    do
    {
        ctaWaitEvent( CtaQueueHd, &event, CTA_WAIT_FOREVER);
    } while (event.id != VCEEVN_PLAY_DONE);/* Ignore other events */
}