Previous Topic Index Next Topic
[API function]

FMUSIC_SetSample

Replaces a mod's sample with a sample definition specified.

signed char F_API FMUSIC_SetSample(
FMUSIC_MODULE *mod,
int sampno,
FSOUND_SAMPLE *sptr
);

Parameters

mod Pointer to the song to set the sample for.
sampno index to sample inside module.
sptr Pointer to the sample definition to replace mod sample

Return Value

On success, TRUE is returned.
On failure, FALSE is returned.

Remarks

Because of the instrument nature of some formats like XM, this function lists all the samples in order of instruments and their subsamples.
ie if instrument 1 has 2 samples and instrument 2 contains 3 samples, then sampno in this case would be 0 and 1 for instrument 1's samples, and 2,3 & 4 for instrument 2's samples.
------------
FMOD frees the sample inside the mod, but only if it was not previously set with SetSample. (previous versions of fmod freed the sample regardless)
------------
Important: For PlayStation 2, this function has to do a blocking query to the IOP, and can take significantly more time than a standard non blocking fmod function. This means it is best to cache the pointers for samples while loading, and not call this function in realtime.
------------
This function is not supported with the MIDI format.
___________________
Supported on the following platforms : Win32, WinCE, Linux, Macintosh, XBox, PlayStation 2, GameCube

See Also

FMUSIC_GetSample

This document copyright ©Firelight Technologies, Pty, Ltd, 1999-2002. All rights reserved.
Generated Fri Sep 05 18:50:22 2003 by SourceDoc v0.10, the automated source code documenter.