Previous Topic Index Next Topic
[API function]

FSOUND_File_SetCallbacks

Specify user callbacks for FMOD's internal file manipulation functions.
If ANY of these parameters are NULL, then FMOD will switch back to its own file routines.
You can replace this with memory routines (ie name can be cast to a memory address for example, then open sets up
a handle based on this information), or alternate file routines, ie a WAD file reader.

DLL_API void F_API FSOUND_File_SetCallbacks(
FSOUND_OPENCALLBACK useropen,
FSOUND_CLOSECALLBACK userclose,
FSOUND_READCALLBACK userread,
FSOUND_SEEKCALLBACK userseek,
FSOUND_TELLCALLBACK usertell
);

Parameters

OpenCallback Callback for opening a file.
CloseCallback Callback for closing a file.
ReadCallback Callback for reading from a file.
SeekCallback Callback for seeking within a file..
TellCallback Callback for returning the offset from the base of the open file in bytes.

Return Value

void

Remarks

Memory loader FMOD functions are not affected, such as FMUSIC_LoadSongMemory etc.
WARNING : This function is dangerous in the wrong hands. You must return the right values, and each
command must work properly, or FMOD will not function, or it may even crash if you give it invalid data.
You must support SEEK_SET, SEEK_CUR and SEEK_END properly, or FMOD will not work properly. See standard I/O help files on how these work under fseek().
Read the documentation in REMARKS and do exactly what it says. See the "simple" example for how it is
used properly.
The MIDI loader does not support user file callbacks. For WAD type data structures with embedded MIDI
files FMUSIC_LoadSongMemory will have to be used.
___________________
Supported on the following platforms : Win32, WinCE, Linux, Macintosh, XBox, PlayStation 2

See Also

FMUSIC_LoadSong , FMUSIC_LoadSongMemory , FSOUND_CLOSECALLBACK , FSOUND_OPENCALLBACK , FSOUND_READCALLBACK , FSOUND_SEEKCALLBACK , FSOUND_TELLCALLBACK

This document copyright ©Firelight Technologies, Pty, Ltd, 1999-2002. All rights reserved.
Generated Fri Dec 20 16:31:08 2002 by SourceDoc v0.10, the automated source code documenter.