upgrade to libmikmod-3.1.21.1 SDL-1.2
authorOzkan Sezer <sezeroz@gmail.com>
Sun, 07 Oct 2018 11:40:55 +0300
branchSDL-1.2
changeset 889673c5875d64d
parent 888 5e920f51a0e7
child 890 ae9b46ccd5ab
upgrade to libmikmod-3.1.21.1
VisualC/external/include/mikmod.h
VisualC/external/lib/x64/libmikmod-2.dll
VisualC/external/lib/x86/libmikmod-2.dll
Xcode/Frameworks/mikmod.framework/Versions/A/Headers/mikmod.h
Xcode/Frameworks/mikmod.framework/Versions/A/Resources/English.lproj/InfoPlist.strings
Xcode/Frameworks/mikmod.framework/Versions/A/Resources/Info.plist
Xcode/Frameworks/mikmod.framework/Versions/A/mikmod
libmikmod-3.1.12.zip
libmikmod-3.1.21.1.zip
     1.1 --- a/VisualC/external/include/mikmod.h	Sun Oct 07 11:26:40 2018 +0300
     1.2 +++ b/VisualC/external/include/mikmod.h	Sun Oct 07 11:40:55 2018 +0300
     1.3 @@ -1,30 +1,28 @@
     1.4 -/*	MikMod sound library
     1.5 -	(c) 1998, 1999, 2000 Miodrag Vallat and others - see file AUTHORS
     1.6 -	for complete list.
     1.7 +/*  MikMod sound library
     1.8 +    (c) 1998-2014 Miodrag Vallat and others - see the AUTHORS file
     1.9 +    for complete list.
    1.10  
    1.11 -	This library is free software; you can redistribute it and/or modify
    1.12 -	it under the terms of the GNU Library General Public License as
    1.13 -	published by the Free Software Foundation; either version 2 of
    1.14 -	the License, or (at your option) any later version.
    1.15 - 
    1.16 -	This program is distributed in the hope that it will be useful,
    1.17 -	but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.18 -	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.19 -	GNU Library General Public License for more details.
    1.20 - 
    1.21 -	You should have received a copy of the GNU Library General Public
    1.22 -	License along with this library; if not, write to the Free Software
    1.23 -	Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
    1.24 -	02111-1307, USA.
    1.25 +    This library is free software; you can redistribute it and/or modify
    1.26 +    it under the terms of the GNU Library General Public License as
    1.27 +    published by the Free Software Foundation; either version 2 of
    1.28 +    the License, or (at your option) any later version.
    1.29 +
    1.30 +    This program is distributed in the hope that it will be useful,
    1.31 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.32 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.33 +    GNU Library General Public License for more details.
    1.34 +
    1.35 +    You should have received a copy of the GNU Library General Public
    1.36 +    License along with this library; if not, write to the Free Software
    1.37 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
    1.38 +    02111-1307, USA.
    1.39  */
    1.40  
    1.41  /*==============================================================================
    1.42  
    1.43 -  $Id: mikmod.h.in,v 1.2 2004/06/01 16:43:45 raph Exp $
    1.44 -
    1.45    MikMod sound library include file
    1.46  
    1.47 -==============================================================================*/
    1.48 +  ==============================================================================*/
    1.49  
    1.50  #ifndef _MIKMOD_H_
    1.51  #define _MIKMOD_H_
    1.52 @@ -38,167 +36,243 @@
    1.53  
    1.54  /*
    1.55   * ========== Compiler magic for shared libraries
    1.56 + *
    1.57 + * ========== NOTE TO WINDOWS DEVELOPERS:
    1.58 + * If you are compiling for Windows and will link to the static library
    1.59 + * (libmikmod.a with MinGW, or mikmod_static.lib with MSVC or LCC, etc),
    1.60 + * you must define MIKMOD_STATIC in your project.  Otherwise, dllimport
    1.61 + * will be assumed.
    1.62   */
    1.63 -
    1.64 -#if defined WIN32 && defined _DLL
    1.65 -#ifdef DLL_EXPORTS
    1.66 -#define MIKMODAPI __declspec(dllexport)
    1.67 +#if defined(_WIN32) || defined(__CYGWIN__)
    1.68 +# if defined(MIKMOD_BUILD) && defined(DLL_EXPORT)       /* building libmikmod as a dll for windows */
    1.69 +#   define MIKMODAPI __declspec(dllexport)
    1.70 +# elif defined(MIKMOD_BUILD) || defined(MIKMOD_STATIC)  /* building or using static libmikmod for windows */
    1.71 +#   define MIKMODAPI
    1.72 +# else
    1.73 +#   define MIKMODAPI __declspec(dllimport)                      /* using libmikmod dll for windows */
    1.74 +# endif
    1.75 +#elif defined(__OS2__) && defined(__WATCOMC__)
    1.76 +# if defined(MIKMOD_BUILD) && defined(__SW_BD)          /* building libmikmod as a dll for os/2 */
    1.77 +#   define MIKMODAPI __declspec(dllexport)
    1.78 +# else
    1.79 +#   define MIKMODAPI                                    /* using dll or static libmikmod for os/2 */
    1.80 +# endif
    1.81 +/* SYM_VISIBILITY should be defined if both the compiler
    1.82 + * and the target support the visibility attributes. the
    1.83 + * configury does that automatically. for the standalone
    1.84 + * makefiles, etc, the developer should add the required
    1.85 + * flags, i.e.:  -DSYM_VISIBILITY -fvisibility=hidden  */
    1.86 +#elif defined(MIKMOD_BUILD) && defined(SYM_VISIBILITY)
    1.87 +#   define MIKMODAPI __attribute__((visibility("default")))
    1.88  #else
    1.89 -#define MIKMODAPI __declspec(dllimport)
    1.90 -#endif
    1.91 -#else
    1.92 -#define MIKMODAPI
    1.93 +#   define MIKMODAPI
    1.94  #endif
    1.95  
    1.96  /*
    1.97 - *	========== Library version
    1.98 + *  ========== Library version
    1.99   */
   1.100  
   1.101  #define LIBMIKMOD_VERSION_MAJOR 3L
   1.102  #define LIBMIKMOD_VERSION_MINOR 1L
   1.103 -#define LIBMIKMOD_REVISION      10L
   1.104 +#define LIBMIKMOD_REVISION     21L
   1.105  
   1.106  #define LIBMIKMOD_VERSION \
   1.107 -	((LIBMIKMOD_VERSION_MAJOR<<16)| \
   1.108 -	 (LIBMIKMOD_VERSION_MINOR<< 8)| \
   1.109 -	 (LIBMIKMOD_REVISION))
   1.110 +    ((LIBMIKMOD_VERSION_MAJOR<<16)| \
   1.111 +     (LIBMIKMOD_VERSION_MINOR<< 8)| \
   1.112 +     (LIBMIKMOD_REVISION))
   1.113  
   1.114  MIKMODAPI extern long MikMod_GetVersion(void);
   1.115  
   1.116  /*
   1.117 - *	========== Platform independent-type definitions
   1.118 + *  ========== Dependency platform headers
   1.119   */
   1.120  
   1.121 -#ifdef WIN32
   1.122 +#ifdef _WIN32
   1.123 +#ifndef WIN32_LEAN_AND_MEAN
   1.124  #define WIN32_LEAN_AND_MEAN
   1.125 +#endif
   1.126  #include <windows.h>
   1.127  #include <io.h>
   1.128  #include <mmsystem.h>
   1.129 +#define _MIKMOD_WIN32
   1.130  #endif
   1.131  
   1.132 -#if defined(__OS2__)||defined(__EMX__)
   1.133 +#if defined(__DJGPP__) || defined(MSDOS) || defined(__MSDOS__) || defined(__DOS__)
   1.134 +#define _MIKMOD_DOS
   1.135 +#endif
   1.136 +
   1.137 +#if defined(__OS2__) || defined(__EMX__)
   1.138  #define INCL_DOSSEMAPHORES
   1.139  #include <os2.h>
   1.140 -#else
   1.141 -typedef char CHAR;
   1.142 +#include <io.h>
   1.143 +#define _MIKMOD_OS2
   1.144  #endif
   1.145  
   1.146 -
   1.147 -
   1.148 -#if defined(__arch64__) || defined(__alpha) || defined(__x86_64) || defined(_LP64)
   1.149 -/* 64 bit architectures */
   1.150 -
   1.151 -typedef signed char     SBYTE;      /* 1 byte, signed */
   1.152 -typedef unsigned char   UBYTE;      /* 1 byte, unsigned */
   1.153 -typedef signed short    SWORD;      /* 2 bytes, signed */
   1.154 -typedef unsigned short  UWORD;      /* 2 bytes, unsigned */
   1.155 -typedef signed long     SLONG;      /* 4 bytes, signed */
   1.156 -typedef unsigned long   ULONG;      /* 4 bytes, unsigned */
   1.157 -typedef int             BOOL;       /* 0=false, <>0 true */
   1.158 -
   1.159 -#else
   1.160 -/* 32 bit architectures */
   1.161 -
   1.162 -typedef signed char     SBYTE;      /* 1 byte, signed */
   1.163 -typedef unsigned char   UBYTE;      /* 1 byte, unsigned */
   1.164 -typedef signed short    SWORD;      /* 2 bytes, signed */
   1.165 -typedef unsigned short  UWORD;      /* 2 bytes, unsigned */
   1.166 -typedef signed long     SLONG;      /* 4 bytes, signed */
   1.167 -#if !defined(__OS2__)&&!defined(__EMX__)&&!defined(WIN32)
   1.168 -typedef unsigned long   ULONG;      /* 4 bytes, unsigned */
   1.169 -typedef int             BOOL;       /* 0=false, <>0 true */
   1.170 -#endif
   1.171 +#if defined(__MORPHOS__) || defined(__AROS__) || defined(_AMIGA) || defined(__AMIGA__) || defined(__amigaos__) || defined(AMIGAOS)
   1.172 +#include <exec/types.h>
   1.173 +#define _MIKMOD_AMIGA
   1.174  #endif
   1.175  
   1.176  /*
   1.177 - *	========== Error codes
   1.178 + *  ========== Platform independent-type definitions
   1.179 + * (pain when it comes to cross-platform maintenance..)
   1.180 + */
   1.181 +
   1.182 +#if !(defined(_MIKMOD_OS2) || defined(_MIKMOD_WIN32))
   1.183 +typedef char               CHAR;
   1.184 +#endif
   1.185 +
   1.186 +/* BOOL:  0=false, <>0 true -- 16 bits on Amiga, int-wide on others. */
   1.187 +#if !(defined(_MIKMOD_OS2) || defined(_MIKMOD_WIN32) || defined(_MIKMOD_AMIGA))
   1.188 +typedef int                BOOL;
   1.189 +#endif
   1.190 +
   1.191 +/* 1 byte, signed and unsigned: */
   1.192 +typedef signed char        SBYTE;
   1.193 +#ifndef _MIKMOD_AMIGA
   1.194 +typedef unsigned char      UBYTE;
   1.195 +#endif
   1.196 +
   1.197 +/* 2 bytes, signed and unsigned: */
   1.198 +#if !(defined __LCC__ && defined _WIN32)
   1.199 +typedef signed short int   SWORD;
   1.200 +#endif
   1.201 +#if !((defined __LCC__ && defined _WIN32) || defined(_MIKMOD_AMIGA))
   1.202 +typedef unsigned short int UWORD;
   1.203 +#endif
   1.204 +
   1.205 +/* 4 bytes, signed and unsigned: */
   1.206 +#if defined(_LP64) || defined(__LP64__) || defined(__arch64__) || defined(__alpha) || defined(__x86_64) || defined(__powerpc64__)
   1.207 +        /* 64 bit architectures: */
   1.208 +typedef signed int         SLONG;
   1.209 +#if !(defined(_WIN32) || defined(_MIKMOD_AMIGA))
   1.210 +typedef unsigned int       ULONG;
   1.211 +#endif
   1.212 +
   1.213 +#else  /* 32 bit architectures: */
   1.214 +typedef signed long int    SLONG;
   1.215 +#if !(defined(_MIKMOD_OS2) || defined(_MIKMOD_WIN32) || defined(_MIKMOD_AMIGA))
   1.216 +typedef unsigned long int  ULONG;
   1.217 +#endif
   1.218 +#endif
   1.219 +
   1.220 +/* make sure types are of correct sizes: */
   1.221 +typedef int __mikmod_typetest [
   1.222 +   (
   1.223 +        (sizeof(SBYTE)==1) && (sizeof(UBYTE)==1)
   1.224 +     && (sizeof(SWORD)==2) && (sizeof(UWORD)==2)
   1.225 +     && (sizeof(SLONG)==4) && (sizeof(ULONG)==4)
   1.226 +#ifndef _MIKMOD_AMIGA
   1.227 +     && (sizeof(BOOL) == sizeof(int))
   1.228 +#endif
   1.229 +     && (sizeof(CHAR) == sizeof(char))
   1.230 +   ) * 2 - 1 ];
   1.231 +
   1.232 +/*
   1.233 + *  ========== Error codes
   1.234   */
   1.235  
   1.236  enum {
   1.237 -	MMERR_OPENING_FILE = 1,
   1.238 -	MMERR_OUT_OF_MEMORY,
   1.239 -	MMERR_DYNAMIC_LINKING,
   1.240 +    MMERR_OPENING_FILE = 1,
   1.241 +    MMERR_OUT_OF_MEMORY,
   1.242 +    MMERR_DYNAMIC_LINKING,
   1.243  
   1.244 -	MMERR_SAMPLE_TOO_BIG,
   1.245 -	MMERR_OUT_OF_HANDLES,
   1.246 -	MMERR_UNKNOWN_WAVE_TYPE,
   1.247 +    MMERR_SAMPLE_TOO_BIG,
   1.248 +    MMERR_OUT_OF_HANDLES,
   1.249 +    MMERR_UNKNOWN_WAVE_TYPE,
   1.250  
   1.251 -	MMERR_LOADING_PATTERN,
   1.252 -	MMERR_LOADING_TRACK,
   1.253 -	MMERR_LOADING_HEADER,
   1.254 -	MMERR_LOADING_SAMPLEINFO,
   1.255 -	MMERR_NOT_A_MODULE,
   1.256 -	MMERR_NOT_A_STREAM,
   1.257 -	MMERR_MED_SYNTHSAMPLES,
   1.258 -	MMERR_ITPACK_INVALID_DATA,
   1.259 +    MMERR_LOADING_PATTERN,
   1.260 +    MMERR_LOADING_TRACK,
   1.261 +    MMERR_LOADING_HEADER,
   1.262 +    MMERR_LOADING_SAMPLEINFO,
   1.263 +    MMERR_NOT_A_MODULE,
   1.264 +    MMERR_NOT_A_STREAM,
   1.265 +    MMERR_MED_SYNTHSAMPLES,
   1.266 +    MMERR_ITPACK_INVALID_DATA,
   1.267  
   1.268 -	MMERR_DETECTING_DEVICE,
   1.269 -	MMERR_INVALID_DEVICE,
   1.270 -	MMERR_INITIALIZING_MIXER,
   1.271 -	MMERR_OPENING_AUDIO,
   1.272 -	MMERR_8BIT_ONLY,
   1.273 -	MMERR_16BIT_ONLY,
   1.274 -	MMERR_STEREO_ONLY,
   1.275 -	MMERR_ULAW,
   1.276 -	MMERR_NON_BLOCK,
   1.277 +    MMERR_DETECTING_DEVICE,
   1.278 +    MMERR_INVALID_DEVICE,
   1.279 +    MMERR_INITIALIZING_MIXER,
   1.280 +    MMERR_OPENING_AUDIO,
   1.281 +    MMERR_8BIT_ONLY,
   1.282 +    MMERR_16BIT_ONLY,
   1.283 +    MMERR_STEREO_ONLY,
   1.284 +    MMERR_ULAW,
   1.285 +    MMERR_NON_BLOCK,
   1.286  
   1.287 -	MMERR_AF_AUDIO_PORT,
   1.288 +    MMERR_AF_AUDIO_PORT,
   1.289  
   1.290 -	MMERR_AIX_CONFIG_INIT,
   1.291 -	MMERR_AIX_CONFIG_CONTROL,
   1.292 -	MMERR_AIX_CONFIG_START,
   1.293 +    MMERR_AIX_CONFIG_INIT,
   1.294 +    MMERR_AIX_CONFIG_CONTROL,
   1.295 +    MMERR_AIX_CONFIG_START,
   1.296  
   1.297 -	MMERR_GUS_SETTINGS,
   1.298 -	MMERR_GUS_RESET,
   1.299 -	MMERR_GUS_TIMER,
   1.300 +    MMERR_GUS_SETTINGS,
   1.301 +    MMERR_GUS_RESET,
   1.302 +    MMERR_GUS_TIMER,
   1.303  
   1.304 -	MMERR_HP_SETSAMPLESIZE,
   1.305 -	MMERR_HP_SETSPEED,
   1.306 -	MMERR_HP_CHANNELS,
   1.307 -	MMERR_HP_AUDIO_OUTPUT,
   1.308 -	MMERR_HP_AUDIO_DESC,
   1.309 -	MMERR_HP_BUFFERSIZE,
   1.310 +    MMERR_HP_SETSAMPLESIZE,
   1.311 +    MMERR_HP_SETSPEED,
   1.312 +    MMERR_HP_CHANNELS,
   1.313 +    MMERR_HP_AUDIO_OUTPUT,
   1.314 +    MMERR_HP_AUDIO_DESC,
   1.315 +    MMERR_HP_BUFFERSIZE,
   1.316  
   1.317 -	MMERR_OSS_SETFRAGMENT,
   1.318 -	MMERR_OSS_SETSAMPLESIZE,
   1.319 -	MMERR_OSS_SETSTEREO,
   1.320 -	MMERR_OSS_SETSPEED,
   1.321 +    MMERR_OSS_SETFRAGMENT,
   1.322 +    MMERR_OSS_SETSAMPLESIZE,
   1.323 +    MMERR_OSS_SETSTEREO,
   1.324 +    MMERR_OSS_SETSPEED,
   1.325  
   1.326 -	MMERR_SGI_SPEED,
   1.327 -	MMERR_SGI_16BIT,
   1.328 -	MMERR_SGI_8BIT,
   1.329 -	MMERR_SGI_STEREO,
   1.330 -	MMERR_SGI_MONO,
   1.331 +    MMERR_SGI_SPEED,
   1.332 +    MMERR_SGI_16BIT,
   1.333 +    MMERR_SGI_8BIT,
   1.334 +    MMERR_SGI_STEREO,
   1.335 +    MMERR_SGI_MONO,
   1.336  
   1.337 -	MMERR_SUN_INIT,
   1.338 +    MMERR_SUN_INIT,
   1.339  
   1.340 -	MMERR_OS2_MIXSETUP,
   1.341 -	MMERR_OS2_SEMAPHORE,
   1.342 -	MMERR_OS2_TIMER,
   1.343 -	MMERR_OS2_THREAD,
   1.344 +    MMERR_OS2_MIXSETUP,
   1.345 +    MMERR_OS2_SEMAPHORE,
   1.346 +    MMERR_OS2_TIMER,
   1.347 +    MMERR_OS2_THREAD,
   1.348  
   1.349 -	MMERR_DS_PRIORITY,
   1.350 -	MMERR_DS_BUFFER,
   1.351 -	MMERR_DS_FORMAT,
   1.352 -	MMERR_DS_NOTIFY,
   1.353 -	MMERR_DS_EVENT,
   1.354 -	MMERR_DS_THREAD,
   1.355 -	MMERR_DS_UPDATE,
   1.356 +    MMERR_DS_PRIORITY,
   1.357 +    MMERR_DS_BUFFER,
   1.358 +    MMERR_DS_FORMAT,
   1.359 +    MMERR_DS_NOTIFY,
   1.360 +    MMERR_DS_EVENT,
   1.361 +    MMERR_DS_THREAD,
   1.362 +    MMERR_DS_UPDATE,
   1.363  
   1.364 -	MMERR_WINMM_HANDLE,
   1.365 -	MMERR_WINMM_ALLOCATED,
   1.366 -	MMERR_WINMM_DEVICEID,
   1.367 -	MMERR_WINMM_FORMAT,
   1.368 -	MMERR_WINMM_UNKNOWN,
   1.369 +    MMERR_WINMM_HANDLE,
   1.370 +    MMERR_WINMM_ALLOCATED,
   1.371 +    MMERR_WINMM_DEVICEID,
   1.372 +    MMERR_WINMM_FORMAT,
   1.373 +    MMERR_WINMM_UNKNOWN,
   1.374  
   1.375 -	MMERR_MAC_SPEED,
   1.376 -	MMERR_MAC_START,
   1.377 +    MMERR_MAC_SPEED,
   1.378 +    MMERR_MAC_START,
   1.379  
   1.380 -	MMERR_MAX
   1.381 +    /* 65-86 exist only in libmikmod3 */
   1.382 +    ___filler_MMERR=(MMERR_MAC_START+22),
   1.383 +
   1.384 +    MMERR_ALSA_NOCONFIG,
   1.385 +    MMERR_ALSA_SETPARAMS,
   1.386 +    MMERR_ALSA_SETFORMAT,
   1.387 +    MMERR_ALSA_SETRATE,
   1.388 +    MMERR_ALSA_SETCHANNELS,
   1.389 +    MMERR_ALSA_BUFFERSIZE,
   1.390 +    MMERR_ALSA_PCM_START,
   1.391 +    MMERR_ALSA_PCM_WRITE,
   1.392 +    MMERR_ALSA_PCM_RECOVER,
   1.393 +
   1.394 +    MMERR_SNDIO_SETPARAMS,
   1.395 +    MMERR_SNDIO_BADPARAMS,
   1.396 +
   1.397 +    MMERR_MAX
   1.398  };
   1.399  
   1.400  /*
   1.401 - *	========== Error handling
   1.402 + *  ========== Error handling
   1.403   */
   1.404  
   1.405  typedef void (MikMod_handler)(void);
   1.406 @@ -211,7 +285,7 @@
   1.407  MIKMODAPI extern MikMod_handler_t MikMod_RegisterErrorHandler(MikMod_handler_t);
   1.408  
   1.409  /*
   1.410 - *	========== Library initialization and core functions
   1.411 + *  ========== Library initialization and core functions
   1.412   */
   1.413  
   1.414  struct MDRIVER;
   1.415 @@ -222,12 +296,12 @@
   1.416  MIKMODAPI extern void   MikMod_RegisterDriver(struct MDRIVER*);
   1.417  MIKMODAPI extern int    MikMod_DriverFromAlias(CHAR*);
   1.418  
   1.419 -MIKMODAPI extern BOOL   MikMod_Init(CHAR*);
   1.420 +MIKMODAPI extern int    MikMod_Init(CHAR*);
   1.421  MIKMODAPI extern void   MikMod_Exit(void);
   1.422 -MIKMODAPI extern BOOL   MikMod_Reset(CHAR*);
   1.423 -MIKMODAPI extern BOOL   MikMod_SetNumVoices(int,int);
   1.424 +MIKMODAPI extern int    MikMod_Reset(CHAR*);
   1.425 +MIKMODAPI extern int    MikMod_SetNumVoices(int,int);
   1.426  MIKMODAPI extern BOOL   MikMod_Active(void);
   1.427 -MIKMODAPI extern BOOL   MikMod_EnableOutput(void);
   1.428 +MIKMODAPI extern int    MikMod_EnableOutput(void);
   1.429  MIKMODAPI extern void   MikMod_DisableOutput(void);
   1.430  MIKMODAPI extern void   MikMod_Update(void);
   1.431  
   1.432 @@ -236,26 +310,26 @@
   1.433  MIKMODAPI extern void   MikMod_Unlock(void);
   1.434  
   1.435  /*
   1.436 - *	========== Reader, Writer
   1.437 + *  ========== Reader, Writer
   1.438   */
   1.439  
   1.440  typedef struct MREADER {
   1.441 -	BOOL (*Seek)(struct MREADER*,long,int);
   1.442 -	long (*Tell)(struct MREADER*);
   1.443 -	BOOL (*Read)(struct MREADER*,void*,size_t);
   1.444 -	int  (*Get)(struct MREADER*);
   1.445 -	BOOL (*Eof)(struct MREADER*);
   1.446 +    int  (*Seek)(struct MREADER*,long,int);
   1.447 +    long (*Tell)(struct MREADER*);
   1.448 +    BOOL (*Read)(struct MREADER*,void*,size_t);
   1.449 +    int  (*Get)(struct MREADER*);
   1.450 +    BOOL (*Eof)(struct MREADER*);
   1.451  } MREADER;
   1.452  
   1.453  typedef struct MWRITER {
   1.454 -	BOOL (*Seek)(struct MWRITER*,long,int);
   1.455 -	long (*Tell)(struct MWRITER*);
   1.456 -	BOOL (*Write)(struct MWRITER*,void*,size_t);
   1.457 -	BOOL (*Put)(struct MWRITER*,int);
   1.458 +    int  (*Seek)(struct MWRITER*, long, int);
   1.459 +    long (*Tell)(struct MWRITER*);
   1.460 +    BOOL (*Write)(struct MWRITER*, void*, size_t);
   1.461 +    int  (*Put)(struct MWRITER*, int);
   1.462  } MWRITER;
   1.463  
   1.464  /*
   1.465 - *	========== Samples
   1.466 + *  ========== Samples
   1.467   */
   1.468  
   1.469  /* Sample playback should not be interrupted */
   1.470 @@ -267,9 +341,9 @@
   1.471  #define SF_SIGNED       0x0004
   1.472  #define SF_BIG_ENDIAN   0x0008
   1.473  #define SF_DELTA        0x0010
   1.474 -#define SF_ITPACKED		0x0020
   1.475 +#define SF_ITPACKED     0x0020
   1.476  
   1.477 -#define	SF_FORMATMASK	0x003F
   1.478 +#define SF_FORMATMASK   0x003F
   1.479  
   1.480  /* General Playback flags */
   1.481  
   1.482 @@ -278,49 +352,49 @@
   1.483  #define SF_REVERSE      0x0400
   1.484  #define SF_SUSTAIN      0x0800
   1.485  
   1.486 -#define SF_PLAYBACKMASK	0x0C00
   1.487 +#define SF_PLAYBACKMASK 0x0C00
   1.488  
   1.489  /* Module-only Playback Flags */
   1.490  
   1.491 -#define SF_OWNPAN		0x1000
   1.492 +#define SF_OWNPAN       0x1000
   1.493  #define SF_UST_LOOP     0x2000
   1.494  
   1.495 -#define SF_EXTRAPLAYBACKMASK	0x3000
   1.496 +#define SF_EXTRAPLAYBACKMASK    0x3000
   1.497  
   1.498  /* Panning constants */
   1.499 -#define PAN_LEFT		0
   1.500 -#define PAN_HALFLEFT 	64
   1.501 -#define PAN_CENTER		128
   1.502 -#define PAN_HALFRIGHT	192
   1.503 -#define PAN_RIGHT		255
   1.504 -#define PAN_SURROUND	512 /* panning value for Dolby Surround */
   1.505 +#define PAN_LEFT        0
   1.506 +#define PAN_HALFLEFT    64
   1.507 +#define PAN_CENTER      128
   1.508 +#define PAN_HALFRIGHT   192
   1.509 +#define PAN_RIGHT       255
   1.510 +#define PAN_SURROUND    512 /* panning value for Dolby Surround */
   1.511  
   1.512  typedef struct SAMPLE {
   1.513 -	SWORD  panning;     /* panning (0-255 or PAN_SURROUND) */
   1.514 -	ULONG  speed;       /* Base playing speed/frequency of note */
   1.515 -	UBYTE  volume;      /* volume 0-64 */
   1.516 -	UWORD  inflags;		/* sample format on disk */
   1.517 -	UWORD  flags;       /* sample format in memory */
   1.518 -	ULONG  length;      /* length of sample (in samples!) */
   1.519 -	ULONG  loopstart;   /* repeat position (relative to start, in samples) */
   1.520 -	ULONG  loopend;     /* repeat end */
   1.521 -	ULONG  susbegin;    /* sustain loop begin (in samples) \  Not Supported */
   1.522 -	ULONG  susend;      /* sustain loop end                /      Yet! */
   1.523 +    SWORD  panning;     /* panning (0-255 or PAN_SURROUND) */
   1.524 +    ULONG  speed;       /* Base playing speed/frequency of note */
   1.525 +    UBYTE  volume;      /* volume 0-64 */
   1.526 +    UWORD  inflags;     /* sample format on disk */
   1.527 +    UWORD  flags;       /* sample format in memory */
   1.528 +    ULONG  length;      /* length of sample (in samples!) */
   1.529 +    ULONG  loopstart;   /* repeat position (relative to start, in samples) */
   1.530 +    ULONG  loopend;     /* repeat end */
   1.531 +    ULONG  susbegin;    /* sustain loop begin (in samples) \  Not Supported */
   1.532 +    ULONG  susend;      /* sustain loop end                /      Yet! */
   1.533  
   1.534 -	/* Variables used by the module player only! (ignored for sound effects) */
   1.535 -	UBYTE  globvol;     /* global volume */
   1.536 -	UBYTE  vibflags;    /* autovibrato flag stuffs */
   1.537 -	UBYTE  vibtype;     /* Vibratos moved from INSTRUMENT to SAMPLE */
   1.538 -	UBYTE  vibsweep;
   1.539 -	UBYTE  vibdepth;
   1.540 -	UBYTE  vibrate;
   1.541 -	CHAR*  samplename;  /* name of the sample */
   1.542 +    /* Variables used by the module player only! (ignored for sound effects) */
   1.543 +    UBYTE  globvol;     /* global volume */
   1.544 +    UBYTE  vibflags;    /* autovibrato flag stuffs */
   1.545 +    UBYTE  vibtype;     /* Vibratos moved from INSTRUMENT to SAMPLE */
   1.546 +    UBYTE  vibsweep;
   1.547 +    UBYTE  vibdepth;
   1.548 +    UBYTE  vibrate;
   1.549 +    CHAR*  samplename;  /* name of the sample */
   1.550  
   1.551 -	/* Values used internally only */
   1.552 -	UWORD  avibpos;     /* autovibrato pos [player use] */
   1.553 -	UBYTE  divfactor;   /* for sample scaling, maintains proper period slides */
   1.554 -	ULONG  seekpos;     /* seek position in file */
   1.555 -	SWORD  handle;      /* sample handle used by individual drivers */
   1.556 +    /* Values used internally only */
   1.557 +    UWORD  avibpos;     /* autovibrato pos [player use] */
   1.558 +    UBYTE  divfactor;   /* for sample scaling, maintains proper period slides */
   1.559 +    ULONG  seekpos;     /* seek position in file */
   1.560 +    SWORD  handle;      /* sample handle used by individual drivers */
   1.561  } SAMPLE;
   1.562  
   1.563  /* Sample functions */
   1.564 @@ -344,12 +418,12 @@
   1.565  MIKMODAPI extern ULONG  Voice_RealVolume(SBYTE);
   1.566  
   1.567  /*
   1.568 - *	========== Internal module representation (UniMod)
   1.569 + *  ========== Internal module representation (UniMod)
   1.570   */
   1.571  
   1.572  /*
   1.573 -	Instrument definition - for information only, the only field which may be
   1.574 -	of use in user programs is the name field
   1.575 +    Instrument definition - for information only, the only field which may be
   1.576 +    of use in user programs is the name field
   1.577  */
   1.578  
   1.579  /* Instrument note count */
   1.580 @@ -357,8 +431,8 @@
   1.581  
   1.582  /* Envelope point */
   1.583  typedef struct ENVPT {
   1.584 -	SWORD pos;
   1.585 -	SWORD val;
   1.586 +    SWORD pos;
   1.587 +    SWORD val;
   1.588  } ENVPT;
   1.589  
   1.590  /* Envelope point count */
   1.591 @@ -366,143 +440,146 @@
   1.592  
   1.593  /* Instrument structure */
   1.594  typedef struct INSTRUMENT {
   1.595 -	CHAR* insname;
   1.596 +    CHAR* insname;
   1.597  
   1.598 -	UBYTE flags;
   1.599 -	UWORD samplenumber[INSTNOTES];
   1.600 -	UBYTE samplenote[INSTNOTES];
   1.601 +    UBYTE flags;
   1.602 +    UWORD samplenumber[INSTNOTES];
   1.603 +    UBYTE samplenote[INSTNOTES];
   1.604  
   1.605 -	UBYTE nnatype;
   1.606 -	UBYTE dca;              /* duplicate check action */
   1.607 -	UBYTE dct;              /* duplicate check type */
   1.608 -	UBYTE globvol;
   1.609 -	UWORD volfade;
   1.610 -	SWORD panning;          /* instrument-based panning var */
   1.611 +    UBYTE nnatype;
   1.612 +    UBYTE dca;              /* duplicate check action */
   1.613 +    UBYTE dct;              /* duplicate check type */
   1.614 +    UBYTE globvol;
   1.615 +    UWORD volfade;
   1.616 +    SWORD panning;          /* instrument-based panning var */
   1.617  
   1.618 -	UBYTE pitpansep;        /* pitch pan separation (0 to 255) */
   1.619 -	UBYTE pitpancenter;     /* pitch pan center (0 to 119) */
   1.620 -	UBYTE rvolvar;          /* random volume varations (0 - 100%) */
   1.621 -	UBYTE rpanvar;          /* random panning varations (0 - 100%) */
   1.622 +    UBYTE pitpansep;        /* pitch pan separation (0 to 255) */
   1.623 +    UBYTE pitpancenter;     /* pitch pan center (0 to 119) */
   1.624 +    UBYTE rvolvar;          /* random volume varations (0 - 100%) */
   1.625 +    UBYTE rpanvar;          /* random panning varations (0 - 100%) */
   1.626  
   1.627 -	/* volume envelope */
   1.628 -	UBYTE volflg;           /* bit 0: on 1: sustain 2: loop */
   1.629 -	UBYTE volpts;
   1.630 -	UBYTE volsusbeg;
   1.631 -	UBYTE volsusend;
   1.632 -	UBYTE volbeg;
   1.633 -	UBYTE volend;
   1.634 -	ENVPT volenv[ENVPOINTS];
   1.635 -	/* panning envelope */
   1.636 -	UBYTE panflg;           /* bit 0: on 1: sustain 2: loop */
   1.637 -	UBYTE panpts;
   1.638 -	UBYTE pansusbeg;
   1.639 -	UBYTE pansusend;
   1.640 -	UBYTE panbeg;
   1.641 -	UBYTE panend;
   1.642 -	ENVPT panenv[ENVPOINTS];
   1.643 -	/* pitch envelope */
   1.644 -	UBYTE pitflg;           /* bit 0: on 1: sustain 2: loop */
   1.645 -	UBYTE pitpts;
   1.646 -	UBYTE pitsusbeg;
   1.647 -	UBYTE pitsusend;
   1.648 -	UBYTE pitbeg;
   1.649 -	UBYTE pitend;
   1.650 -	ENVPT pitenv[ENVPOINTS];
   1.651 +    /* volume envelope */
   1.652 +    UBYTE volflg;           /* bit 0: on 1: sustain 2: loop */
   1.653 +    UBYTE volpts;
   1.654 +    UBYTE volsusbeg;
   1.655 +    UBYTE volsusend;
   1.656 +    UBYTE volbeg;
   1.657 +    UBYTE volend;
   1.658 +    ENVPT volenv[ENVPOINTS];
   1.659 +    /* panning envelope */
   1.660 +    UBYTE panflg;           /* bit 0: on 1: sustain 2: loop */
   1.661 +    UBYTE panpts;
   1.662 +    UBYTE pansusbeg;
   1.663 +    UBYTE pansusend;
   1.664 +    UBYTE panbeg;
   1.665 +    UBYTE panend;
   1.666 +    ENVPT panenv[ENVPOINTS];
   1.667 +    /* pitch envelope */
   1.668 +    UBYTE pitflg;           /* bit 0: on 1: sustain 2: loop */
   1.669 +    UBYTE pitpts;
   1.670 +    UBYTE pitsusbeg;
   1.671 +    UBYTE pitsusend;
   1.672 +    UBYTE pitbeg;
   1.673 +    UBYTE pitend;
   1.674 +    ENVPT pitenv[ENVPOINTS];
   1.675  } INSTRUMENT;
   1.676  
   1.677  struct MP_CONTROL;
   1.678  struct MP_VOICE;
   1.679  
   1.680  /*
   1.681 -	Module definition
   1.682 +    Module definition
   1.683  */
   1.684  
   1.685  /* maximum master channels supported */
   1.686 -#define UF_MAXCHAN	64
   1.687 +#define UF_MAXCHAN      64
   1.688  
   1.689  /* Module flags */
   1.690 -#define UF_XMPERIODS	0x0001 /* XM periods / finetuning */
   1.691 -#define UF_LINEAR		0x0002 /* LINEAR periods (UF_XMPERIODS must be set) */
   1.692 -#define UF_INST			0x0004 /* Instruments are used */
   1.693 -#define UF_NNA			0x0008 /* IT: NNA used, set numvoices rather
   1.694 -								  than numchn */
   1.695 -#define UF_S3MSLIDES	0x0010 /* uses old S3M volume slides */
   1.696 -#define UF_BGSLIDES		0x0020 /* continue volume slides in the background */
   1.697 -#define UF_HIGHBPM		0x0040 /* MED: can use >255 bpm */
   1.698 -#define UF_NOWRAP		0x0080 /* XM-type (i.e. illogical) pattern break
   1.699 -								  semantics */
   1.700 -#define UF_ARPMEM		0x0100 /* IT: need arpeggio memory */
   1.701 -#define UF_FT2QUIRKS	0x0200 /* emulate some FT2 replay quirks */
   1.702 -#define UF_PANNING		0x0400 /* module uses panning effects or have
   1.703 -								  non-tracker default initial panning */
   1.704 +#define UF_XMPERIODS    0x0001 /* XM periods / finetuning */
   1.705 +#define UF_LINEAR       0x0002 /* LINEAR periods (UF_XMPERIODS must be set) */
   1.706 +#define UF_INST         0x0004 /* Instruments are used */
   1.707 +#define UF_NNA          0x0008 /* IT: NNA used, set numvoices rather
   1.708 +                                  than numchn */
   1.709 +#define UF_S3MSLIDES    0x0010 /* uses old S3M volume slides */
   1.710 +#define UF_BGSLIDES     0x0020 /* continue volume slides in the background */
   1.711 +#define UF_HIGHBPM      0x0040 /* MED: can use >255 bpm */
   1.712 +#define UF_NOWRAP       0x0080 /* XM-type (i.e. illogical) pattern break
   1.713 +                                  semantics */
   1.714 +#define UF_ARPMEM       0x0100 /* IT: need arpeggio memory */
   1.715 +#define UF_FT2QUIRKS    0x0200 /* emulate some FT2 replay quirks */
   1.716 +#define UF_PANNING      0x0400 /* module uses panning effects or have
   1.717 +                                  non-tracker default initial panning */
   1.718  
   1.719  typedef struct MODULE {
   1.720 -	/* general module information */
   1.721 -		CHAR*       songname;    /* name of the song */
   1.722 -		CHAR*       modtype;     /* string type of module loaded */
   1.723 -		CHAR*       comment;     /* module comments */
   1.724 + /* general module information */
   1.725 +    CHAR*       songname;    /* name of the song */
   1.726 +    CHAR*       modtype;     /* string type of module loaded */
   1.727 +    CHAR*       comment;     /* module comments */
   1.728  
   1.729 -		UWORD       flags;       /* See module flags above */
   1.730 -		UBYTE       numchn;      /* number of module channels */
   1.731 -		UBYTE       numvoices;   /* max # voices used for full NNA playback */
   1.732 -		UWORD       numpos;      /* number of positions in this song */
   1.733 -		UWORD       numpat;      /* number of patterns in this song */
   1.734 -		UWORD       numins;      /* number of instruments */
   1.735 -		UWORD       numsmp;      /* number of samples */
   1.736 -struct  INSTRUMENT* instruments; /* all instruments */
   1.737 -struct  SAMPLE*     samples;     /* all samples */
   1.738 -		UBYTE       realchn;     /* real number of channels used */
   1.739 -		UBYTE       totalchn;    /* total number of channels used (incl NNAs) */
   1.740 +    UWORD       flags;       /* See module flags above */
   1.741 +    UBYTE       numchn;      /* number of module channels */
   1.742 +    UBYTE       numvoices;   /* max # voices used for full NNA playback */
   1.743 +    UWORD       numpos;      /* number of positions in this song */
   1.744 +    UWORD       numpat;      /* number of patterns in this song */
   1.745 +    UWORD       numins;      /* number of instruments */
   1.746 +    UWORD       numsmp;      /* number of samples */
   1.747  
   1.748 -	/* playback settings */
   1.749 -		UWORD       reppos;      /* restart position */
   1.750 -		UBYTE       initspeed;   /* initial song speed */
   1.751 -		UWORD       inittempo;   /* initial song tempo */
   1.752 -		UBYTE       initvolume;  /* initial global volume (0 - 128) */
   1.753 -		UWORD       panning[UF_MAXCHAN]; /* panning positions */
   1.754 -		UBYTE       chanvol[UF_MAXCHAN]; /* channel positions */
   1.755 -		UWORD       bpm;         /* current beats-per-minute speed */
   1.756 -		UWORD       sngspd;      /* current song speed */
   1.757 -		SWORD       volume;      /* song volume (0-128) (or user volume) */
   1.758 +    struct INSTRUMENT* instruments; /* all instruments */
   1.759 +    struct SAMPLE*     samples;     /* all samples */
   1.760  
   1.761 -		BOOL        extspd;      /* extended speed flag (default enabled) */
   1.762 -		BOOL        panflag;     /* panning flag (default enabled) */
   1.763 -		BOOL        wrap;        /* wrap module ? (default disabled) */
   1.764 -		BOOL        loop;		 /* allow module to loop ? (default enabled) */
   1.765 -		BOOL        fadeout;	 /* volume fade out during last pattern */
   1.766 +    UBYTE       realchn;     /* real number of channels used */
   1.767 +    UBYTE       totalchn;    /* total number of channels used (incl NNAs) */
   1.768  
   1.769 -		UWORD       patpos;      /* current row number */
   1.770 -		SWORD       sngpos;      /* current song position */
   1.771 -		ULONG       sngtime;     /* current song time in 2^-10 seconds */
   1.772 + /* playback settings */
   1.773 +    UWORD       reppos;      /* restart position */
   1.774 +    UBYTE       initspeed;   /* initial song speed */
   1.775 +    UWORD       inittempo;   /* initial song tempo */
   1.776 +    UBYTE       initvolume;  /* initial global volume (0 - 128) */
   1.777 +    UWORD       panning[UF_MAXCHAN]; /* panning positions */
   1.778 +    UBYTE       chanvol[UF_MAXCHAN]; /* channel positions */
   1.779 +    UWORD       bpm;         /* current beats-per-minute speed */
   1.780 +    UWORD       sngspd;      /* current song speed */
   1.781 +    SWORD       volume;      /* song volume (0-128) (or user volume) */
   1.782  
   1.783 -		SWORD       relspd;      /* relative speed factor */
   1.784 +    BOOL        extspd;      /* extended speed flag (default enabled) */
   1.785 +    BOOL        panflag;     /* panning flag (default enabled) */
   1.786 +    BOOL        wrap;        /* wrap module ? (default disabled) */
   1.787 +    BOOL        loop;        /* allow module to loop ? (default enabled) */
   1.788 +    BOOL        fadeout;     /* volume fade out during last pattern */
   1.789  
   1.790 -	/* internal module representation */
   1.791 -		UWORD       numtrk;      /* number of tracks */
   1.792 -		UBYTE**     tracks;      /* array of numtrk pointers to tracks */
   1.793 -		UWORD*      patterns;    /* array of Patterns */
   1.794 -		UWORD*      pattrows;    /* array of number of rows for each pattern */
   1.795 -		UWORD*      positions;   /* all positions */
   1.796 +    UWORD       patpos;      /* current row number */
   1.797 +    SWORD       sngpos;      /* current song position */
   1.798 +    ULONG       sngtime;     /* current song time in 2^-10 seconds */
   1.799  
   1.800 -		BOOL        forbid;      /* if true, no player update! */
   1.801 -		UWORD       numrow;      /* number of rows on current pattern */
   1.802 -		UWORD       vbtick;      /* tick counter (counts from 0 to sngspd) */
   1.803 -		UWORD       sngremainder;/* used for song time computation */
   1.804 +    SWORD       relspd;      /* relative speed factor */
   1.805  
   1.806 -struct MP_CONTROL*  control;     /* Effects Channel info (size pf->numchn) */
   1.807 -struct MP_VOICE*    voice;       /* Audio Voice information (size md_numchn) */
   1.808 + /* internal module representation */
   1.809 +    UWORD       numtrk;      /* number of tracks */
   1.810 +    UBYTE**     tracks;      /* array of numtrk pointers to tracks */
   1.811 +    UWORD*      patterns;    /* array of Patterns */
   1.812 +    UWORD*      pattrows;    /* array of number of rows for each pattern */
   1.813 +    UWORD*      positions;   /* all positions */
   1.814  
   1.815 -		UBYTE       globalslide; /* global volume slide rate */
   1.816 -		UBYTE       pat_repcrazy;/* module has just looped to position -1 */
   1.817 -		UWORD       patbrk;      /* position where to start a new pattern */
   1.818 -		UBYTE       patdly;      /* patterndelay counter (command memory) */
   1.819 -		UBYTE       patdly2;     /* patterndelay counter (real one) */
   1.820 -		SWORD       posjmp;      /* flag to indicate a jump is needed... */
   1.821 -		UWORD		bpmlimit;	 /* threshold to detect bpm or speed values */
   1.822 +    BOOL        forbid;      /* if true, no player update! */
   1.823 +    UWORD       numrow;      /* number of rows on current pattern */
   1.824 +    UWORD       vbtick;      /* tick counter (counts from 0 to sngspd) */
   1.825 +    UWORD       sngremainder;/* used for song time computation */
   1.826 +
   1.827 +    struct MP_CONTROL* control; /* Effects Channel info (size pf->numchn) */
   1.828 +    struct MP_VOICE*   voice;   /* Audio Voice information (size md_numchn) */
   1.829 +
   1.830 +    UBYTE       globalslide; /* global volume slide rate */
   1.831 +    UBYTE       pat_repcrazy;/* module has just looped to position -1 */
   1.832 +    UWORD       patbrk;      /* position where to start a new pattern */
   1.833 +    UBYTE       patdly;      /* patterndelay counter (command memory) */
   1.834 +    UBYTE       patdly2;     /* patterndelay counter (real one) */
   1.835 +    SWORD       posjmp;      /* flag to indicate a jump is needed... */
   1.836 +    UWORD       bpmlimit;    /* threshold to detect bpm or speed values */
   1.837  } MODULE;
   1.838  
   1.839 +
   1.840  /*
   1.841 - *	========== Module loaders
   1.842 + *  ========== Module loaders
   1.843   */
   1.844  
   1.845  struct MLOADER;
   1.846 @@ -531,7 +608,7 @@
   1.847  MIKMODAPI extern struct MLOADER load_xm;  /* FastTracker 2 (by Triton) */
   1.848  
   1.849  /*
   1.850 - *	========== Module player
   1.851 + *  ========== Module player
   1.852   */
   1.853  
   1.854  MIKMODAPI extern MODULE* Player_Load(CHAR*,int,BOOL);
   1.855 @@ -559,8 +636,7 @@
   1.856  MIKMODAPI extern int     Player_GetChannelVoice(UBYTE);
   1.857  MIKMODAPI extern UWORD   Player_GetChannelPeriod(UBYTE);
   1.858  
   1.859 -typedef void (MikMod_player)(void);
   1.860 -typedef MikMod_player *MikMod_player_t;
   1.861 +typedef void (*MikMod_player_t)(void);
   1.862  
   1.863  MIKMODAPI extern MikMod_player_t MikMod_RegisterPlayer(MikMod_player_t);
   1.864  
   1.865 @@ -568,17 +644,17 @@
   1.866  #define MUTE_INCLUSIVE  32001
   1.867  
   1.868  /*
   1.869 - *	========== Drivers
   1.870 + *  ========== Drivers
   1.871   */
   1.872  
   1.873  enum {
   1.874 -	MD_MUSIC = 0,
   1.875 -	MD_SNDFX
   1.876 +    MD_MUSIC = 0,
   1.877 +    MD_SNDFX
   1.878  };
   1.879  
   1.880  enum {
   1.881 -	MD_HARDWARE = 0,
   1.882 -	MD_SOFTWARE
   1.883 +    MD_HARDWARE = 0,
   1.884 +    MD_SOFTWARE
   1.885  };
   1.886  
   1.887  /* Mixing flags */
   1.888 @@ -594,42 +670,44 @@
   1.889  #define DMODE_INTERP     0x0200 /* enable interpolation */
   1.890  #define DMODE_REVERSE    0x0400 /* reverse stereo */
   1.891  
   1.892 +
   1.893  struct SAMPLOAD;
   1.894 +
   1.895  typedef struct MDRIVER {
   1.896 -struct MDRIVER* next;
   1.897 -	CHAR*       Name;
   1.898 -	CHAR*       Version;
   1.899 +    struct MDRIVER* next;
   1.900 +    CHAR*       Name;
   1.901 +    CHAR*       Version;
   1.902  
   1.903 -	UBYTE       HardVoiceLimit; /* Limit of hardware mixer voices */
   1.904 -	UBYTE       SoftVoiceLimit; /* Limit of software mixer voices */
   1.905 +    UBYTE       HardVoiceLimit; /* Limit of hardware mixer voices */
   1.906 +    UBYTE       SoftVoiceLimit; /* Limit of software mixer voices */
   1.907  
   1.908 -	CHAR*       Alias;
   1.909 +    CHAR*       Alias;
   1.910  
   1.911 -	void        (*CommandLine)      (CHAR*);
   1.912 -	BOOL        (*IsPresent)        (void);
   1.913 -	SWORD       (*SampleLoad)       (struct SAMPLOAD*,int);
   1.914 -	void        (*SampleUnload)     (SWORD);
   1.915 -	ULONG       (*FreeSampleSpace)  (int);
   1.916 -	ULONG       (*RealSampleLength) (int,struct SAMPLE*);
   1.917 -	BOOL        (*Init)             (void);
   1.918 -	void        (*Exit)             (void);
   1.919 -	BOOL        (*Reset)            (void);
   1.920 -	BOOL        (*SetNumVoices)     (void);
   1.921 -	BOOL        (*PlayStart)        (void);
   1.922 -	void        (*PlayStop)         (void);
   1.923 -	void        (*Update)           (void);
   1.924 -	void		(*Pause)			(void);
   1.925 -	void        (*VoiceSetVolume)   (UBYTE,UWORD);
   1.926 -	UWORD       (*VoiceGetVolume)   (UBYTE);
   1.927 -	void        (*VoiceSetFrequency)(UBYTE,ULONG);
   1.928 -	ULONG       (*VoiceGetFrequency)(UBYTE);
   1.929 -	void        (*VoiceSetPanning)  (UBYTE,ULONG);
   1.930 -	ULONG       (*VoiceGetPanning)  (UBYTE);
   1.931 -	void        (*VoicePlay)        (UBYTE,SWORD,ULONG,ULONG,ULONG,ULONG,UWORD);
   1.932 -	void        (*VoiceStop)        (UBYTE);
   1.933 -	BOOL        (*VoiceStopped)     (UBYTE);
   1.934 -	SLONG       (*VoiceGetPosition) (UBYTE);
   1.935 -	ULONG       (*VoiceRealVolume)  (UBYTE);
   1.936 +    void        (*CommandLine)      (CHAR*);
   1.937 +    BOOL        (*IsPresent)        (void);
   1.938 +    SWORD       (*SampleLoad)       (struct SAMPLOAD*,int);
   1.939 +    void        (*SampleUnload)     (SWORD);
   1.940 +    ULONG       (*FreeSampleSpace)  (int);
   1.941 +    ULONG       (*RealSampleLength) (int,struct SAMPLE*);
   1.942 +    int         (*Init)             (void);
   1.943 +    void        (*Exit)             (void);
   1.944 +    int         (*Reset)            (void);
   1.945 +    int         (*SetNumVoices)     (void);
   1.946 +    int         (*PlayStart)        (void);
   1.947 +    void        (*PlayStop)         (void);
   1.948 +    void        (*Update)           (void);
   1.949 +    void        (*Pause)            (void);
   1.950 +    void        (*VoiceSetVolume)   (UBYTE,UWORD);
   1.951 +    UWORD       (*VoiceGetVolume)   (UBYTE);
   1.952 +    void        (*VoiceSetFrequency)(UBYTE,ULONG);
   1.953 +    ULONG       (*VoiceGetFrequency)(UBYTE);
   1.954 +    void        (*VoiceSetPanning)  (UBYTE,ULONG);
   1.955 +    ULONG       (*VoiceGetPanning)  (UBYTE);
   1.956 +    void        (*VoicePlay)        (UBYTE,SWORD,ULONG,ULONG,ULONG,ULONG,UWORD);
   1.957 +    void        (*VoiceStop)        (UBYTE);
   1.958 +    BOOL        (*VoiceStopped)     (UBYTE);
   1.959 +    SLONG       (*VoiceGetPosition) (UBYTE);
   1.960 +    ULONG       (*VoiceRealVolume)  (UBYTE);
   1.961  } MDRIVER;
   1.962  
   1.963  /* These variables can be changed at ANY time and results will be immediate */
   1.964 @@ -659,7 +737,7 @@
   1.965  MIKMODAPI extern struct MDRIVER drv_wav;    /* RIFF WAVE file disk writer [music.wav] */
   1.966  
   1.967  MIKMODAPI extern struct MDRIVER drv_ultra;  /* Linux Ultrasound driver */
   1.968 -MIKMODAPI extern struct MDRIVER drv_sam9407;	/* Linux sam9407 driver */
   1.969 +MIKMODAPI extern struct MDRIVER drv_sam9407;/* Linux sam9407 driver */
   1.970  
   1.971  MIKMODAPI extern struct MDRIVER drv_AF;     /* Dec Alpha AudioFile */
   1.972  MIKMODAPI extern struct MDRIVER drv_aix;    /* AIX audio device */
   1.973 @@ -668,6 +746,7 @@
   1.974  MIKMODAPI extern struct MDRIVER drv_hp;     /* HP-UX audio device */
   1.975  MIKMODAPI extern struct MDRIVER drv_oss;    /* OpenSound System (Linux,FreeBSD...) */
   1.976  MIKMODAPI extern struct MDRIVER drv_sgi;    /* SGI audio library */
   1.977 +MIKMODAPI extern struct MDRIVER drv_sndio;  /* OpenBSD sndio */
   1.978  MIKMODAPI extern struct MDRIVER drv_sun;    /* Sun/NetBSD/OpenBSD audio device */
   1.979  
   1.980  MIKMODAPI extern struct MDRIVER drv_dart;   /* OS/2 Direct Audio RealTime */
   1.981 @@ -680,13 +759,13 @@
   1.982  
   1.983  /*========== Virtual channel mixer interface (for user-supplied drivers only) */
   1.984  
   1.985 -MIKMODAPI extern BOOL  VC_Init(void);
   1.986 +MIKMODAPI extern int   VC_Init(void);
   1.987  MIKMODAPI extern void  VC_Exit(void);
   1.988 -MIKMODAPI extern BOOL  VC_SetNumVoices(void);
   1.989 +MIKMODAPI extern int   VC_SetNumVoices(void);
   1.990  MIKMODAPI extern ULONG VC_SampleSpace(int);
   1.991  MIKMODAPI extern ULONG VC_SampleLength(int,SAMPLE*);
   1.992  
   1.993 -MIKMODAPI extern BOOL  VC_PlayStart(void);
   1.994 +MIKMODAPI extern int   VC_PlayStart(void);
   1.995  MIKMODAPI extern void  VC_PlayStop(void);
   1.996  
   1.997  MIKMODAPI extern SWORD VC_SampleLoad(struct SAMPLOAD*,int);
     2.1 Binary file VisualC/external/lib/x64/libmikmod-2.dll has changed
     3.1 Binary file VisualC/external/lib/x86/libmikmod-2.dll has changed
     4.1 --- a/Xcode/Frameworks/mikmod.framework/Versions/A/Headers/mikmod.h	Sun Oct 07 11:26:40 2018 +0300
     4.2 +++ b/Xcode/Frameworks/mikmod.framework/Versions/A/Headers/mikmod.h	Sun Oct 07 11:40:55 2018 +0300
     4.3 @@ -1,30 +1,28 @@
     4.4 -/*	MikMod sound library
     4.5 -	(c) 1998, 1999, 2000 Miodrag Vallat and others - see file AUTHORS
     4.6 -	for complete list.
     4.7 +/*  MikMod sound library
     4.8 +    (c) 1998-2014 Miodrag Vallat and others - see the AUTHORS file
     4.9 +    for complete list.
    4.10  
    4.11 -	This library is free software; you can redistribute it and/or modify
    4.12 -	it under the terms of the GNU Library General Public License as
    4.13 -	published by the Free Software Foundation; either version 2 of
    4.14 -	the License, or (at your option) any later version.
    4.15 - 
    4.16 -	This program is distributed in the hope that it will be useful,
    4.17 -	but WITHOUT ANY WARRANTY; without even the implied warranty of
    4.18 -	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    4.19 -	GNU Library General Public License for more details.
    4.20 - 
    4.21 -	You should have received a copy of the GNU Library General Public
    4.22 -	License along with this library; if not, write to the Free Software
    4.23 -	Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
    4.24 -	02111-1307, USA.
    4.25 +    This library is free software; you can redistribute it and/or modify
    4.26 +    it under the terms of the GNU Library General Public License as
    4.27 +    published by the Free Software Foundation; either version 2 of
    4.28 +    the License, or (at your option) any later version.
    4.29 +
    4.30 +    This program is distributed in the hope that it will be useful,
    4.31 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    4.32 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    4.33 +    GNU Library General Public License for more details.
    4.34 +
    4.35 +    You should have received a copy of the GNU Library General Public
    4.36 +    License along with this library; if not, write to the Free Software
    4.37 +    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
    4.38 +    02111-1307, USA.
    4.39  */
    4.40  
    4.41  /*==============================================================================
    4.42  
    4.43 -  $Id: mikmod.h.in,v 1.2 2004/06/01 16:43:45 raph Exp $
    4.44 -
    4.45    MikMod sound library include file
    4.46  
    4.47 -==============================================================================*/
    4.48 +  ==============================================================================*/
    4.49  
    4.50  #ifndef _MIKMOD_H_
    4.51  #define _MIKMOD_H_
    4.52 @@ -38,167 +36,243 @@
    4.53  
    4.54  /*
    4.55   * ========== Compiler magic for shared libraries
    4.56 + *
    4.57 + * ========== NOTE TO WINDOWS DEVELOPERS:
    4.58 + * If you are compiling for Windows and will link to the static library
    4.59 + * (libmikmod.a with MinGW, or mikmod_static.lib with MSVC or LCC, etc),
    4.60 + * you must define MIKMOD_STATIC in your project.  Otherwise, dllimport
    4.61 + * will be assumed.
    4.62   */
    4.63 -
    4.64 -#if defined WIN32 && defined _DLL
    4.65 -#ifdef DLL_EXPORTS
    4.66 -#define MIKMODAPI __declspec(dllexport)
    4.67 +#if defined(_WIN32) || defined(__CYGWIN__)
    4.68 +# if defined(MIKMOD_BUILD) && defined(DLL_EXPORT)       /* building libmikmod as a dll for windows */
    4.69 +#   define MIKMODAPI __declspec(dllexport)
    4.70 +# elif defined(MIKMOD_BUILD) || defined(MIKMOD_STATIC)  /* building or using static libmikmod for windows */
    4.71 +#   define MIKMODAPI
    4.72 +# else
    4.73 +#   define MIKMODAPI __declspec(dllimport)                      /* using libmikmod dll for windows */
    4.74 +# endif
    4.75 +#elif defined(__OS2__) && defined(__WATCOMC__)
    4.76 +# if defined(MIKMOD_BUILD) && defined(__SW_BD)          /* building libmikmod as a dll for os/2 */
    4.77 +#   define MIKMODAPI __declspec(dllexport)
    4.78 +# else
    4.79 +#   define MIKMODAPI                                    /* using dll or static libmikmod for os/2 */
    4.80 +# endif
    4.81 +/* SYM_VISIBILITY should be defined if both the compiler
    4.82 + * and the target support the visibility attributes. the
    4.83 + * configury does that automatically. for the standalone
    4.84 + * makefiles, etc, the developer should add the required
    4.85 + * flags, i.e.:  -DSYM_VISIBILITY -fvisibility=hidden  */
    4.86 +#elif defined(MIKMOD_BUILD) && defined(SYM_VISIBILITY)
    4.87 +#   define MIKMODAPI __attribute__((visibility("default")))
    4.88  #else
    4.89 -#define MIKMODAPI __declspec(dllimport)
    4.90 -#endif
    4.91 -#else
    4.92 -#define MIKMODAPI
    4.93 +#   define MIKMODAPI
    4.94  #endif
    4.95  
    4.96  /*
    4.97 - *	========== Library version
    4.98 + *  ========== Library version
    4.99   */
   4.100  
   4.101  #define LIBMIKMOD_VERSION_MAJOR 3L
   4.102  #define LIBMIKMOD_VERSION_MINOR 1L
   4.103 -#define LIBMIKMOD_REVISION      10L
   4.104 +#define LIBMIKMOD_REVISION     21L
   4.105  
   4.106  #define LIBMIKMOD_VERSION \
   4.107 -	((LIBMIKMOD_VERSION_MAJOR<<16)| \
   4.108 -	 (LIBMIKMOD_VERSION_MINOR<< 8)| \
   4.109 -	 (LIBMIKMOD_REVISION))
   4.110 +    ((LIBMIKMOD_VERSION_MAJOR<<16)| \
   4.111 +     (LIBMIKMOD_VERSION_MINOR<< 8)| \
   4.112 +     (LIBMIKMOD_REVISION))
   4.113  
   4.114  MIKMODAPI extern long MikMod_GetVersion(void);
   4.115  
   4.116  /*
   4.117 - *	========== Platform independent-type definitions
   4.118 + *  ========== Dependency platform headers
   4.119   */
   4.120  
   4.121 -#ifdef WIN32
   4.122 +#ifdef _WIN32
   4.123 +#ifndef WIN32_LEAN_AND_MEAN
   4.124  #define WIN32_LEAN_AND_MEAN
   4.125 +#endif
   4.126  #include <windows.h>
   4.127  #include <io.h>
   4.128  #include <mmsystem.h>
   4.129 +#define _MIKMOD_WIN32
   4.130  #endif
   4.131  
   4.132 -#if defined(__OS2__)||defined(__EMX__)
   4.133 +#if defined(__DJGPP__) || defined(MSDOS) || defined(__MSDOS__) || defined(__DOS__)
   4.134 +#define _MIKMOD_DOS
   4.135 +#endif
   4.136 +
   4.137 +#if defined(__OS2__) || defined(__EMX__)
   4.138  #define INCL_DOSSEMAPHORES
   4.139  #include <os2.h>
   4.140 -#else
   4.141 -typedef char CHAR;
   4.142 +#include <io.h>
   4.143 +#define _MIKMOD_OS2
   4.144  #endif
   4.145  
   4.146 -
   4.147 -
   4.148 -#if defined(__arch64__) || defined(__alpha) || defined(__x86_64) || defined(_LP64)
   4.149 -/* 64 bit architectures */
   4.150 -
   4.151 -typedef signed char     SBYTE;      /* 1 byte, signed */
   4.152 -typedef unsigned char   UBYTE;      /* 1 byte, unsigned */
   4.153 -typedef signed short    SWORD;      /* 2 bytes, signed */
   4.154 -typedef unsigned short  UWORD;      /* 2 bytes, unsigned */
   4.155 -typedef signed int      SLONG;      /* 4 bytes, signed */
   4.156 -typedef unsigned int    ULONG;      /* 4 bytes, unsigned */
   4.157 -typedef int             BOOL;       /* 0=false, <>0 true */
   4.158 -
   4.159 -#else
   4.160 -/* 32 bit architectures */
   4.161 -
   4.162 -typedef signed char     SBYTE;      /* 1 byte, signed */
   4.163 -typedef unsigned char   UBYTE;      /* 1 byte, unsigned */
   4.164 -typedef signed short    SWORD;      /* 2 bytes, signed */
   4.165 -typedef unsigned short  UWORD;      /* 2 bytes, unsigned */
   4.166 -typedef signed long     SLONG;      /* 4 bytes, signed */
   4.167 -#if !defined(__OS2__)&&!defined(__EMX__)&&!defined(WIN32)
   4.168 -typedef unsigned long   ULONG;      /* 4 bytes, unsigned */
   4.169 -typedef int             BOOL;       /* 0=false, <>0 true */
   4.170 -#endif
   4.171 +#if defined(__MORPHOS__) || defined(__AROS__) || defined(_AMIGA) || defined(__AMIGA__) || defined(__amigaos__) || defined(AMIGAOS)
   4.172 +#include <exec/types.h>
   4.173 +#define _MIKMOD_AMIGA
   4.174  #endif
   4.175  
   4.176  /*
   4.177 - *	========== Error codes
   4.178 + *  ========== Platform independent-type definitions
   4.179 + * (pain when it comes to cross-platform maintenance..)
   4.180 + */
   4.181 +
   4.182 +#if !(defined(_MIKMOD_OS2) || defined(_MIKMOD_WIN32))
   4.183 +typedef char               CHAR;
   4.184 +#endif
   4.185 +
   4.186 +/* BOOL:  0=false, <>0 true -- 16 bits on Amiga, int-wide on others. */
   4.187 +#if !(defined(_MIKMOD_OS2) || defined(_MIKMOD_WIN32) || defined(_MIKMOD_AMIGA))
   4.188 +typedef int                BOOL;
   4.189 +#endif
   4.190 +
   4.191 +/* 1 byte, signed and unsigned: */
   4.192 +typedef signed char        SBYTE;
   4.193 +#ifndef _MIKMOD_AMIGA
   4.194 +typedef unsigned char      UBYTE;
   4.195 +#endif
   4.196 +
   4.197 +/* 2 bytes, signed and unsigned: */
   4.198 +#if !(defined __LCC__ && defined _WIN32)
   4.199 +typedef signed short int   SWORD;
   4.200 +#endif
   4.201 +#if !((defined __LCC__ && defined _WIN32) || defined(_MIKMOD_AMIGA))
   4.202 +typedef unsigned short int UWORD;
   4.203 +#endif
   4.204 +
   4.205 +/* 4 bytes, signed and unsigned: */
   4.206 +#if defined(_LP64) || defined(__LP64__) || defined(__arch64__) || defined(__alpha) || defined(__x86_64) || defined(__powerpc64__)
   4.207 +        /* 64 bit architectures: */
   4.208 +typedef signed int         SLONG;
   4.209 +#if !(defined(_WIN32) || defined(_MIKMOD_AMIGA))
   4.210 +typedef unsigned int       ULONG;
   4.211 +#endif
   4.212 +
   4.213 +#else  /* 32 bit architectures: */
   4.214 +typedef signed long int    SLONG;
   4.215 +#if !(defined(_MIKMOD_OS2) || defined(_MIKMOD_WIN32) || defined(_MIKMOD_AMIGA))
   4.216 +typedef unsigned long int  ULONG;
   4.217 +#endif
   4.218 +#endif
   4.219 +
   4.220 +/* make sure types are of correct sizes: */
   4.221 +typedef int __mikmod_typetest [
   4.222 +   (
   4.223 +        (sizeof(SBYTE)==1) && (sizeof(UBYTE)==1)
   4.224 +     && (sizeof(SWORD)==2) && (sizeof(UWORD)==2)
   4.225 +     && (sizeof(SLONG)==4) && (sizeof(ULONG)==4)
   4.226 +#ifndef _MIKMOD_AMIGA
   4.227 +     && (sizeof(BOOL) == sizeof(int))
   4.228 +#endif
   4.229 +     && (sizeof(CHAR) == sizeof(char))
   4.230 +   ) * 2 - 1 ];
   4.231 +
   4.232 +/*
   4.233 + *  ========== Error codes
   4.234   */
   4.235  
   4.236  enum {
   4.237 -	MMERR_OPENING_FILE = 1,
   4.238 -	MMERR_OUT_OF_MEMORY,
   4.239 -	MMERR_DYNAMIC_LINKING,
   4.240 +    MMERR_OPENING_FILE = 1,
   4.241 +    MMERR_OUT_OF_MEMORY,
   4.242 +    MMERR_DYNAMIC_LINKING,
   4.243  
   4.244 -	MMERR_SAMPLE_TOO_BIG,
   4.245 -	MMERR_OUT_OF_HANDLES,
   4.246 -	MMERR_UNKNOWN_WAVE_TYPE,
   4.247 +    MMERR_SAMPLE_TOO_BIG,
   4.248 +    MMERR_OUT_OF_HANDLES,
   4.249 +    MMERR_UNKNOWN_WAVE_TYPE,
   4.250  
   4.251 -	MMERR_LOADING_PATTERN,
   4.252 -	MMERR_LOADING_TRACK,
   4.253 -	MMERR_LOADING_HEADER,
   4.254 -	MMERR_LOADING_SAMPLEINFO,
   4.255 -	MMERR_NOT_A_MODULE,
   4.256 -	MMERR_NOT_A_STREAM,
   4.257 -	MMERR_MED_SYNTHSAMPLES,
   4.258 -	MMERR_ITPACK_INVALID_DATA,
   4.259 +    MMERR_LOADING_PATTERN,
   4.260 +    MMERR_LOADING_TRACK,
   4.261 +    MMERR_LOADING_HEADER,
   4.262 +    MMERR_LOADING_SAMPLEINFO,
   4.263 +    MMERR_NOT_A_MODULE,
   4.264 +    MMERR_NOT_A_STREAM,
   4.265 +    MMERR_MED_SYNTHSAMPLES,
   4.266 +    MMERR_ITPACK_INVALID_DATA,
   4.267  
   4.268 -	MMERR_DETECTING_DEVICE,
   4.269 -	MMERR_INVALID_DEVICE,
   4.270 -	MMERR_INITIALIZING_MIXER,
   4.271 -	MMERR_OPENING_AUDIO,
   4.272 -	MMERR_8BIT_ONLY,
   4.273 -	MMERR_16BIT_ONLY,
   4.274 -	MMERR_STEREO_ONLY,
   4.275 -	MMERR_ULAW,
   4.276 -	MMERR_NON_BLOCK,
   4.277 +    MMERR_DETECTING_DEVICE,
   4.278 +    MMERR_INVALID_DEVICE,
   4.279 +    MMERR_INITIALIZING_MIXER,
   4.280 +    MMERR_OPENING_AUDIO,
   4.281 +    MMERR_8BIT_ONLY,
   4.282 +    MMERR_16BIT_ONLY,
   4.283 +    MMERR_STEREO_ONLY,
   4.284 +    MMERR_ULAW,
   4.285 +    MMERR_NON_BLOCK,
   4.286  
   4.287 -	MMERR_AF_AUDIO_PORT,
   4.288 +    MMERR_AF_AUDIO_PORT,
   4.289  
   4.290 -	MMERR_AIX_CONFIG_INIT,
   4.291 -	MMERR_AIX_CONFIG_CONTROL,
   4.292 -	MMERR_AIX_CONFIG_START,
   4.293 +    MMERR_AIX_CONFIG_INIT,
   4.294 +    MMERR_AIX_CONFIG_CONTROL,
   4.295 +    MMERR_AIX_CONFIG_START,
   4.296  
   4.297 -	MMERR_GUS_SETTINGS,
   4.298 -	MMERR_GUS_RESET,
   4.299 -	MMERR_GUS_TIMER,
   4.300 +    MMERR_GUS_SETTINGS,
   4.301 +    MMERR_GUS_RESET,
   4.302 +    MMERR_GUS_TIMER,
   4.303  
   4.304 -	MMERR_HP_SETSAMPLESIZE,
   4.305 -	MMERR_HP_SETSPEED,
   4.306 -	MMERR_HP_CHANNELS,
   4.307 -	MMERR_HP_AUDIO_OUTPUT,
   4.308 -	MMERR_HP_AUDIO_DESC,
   4.309 -	MMERR_HP_BUFFERSIZE,
   4.310 +    MMERR_HP_SETSAMPLESIZE,
   4.311 +    MMERR_HP_SETSPEED,
   4.312 +    MMERR_HP_CHANNELS,
   4.313 +    MMERR_HP_AUDIO_OUTPUT,
   4.314 +    MMERR_HP_AUDIO_DESC,
   4.315 +    MMERR_HP_BUFFERSIZE,
   4.316  
   4.317 -	MMERR_OSS_SETFRAGMENT,
   4.318 -	MMERR_OSS_SETSAMPLESIZE,
   4.319 -	MMERR_OSS_SETSTEREO,
   4.320 -	MMERR_OSS_SETSPEED,
   4.321 +    MMERR_OSS_SETFRAGMENT,
   4.322 +    MMERR_OSS_SETSAMPLESIZE,
   4.323 +    MMERR_OSS_SETSTEREO,
   4.324 +    MMERR_OSS_SETSPEED,
   4.325  
   4.326 -	MMERR_SGI_SPEED,
   4.327 -	MMERR_SGI_16BIT,
   4.328 -	MMERR_SGI_8BIT,
   4.329 -	MMERR_SGI_STEREO,
   4.330 -	MMERR_SGI_MONO,
   4.331 +    MMERR_SGI_SPEED,
   4.332 +    MMERR_SGI_16BIT,
   4.333 +    MMERR_SGI_8BIT,
   4.334 +    MMERR_SGI_STEREO,
   4.335 +    MMERR_SGI_MONO,
   4.336  
   4.337 -	MMERR_SUN_INIT,
   4.338 +    MMERR_SUN_INIT,
   4.339  
   4.340 -	MMERR_OS2_MIXSETUP,
   4.341 -	MMERR_OS2_SEMAPHORE,
   4.342 -	MMERR_OS2_TIMER,
   4.343 -	MMERR_OS2_THREAD,
   4.344 +    MMERR_OS2_MIXSETUP,
   4.345 +    MMERR_OS2_SEMAPHORE,
   4.346 +    MMERR_OS2_TIMER,
   4.347 +    MMERR_OS2_THREAD,
   4.348  
   4.349 -	MMERR_DS_PRIORITY,
   4.350 -	MMERR_DS_BUFFER,
   4.351 -	MMERR_DS_FORMAT,
   4.352 -	MMERR_DS_NOTIFY,
   4.353 -	MMERR_DS_EVENT,
   4.354 -	MMERR_DS_THREAD,
   4.355 -	MMERR_DS_UPDATE,
   4.356 +    MMERR_DS_PRIORITY,
   4.357 +    MMERR_DS_BUFFER,
   4.358 +    MMERR_DS_FORMAT,
   4.359 +    MMERR_DS_NOTIFY,
   4.360 +    MMERR_DS_EVENT,
   4.361 +    MMERR_DS_THREAD,
   4.362 +    MMERR_DS_UPDATE,
   4.363  
   4.364 -	MMERR_WINMM_HANDLE,
   4.365 -	MMERR_WINMM_ALLOCATED,
   4.366 -	MMERR_WINMM_DEVICEID,
   4.367 -	MMERR_WINMM_FORMAT,
   4.368 -	MMERR_WINMM_UNKNOWN,
   4.369 +    MMERR_WINMM_HANDLE,
   4.370 +    MMERR_WINMM_ALLOCATED,
   4.371 +    MMERR_WINMM_DEVICEID,
   4.372 +    MMERR_WINMM_FORMAT,
   4.373 +    MMERR_WINMM_UNKNOWN,
   4.374  
   4.375 -	MMERR_MAC_SPEED,
   4.376 -	MMERR_MAC_START,
   4.377 +    MMERR_MAC_SPEED,
   4.378 +    MMERR_MAC_START,
   4.379  
   4.380 -	MMERR_MAX
   4.381 +    /* 65-86 exist only in libmikmod3 */
   4.382 +    ___filler_MMERR=(MMERR_MAC_START+22),
   4.383 +
   4.384 +    MMERR_ALSA_NOCONFIG,
   4.385 +    MMERR_ALSA_SETPARAMS,
   4.386 +    MMERR_ALSA_SETFORMAT,
   4.387 +    MMERR_ALSA_SETRATE,
   4.388 +    MMERR_ALSA_SETCHANNELS,
   4.389 +    MMERR_ALSA_BUFFERSIZE,
   4.390 +    MMERR_ALSA_PCM_START,
   4.391 +    MMERR_ALSA_PCM_WRITE,
   4.392 +    MMERR_ALSA_PCM_RECOVER,
   4.393 +
   4.394 +    MMERR_SNDIO_SETPARAMS,
   4.395 +    MMERR_SNDIO_BADPARAMS,
   4.396 +
   4.397 +    MMERR_MAX
   4.398  };
   4.399  
   4.400  /*
   4.401 - *	========== Error handling
   4.402 + *  ========== Error handling
   4.403   */
   4.404  
   4.405  typedef void (MikMod_handler)(void);
   4.406 @@ -211,7 +285,7 @@
   4.407  MIKMODAPI extern MikMod_handler_t MikMod_RegisterErrorHandler(MikMod_handler_t);
   4.408  
   4.409  /*
   4.410 - *	========== Library initialization and core functions
   4.411 + *  ========== Library initialization and core functions
   4.412   */
   4.413  
   4.414  struct MDRIVER;
   4.415 @@ -222,12 +296,12 @@
   4.416  MIKMODAPI extern void   MikMod_RegisterDriver(struct MDRIVER*);
   4.417  MIKMODAPI extern int    MikMod_DriverFromAlias(CHAR*);
   4.418  
   4.419 -MIKMODAPI extern BOOL   MikMod_Init(CHAR*);
   4.420 +MIKMODAPI extern int    MikMod_Init(CHAR*);
   4.421  MIKMODAPI extern void   MikMod_Exit(void);
   4.422 -MIKMODAPI extern BOOL   MikMod_Reset(CHAR*);
   4.423 -MIKMODAPI extern BOOL   MikMod_SetNumVoices(int,int);
   4.424 +MIKMODAPI extern int    MikMod_Reset(CHAR*);
   4.425 +MIKMODAPI extern int    MikMod_SetNumVoices(int,int);
   4.426  MIKMODAPI extern BOOL   MikMod_Active(void);
   4.427 -MIKMODAPI extern BOOL   MikMod_EnableOutput(void);
   4.428 +MIKMODAPI extern int    MikMod_EnableOutput(void);
   4.429  MIKMODAPI extern void   MikMod_DisableOutput(void);
   4.430  MIKMODAPI extern void   MikMod_Update(void);
   4.431  
   4.432 @@ -236,26 +310,26 @@
   4.433  MIKMODAPI extern void   MikMod_Unlock(void);
   4.434  
   4.435  /*
   4.436 - *	========== Reader, Writer
   4.437 + *  ========== Reader, Writer
   4.438   */
   4.439  
   4.440  typedef struct MREADER {
   4.441 -	BOOL (*Seek)(struct MREADER*,long,int);
   4.442 -	long (*Tell)(struct MREADER*);
   4.443 -	BOOL (*Read)(struct MREADER*,void*,size_t);
   4.444 -	int  (*Get)(struct MREADER*);
   4.445 -	BOOL (*Eof)(struct MREADER*);
   4.446 +    int  (*Seek)(struct MREADER*,long,int);
   4.447 +    long (*Tell)(struct MREADER*);
   4.448 +    BOOL (*Read)(struct MREADER*,void*,size_t);
   4.449 +    int  (*Get)(struct MREADER*);
   4.450 +    BOOL (*Eof)(struct MREADER*);
   4.451  } MREADER;
   4.452  
   4.453  typedef struct MWRITER {
   4.454 -	BOOL (*Seek)(struct MWRITER*,long,int);
   4.455 -	long (*Tell)(struct MWRITER*);
   4.456 -	BOOL (*Write)(struct MWRITER*,void*,size_t);
   4.457 -	BOOL (*Put)(struct MWRITER*,int);
   4.458 +    int  (*Seek)(struct MWRITER*, long, int);
   4.459 +    long (*Tell)(struct MWRITER*);
   4.460 +    BOOL (*Write)(struct MWRITER*, void*, size_t);
   4.461 +    int  (*Put)(struct MWRITER*, int);
   4.462  } MWRITER;
   4.463  
   4.464  /*
   4.465 - *	========== Samples
   4.466 + *  ========== Samples
   4.467   */
   4.468  
   4.469  /* Sample playback should not be interrupted */
   4.470 @@ -267,9 +341,9 @@
   4.471  #define SF_SIGNED       0x0004
   4.472  #define SF_BIG_ENDIAN   0x0008
   4.473  #define SF_DELTA        0x0010
   4.474 -#define SF_ITPACKED		0x0020
   4.475 +#define SF_ITPACKED     0x0020
   4.476  
   4.477 -#define	SF_FORMATMASK	0x003F
   4.478 +#define SF_FORMATMASK   0x003F
   4.479  
   4.480  /* General Playback flags */
   4.481  
   4.482 @@ -278,49 +352,49 @@
   4.483  #define SF_REVERSE      0x0400
   4.484  #define SF_SUSTAIN      0x0800
   4.485  
   4.486 -#define SF_PLAYBACKMASK	0x0C00
   4.487 +#define SF_PLAYBACKMASK 0x0C00
   4.488  
   4.489  /* Module-only Playback Flags */
   4.490  
   4.491 -#define SF_OWNPAN		0x1000
   4.492 +#define SF_OWNPAN       0x1000
   4.493  #define SF_UST_LOOP     0x2000
   4.494  
   4.495 -#define SF_EXTRAPLAYBACKMASK	0x3000
   4.496 +#define SF_EXTRAPLAYBACKMASK    0x3000
   4.497  
   4.498  /* Panning constants */
   4.499 -#define PAN_LEFT		0
   4.500 -#define PAN_HALFLEFT 	64
   4.501 -#define PAN_CENTER		128
   4.502 -#define PAN_HALFRIGHT	192
   4.503 -#define PAN_RIGHT		255
   4.504 -#define PAN_SURROUND	512 /* panning value for Dolby Surround */
   4.505 +#define PAN_LEFT        0
   4.506 +#define PAN_HALFLEFT    64
   4.507 +#define PAN_CENTER      128
   4.508 +#define PAN_HALFRIGHT   192
   4.509 +#define PAN_RIGHT       255
   4.510 +#define PAN_SURROUND    512 /* panning value for Dolby Surround */
   4.511  
   4.512  typedef struct SAMPLE {
   4.513 -	SWORD  panning;     /* panning (0-255 or PAN_SURROUND) */
   4.514 -	ULONG  speed;       /* Base playing speed/frequency of note */
   4.515 -	UBYTE  volume;      /* volume 0-64 */
   4.516 -	UWORD  inflags;		/* sample format on disk */
   4.517 -	UWORD  flags;       /* sample format in memory */
   4.518 -	ULONG  length;      /* length of sample (in samples!) */
   4.519 -	ULONG  loopstart;   /* repeat position (relative to start, in samples) */
   4.520 -	ULONG  loopend;     /* repeat end */
   4.521 -	ULONG  susbegin;    /* sustain loop begin (in samples) \  Not Supported */
   4.522 -	ULONG  susend;      /* sustain loop end                /      Yet! */
   4.523 +    SWORD  panning;     /* panning (0-255 or PAN_SURROUND) */
   4.524 +    ULONG  speed;       /* Base playing speed/frequency of note */
   4.525 +    UBYTE  volume;      /* volume 0-64 */
   4.526 +    UWORD  inflags;     /* sample format on disk */
   4.527 +    UWORD  flags;       /* sample format in memory */
   4.528 +    ULONG  length;      /* length of sample (in samples!) */
   4.529 +    ULONG  loopstart;   /* repeat position (relative to start, in samples) */
   4.530 +    ULONG  loopend;     /* repeat end */
   4.531 +    ULONG  susbegin;    /* sustain loop begin (in samples) \  Not Supported */
   4.532 +    ULONG  susend;      /* sustain loop end                /      Yet! */
   4.533  
   4.534 -	/* Variables used by the module player only! (ignored for sound effects) */
   4.535 -	UBYTE  globvol;     /* global volume */
   4.536 -	UBYTE  vibflags;    /* autovibrato flag stuffs */
   4.537 -	UBYTE  vibtype;     /* Vibratos moved from INSTRUMENT to SAMPLE */
   4.538 -	UBYTE  vibsweep;
   4.539 -	UBYTE  vibdepth;
   4.540 -	UBYTE  vibrate;
   4.541 -	CHAR*  samplename;  /* name of the sample */
   4.542 +    /* Variables used by the module player only! (ignored for sound effects) */
   4.543 +    UBYTE  globvol;     /* global volume */
   4.544 +    UBYTE  vibflags;    /* autovibrato flag stuffs */
   4.545 +    UBYTE  vibtype;     /* Vibratos moved from INSTRUMENT to SAMPLE */
   4.546 +    UBYTE  vibsweep;
   4.547 +    UBYTE  vibdepth;
   4.548 +    UBYTE  vibrate;
   4.549 +    CHAR*  samplename;  /* name of the sample */
   4.550  
   4.551 -	/* Values used internally only */
   4.552 -	UWORD  avibpos;     /* autovibrato pos [player use] */
   4.553 -	UBYTE  divfactor;   /* for sample scaling, maintains proper period slides */
   4.554 -	ULONG  seekpos;     /* seek position in file */
   4.555 -	SWORD  handle;      /* sample handle used by individual drivers */
   4.556 +    /* Values used internally only */
   4.557 +    UWORD  avibpos;     /* autovibrato pos [player use] */
   4.558 +    UBYTE  divfactor;   /* for sample scaling, maintains proper period slides */
   4.559 +    ULONG  seekpos;     /* seek position in file */
   4.560 +    SWORD  handle;      /* sample handle used by individual drivers */
   4.561  } SAMPLE;
   4.562  
   4.563  /* Sample functions */
   4.564 @@ -344,12 +418,12 @@
   4.565  MIKMODAPI extern ULONG  Voice_RealVolume(SBYTE);
   4.566  
   4.567  /*
   4.568 - *	========== Internal module representation (UniMod)
   4.569 + *  ========== Internal module representation (UniMod)
   4.570   */
   4.571  
   4.572  /*
   4.573 -	Instrument definition - for information only, the only field which may be
   4.574 -	of use in user programs is the name field
   4.575 +    Instrument definition - for information only, the only field which may be
   4.576 +    of use in user programs is the name field
   4.577  */
   4.578  
   4.579  /* Instrument note count */
   4.580 @@ -357,8 +431,8 @@
   4.581  
   4.582  /* Envelope point */
   4.583  typedef struct ENVPT {
   4.584 -	SWORD pos;
   4.585 -	SWORD val;
   4.586 +    SWORD pos;
   4.587 +    SWORD val;
   4.588  } ENVPT;
   4.589  
   4.590  /* Envelope point count */
   4.591 @@ -366,143 +440,146 @@
   4.592  
   4.593  /* Instrument structure */
   4.594  typedef struct INSTRUMENT {
   4.595 -	CHAR* insname;
   4.596 +    CHAR* insname;
   4.597  
   4.598 -	UBYTE flags;
   4.599 -	UWORD samplenumber[INSTNOTES];
   4.600 -	UBYTE samplenote[INSTNOTES];
   4.601 +    UBYTE flags;
   4.602 +    UWORD samplenumber[INSTNOTES];
   4.603 +    UBYTE samplenote[INSTNOTES];
   4.604  
   4.605 -	UBYTE nnatype;
   4.606 -	UBYTE dca;              /* duplicate check action */
   4.607 -	UBYTE dct;              /* duplicate check type */
   4.608 -	UBYTE globvol;
   4.609 -	UWORD volfade;
   4.610 -	SWORD panning;          /* instrument-based panning var */
   4.611 +    UBYTE nnatype;
   4.612 +    UBYTE dca;              /* duplicate check action */
   4.613 +    UBYTE dct;              /* duplicate check type */
   4.614 +    UBYTE globvol;
   4.615 +    UWORD volfade;
   4.616 +    SWORD panning;          /* instrument-based panning var */
   4.617  
   4.618 -	UBYTE pitpansep;        /* pitch pan separation (0 to 255) */
   4.619 -	UBYTE pitpancenter;     /* pitch pan center (0 to 119) */
   4.620 -	UBYTE rvolvar;          /* random volume varations (0 - 100%) */
   4.621 -	UBYTE rpanvar;          /* random panning varations (0 - 100%) */
   4.622 +    UBYTE pitpansep;        /* pitch pan separation (0 to 255) */
   4.623 +    UBYTE pitpancenter;     /* pitch pan center (0 to 119) */
   4.624 +    UBYTE rvolvar;          /* random volume varations (0 - 100%) */
   4.625 +    UBYTE rpanvar;          /* random panning varations (0 - 100%) */
   4.626  
   4.627 -	/* volume envelope */
   4.628 -	UBYTE volflg;           /* bit 0: on 1: sustain 2: loop */
   4.629 -	UBYTE volpts;
   4.630 -	UBYTE volsusbeg;
   4.631 -	UBYTE volsusend;
   4.632 -	UBYTE volbeg;
   4.633 -	UBYTE volend;
   4.634 -	ENVPT volenv[ENVPOINTS];
   4.635 -	/* panning envelope */
   4.636 -	UBYTE panflg;           /* bit 0: on 1: sustain 2: loop */
   4.637 -	UBYTE panpts;
   4.638 -	UBYTE pansusbeg;
   4.639 -	UBYTE pansusend;
   4.640 -	UBYTE panbeg;
   4.641 -	UBYTE panend;
   4.642 -	ENVPT panenv[ENVPOINTS];
   4.643 -	/* pitch envelope */
   4.644 -	UBYTE pitflg;           /* bit 0: on 1: sustain 2: loop */
   4.645 -	UBYTE pitpts;
   4.646 -	UBYTE pitsusbeg;
   4.647 -	UBYTE pitsusend;
   4.648 -	UBYTE pitbeg;
   4.649 -	UBYTE pitend;
   4.650 -	ENVPT pitenv[ENVPOINTS];
   4.651 +    /* volume envelope */
   4.652 +    UBYTE volflg;           /* bit 0: on 1: sustain 2: loop */
   4.653 +    UBYTE volpts;
   4.654 +    UBYTE volsusbeg;
   4.655 +    UBYTE volsusend;
   4.656 +    UBYTE volbeg;
   4.657 +    UBYTE volend;
   4.658 +    ENVPT volenv[ENVPOINTS];
   4.659 +    /* panning envelope */
   4.660 +    UBYTE panflg;           /* bit 0: on 1: sustain 2: loop */
   4.661 +    UBYTE panpts;
   4.662 +    UBYTE pansusbeg;
   4.663 +    UBYTE pansusend;
   4.664 +    UBYTE panbeg;
   4.665 +    UBYTE panend;
   4.666 +    ENVPT panenv[ENVPOINTS];
   4.667 +    /* pitch envelope */
   4.668 +    UBYTE pitflg;           /* bit 0: on 1: sustain 2: loop */
   4.669 +    UBYTE pitpts;
   4.670 +    UBYTE pitsusbeg;
   4.671 +    UBYTE pitsusend;
   4.672 +    UBYTE pitbeg;
   4.673 +    UBYTE pitend;
   4.674 +    ENVPT pitenv[ENVPOINTS];
   4.675  } INSTRUMENT;
   4.676  
   4.677  struct MP_CONTROL;
   4.678  struct MP_VOICE;
   4.679  
   4.680  /*
   4.681 -	Module definition
   4.682 +    Module definition
   4.683  */
   4.684  
   4.685  /* maximum master channels supported */
   4.686 -#define UF_MAXCHAN	64
   4.687 +#define UF_MAXCHAN      64
   4.688  
   4.689  /* Module flags */
   4.690 -#define UF_XMPERIODS	0x0001 /* XM periods / finetuning */
   4.691 -#define UF_LINEAR		0x0002 /* LINEAR periods (UF_XMPERIODS must be set) */
   4.692 -#define UF_INST			0x0004 /* Instruments are used */
   4.693 -#define UF_NNA			0x0008 /* IT: NNA used, set numvoices rather
   4.694 -								  than numchn */
   4.695 -#define UF_S3MSLIDES	0x0010 /* uses old S3M volume slides */
   4.696 -#define UF_BGSLIDES		0x0020 /* continue volume slides in the background */
   4.697 -#define UF_HIGHBPM		0x0040 /* MED: can use >255 bpm */
   4.698 -#define UF_NOWRAP		0x0080 /* XM-type (i.e. illogical) pattern break
   4.699 -								  semantics */
   4.700 -#define UF_ARPMEM		0x0100 /* IT: need arpeggio memory */
   4.701 -#define UF_FT2QUIRKS	0x0200 /* emulate some FT2 replay quirks */
   4.702 -#define UF_PANNING		0x0400 /* module uses panning effects or have
   4.703 -								  non-tracker default initial panning */
   4.704 +#define UF_XMPERIODS    0x0001 /* XM periods / finetuning */
   4.705 +#define UF_LINEAR       0x0002 /* LINEAR periods (UF_XMPERIODS must be set) */
   4.706 +#define UF_INST         0x0004 /* Instruments are used */
   4.707 +#define UF_NNA          0x0008 /* IT: NNA used, set numvoices rather
   4.708 +                                  than numchn */
   4.709 +#define UF_S3MSLIDES    0x0010 /* uses old S3M volume slides */
   4.710 +#define UF_BGSLIDES     0x0020 /* continue volume slides in the background */
   4.711 +#define UF_HIGHBPM      0x0040 /* MED: can use >255 bpm */
   4.712 +#define UF_NOWRAP       0x0080 /* XM-type (i.e. illogical) pattern break
   4.713 +                                  semantics */
   4.714 +#define UF_ARPMEM       0x0100 /* IT: need arpeggio memory */
   4.715 +#define UF_FT2QUIRKS    0x0200 /* emulate some FT2 replay quirks */
   4.716 +#define UF_PANNING      0x0400 /* module uses panning effects or have
   4.717 +                                  non-tracker default initial panning */
   4.718  
   4.719  typedef struct MODULE {
   4.720 -	/* general module information */
   4.721 -		CHAR*       songname;    /* name of the song */
   4.722 -		CHAR*       modtype;     /* string type of module loaded */
   4.723 -		CHAR*       comment;     /* module comments */
   4.724 + /* general module information */
   4.725 +    CHAR*       songname;    /* name of the song */
   4.726 +    CHAR*       modtype;     /* string type of module loaded */
   4.727 +    CHAR*       comment;     /* module comments */
   4.728  
   4.729 -		UWORD       flags;       /* See module flags above */
   4.730 -		UBYTE       numchn;      /* number of module channels */
   4.731 -		UBYTE       numvoices;   /* max # voices used for full NNA playback */
   4.732 -		UWORD       numpos;      /* number of positions in this song */
   4.733 -		UWORD       numpat;      /* number of patterns in this song */
   4.734 -		UWORD       numins;      /* number of instruments */
   4.735 -		UWORD       numsmp;      /* number of samples */
   4.736 -struct  INSTRUMENT* instruments; /* all instruments */
   4.737 -struct  SAMPLE*     samples;     /* all samples */
   4.738 -		UBYTE       realchn;     /* real number of channels used */
   4.739 -		UBYTE       totalchn;    /* total number of channels used (incl NNAs) */
   4.740 +    UWORD       flags;       /* See module flags above */
   4.741 +    UBYTE       numchn;      /* number of module channels */
   4.742 +    UBYTE       numvoices;   /* max # voices used for full NNA playback */
   4.743 +    UWORD       numpos;      /* number of positions in this song */
   4.744 +    UWORD       numpat;      /* number of patterns in this song */
   4.745 +    UWORD       numins;      /* number of instruments */
   4.746 +    UWORD       numsmp;      /* number of samples */
   4.747  
   4.748 -	/* playback settings */
   4.749 -		UWORD       reppos;      /* restart position */
   4.750 -		UBYTE       initspeed;   /* initial song speed */
   4.751 -		UWORD       inittempo;   /* initial song tempo */
   4.752 -		UBYTE       initvolume;  /* initial global volume (0 - 128) */
   4.753 -		UWORD       panning[UF_MAXCHAN]; /* panning positions */
   4.754 -		UBYTE       chanvol[UF_MAXCHAN]; /* channel positions */
   4.755 -		UWORD       bpm;         /* current beats-per-minute speed */
   4.756 -		UWORD       sngspd;      /* current song speed */
   4.757 -		SWORD       volume;      /* song volume (0-128) (or user volume) */
   4.758 +    struct INSTRUMENT* instruments; /* all instruments */
   4.759 +    struct SAMPLE*     samples;     /* all samples */
   4.760  
   4.761 -		BOOL        extspd;      /* extended speed flag (default enabled) */
   4.762 -		BOOL        panflag;     /* panning flag (default enabled) */
   4.763 -		BOOL        wrap;        /* wrap module ? (default disabled) */
   4.764 -		BOOL        loop;		 /* allow module to loop ? (default enabled) */
   4.765 -		BOOL        fadeout;	 /* volume fade out during last pattern */
   4.766 +    UBYTE       realchn;     /* real number of channels used */
   4.767 +    UBYTE       totalchn;    /* total number of channels used (incl NNAs) */
   4.768  
   4.769 -		UWORD       patpos;      /* current row number */
   4.770 -		SWORD       sngpos;      /* current song position */
   4.771 -		ULONG       sngtime;     /* current song time in 2^-10 seconds */
   4.772 + /* playback settings */
   4.773 +    UWORD       reppos;      /* restart position */
   4.774 +    UBYTE       initspeed;   /* initial song speed */
   4.775 +    UWORD       inittempo;   /* initial song tempo */
   4.776 +    UBYTE       initvolume;  /* initial global volume (0 - 128) */
   4.777 +    UWORD       panning[UF_MAXCHAN]; /* panning positions */
   4.778 +    UBYTE       chanvol[UF_MAXCHAN]; /* channel positions */
   4.779 +    UWORD       bpm;         /* current beats-per-minute speed */
   4.780 +    UWORD       sngspd;      /* current song speed */
   4.781 +    SWORD       volume;      /* song volume (0-128) (or user volume) */
   4.782  
   4.783 -		SWORD       relspd;      /* relative speed factor */
   4.784 +    BOOL        extspd;      /* extended speed flag (default enabled) */
   4.785 +    BOOL        panflag;     /* panning flag (default enabled) */
   4.786 +    BOOL        wrap;        /* wrap module ? (default disabled) */
   4.787 +    BOOL        loop;        /* allow module to loop ? (default enabled) */
   4.788 +    BOOL        fadeout;     /* volume fade out during last pattern */
   4.789  
   4.790 -	/* internal module representation */
   4.791 -		UWORD       numtrk;      /* number of tracks */
   4.792 -		UBYTE**     tracks;      /* array of numtrk pointers to tracks */
   4.793 -		UWORD*      patterns;    /* array of Patterns */
   4.794 -		UWORD*      pattrows;    /* array of number of rows for each pattern */
   4.795 -		UWORD*      positions;   /* all positions */
   4.796 +    UWORD       patpos;      /* current row number */
   4.797 +    SWORD       sngpos;      /* current song position */
   4.798 +    ULONG       sngtime;     /* current song time in 2^-10 seconds */
   4.799  
   4.800 -		BOOL        forbid;      /* if true, no player update! */
   4.801 -		UWORD       numrow;      /* number of rows on current pattern */
   4.802 -		UWORD       vbtick;      /* tick counter (counts from 0 to sngspd) */
   4.803 -		UWORD       sngremainder;/* used for song time computation */
   4.804 +    SWORD       relspd;      /* relative speed factor */
   4.805  
   4.806 -struct MP_CONTROL*  control;     /* Effects Channel info (size pf->numchn) */
   4.807 -struct MP_VOICE*    voice;       /* Audio Voice information (size md_numchn) */
   4.808 + /* internal module representation */
   4.809 +    UWORD       numtrk;      /* number of tracks */
   4.810 +    UBYTE**     tracks;      /* array of numtrk pointers to tracks */
   4.811 +    UWORD*      patterns;    /* array of Patterns */
   4.812 +    UWORD*      pattrows;    /* array of number of rows for each pattern */
   4.813 +    UWORD*      positions;   /* all positions */
   4.814  
   4.815 -		UBYTE       globalslide; /* global volume slide rate */
   4.816 -		UBYTE       pat_repcrazy;/* module has just looped to position -1 */
   4.817 -		UWORD       patbrk;      /* position where to start a new pattern */
   4.818 -		UBYTE       patdly;      /* patterndelay counter (command memory) */
   4.819 -		UBYTE       patdly2;     /* patterndelay counter (real one) */
   4.820 -		SWORD       posjmp;      /* flag to indicate a jump is needed... */
   4.821 -		UWORD		bpmlimit;	 /* threshold to detect bpm or speed values */
   4.822 +    BOOL        forbid;      /* if true, no player update! */
   4.823 +    UWORD       numrow;      /* number of rows on current pattern */
   4.824 +    UWORD       vbtick;      /* tick counter (counts from 0 to sngspd) */
   4.825 +    UWORD       sngremainder;/* used for song time computation */
   4.826 +
   4.827 +    struct MP_CONTROL* control; /* Effects Channel info (size pf->numchn) */
   4.828 +    struct MP_VOICE*   voice;   /* Audio Voice information (size md_numchn) */
   4.829 +
   4.830 +    UBYTE       globalslide; /* global volume slide rate */
   4.831 +    UBYTE       pat_repcrazy;/* module has just looped to position -1 */
   4.832 +    UWORD       patbrk;      /* position where to start a new pattern */
   4.833 +    UBYTE       patdly;      /* patterndelay counter (command memory) */
   4.834 +    UBYTE       patdly2;     /* patterndelay counter (real one) */
   4.835 +    SWORD       posjmp;      /* flag to indicate a jump is needed... */
   4.836 +    UWORD       bpmlimit;    /* threshold to detect bpm or speed values */
   4.837  } MODULE;
   4.838  
   4.839 +
   4.840  /*
   4.841 - *	========== Module loaders
   4.842 + *  ========== Module loaders
   4.843   */
   4.844  
   4.845  struct MLOADER;
   4.846 @@ -531,7 +608,7 @@
   4.847  MIKMODAPI extern struct MLOADER load_xm;  /* FastTracker 2 (by Triton) */
   4.848  
   4.849  /*
   4.850 - *	========== Module player
   4.851 + *  ========== Module player
   4.852   */
   4.853  
   4.854  MIKMODAPI extern MODULE* Player_Load(CHAR*,int,BOOL);
   4.855 @@ -559,8 +636,7 @@
   4.856  MIKMODAPI extern int     Player_GetChannelVoice(UBYTE);
   4.857  MIKMODAPI extern UWORD   Player_GetChannelPeriod(UBYTE);
   4.858  
   4.859 -typedef void (MikMod_player)(void);
   4.860 -typedef MikMod_player *MikMod_player_t;
   4.861 +typedef void (*MikMod_player_t)(void);
   4.862  
   4.863  MIKMODAPI extern MikMod_player_t MikMod_RegisterPlayer(MikMod_player_t);
   4.864  
   4.865 @@ -568,17 +644,17 @@
   4.866  #define MUTE_INCLUSIVE  32001
   4.867  
   4.868  /*
   4.869 - *	========== Drivers
   4.870 + *  ========== Drivers
   4.871   */
   4.872  
   4.873  enum {
   4.874 -	MD_MUSIC = 0,
   4.875 -	MD_SNDFX
   4.876 +    MD_MUSIC = 0,
   4.877 +    MD_SNDFX
   4.878  };
   4.879  
   4.880  enum {
   4.881 -	MD_HARDWARE = 0,
   4.882 -	MD_SOFTWARE
   4.883 +    MD_HARDWARE = 0,
   4.884 +    MD_SOFTWARE
   4.885  };
   4.886  
   4.887  /* Mixing flags */
   4.888 @@ -594,42 +670,44 @@
   4.889  #define DMODE_INTERP     0x0200 /* enable interpolation */
   4.890  #define DMODE_REVERSE    0x0400 /* reverse stereo */
   4.891  
   4.892 +
   4.893  struct SAMPLOAD;
   4.894 +
   4.895  typedef struct MDRIVER {
   4.896 -struct MDRIVER* next;
   4.897 -	CHAR*       Name;
   4.898 -	CHAR*       Version;
   4.899 +    struct MDRIVER* next;
   4.900 +    CHAR*       Name;
   4.901 +    CHAR*       Version;
   4.902  
   4.903 -	UBYTE       HardVoiceLimit; /* Limit of hardware mixer voices */
   4.904 -	UBYTE       SoftVoiceLimit; /* Limit of software mixer voices */
   4.905 +    UBYTE       HardVoiceLimit; /* Limit of hardware mixer voices */
   4.906 +    UBYTE       SoftVoiceLimit; /* Limit of software mixer voices */
   4.907  
   4.908 -	CHAR*       Alias;
   4.909 +    CHAR*       Alias;
   4.910  
   4.911 -	void        (*CommandLine)      (CHAR*);
   4.912 -	BOOL        (*IsPresent)        (void);
   4.913 -	SWORD       (*SampleLoad)       (struct SAMPLOAD*,int);
   4.914 -	void        (*SampleUnload)     (SWORD);
   4.915 -	ULONG       (*FreeSampleSpace)  (int);
   4.916 -	ULONG       (*RealSampleLength) (int,struct SAMPLE*);
   4.917 -	BOOL        (*Init)             (void);
   4.918 -	void        (*Exit)             (void);
   4.919 -	BOOL        (*Reset)            (void);
   4.920 -	BOOL        (*SetNumVoices)     (void);
   4.921 -	BOOL        (*PlayStart)        (void);
   4.922 -	void        (*PlayStop)         (void);
   4.923 -	void        (*Update)           (void);
   4.924 -	void		(*Pause)			(void);
   4.925 -	void        (*VoiceSetVolume)   (UBYTE,UWORD);
   4.926 -	UWORD       (*VoiceGetVolume)   (UBYTE);
   4.927 -	void        (*VoiceSetFrequency)(UBYTE,ULONG);
   4.928 -	ULONG       (*VoiceGetFrequency)(UBYTE);
   4.929 -	void        (*VoiceSetPanning)  (UBYTE,ULONG);
   4.930 -	ULONG       (*VoiceGetPanning)  (UBYTE);
   4.931 -	void        (*VoicePlay)        (UBYTE,SWORD,ULONG,ULONG,ULONG,ULONG,UWORD);
   4.932 -	void        (*VoiceStop)        (UBYTE);
   4.933 -	BOOL        (*VoiceStopped)     (UBYTE);
   4.934 -	SLONG       (*VoiceGetPosition) (UBYTE);
   4.935 -	ULONG       (*VoiceRealVolume)  (UBYTE);
   4.936 +    void        (*CommandLine)      (CHAR*);
   4.937 +    BOOL        (*IsPresent)        (void);
   4.938 +    SWORD       (*SampleLoad)       (struct SAMPLOAD*,int);
   4.939 +    void        (*SampleUnload)     (SWORD);
   4.940 +    ULONG       (*FreeSampleSpace)  (int);
   4.941 +    ULONG       (*RealSampleLength) (int,struct SAMPLE*);
   4.942 +    int         (*Init)             (void);
   4.943 +    void        (*Exit)             (void);
   4.944 +    int         (*Reset)            (void);
   4.945 +    int         (*SetNumVoices)     (void);
   4.946 +    int         (*PlayStart)        (void);
   4.947 +    void        (*PlayStop)         (void);
   4.948 +    void        (*Update)           (void);
   4.949 +    void        (*Pause)            (void);
   4.950 +    void        (*VoiceSetVolume)   (UBYTE,UWORD);
   4.951 +    UWORD       (*VoiceGetVolume)   (UBYTE);
   4.952 +    void        (*VoiceSetFrequency)(UBYTE,ULONG);
   4.953 +    ULONG       (*VoiceGetFrequency)(UBYTE);
   4.954 +    void        (*VoiceSetPanning)  (UBYTE,ULONG);
   4.955 +    ULONG       (*VoiceGetPanning)  (UBYTE);
   4.956 +    void        (*VoicePlay)        (UBYTE,SWORD,ULONG,ULONG,ULONG,ULONG,UWORD);
   4.957 +    void        (*VoiceStop)        (UBYTE);
   4.958 +    BOOL        (*VoiceStopped)     (UBYTE);
   4.959 +    SLONG       (*VoiceGetPosition) (UBYTE);
   4.960 +    ULONG       (*VoiceRealVolume)  (UBYTE);
   4.961  } MDRIVER;
   4.962  
   4.963  /* These variables can be changed at ANY time and results will be immediate */
   4.964 @@ -659,7 +737,7 @@
   4.965  MIKMODAPI extern struct MDRIVER drv_wav;    /* RIFF WAVE file disk writer [music.wav] */
   4.966  
   4.967  MIKMODAPI extern struct MDRIVER drv_ultra;  /* Linux Ultrasound driver */
   4.968 -MIKMODAPI extern struct MDRIVER drv_sam9407;	/* Linux sam9407 driver */
   4.969 +MIKMODAPI extern struct MDRIVER drv_sam9407;/* Linux sam9407 driver */
   4.970  
   4.971  MIKMODAPI extern struct MDRIVER drv_AF;     /* Dec Alpha AudioFile */
   4.972  MIKMODAPI extern struct MDRIVER drv_aix;    /* AIX audio device */
   4.973 @@ -668,6 +746,7 @@
   4.974  MIKMODAPI extern struct MDRIVER drv_hp;     /* HP-UX audio device */
   4.975  MIKMODAPI extern struct MDRIVER drv_oss;    /* OpenSound System (Linux,FreeBSD...) */
   4.976  MIKMODAPI extern struct MDRIVER drv_sgi;    /* SGI audio library */
   4.977 +MIKMODAPI extern struct MDRIVER drv_sndio;  /* OpenBSD sndio */
   4.978  MIKMODAPI extern struct MDRIVER drv_sun;    /* Sun/NetBSD/OpenBSD audio device */
   4.979  
   4.980  MIKMODAPI extern struct MDRIVER drv_dart;   /* OS/2 Direct Audio RealTime */
   4.981 @@ -680,13 +759,13 @@
   4.982  
   4.983  /*========== Virtual channel mixer interface (for user-supplied drivers only) */
   4.984  
   4.985 -MIKMODAPI extern BOOL  VC_Init(void);
   4.986 +MIKMODAPI extern int   VC_Init(void);
   4.987  MIKMODAPI extern void  VC_Exit(void);
   4.988 -MIKMODAPI extern BOOL  VC_SetNumVoices(void);
   4.989 +MIKMODAPI extern int   VC_SetNumVoices(void);
   4.990  MIKMODAPI extern ULONG VC_SampleSpace(int);
   4.991  MIKMODAPI extern ULONG VC_SampleLength(int,SAMPLE*);
   4.992  
   4.993 -MIKMODAPI extern BOOL  VC_PlayStart(void);
   4.994 +MIKMODAPI extern int   VC_PlayStart(void);
   4.995  MIKMODAPI extern void  VC_PlayStop(void);
   4.996  
   4.997  MIKMODAPI extern SWORD VC_SampleLoad(struct SAMPLOAD*,int);
     5.1 Binary file Xcode/Frameworks/mikmod.framework/Versions/A/Resources/English.lproj/InfoPlist.strings has changed
     6.1 --- a/Xcode/Frameworks/mikmod.framework/Versions/A/Resources/Info.plist	Sun Oct 07 11:26:40 2018 +0300
     6.2 +++ b/Xcode/Frameworks/mikmod.framework/Versions/A/Resources/Info.plist	Sun Oct 07 11:40:55 2018 +0300
     6.3 @@ -7,7 +7,7 @@
     6.4  	<key>CFBundleExecutable</key>
     6.5  	<string>mikmod</string>
     6.6  	<key>CFBundleGetInfoString</key>
     6.7 -	<string>libmikmod 3.1.12</string>
     6.8 +	<string>libmikmod 3.1.21</string>
     6.9  	<key>CFBundleInfoDictionaryVersion</key>
    6.10  	<string>6.0</string>
    6.11  	<key>CFBundleName</key>
    6.12 @@ -15,10 +15,10 @@
    6.13  	<key>CFBundlePackageType</key>
    6.14  	<string>FMWK</string>
    6.15  	<key>CFBundleShortVersionString</key>
    6.16 -	<string>3.1.12</string>
    6.17 +	<string>3.1.21</string>
    6.18  	<key>CFBundleSignature</key>
    6.19  	<string>????</string>
    6.20  	<key>CFBundleVersion</key>
    6.21 -	<string>3.1.12</string>
    6.22 +	<string>3.1.21</string>
    6.23  </dict>
    6.24  </plist>
     7.1 Binary file Xcode/Frameworks/mikmod.framework/Versions/A/mikmod has changed
     8.1 Binary file libmikmod-3.1.12.zip has changed
     9.1 Binary file libmikmod-3.1.21.1.zip has changed