|Firelight Technologies FMOD Ex|
Callback for reading from a file asynchronously. Different to FMOD_FILE_READCALLBACK in that this function can be returned from immediately without supplying any data, which will simply cause FMOD to wait internally for data.
The user will fill out the writeable variables in the FMOD_ASYNCREADINFO structure (in any thread), and when the FMOD_ASYNCREADINFO::result field is set to something other than FMOD_ERR_NOTREADY then it will continue.
FMOD_RESULT F_CALLBACK FMOD_FILE_ASYNCREADCALLBACK( FMOD_ASYNCREADINFO * info, void * userdata );
Pointer to FMOD_ASYNCREADINFO structure. Use this structure for your own system, to obtain the pointer to write to and number of bytes to read, as well as other information.
Userdata initialized in the FMOD_FILE_OPENCALLBACK.
If the function succeeds then the return value is FMOD_OK.
If the function fails then the return value will be one of the values defined in the FMOD_RESULT enumeration.
To return immediately, return FMOD_OK.
If during your code path, there was a fatal error, for example if you ran out of memory return FMOD_ERR_MEMORY and this will cause FMOD to stop what it was trying to do and return the error back to the caller.
NOTE: If userasyncread is processed in the main thread, then it will hang the application, because FMOD will wait internally until data is ready, and the main thread process will not be able to supply the data. For this reason the user's file access should normally be from a separate thread.
Version 4.44.07 Built on Feb 11, 2013