Maxmod
|
Functions | |
void | mmInit (mm_ds_system *system) |
Initializes Maxmod with the settings specified. | |
void | mmInitDefault (const char *soundbank_file) |
Initialize Maxmod with default settings. | |
void | mmInitDefaultMem (mm_addr soundbank) |
Initialize Maxmod with default settings. | |
void | mmLoad (mm_word module_ID) |
Loads a module into memory for playback. | |
void | mmLoadEffect (mm_word sample_ID) |
Loads a sound effect into memory for playback. | |
void | mmLockChannels (mm_word bitmask) |
Lock audio channels to prevent Maxmod from using them. | |
void | mmSelectMode (mm_mode_enum mode) |
Switches the audio mode for Maxmod DS. | |
void | mmSetCustomSoundBankHandler (mm_callback p_loader) |
Install a custom routine to interface with the soundbank data. | |
void | mmSetEventHandler (mm_callback handler) |
Install handler to receive song events. | |
void | mmSoundBankInFiles (char *filename) |
Setup the standard interface for a soundbank that is loaded in the file system. | |
void | mmSoundBankInMemory (mm_addr address) |
Enable the standard interface for a soundbank that is loaded into memory. | |
void | mmUnload (mm_word module_ID) |
Unloads and frees memory space occupied by a module. | |
void | mmUnloadEffect (mm_word sample_ID) |
Unloads a sound effect and frees the memory if the reference count becomes zero. | |
void | mmUnlockChannels (mm_word bitmask) |
Unlocks audio channels to allow Maxmod to use them. | |
void mmInit | ( | mm_ds_system * | system | ) |
Initializes Maxmod with the settings specified.
Initialize system. Call once at startup.
For DS projects, you must also setup a soundbank interface with one of the mmSoundBank* functions.
system | Maxmod setup configuration. |
Example:
void mmInitDefault | ( | const char * | soundbank_file | ) |
Initialize Maxmod with default settings.
For DS, this function also sets up the internal soundbank interface to use the file specified.
soundbank_file | Filename of soundbank. A soundbank file can be created with the Maxmod Utility. |
void mmInitDefaultMem | ( | mm_addr | soundbank | ) |
Initialize Maxmod with default settings.
This function also sets up the internal soundbank interface to use the file that is located somewhere in memory.
Use this when you have the entire soundbank loaded into memory.
soundbank | Address of soundbank data. |
void mmLoad | ( | mm_word | module_ID | ) |
Loads a module into memory for playback.
Must be used before starting to play a module with mmStart().
module_ID | Index of module to be loaded. Values are defined in the soundbank header output. (prefixed with "MOD_") |
void mmLoadEffect | ( | mm_word | sample_ID | ) |
Loads a sound effect into memory for playback.
May be played with mmEffect()/mmEffectEx() afterwards.
sample_ID | Index of sample to be loaded. Values are defined in the soundbank header output (prefixed with "SFX_) |
void mmLockChannels | ( | mm_word | bitmask | ) |
Lock audio channels to prevent Maxmod from using them.
This is for when you need to operate on the DS hardware channels directly. Note that if you use this function while music or sound effects are playing, any active notes that are using the channels to be locked will be cut.
bitmask | Selection of channels to lock. Bit0 = Channel0, Bit1 = Channel1 ... Bit15 = Channel15 |
void mmSelectMode | ( | mm_mode_enum | mode | ) |
Switches the audio mode for Maxmod DS.
Hardware mixing offers 16-channel audio with minimal CPU load.
Interpolated mixing extends the capability of the hardware channels by adding linear interpolation in software.
Extended mixing increases the channel count to 30 with software mixing.
mode | New audio mode. Pass MM_MODE_A for complete hardware mixing, MM_MODE_B for interpolated mixing, or MM_MODE_C for extended mixing. |
void mmSetCustomSoundBankHandler | ( | mm_callback | p_loader | ) |
Install a custom routine to interface with the soundbank data.
The routine will be responsible for handling requests from Maxmod to access data in the soundbank.
p_loader | Function pointer to soundbank request handler. |
void mmSetEventHandler | ( | mm_callback | handler | ) |
Install handler to receive song events.
Use this function to receive song events. Song events occur in two situations. One is by special pattern data in a module (which is triggered by SFx/EFx commands). The other occurs when a module finishes playback (in MM_PLAY_ONCE mode).
handler | Function pointer to event handler. |
void mmSoundBankInFiles | ( | char * | filename | ) |
Setup the standard interface for a soundbank that is loaded in the file system.
This function should be called after mmInit and before any Load or Unload operations. This function is called by mmInitDefault.
filename | Filename of your soundbank binary. |
void mmSoundBankInMemory | ( | mm_addr | address | ) |
Enable the standard interface for a soundbank that is loaded into memory.
This function should be called after mmInit and before any Load or Unload functions. This function is called by mmInitDefaultMem.
address | Memory address of soundbank file. |
void mmUnload | ( | mm_word | module_ID | ) |
Unloads and frees memory space occupied by a module.
Caution: Ensure that the module to be unloaded isn't playing!
module_ID | Index of module to be unloaded from memory. |
void mmUnloadEffect | ( | mm_word | sample_ID | ) |
Unloads a sound effect and frees the memory if the reference count becomes zero.
sample_ID | Index of sample to be unloaded. |
void mmUnlockChannels | ( | mm_word | bitmask | ) |
Unlocks audio channels to allow Maxmod to use them.
This function can be used to restore channel usage to Maxmod when you are finished using certain channels.
Note that in the "Interpolated Audio" mode, channels can not be unlocked. To unlock channels in the interpolated mode you must reset the audio system. To reset the audio system, use mmSelectMode.
bitmask | Selection of channels to unlock. Bit0 = Channel0, Bit1 = Channel1, Bit2 = Channel2 ... Bit15 = Channel15 |