Table of Contents Index NMS Glossary Previous Page Next Page (Page 16 of 69 in this chapter) Version


adiGetPlayStatus

Description

Retrieves status for the active or most recently executed play operation.

Prototype

DWORD adiGetPlayStatus ( CTAHD ctahd,
ADI_PLAY_STATUS *info,
unsigned size )

ctahd CTA context handle returned by ctaCreateContext.

info Pointer to the ADI_PLAY_STATUS structure, as shown:

typedef struct

{

DWORD size; /* returned size (GetPlayStatus()) */

DWORD reason; /* reason last play ended */

DWORD buffercount; /* counter of buffers submitted */

DWORD framecount; /* number of frames submitted */

DWORD totalbytes; /* total bytes submitted */

void *buffer; /* last buffer pointer submitted */

DWORD bytecount; /* size of last buffer submitted */

DWORD bytesplayed; /* total bytes actually played */

DWORD timestarted; /* actual time started (ms units) */

DWORD underrun; /* counts out-of-frame events */

} ADI_PLAY_STATUS;

size Amount of memory available at info to receive the ADI_PLAY_STATUS.

Return Values

Events

None.

Details

This function retrieves status information about the active or most recently completed voice play operation for the specified CTA context.

Up to size bytes of the ADI_PLAY_STATUS structure are copied to the address pointed to by info. If size is greater than or equal to sizeof(ADI_PLAY_STATUS), the complete structure is copied. The number of bytes copied is returned in the ADI_PLAY_STATUS size field.

adiGetPlayStatus may be issued while actively playing. If there is no active play operation, the status information pertains to the most recently completed instance.

The ADI_PLAY_STATUS structure contains the following fields:
Field

Description

size

Number of bytes copied to info.

reason

Termination condition for the last ADIEVN_PLAY_DONE. This field is 0 if the play operation is active, or if it has not been started since the CTA context was last opened.

buffercount

Number of buffers submitted.

framecount

Number of voice frames submitted.

totalbytes

Number of bytes submitted by the application.

buffer

Last buffer pointer submitted.

bytecount

Size of the last buffer submitted.

bytesplayed

Total number of bytes actually processed by the DSP and transmitted.

timestarted

Timestamp for when the play operation started (refer to adiGetTimeStamp).

underrun

Total number of underruns during the play instance (refer to the ADI Service Developer's Manual for more information about underruns).

See Also

adiStartPlaying, adiPlayAsync, adiPlayFromMemory, adiStopPlaying

Example


void myShowPlayStatus( CTAHD ctahd )
{
    ADI_PLAY_STATUS playstatus;

    adiGetPlayStatus( ctahd, &playstatus, sizeof playstatus );

    printf( "Termination condition=%x  bytes played=%d\n",
            playstatus.reason, playstatus.bytesplayed );
}



Table of Contents Index NMS Glossary Previous Page Next Page (Page 16 of 69 in this chapter) Version


Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2000, Natural MicroSystems, Inc. All rights reserved.