SB AWE32 Developer's Information Pack PART II DOS Real/Protected Mode API •• 24
Copyright Creative Technology Ltd., 1994-1996 Version 3.00
awe32SetPresets
WORD
PASCAL
awe32SetPresets(SOUND_PACKET FAR* SP)
Action
Use the specified presets (in SP->presets) for the specified SoundFont bank (in SP-
>bank_no). Until the awe32Terminate function is called or the presets are reset with
awe32ReleaseBank, the library will continue to use the memory block pointed to by
SP->presets.
Parameters
SP
Points to the SOUND_PACKET in which the bank number, and the memory buffer are
specified. awe32SetPresets assumes SP is not NULL.
Member Remarks
bank_no
The bank number for which these presets will be set.
presets
Points to the buffer in which the presets are stored. The buffer
should be at least
SP->presets_read_size
bytes in length. (
SP-
>presets_read_size
is set by calling
awe32SFontLoadRequest
). The library will continue to use
this memory for the SoundFont bank, so you must not free it
unless the library is terminated with
awe32Terminate
or the
presets are reset with a call to
awe32ReleaseBank
.
Return
If successful, awe32SetPresets returns zero; otherwise, it returns non-zero. The
following fields of SP will filled upon successful return from this API.
Member Remarks
preset_size
The actual size required in
SP->presets
. This will not be more
than the value in
SP->preset_read_size
; typically, it will be
about 30 percent smaller. The client may resize the presets
memory block if the location of the block does not change.
(The Standard C library function,
realloc
, may move a block to
resize it, so
realloc
is not suitable for resizing the presets
block.)
awe32ReleaseBank
WORD
PASCAL
awe32ReleaseBank(SOUND_PACKET FAR* SP)
Action
Mark the memory being used for presets by the bank as free and makes the bank
unusable. Applications are responsible for freeing any allocated memory buffers.
Attempting to play a patch from the released bank results in undefined behavior.
Parameters
SP
Points to the SOUND_PACKET in which the bank number is specified.
awe32ReleaseBank assumes SP is not NULL.