FMOD_ASYNCREADINFO

FMOD Studio API

Firelight Technologies FMOD Studio API

FMOD_ASYNCREADINFO

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

C/C++ Syntax

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

JavaScript Syntax

struct FMOD_ASYNCREADINFO
{
  handle,
  offset,
  sizebytes,
  priority,
  userdata,
  buffer,
  bytesread,
  done,
};

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')

userdata

[r/w] User data pointer specific to this request. Initially 0, can be ignored or set by the user. Not related to the file's main userdata member.

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.

done

[r] FMOD file system wake up function. Call this when user file read is finished. Pass result of file read as a parameter.

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 calling 'done'.
As soon as done is called, FMOD will asynchronously continue internally using the data provided in this structure.

Set result in the 'done' function pointer 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.

JavaScript only :

Not all fields are currently supported or may not work as expected at this time. To initialize an new instance in javascript use "FMOD.ASYNCREADINFO()", no 'new' keyword is required.

See Also




Version 1.10.03 Built on Feb 1, 2018