diff --git a/MacOSX/codecs/include/xmp.h b/MacOSX/codecs/include/xmp.h index 8ec6deeb..9c8aebcf 100644 --- a/MacOSX/codecs/include/xmp.h +++ b/MacOSX/codecs/include/xmp.h @@ -26,11 +26,17 @@ extern "C" { #elif defined(__SUNPRO_C) && defined(XMP_LDSCOPE_GLOBAL) # define LIBXMP_EXPORT __global #elif defined(EMSCRIPTEN) +# include # define LIBXMP_EXPORT EMSCRIPTEN_KEEPALIVE +# define LIBXMP_EXPORT_VAR #else # define LIBXMP_EXPORT #endif +#if !defined (LIBXMP_EXPORT_VAR) +# define LIBXMP_EXPORT_VAR LIBXMP_EXPORT +#endif + #define XMP_NAME_SIZE 64 /* Size of module name and type */ #define XMP_KEY_OFF 0x81 /* Note number for key off event */ @@ -171,6 +177,36 @@ struct xmp_envelope { short data[XMP_MAX_ENV_POINTS * 2]; }; +struct xmp_subinstrument { + int vol; /* Default volume */ + int gvl; /* Global volume */ + int pan; /* Pan */ + int xpo; /* Transpose */ + int fin; /* Finetune */ + int vwf; /* Vibrato waveform */ + int vde; /* Vibrato depth */ + int vra; /* Vibrato rate */ + int vsw; /* Vibrato sweep */ + int rvv; /* Random volume/pan variation (IT) */ + int sid; /* Sample number */ +#define XMP_INST_NNA_CUT 0x00 +#define XMP_INST_NNA_CONT 0x01 +#define XMP_INST_NNA_OFF 0x02 +#define XMP_INST_NNA_FADE 0x03 + int nna; /* New note action */ +#define XMP_INST_DCT_OFF 0x00 +#define XMP_INST_DCT_NOTE 0x01 +#define XMP_INST_DCT_SMP 0x02 +#define XMP_INST_DCT_INST 0x03 + int dct; /* Duplicate check type */ +#define XMP_INST_DCA_CUT XMP_INST_NNA_CUT +#define XMP_INST_DCA_OFF XMP_INST_NNA_OFF +#define XMP_INST_DCA_FADE XMP_INST_NNA_FADE + int dca; /* Duplicate check action */ + int ifc; /* Initial filter cutoff */ + int ifr; /* Initial filter resonance */ +}; + struct xmp_instrument { char name[32]; /* Instrument name */ int vol; /* Instrument volume */ @@ -185,35 +221,7 @@ struct xmp_instrument { signed char xpo; /* Instrument transpose for each key */ } map[XMP_MAX_KEYS]; - struct xmp_subinstrument { - int vol; /* Default volume */ - int gvl; /* Global volume */ - int pan; /* Pan */ - int xpo; /* Transpose */ - int fin; /* Finetune */ - int vwf; /* Vibrato waveform */ - int vde; /* Vibrato depth */ - int vra; /* Vibrato rate */ - int vsw; /* Vibrato sweep */ - int rvv; /* Random volume/pan variation (IT) */ - int sid; /* Sample number */ -#define XMP_INST_NNA_CUT 0x00 -#define XMP_INST_NNA_CONT 0x01 -#define XMP_INST_NNA_OFF 0x02 -#define XMP_INST_NNA_FADE 0x03 - int nna; /* New note action */ -#define XMP_INST_DCT_OFF 0x00 -#define XMP_INST_DCT_NOTE 0x01 -#define XMP_INST_DCT_SMP 0x02 -#define XMP_INST_DCT_INST 0x03 - int dct; /* Duplicate check type */ -#define XMP_INST_DCA_CUT XMP_INST_NNA_CUT -#define XMP_INST_DCA_OFF XMP_INST_NNA_OFF -#define XMP_INST_DCA_FADE XMP_INST_NNA_FADE - int dca; /* Duplicate check action */ - int ifc; /* Initial filter cutoff */ - int ifr; /* Initial filter resonance */ - } *sub; + struct xmp_subinstrument *sub; void *extra; /* Extra fields */ }; @@ -276,6 +284,19 @@ struct xmp_module_info { struct xmp_sequence *seq_data; /* Pointer to sequence data */ }; +struct xmp_channel_info { + unsigned int period; /* Sample period (* 4096) */ + unsigned int position; /* Sample position */ + short pitchbend; /* Linear bend from base note*/ + unsigned char note; /* Current base note number */ + unsigned char instrument; /* Current instrument number */ + unsigned char sample; /* Current sample number */ + unsigned char volume; /* Current volume */ + unsigned char pan; /* Current stereo pan */ + unsigned char reserved; /* Reserved */ + struct xmp_event event; /* Current track event */ +}; + struct xmp_frame_info { /* Current frame information */ int pos; /* Current position */ int pattern; /* Current pattern */ @@ -296,30 +317,19 @@ struct xmp_frame_info { /* Current frame information */ int virt_used; /* Used virtual channels */ int sequence; /* Current sequence */ - struct xmp_channel_info { /* Current channel information */ - unsigned int period; /* Sample period (* 4096) */ - unsigned int position; /* Sample position */ - short pitchbend; /* Linear bend from base note*/ - unsigned char note; /* Current base note number */ - unsigned char instrument; /* Current instrument number */ - unsigned char sample; /* Current sample number */ - unsigned char volume; /* Current volume */ - unsigned char pan; /* Current stereo pan */ - unsigned char reserved; /* Reserved */ - struct xmp_event event; /* Current track event */ - } channel_info[XMP_MAX_CHANNELS]; + struct xmp_channel_info channel_info[XMP_MAX_CHANNELS]; /* Current channel information */ }; typedef char *xmp_context; -LIBXMP_EXPORT extern const char *xmp_version; -LIBXMP_EXPORT extern const unsigned int xmp_vercode; +LIBXMP_EXPORT_VAR extern const char *xmp_version; +LIBXMP_EXPORT_VAR extern const unsigned int xmp_vercode; LIBXMP_EXPORT xmp_context xmp_create_context (void); LIBXMP_EXPORT void xmp_free_context (xmp_context); -LIBXMP_EXPORT int xmp_test_module (char *, struct xmp_test_info *); -LIBXMP_EXPORT int xmp_load_module (xmp_context, char *); +LIBXMP_EXPORT int xmp_test_module (const char *, struct xmp_test_info *); +LIBXMP_EXPORT int xmp_load_module (xmp_context, const char *); LIBXMP_EXPORT void xmp_scan_module (xmp_context); LIBXMP_EXPORT void xmp_release_module (xmp_context); LIBXMP_EXPORT int xmp_start_player (xmp_context, int, int); @@ -329,7 +339,7 @@ LIBXMP_EXPORT void xmp_get_frame_info (xmp_context, struct xmp_frame_inf LIBXMP_EXPORT void xmp_end_player (xmp_context); LIBXMP_EXPORT void xmp_inject_event (xmp_context, int, struct xmp_event *); LIBXMP_EXPORT void xmp_get_module_info (xmp_context, struct xmp_module_info *); -LIBXMP_EXPORT char **xmp_get_format_list (void); +LIBXMP_EXPORT const char *const *xmp_get_format_list (void); LIBXMP_EXPORT int xmp_next_position (xmp_context); LIBXMP_EXPORT int xmp_prev_position (xmp_context); LIBXMP_EXPORT int xmp_set_position (xmp_context, int); @@ -342,9 +352,11 @@ LIBXMP_EXPORT int xmp_channel_mute (xmp_context, int, int); LIBXMP_EXPORT int xmp_channel_vol (xmp_context, int, int); LIBXMP_EXPORT int xmp_set_player (xmp_context, int, int); LIBXMP_EXPORT int xmp_get_player (xmp_context, int); -LIBXMP_EXPORT int xmp_set_instrument_path (xmp_context, char *); +LIBXMP_EXPORT int xmp_set_instrument_path (xmp_context, const char *); LIBXMP_EXPORT int xmp_load_module_from_memory (xmp_context, void *, long); LIBXMP_EXPORT int xmp_load_module_from_file (xmp_context, void *, long); +LIBXMP_EXPORT int xmp_test_module_from_memory (void *, long, struct xmp_test_info *); +LIBXMP_EXPORT int xmp_test_module_from_file (void *, struct xmp_test_info *); /* External sample mixer API */ LIBXMP_EXPORT int xmp_start_smix (xmp_context, int, int); @@ -352,7 +364,7 @@ LIBXMP_EXPORT void xmp_end_smix (xmp_context); LIBXMP_EXPORT int xmp_smix_play_instrument(xmp_context, int, int, int, int); LIBXMP_EXPORT int xmp_smix_play_sample (xmp_context, int, int, int, int); LIBXMP_EXPORT int xmp_smix_channel_pan (xmp_context, int, int); -LIBXMP_EXPORT int xmp_smix_load_sample (xmp_context, int, char *); +LIBXMP_EXPORT int xmp_smix_load_sample (xmp_context, int, const char *); LIBXMP_EXPORT int xmp_smix_release_sample (xmp_context, int); #ifdef __cplusplus diff --git a/MacOSX/codecs/lib/libmikmod.dylib b/MacOSX/codecs/lib/libmikmod.dylib index e28462c8..bbffac6b 100755 Binary files a/MacOSX/codecs/lib/libmikmod.dylib and b/MacOSX/codecs/lib/libmikmod.dylib differ diff --git a/MacOSX/codecs/lib/libxmp.dylib b/MacOSX/codecs/lib/libxmp.dylib index ef0d97fa..df77e605 100755 Binary files a/MacOSX/codecs/lib/libxmp.dylib and b/MacOSX/codecs/lib/libxmp.dylib differ diff --git a/Windows/codecs/include/xmp.h b/Windows/codecs/include/xmp.h index 8ec6deeb..9c8aebcf 100644 --- a/Windows/codecs/include/xmp.h +++ b/Windows/codecs/include/xmp.h @@ -26,11 +26,17 @@ extern "C" { #elif defined(__SUNPRO_C) && defined(XMP_LDSCOPE_GLOBAL) # define LIBXMP_EXPORT __global #elif defined(EMSCRIPTEN) +# include # define LIBXMP_EXPORT EMSCRIPTEN_KEEPALIVE +# define LIBXMP_EXPORT_VAR #else # define LIBXMP_EXPORT #endif +#if !defined (LIBXMP_EXPORT_VAR) +# define LIBXMP_EXPORT_VAR LIBXMP_EXPORT +#endif + #define XMP_NAME_SIZE 64 /* Size of module name and type */ #define XMP_KEY_OFF 0x81 /* Note number for key off event */ @@ -171,6 +177,36 @@ struct xmp_envelope { short data[XMP_MAX_ENV_POINTS * 2]; }; +struct xmp_subinstrument { + int vol; /* Default volume */ + int gvl; /* Global volume */ + int pan; /* Pan */ + int xpo; /* Transpose */ + int fin; /* Finetune */ + int vwf; /* Vibrato waveform */ + int vde; /* Vibrato depth */ + int vra; /* Vibrato rate */ + int vsw; /* Vibrato sweep */ + int rvv; /* Random volume/pan variation (IT) */ + int sid; /* Sample number */ +#define XMP_INST_NNA_CUT 0x00 +#define XMP_INST_NNA_CONT 0x01 +#define XMP_INST_NNA_OFF 0x02 +#define XMP_INST_NNA_FADE 0x03 + int nna; /* New note action */ +#define XMP_INST_DCT_OFF 0x00 +#define XMP_INST_DCT_NOTE 0x01 +#define XMP_INST_DCT_SMP 0x02 +#define XMP_INST_DCT_INST 0x03 + int dct; /* Duplicate check type */ +#define XMP_INST_DCA_CUT XMP_INST_NNA_CUT +#define XMP_INST_DCA_OFF XMP_INST_NNA_OFF +#define XMP_INST_DCA_FADE XMP_INST_NNA_FADE + int dca; /* Duplicate check action */ + int ifc; /* Initial filter cutoff */ + int ifr; /* Initial filter resonance */ +}; + struct xmp_instrument { char name[32]; /* Instrument name */ int vol; /* Instrument volume */ @@ -185,35 +221,7 @@ struct xmp_instrument { signed char xpo; /* Instrument transpose for each key */ } map[XMP_MAX_KEYS]; - struct xmp_subinstrument { - int vol; /* Default volume */ - int gvl; /* Global volume */ - int pan; /* Pan */ - int xpo; /* Transpose */ - int fin; /* Finetune */ - int vwf; /* Vibrato waveform */ - int vde; /* Vibrato depth */ - int vra; /* Vibrato rate */ - int vsw; /* Vibrato sweep */ - int rvv; /* Random volume/pan variation (IT) */ - int sid; /* Sample number */ -#define XMP_INST_NNA_CUT 0x00 -#define XMP_INST_NNA_CONT 0x01 -#define XMP_INST_NNA_OFF 0x02 -#define XMP_INST_NNA_FADE 0x03 - int nna; /* New note action */ -#define XMP_INST_DCT_OFF 0x00 -#define XMP_INST_DCT_NOTE 0x01 -#define XMP_INST_DCT_SMP 0x02 -#define XMP_INST_DCT_INST 0x03 - int dct; /* Duplicate check type */ -#define XMP_INST_DCA_CUT XMP_INST_NNA_CUT -#define XMP_INST_DCA_OFF XMP_INST_NNA_OFF -#define XMP_INST_DCA_FADE XMP_INST_NNA_FADE - int dca; /* Duplicate check action */ - int ifc; /* Initial filter cutoff */ - int ifr; /* Initial filter resonance */ - } *sub; + struct xmp_subinstrument *sub; void *extra; /* Extra fields */ }; @@ -276,6 +284,19 @@ struct xmp_module_info { struct xmp_sequence *seq_data; /* Pointer to sequence data */ }; +struct xmp_channel_info { + unsigned int period; /* Sample period (* 4096) */ + unsigned int position; /* Sample position */ + short pitchbend; /* Linear bend from base note*/ + unsigned char note; /* Current base note number */ + unsigned char instrument; /* Current instrument number */ + unsigned char sample; /* Current sample number */ + unsigned char volume; /* Current volume */ + unsigned char pan; /* Current stereo pan */ + unsigned char reserved; /* Reserved */ + struct xmp_event event; /* Current track event */ +}; + struct xmp_frame_info { /* Current frame information */ int pos; /* Current position */ int pattern; /* Current pattern */ @@ -296,30 +317,19 @@ struct xmp_frame_info { /* Current frame information */ int virt_used; /* Used virtual channels */ int sequence; /* Current sequence */ - struct xmp_channel_info { /* Current channel information */ - unsigned int period; /* Sample period (* 4096) */ - unsigned int position; /* Sample position */ - short pitchbend; /* Linear bend from base note*/ - unsigned char note; /* Current base note number */ - unsigned char instrument; /* Current instrument number */ - unsigned char sample; /* Current sample number */ - unsigned char volume; /* Current volume */ - unsigned char pan; /* Current stereo pan */ - unsigned char reserved; /* Reserved */ - struct xmp_event event; /* Current track event */ - } channel_info[XMP_MAX_CHANNELS]; + struct xmp_channel_info channel_info[XMP_MAX_CHANNELS]; /* Current channel information */ }; typedef char *xmp_context; -LIBXMP_EXPORT extern const char *xmp_version; -LIBXMP_EXPORT extern const unsigned int xmp_vercode; +LIBXMP_EXPORT_VAR extern const char *xmp_version; +LIBXMP_EXPORT_VAR extern const unsigned int xmp_vercode; LIBXMP_EXPORT xmp_context xmp_create_context (void); LIBXMP_EXPORT void xmp_free_context (xmp_context); -LIBXMP_EXPORT int xmp_test_module (char *, struct xmp_test_info *); -LIBXMP_EXPORT int xmp_load_module (xmp_context, char *); +LIBXMP_EXPORT int xmp_test_module (const char *, struct xmp_test_info *); +LIBXMP_EXPORT int xmp_load_module (xmp_context, const char *); LIBXMP_EXPORT void xmp_scan_module (xmp_context); LIBXMP_EXPORT void xmp_release_module (xmp_context); LIBXMP_EXPORT int xmp_start_player (xmp_context, int, int); @@ -329,7 +339,7 @@ LIBXMP_EXPORT void xmp_get_frame_info (xmp_context, struct xmp_frame_inf LIBXMP_EXPORT void xmp_end_player (xmp_context); LIBXMP_EXPORT void xmp_inject_event (xmp_context, int, struct xmp_event *); LIBXMP_EXPORT void xmp_get_module_info (xmp_context, struct xmp_module_info *); -LIBXMP_EXPORT char **xmp_get_format_list (void); +LIBXMP_EXPORT const char *const *xmp_get_format_list (void); LIBXMP_EXPORT int xmp_next_position (xmp_context); LIBXMP_EXPORT int xmp_prev_position (xmp_context); LIBXMP_EXPORT int xmp_set_position (xmp_context, int); @@ -342,9 +352,11 @@ LIBXMP_EXPORT int xmp_channel_mute (xmp_context, int, int); LIBXMP_EXPORT int xmp_channel_vol (xmp_context, int, int); LIBXMP_EXPORT int xmp_set_player (xmp_context, int, int); LIBXMP_EXPORT int xmp_get_player (xmp_context, int); -LIBXMP_EXPORT int xmp_set_instrument_path (xmp_context, char *); +LIBXMP_EXPORT int xmp_set_instrument_path (xmp_context, const char *); LIBXMP_EXPORT int xmp_load_module_from_memory (xmp_context, void *, long); LIBXMP_EXPORT int xmp_load_module_from_file (xmp_context, void *, long); +LIBXMP_EXPORT int xmp_test_module_from_memory (void *, long, struct xmp_test_info *); +LIBXMP_EXPORT int xmp_test_module_from_file (void *, struct xmp_test_info *); /* External sample mixer API */ LIBXMP_EXPORT int xmp_start_smix (xmp_context, int, int); @@ -352,7 +364,7 @@ LIBXMP_EXPORT void xmp_end_smix (xmp_context); LIBXMP_EXPORT int xmp_smix_play_instrument(xmp_context, int, int, int, int); LIBXMP_EXPORT int xmp_smix_play_sample (xmp_context, int, int, int, int); LIBXMP_EXPORT int xmp_smix_channel_pan (xmp_context, int, int); -LIBXMP_EXPORT int xmp_smix_load_sample (xmp_context, int, char *); +LIBXMP_EXPORT int xmp_smix_load_sample (xmp_context, int, const char *); LIBXMP_EXPORT int xmp_smix_release_sample (xmp_context, int); #ifdef __cplusplus diff --git a/Windows/codecs/x64/libmikmod-3.dll b/Windows/codecs/x64/libmikmod-3.dll index 5ca6bf94..f24ee961 100644 Binary files a/Windows/codecs/x64/libmikmod-3.dll and b/Windows/codecs/x64/libmikmod-3.dll differ diff --git a/Windows/codecs/x64/libxmp.dll b/Windows/codecs/x64/libxmp.dll index 3ab0c29b..1b194afe 100644 Binary files a/Windows/codecs/x64/libxmp.dll and b/Windows/codecs/x64/libxmp.dll differ diff --git a/Windows/codecs/x86-watcom/libxmp.lib b/Windows/codecs/x86-watcom/libxmp.lib index 0e916e16..92598e3e 100644 Binary files a/Windows/codecs/x86-watcom/libxmp.lib and b/Windows/codecs/x86-watcom/libxmp.lib differ diff --git a/Windows/codecs/x86-watcom/mikmod.lib b/Windows/codecs/x86-watcom/mikmod.lib index b784f186..b1f3105a 100644 Binary files a/Windows/codecs/x86-watcom/mikmod.lib and b/Windows/codecs/x86-watcom/mikmod.lib differ diff --git a/Windows/codecs/x86/libmikmod-3.dll b/Windows/codecs/x86/libmikmod-3.dll index f59f6389..f4ccd8ee 100644 Binary files a/Windows/codecs/x86/libmikmod-3.dll and b/Windows/codecs/x86/libmikmod-3.dll differ diff --git a/Windows/codecs/x86/libxmp.dll b/Windows/codecs/x86/libxmp.dll index 06064ed2..8eb47dc6 100644 Binary files a/Windows/codecs/x86/libxmp.dll and b/Windows/codecs/x86/libxmp.dll differ