Firelight Technologies FMOD Studio API

FMOD_ASYNCREADINFO

Structure that is passed into FMOD_FILE_ASYNCREAD_CALLBACK. Use the information in this structure to perform

Structure

typedef struct {
  void *handle;
  unsigned int offset;
  unsigned int sizebytes;
  int priority;
  void *buffer;
  unsigned int bytesread;
  FMOD_RESULT result;
  void *userdata;
} FMOD_ASYNCREADINFO;

Members

handle

[r] The file handle that was filled out in the open callback.

offset

[r] Seek position, make sure you read from this file offset.

sizebytes

[r] how many bytes requested for read.

priority

[r] 0 = low importance. 100 = extremely important (ie 'must read now or stuttering may occur')

buffer

[w] Buffer to read file data into.

bytesread

[w] Fill this in before setting result code to tell FMOD how many bytes were read.

result

[r/w] Result code, FMOD_OK tells the system it is ready to consume the data. Set this last! Default value = FMOD_ERR_NOTREADY.

userdata

[r] User data pointer.

Remarks

Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
Members marked with [w] mean the variable can be written to. The user can set the value.

Instructions: write to 'buffer', and 'bytesread' BEFORE setting 'result'.
As soon as result is set, FMOD will asynchronously continue internally using the data provided in this structure.

Set 'result' to the result expected from a normal file read callback.
If the read was successful, set it to FMOD_OK.
If it read some data but hit the end of the file, set it to FMOD_ERR_FILE_EOF.
If a bad error occurred, return FMOD_ERR_FILE_BAD
If a disk was ejected, return FMOD_ERR_FILE_DISKEJECTED.

See Also




Version 1.03.06 Built on Apr 17, 2014