mme_trksessionview_readx()

Read track data from the track session view

Synopsis:

#include <mme/mme.h>

int mme_trksessionview_readx( mme_hdl_t *hdl,
                              unsigned type,
                              int offset,
                              unsigned ntracks,
                              void *buf,
                              unsigned *buflen );

Arguments:

hdl
An MME connection handle.
type
The type of information requested. See TRKVIEW_READ_* below.
offset
The 0-based offset in the track session at which to start reading.
ntracks
The number of tracks for which information is requested.
buf
A pointer to the buffer into which the information can be placed.
buflen
A pointer to the size,in bytes, of the buffer. Specify the size you allocate for the request when calling the function; it will fill in the size actually required to fulfill the request, which you can check when the function returns.

Library:

mme

Description:

The function mme_trksessionview_readx() reads track session data from the trksessionview table. It fills the buffer referenced by buf with an array of elements.

The number of elements in the array is set by the ntracks parameter, and the type and size of the elements are determined by the type parameter:


Note: Set the type argument to TRKVIEW_READ_FILE only for file-based track sessions (track sessions created with the mode argument set to MME_PLAYMODE_FILE).

The function mme_trksessionview_readx() returns the number of elements it successfully read. This number may be less than the number of elements requested (ntracks if the source mediastore contains less files than the requested number, or if the allocated buffer is too small to contain the information for all the requested tracks.

To ensure that you call mme_trksessionview_readx() with a buffer large enough for all the requested elements, you can call it once with buflen set to 0:

*buflen = 0
mme_trksessionview_readx(hdl, type, offset, ntracks, buf, buflen);

The function will fill in buflen with the buffer size required for the number and type of information you request. You can then call mme_trksessionview_readx() a second time, certain that your buffer is large enough for your request.

trksessionview_entry_t

typedef struct {
        uint64_t fid;
} trksessionview_entry_t;

The data structure trksessionview_entry_t defines the array used by mme_trksessionview_read() to store track session view entries in memory.

trksessionview_entry_file_t

typedef struct {
    uint64_t  msid;
    uint32_t  reserved;
    char      *filename;
} trksessionview_entry_file_t;

The data structure trksessionview_entry_file_t carries information about tracks in a track session. It contains the following members:

Member Type Description
msid uint64_t The mediastore ID of the mediastore with the track.
reserved uint32-t Reserved for future use.
filename char The filename of the track.

TRKVIEW_READ_*

#define TRKVIEW_READ_FID  0x00000001
#define TRKVIEW_READ_FILE 0x00000002

The TRKVIEW_READ_* constants are used to set the type of information mme_trksessionview_readx() requests from the trksessionview table. Its value can be set to:

Events

None delivered.

Blocking and validation

This function doesn't block.

Returns:

0: the number of elements the function successfully read.
Success.
-1
An error occurred (errno is set).

Classification:

QNX Neutrino

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

mme_trksessionview_get_info(), mme_trksessionview_info_t, mme_trksessionview_metadata_get(), mme_trksessionview_writedb()