LibXM7
Functions
libXM7 ARM9 functions.

ARM9 functions (... well, you can use them even on ARM7 if you want...). More...

Functions

XM7_Error XM7_LoadMOD (XM7_ModuleManager_Type *Module, const void *MODModule_)
 Load a MOD into a XM7_ModuleManager_Type structure. More...
 
XM7_Error XM7_LoadXM (XM7_ModuleManager_Type *Module, const void *XMModule_)
 Load an XM into a XM7_ModuleManager_Type structure. More...
 
void XM7_SetPanningStyle (XM7_ModuleManager_Type *Module, XM7_PanningStyles style, XM7_PanningDisplacementStyles displacement)
 This function configures how the panning is managed in the reproduction. More...
 
void XM7_SetReplayStyle (XM7_ModuleManager_Type *Module, XM7_ReplayStyles style)
 Setup the replay style of the module. More...
 
void XM7_UnloadMOD (XM7_ModuleManager_Type *Module)
 This function frees all the allocated memory thus unloading the module. More...
 
void XM7_UnloadXM (XM7_ModuleManager_Type *Module)
 This function frees all the allocated memory thus unloading the module. More...
 

Detailed Description

ARM9 functions (... well, you can use them even on ARM7 if you want...).

Function Documentation

◆ XM7_LoadMOD()

XM7_Error XM7_LoadMOD ( XM7_ModuleManager_Type *  Module,
const void *  MODModule_ 
)

Load a MOD into a XM7_ModuleManager_Type structure.

Both parameters are pointers; the first one should point to an already allocated structure where this function will load the module, whereas the second is the pointer to a copy in memory of a whole MOD file. This function uses malloc() to allocate space for patterns, instruments and samples into the heap. Unlike the other functions, this function does return a value, which is 0 when the loading is successful and a different value when the loading has a different outcome.

Parameters
ModulePointer to an allocated XM7_ModuleManager_Type structure.
MODModule_Pointer to the MOD file in RAM.
Returns
Error code.

◆ XM7_LoadXM()

XM7_Error XM7_LoadXM ( XM7_ModuleManager_Type *  Module,
const void *  XMModule_ 
)

Load an XM into a XM7_ModuleManager_Type structure.

Both parameters are pointers; the first one should point to an already allocated structure where this function will load the XM module, whereas the second is the pointer to a copy in memory of a whole XM file. This function uses malloc() to allocate space for patterns, instruments and samples into the heap. Unlike the other functions, this function does return a value, which is 0 when the loading is successful and a different value when the loading has a different outcome.

Parameters
ModulePointer to an allocated XM7_ModuleManager_Type structure.
XMModule_Pointer to the XM file in RAM.
Returns
Error code.

◆ XM7_SetPanningStyle()

void XM7_SetPanningStyle ( XM7_ModuleManager_Type *  Module,
XM7_PanningStyles  style,
XM7_PanningDisplacementStyles  displacement 
)

This function configures how the panning is managed in the reproduction.

XM format has panning effects, instrument panning settings and even panning envelopes, whereas MOD format has virtually none and originally (on Amiga machines) mapped channels directly to the left speaker OR to the right speaker only, following the rule that the first channel goes right and the second goes left, then the opposite for the next two and swap again for the fifth and sixth and so on (R-L-L-R-R-L-L-R ...).

Then, if the XM7_PanningStyles used is XM7_PANNING_TYPE_AMIGA, you can specity a value for the displacement, this will be the 'distance' from the originally assigned speaker, maximum value is 127 (which actually will completely swap channels...).

Parameters
ModulePointer to an allocated XM7_ModuleManager_Type structure.
stylePanning style.
displacementDisplacement style.

◆ XM7_SetReplayStyle()

void XM7_SetReplayStyle ( XM7_ModuleManager_Type *  Module,
XM7_ReplayStyles  style 
)

Setup the replay style of the module.

This function sets some parameters that affect the way the module will be reproduced, mainly because there are some differencies in some effect behaviour if used in XM or MOD modules. Actually this simply affects the effect 0xy (Arpeggio) and activates/deactivates the 'on-the-fly sample change' feature.

Parameters
ModulePointer to an allocated XM7_ModuleManager_Type structure.
styleReplay style.

◆ XM7_UnloadMOD()

void XM7_UnloadMOD ( XM7_ModuleManager_Type *  Module)

This function frees all the allocated memory thus unloading the module.

It doesn't deallocate the XM7_ModuleManager_Type structure.

This function is just an alias of XM7_UnloadXM(), for your convenience.

Parameters
ModulePointer to an allocated XM7_ModuleManager_Type structure.

◆ XM7_UnloadXM()

void XM7_UnloadXM ( XM7_ModuleManager_Type *  Module)

This function frees all the allocated memory thus unloading the module.

It doesn't deallocate the XM7_ModuleManager_Type structure.

Parameters
ModulePointer to an allocated XM7_ModuleManager_Type structure.