home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2007 September / maximum-cd-2007-09.iso / Assets / data / AssaultCube_v0.93.exe / source / include / fmoddyn.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-11-06  |  34.3 KB  |  505 lines

  1. /* ========================================================================================== */
  2. /* FMOD Dynamic DLL loading header. Copyright (c), Firelight Technologies Pty, Ltd 1999-2003. */
  3. /* ========================================================================================== */
  4.  
  5. #ifndef _FMODDYN_H_
  6. #define _FMODDYN_H_
  7.  
  8. #ifdef WIN32
  9.   #include <windows.h>
  10. #else
  11.   #include <dlfcn.h>
  12.   #include <string.h>
  13. #endif
  14.  
  15. #include "fmod.h"
  16.  
  17. typedef struct
  18. {
  19.     void           *module;
  20.  
  21.     signed char     (F_API *FSOUND_SetOutput)(int outputtype);
  22.     signed char     (F_API *FSOUND_SetDriver)(int driver);
  23.     signed char     (F_API *FSOUND_SetMixer)(int mixer);
  24.     signed char     (F_API *FSOUND_SetBufferSize)(int len_ms);
  25.     signed char     (F_API *FSOUND_SetHWND)(void *hwnd);
  26.     signed char     (F_API *FSOUND_SetMinHardwareChannels)(int min);
  27.     signed char     (F_API *FSOUND_SetMaxHardwareChannels)(int max);
  28.     signed char     (F_API *FSOUND_SetMemorySystem)(void *pool, int poollen, FSOUND_ALLOCCALLBACK useralloc, FSOUND_REALLOCCALLBACK userrealloc, FSOUND_FREECALLBACK userfree);
  29.     signed char     (F_API *FSOUND_Init)(int mixrate, int maxsoftwarechannels, unsigned int flags);
  30.     void            (F_API *FSOUND_Close)();
  31.     void            (F_API *FSOUND_SetSpeakerMode)(unsigned int speakermode);
  32.     void            (F_API *FSOUND_SetSFXMasterVolume)(int volume);
  33.     void            (F_API *FSOUND_SetPanSeperation)(float pansep);
  34.     void            (F_API *FSOUND_File_SetCallbacks)(FSOUND_OPENCALLBACK  useropen, FSOUND_CLOSECALLBACK userclose, FSOUND_READCALLBACK userread, FSOUND_SEEKCALLBACK  userseek, FSOUND_TELLCALLBACK  usertell);
  35.     int             (F_API *FSOUND_GetError)();
  36.     float           (F_API *FSOUND_GetVersion)();
  37.     int             (F_API *FSOUND_GetOutput)();
  38.     void *          (F_API *FSOUND_GetOutputHandle)();
  39.     int             (F_API *FSOUND_GetDriver)();
  40.     int             (F_API *FSOUND_GetMixer)();
  41.     int             (F_API *FSOUND_GetNumDrivers)();
  42.     signed char *   (F_API *FSOUND_GetDriverName)(int id);
  43.     signed char     (F_API *FSOUND_GetDriverCaps)(int id, unsigned int *caps);
  44.     int             (F_API *FSOUND_GetOutputRate)();
  45.     int             (F_API *FSOUND_GetMaxChannels)();
  46.     int             (F_API *FSOUND_GetMaxSamples)();
  47.     int             (F_API *FSOUND_GetSFXMasterVolume)();
  48.     int             (F_API *FSOUND_GetNumHardwareChannels)();
  49.     int             (F_API *FSOUND_GetChannelsPlaying)();
  50.     float           (F_API *FSOUND_GetCPUUsage)();
  51.     void            (F_API *FSOUND_GetMemoryStats)(unsigned int *currentalloced, unsigned int *maxalloced);
  52.     FSOUND_SAMPLE * (F_API *FSOUND_Sample_Load)(int index, const char *name_or_data, unsigned int mode, int memlength);
  53.     FSOUND_SAMPLE * (F_API *FSOUND_Sample_Alloc)(int index, int length, unsigned int mode, int deffreq, int defvol, int defpan, int defpri);
  54.     void            (F_API *FSOUND_Sample_Free)(FSOUND_SAMPLE *sptr);
  55.     signed char     (F_API *FSOUND_Sample_Upload)(FSOUND_SAMPLE *sptr, void *srcdata, unsigned int mode);
  56.     signed char     (F_API *FSOUND_Sample_Lock)(FSOUND_SAMPLE *sptr, int offset, int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2);
  57.     signed char     (F_API *FSOUND_Sample_Unlock)(FSOUND_SAMPLE *sptr, void *ptr1, void *ptr2, unsigned int len1, unsigned int len2);
  58.     signed char     (F_API *FSOUND_Sample_SetMode)(FSOUND_SAMPLE *sptr, unsigned int mode);
  59.     signed char     (F_API *FSOUND_Sample_SetLoopPoints)(FSOUND_SAMPLE *sptr, int loopstart, int loopend);
  60.     signed char     (F_API *FSOUND_Sample_SetDefaults)(FSOUND_SAMPLE *sptr, int deffreq, int defvol, int defpan, int defpri);
  61.     signed char     (F_API *FSOUND_Sample_SetMinMaxDistance)(FSOUND_SAMPLE *sptr, float min, float max);
  62.     signed char     (F_API *FSOUND_Sample_SetMaxPlaybacks)(FSOUND_SAMPLE *sptr, int max);
  63.     FSOUND_SAMPLE * (F_API *FSOUND_Sample_Get)(int sampno);
  64.     char *          (F_API *FSOUND_Sample_GetName)(FSOUND_SAMPLE *sptr);
  65.     unsigned int    (F_API *FSOUND_Sample_GetLength)(FSOUND_SAMPLE *sptr);
  66.     signed char     (F_API *FSOUND_Sample_GetLoopPoints)(FSOUND_SAMPLE *sptr, int *loopstart, int *loopend);
  67.     signed char     (F_API *FSOUND_Sample_GetDefaults)(FSOUND_SAMPLE *sptr, int *deffreq, int *defvol, int *defpan, int *defpri);
  68.     unsigned int    (F_API *FSOUND_Sample_GetMode)(FSOUND_SAMPLE *sptr);
  69.     int             (F_API *FSOUND_PlaySound)(int channel, FSOUND_SAMPLE *sptr);
  70.     int             (F_API *FSOUND_PlaySoundEx)(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused);
  71.     signed char     (F_API *FSOUND_StopSound)(int channel);
  72.     signed char     (F_API *FSOUND_SetFrequency)(int channel, int freq);
  73.     signed char     (F_API *FSOUND_SetVolume)(int channel, int vol);
  74.     signed char     (F_API *FSOUND_SetVolumeAbsolute)(int channel, int vol);
  75.     signed char     (F_API *FSOUND_SetPan)(int channel, int pan);
  76.     signed char     (F_API *FSOUND_SetSurround)(int channel, signed char surround);
  77.     signed char     (F_API *FSOUND_SetMute)(int channel, signed char mute);
  78.     signed char     (F_API *FSOUND_SetPriority)(int channel, int priority);
  79.     signed char     (F_API *FSOUND_SetReserved)(int channel, signed char reserved);
  80.     signed char     (F_API *FSOUND_SetPaused)(int channel, signed char paused);
  81.     signed char     (F_API *FSOUND_SetLoopMode)(int channel, unsigned int loopmode);
  82.     signed char     (F_API *FSOUND_SetCurrentPosition)(int channel, unsigned int offset);
  83.     signed char     (F_API *FSOUND_IsPlaying)(int channel);
  84.     int             (F_API *FSOUND_GetFrequency)(int channel);
  85.     int             (F_API *FSOUND_GetVolume)(int channel);
  86.     int             (F_API *FSOUND_GetPan)(int channel);
  87.     signed char     (F_API *FSOUND_GetSurround)(int channel);
  88.     signed char     (F_API *FSOUND_GetMute)(int channel);
  89.     int             (F_API *FSOUND_GetPriority)(int channel);
  90.     signed char     (F_API *FSOUND_GetReserved)(int channel);
  91.     signed char     (F_API *FSOUND_GetPaused)(int channel);
  92.     unsigned int    (F_API *FSOUND_GetLoopMode)(int channel);
  93.     unsigned int    (F_API *FSOUND_GetCurrentPosition)(int channel);
  94.     FSOUND_SAMPLE * (F_API *FSOUND_GetCurrentSample)(int channel);
  95.     signed char     (F_API *FSOUND_GetCurrentLevels)(int channel, float *l, float *r);
  96.     int             (F_API *FSOUND_FX_Enable)(int channel, unsigned int fx);    /* See FSOUND_FX_MODES */
  97.     signed char     (F_API *FSOUND_FX_Disable)(int channel);    
  98.     signed char     (F_API *FSOUND_FX_SetChorus)(int fxid, float WetDryMix, float Depth, float Feedback, float Frequency, int Waveform, float Delay, int Phase);
  99.     signed char     (F_API *FSOUND_FX_SetCompressor)(int fxid, float Gain, float Attack, float Release, float Threshold, float Ratio, float Predelay);
  100.     signed char     (F_API *FSOUND_FX_SetDistortion)(int fxid, float Gain, float Edge, float PostEQCenterFrequency, float PostEQBandwidth, float PreLowpassCutoff);
  101.     signed char     (F_API *FSOUND_FX_SetEcho)(int fxid, float WetDryMix, float Feedback, float LeftDelay, float RightDelay, int PanDelay);
  102.     signed char     (F_API *FSOUND_FX_SetFlanger)(int fxid, float WetDryMix, float Depth, float Feedback, float Frequency, int Waveform, float Delay, int Phase);
  103.     signed char     (F_API *FSOUND_FX_SetGargle)(int fxid, int RateHz, int WaveShape);
  104.     signed char     (F_API *FSOUND_FX_SetI3DL2Reverb)(int fxid, int Room, int RoomHF, float RoomRolloffFactor, float DecayTime, float DecayHFRatio, int Reflections, float ReflectionsDelay, int Reverb, float ReverbDelay, float Diffusion, float Density, float HFReference);
  105.     signed char     (F_API *FSOUND_FX_SetParamEQ)(int fxid, float Center, float Bandwidth, float Gain);
  106.     signed char     (F_API *FSOUND_FX_SetWavesReverb)(int fxid, float InGain, float ReverbMix, float ReverbTime, float HighFreqRTRatio);  
  107.     void            (F_API *FSOUND_Update)();   /* you must call this once a frame */
  108.     void            (F_API *FSOUND_3D_SetDopplerFactor)(float scale);
  109.     void            (F_API *FSOUND_3D_SetDistanceFactor)(float scale);
  110.     void            (F_API *FSOUND_3D_SetRolloffFactor)(float scale);
  111.     signed char     (F_API *FSOUND_3D_SetAttributes)(int channel, float *pos, float *vel);
  112.     signed char     (F_API *FSOUND_3D_GetAttributes)(int channel, float *pos, float *vel);
  113.     void            (F_API *FSOUND_3D_Listener_SetCurrent)(int current, int numlisteners);  /* use this if you use multiple listeners / splitscreen */
  114.     void            (F_API *FSOUND_3D_Listener_SetAttributes)(float *pos, float *vel, float fx, float fy, float fz, float tx, float ty, float tz);
  115.     void            (F_API *FSOUND_3D_Listener_GetAttributes)(float *pos, float *vel, float *fx, float *fy, float *fz, float *tx, float *ty, float *tz);
  116.     signed char     (F_API *FSOUND_Stream_SetBufferSize)(int ms);      /* call this before opening streams, not after */
  117.     FSOUND_STREAM * (F_API *FSOUND_Stream_OpenFile)(const char *filename, unsigned int mode, int memlength);
  118.     FSOUND_STREAM * (F_API *FSOUND_Stream_Create)(FSOUND_STREAMCALLBACK callback, int length, unsigned int mode, int samplerate, int userdata);
  119.     int             (F_API *FSOUND_Stream_Play)(int channel, FSOUND_STREAM *stream);
  120.     int             (F_API *FSOUND_Stream_PlayEx)(int channel, FSOUND_STREAM *stream, FSOUND_DSPUNIT *dsp, signed char startpaused);
  121.     signed char     (F_API *FSOUND_Stream_Stop)(FSOUND_STREAM *stream);
  122.     signed char     (F_API *FSOUND_Stream_Close)(FSOUND_STREAM *stream);
  123.     signed char     (F_API *FSOUND_Stream_SetEndCallback)(FSOUND_STREAM *stream, FSOUND_STREAMCALLBACK callback, int userdata);
  124.     signed char     (F_API *FSOUND_Stream_SetSynchCallback)(FSOUND_STREAM *stream, FSOUND_STREAMCALLBACK callback, int userdata);
  125.     FSOUND_SAMPLE * (F_API *FSOUND_Stream_GetSample)(FSOUND_STREAM *stream);   /* every stream contains a sample to playback on */
  126.     FSOUND_DSPUNIT *(F_API *FSOUND_Stream_CreateDSP)(FSOUND_STREAM *stream, FSOUND_DSPCALLBACK callback, int priority, int param);
  127.     signed char     (F_API *FSOUND_Stream_SetPosition)(FSOUND_STREAM *stream, unsigned int position);
  128.     unsigned int    (F_API *FSOUND_Stream_GetPosition)(FSOUND_STREAM *stream);
  129.     signed char     (F_API *FSOUND_Stream_SetTime)(FSOUND_STREAM *stream, int ms);
  130.     int             (F_API *FSOUND_Stream_GetTime)(FSOUND_STREAM *stream);
  131.     int             (F_API *FSOUND_Stream_GetLength)(FSOUND_STREAM *stream);
  132.     int             (F_API *FSOUND_Stream_GetLengthMs)(FSOUND_STREAM *stream);
  133.     signed char     (F_API *FSOUND_Stream_SetSubStream)(FSOUND_STREAM *stream, int index);
  134.     int             (F_API *FSOUND_Stream_GetNumSubStreams)(FSOUND_STREAM *stream);
  135.     signed char     (F_API *FSOUND_Stream_SetSubStreamSentence)(FSOUND_STREAM *stream, int *sentencelist, int numitems);
  136.     signed char     (F_API *FSOUND_Stream_SetMode)(FSOUND_STREAM *stream, unsigned int mode);
  137.     unsigned int    (F_API *FSOUND_Stream_GetMode)(FSOUND_STREAM *stream);
  138.     signed char     (F_API *FSOUND_Stream_SetLoopPoints)(FSOUND_STREAM *stream, unsigned int loopstartpcm, unsigned int loopendpcm);
  139.     signed char     (F_API *FSOUND_Stream_SetLoopCount)(FSOUND_STREAM *stream, int count);
  140.     int             (F_API *FSOUND_Stream_AddSynchPoint)(FSOUND_STREAM *stream, unsigned int pcmoffset, int userdata);
  141.     signed char     (F_API *FSOUND_Stream_DeleteSynchPoint)(FSOUND_STREAM *stream, int index);
  142.     int             (F_API *FSOUND_Stream_GetNumSynchPoints)(FSOUND_STREAM *stream);
  143.     int             (F_API *FSOUND_Stream_GetOpenState)(FSOUND_STREAM *stream);
  144.     signed char     (F_API *FSOUND_CD_Play)(char drive, int track);
  145.     void            (F_API *FSOUND_CD_SetPlayMode)(char drive, signed char mode);
  146.     signed char     (F_API *FSOUND_CD_Stop)(char drive);
  147.     signed char     (F_API *FSOUND_CD_SetPaused)(char drive, signed char paused);
  148.     signed char     (F_API *FSOUND_CD_SetVolume)(char drive, int volume);
  149.     signed char     (F_API *FSOUND_CD_SetTrackTime)(char drive, unsigned int ms);
  150.     signed char     (F_API *FSOUND_CD_Eject)(char drive);
  151.     signed char     (F_API *FSOUND_CD_GetPaused)(char drive);
  152.     int             (F_API *FSOUND_CD_GetTrack)(char drive);
  153.     int             (F_API *FSOUND_CD_GetNumTracks)(char drive);
  154.     int             (F_API *FSOUND_CD_GetVolume)(char drive);
  155.     int             (F_API *FSOUND_CD_GetTrackLength)(char drive, int track); 
  156.     int             (F_API *FSOUND_CD_GetTrackTime)(char drive);
  157.     FSOUND_DSPUNIT *(F_API *FSOUND_DSP_Create)(FSOUND_DSPCALLBACK callback, int priority, int param);
  158.     void            (F_API *FSOUND_DSP_Free)(FSOUND_DSPUNIT *unit);
  159.     void            (F_API *FSOUND_DSP_SetPriority)(FSOUND_DSPUNIT *unit, int priority);
  160.     int             (F_API *FSOUND_DSP_GetPriority)(FSOUND_DSPUNIT *unit);
  161.     void            (F_API *FSOUND_DSP_SetActive)(FSOUND_DSPUNIT *unit, signed char active);
  162.     signed char     (F_API *FSOUND_DSP_GetActive)(FSOUND_DSPUNIT *unit);
  163.     FSOUND_DSPUNIT *(F_API *FSOUND_DSP_GetClearUnit)();
  164.     FSOUND_DSPUNIT *(F_API *FSOUND_DSP_GetSFXUnit)();
  165.     FSOUND_DSPUNIT *(F_API *FSOUND_DSP_GetMusicUnit)();
  166.     FSOUND_DSPUNIT *(F_API *FSOUND_DSP_GetFFTUnit)();
  167.     FSOUND_DSPUNIT *(F_API *FSOUND_DSP_GetClipAndCopyUnit)();
  168.     signed char     (F_API *FSOUND_DSP_MixBuffers)(void *destbuffer, void *srcbuffer, int len, int freq, int vol, int pan, unsigned int mode);
  169.     void            (F_API *FSOUND_DSP_ClearMixBuffer)();
  170.     int             (F_API *FSOUND_DSP_GetBufferLength)();      /* Length of each DSP update */
  171.     int             (F_API *FSOUND_DSP_GetBufferLengthTotal)(); /* Total buffer length due to FSOUND_SetBufferSize */
  172.     float *         (F_API *FSOUND_DSP_GetSpectrum)();          /* Array of 512 floats - call FSOUND_DSP_SetActive(FSOUND_DSP_GetFFTUnit(), TRUE)) for this to work. */
  173.     signed char     (F_API *FSOUND_Reverb_SetProperties)(FSOUND_REVERB_PROPERTIES *prop);
  174.     signed char     (F_API *FSOUND_Reverb_GetProperties)(FSOUND_REVERB_PROPERTIES *prop);
  175.     signed char     (F_API *FSOUND_Reverb_SetChannelProperties)(int channel, FSOUND_REVERB_CHANNELPROPERTIES *prop);
  176.     signed char     (F_API *FSOUND_Reverb_GetChannelProperties)(int channel, FSOUND_REVERB_CHANNELPROPERTIES *prop);
  177.     signed char     (F_API *FSOUND_Record_SetDriver)(int outputtype);
  178.     int             (F_API *FSOUND_Record_GetNumDrivers)();
  179.     signed char *   (F_API *FSOUND_Record_GetDriverName)(int id);
  180.     int             (F_API *FSOUND_Record_GetDriver)();
  181.     signed char     (F_API *FSOUND_Record_StartSample)(FSOUND_SAMPLE *sptr, signed char loop);
  182.     signed char     (F_API *FSOUND_Record_Stop)();
  183.     int             (F_API *FSOUND_Record_GetPosition)();  
  184.     FMUSIC_MODULE * (F_API *FMUSIC_LoadSong)(const char *name);
  185.     FMUSIC_MODULE * (F_API *FMUSIC_LoadSongEx)(void *data, int length);
  186.     int             (F_API *FMUSIC_GetOpenState)(FMUSIC_MODULE *mod);
  187.     signed char     (F_API *FMUSIC_FreeSong)(FMUSIC_MODULE *mod);
  188.     signed char     (F_API *FMUSIC_PlaySong)(FMUSIC_MODULE *mod);
  189.     signed char     (F_API *FMUSIC_StopSong)(FMUSIC_MODULE *mod);
  190.     void            (F_API *FMUSIC_StopAllSongs)();
  191.     signed char     (F_API *FMUSIC_SetZxxCallback)(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback);
  192.     signed char     (F_API *FMUSIC_SetRowCallback)(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback, int rowstep);
  193.     signed char     (F_API *FMUSIC_SetOrderCallback)(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback, int orderstep);
  194.     signed char     (F_API *FMUSIC_SetInstCallback)(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback, int instrument);
  195.     signed char     (F_API *FMUSIC_SetSample)(FMUSIC_MODULE *mod, int sampno, FSOUND_SAMPLE *sptr);
  196.     signed char     (F_API *FMUSIC_SetUserData)(FMUSIC_MODULE *mod, unsigned int userdata);
  197.     signed char     (F_API *FMUSIC_OptimizeChannels)(FMUSIC_MODULE *mod, int maxchannels, int minvolume);
  198.     signed char     (F_API *FMUSIC_SetReverb)(signed char reverb);             /* MIDI only */
  199.     signed char     (F_API *FMUSIC_SetLooping)(FMUSIC_MODULE *mod, signed char looping);
  200.     signed char     (F_API *FMUSIC_SetOrder)(FMUSIC_MODULE *mod, int order);
  201.     signed char     (F_API *FMUSIC_SetPaused)(FMUSIC_MODULE *mod, signed char pause);
  202.     signed char     (F_API *FMUSIC_SetMasterVolume)(FMUSIC_MODULE *mod, int volume);
  203.     signed char     (F_API *FMUSIC_SetMasterSpeed)(FMUSIC_MODULE *mode, float speed);
  204.     signed char     (F_API *FMUSIC_SetPanSeperation)(FMUSIC_MODULE *mod, float pansep);
  205.     char *          (F_API *FMUSIC_GetName)(FMUSIC_MODULE *mod);
  206.     int             (F_API *FMUSIC_GetType)(FMUSIC_MODULE *mod);
  207.     int             (F_API *FMUSIC_GetNumOrders)(FMUSIC_MODULE *mod);
  208.     int             (F_API *FMUSIC_GetNumPatterns)(FMUSIC_MODULE *mod);
  209.     int             (F_API *FMUSIC_GetNumInstruments)(FMUSIC_MODULE *mod);
  210.     int             (F_API *FMUSIC_GetNumSamples)(FMUSIC_MODULE *mod);
  211.     int             (F_API *FMUSIC_GetNumChannels)(FMUSIC_MODULE *mod);
  212.     FSOUND_SAMPLE * (F_API *FMUSIC_GetSample)(FMUSIC_MODULE *mod, int sampno);
  213.     int             (F_API *FMUSIC_GetPatternLength)(FMUSIC_MODULE *mod, int orderno);
  214.     signed char     (F_API *FMUSIC_IsFinished)(FMUSIC_MODULE *mod);
  215.     signed char     (F_API *FMUSIC_IsPlaying)(FMUSIC_MODULE *mod);
  216.     int             (F_API *FMUSIC_GetMasterVolume)(FMUSIC_MODULE *mod);
  217.     int             (F_API *FMUSIC_GetGlobalVolume)(FMUSIC_MODULE *mod);
  218.     int             (F_API *FMUSIC_GetOrder)(FMUSIC_MODULE *mod);
  219.     int             (F_API *FMUSIC_GetPattern)(FMUSIC_MODULE *mod);
  220.     int             (F_API *FMUSIC_GetSpeed)(FMUSIC_MODULE *mod);
  221.     int             (F_API *FMUSIC_GetBPM)(FMUSIC_MODULE *mod);
  222.     int             (F_API *FMUSIC_GetRow)(FMUSIC_MODULE *mod);
  223.     signed char     (F_API *FMUSIC_GetPaused)(FMUSIC_MODULE *mod);
  224.     int             (F_API *FMUSIC_GetTime)(FMUSIC_MODULE *mod);
  225.     int             (F_API *FMUSIC_GetRealChannel)(FMUSIC_MODULE *mod, int modchannel);
  226.     unsigned int    (F_API *FMUSIC_GetUserData)(FMUSIC_MODULE *mod);
  227. } FMOD_INSTANCE;
  228.  
  229.  
  230. static FMOD_INSTANCE *FMOD_CreateInstance(char *dllName)
  231. {
  232.     FMOD_INSTANCE *instance;
  233.  
  234.     instance = (FMOD_INSTANCE *)calloc(sizeof(FMOD_INSTANCE), 1);
  235.     if (!instance)
  236.     {
  237.         return NULL;
  238.     }
  239.  
  240. #ifdef WIN32
  241.     instance->module = LoadLibrary(dllName);
  242. #else
  243.     instance->module = dlopen(dllName, RTLD_GLOBAL | RTLD_LAZY);
  244. #endif
  245.     if (!instance->module)
  246.     {
  247.         free(instance);
  248.         return NULL;
  249.     }
  250.  
  251. #ifdef WIN32
  252.     #define F_GETPROC(_x, _y)                                                                       \
  253.     {                                                                                             \
  254.         *((unsigned int *)&instance->_x) = (unsigned int)GetProcAddress((HMODULE)instance->module, _y);    \
  255.         if (!instance->_x)                                                                        \
  256.         {                                                                                         \
  257.             FreeLibrary((HMODULE)instance->module);                                                        \
  258.             free(instance);                                                                       \
  259.             return NULL;                                                                          \
  260.         }                                                                                         \
  261.     }
  262. #else
  263.     #define F_GETPROC(_x, _y)                                                                       \
  264.     {                                                                                             \
  265.         char tmp[] = _y;                                                                          \
  266.         *(strchr(tmp, '@')) = 0;                                                                  \
  267.         *((unsigned int *)&instance->_x) = (unsigned int)dlsym(instance->module, &tmp[1]);        \
  268.         if (!instance->_x)                                                                        \
  269.         {                                                                                         \
  270.             dlclose(instance->module);                                                            \
  271.             free(instance);                                                                       \
  272.             return NULL;                                                                          \
  273.         }                                                                                         \
  274.     }
  275. #endif
  276.  
  277.     F_GETPROC(FSOUND_SetOutput, "_FSOUND_SetOutput@4");
  278.     F_GETPROC(FSOUND_SetDriver, "_FSOUND_SetDriver@4");
  279.     F_GETPROC(FSOUND_SetMixer, "_FSOUND_SetMixer@4");
  280.     F_GETPROC(FSOUND_SetBufferSize, "_FSOUND_SetBufferSize@4");
  281.     F_GETPROC(FSOUND_SetHWND, "_FSOUND_SetHWND@4");
  282.     F_GETPROC(FSOUND_SetMinHardwareChannels, "_FSOUND_SetMinHardwareChannels@4");
  283.     F_GETPROC(FSOUND_SetMaxHardwareChannels, "_FSOUND_SetMaxHardwareChannels@4");
  284.     F_GETPROC(FSOUND_SetMemorySystem, "_FSOUND_SetMemorySystem@20");
  285.     F_GETPROC(FSOUND_Init, "_FSOUND_Init@12");
  286.     F_GETPROC(FSOUND_Close, "_FSOUND_Close@0");
  287.     F_GETPROC(FSOUND_SetSFXMasterVolume, "_FSOUND_SetSFXMasterVolume@4");
  288.     F_GETPROC(FSOUND_SetPanSeperation, "_FSOUND_SetPanSeperation@4");
  289.     F_GETPROC(FSOUND_SetSpeakerMode, "_FSOUND_SetSpeakerMode@4");
  290.     F_GETPROC(FSOUND_GetError, "_FSOUND_GetError@0");
  291.     F_GETPROC(FSOUND_GetVersion, "_FSOUND_GetVersion@0");
  292.     F_GETPROC(FSOUND_GetOutput, "_FSOUND_GetOutput@0");
  293.     F_GETPROC(FSOUND_GetOutputHandle, "_FSOUND_GetOutputHandle@0");
  294.     F_GETPROC(FSOUND_GetDriver, "_FSOUND_GetDriver@0");
  295.     F_GETPROC(FSOUND_GetMixer, "_FSOUND_GetMixer@0");
  296.     F_GETPROC(FSOUND_GetNumDrivers, "_FSOUND_GetNumDrivers@0");
  297.     F_GETPROC(FSOUND_GetDriverName, "_FSOUND_GetDriverName@4");
  298.     F_GETPROC(FSOUND_GetDriverCaps, "_FSOUND_GetDriverCaps@8");
  299.     F_GETPROC(FSOUND_GetOutputRate, "_FSOUND_GetOutputRate@0");
  300.     F_GETPROC(FSOUND_GetMaxChannels, "_FSOUND_GetMaxChannels@0");
  301.     F_GETPROC(FSOUND_GetMaxSamples, "_FSOUND_GetMaxSamples@0");
  302.     F_GETPROC(FSOUND_GetSFXMasterVolume, "_FSOUND_GetSFXMasterVolume@0");
  303.     F_GETPROC(FSOUND_GetNumHardwareChannels, "_FSOUND_GetNumHardwareChannels@0");
  304.     F_GETPROC(FSOUND_GetChannelsPlaying, "_FSOUND_GetChannelsPlaying@0");
  305.     F_GETPROC(FSOUND_GetCPUUsage, "_FSOUND_GetCPUUsage@0");
  306.     F_GETPROC(FSOUND_GetMemoryStats, "_FSOUND_GetMemoryStats@8");
  307.     F_GETPROC(FSOUND_Sample_Load, "_FSOUND_Sample_Load@16");
  308.     F_GETPROC(FSOUND_Sample_Alloc, "_FSOUND_Sample_Alloc@28");
  309.     F_GETPROC(FSOUND_Sample_Free, "_FSOUND_Sample_Free@4");
  310.     F_GETPROC(FSOUND_Sample_Upload, "_FSOUND_Sample_Upload@12");
  311.     F_GETPROC(FSOUND_Sample_Lock, "_FSOUND_Sample_Lock@28");
  312.     F_GETPROC(FSOUND_Sample_Unlock, "_FSOUND_Sample_Unlock@20");
  313.     F_GETPROC(FSOUND_Sample_SetMode, "_FSOUND_Sample_SetMode@8");
  314.     F_GETPROC(FSOUND_Sample_SetLoopPoints, "_FSOUND_Sample_SetLoopPoints@12");
  315.     F_GETPROC(FSOUND_Sample_SetDefaults, "_FSOUND_Sample_SetDefaults@20");
  316.     F_GETPROC(FSOUND_Sample_SetMinMaxDistance, "_FSOUND_Sample_SetMinMaxDistance@12");
  317.     F_GETPROC(FSOUND_Sample_SetMaxPlaybacks, "_FSOUND_Sample_SetMaxPlaybacks@8");
  318.     F_GETPROC(FSOUND_Sample_Get, "_FSOUND_Sample_Get@4");
  319.     F_GETPROC(FSOUND_Sample_GetName, "_FSOUND_Sample_GetName@4");
  320.     F_GETPROC(FSOUND_Sample_GetLength, "_FSOUND_Sample_GetLength@4");
  321.     F_GETPROC(FSOUND_Sample_GetLoopPoints, "_FSOUND_Sample_GetLoopPoints@12");
  322.     F_GETPROC(FSOUND_Sample_GetDefaults, "_FSOUND_Sample_GetDefaults@20");
  323.     F_GETPROC(FSOUND_Sample_GetMode, "_FSOUND_Sample_GetMode@4");
  324.     F_GETPROC(FSOUND_PlaySound, "_FSOUND_PlaySound@8");
  325.     F_GETPROC(FSOUND_PlaySoundEx, "_FSOUND_PlaySoundEx@16");
  326.     F_GETPROC(FSOUND_StopSound, "_FSOUND_StopSound@4");
  327.     F_GETPROC(FSOUND_SetFrequency, "_FSOUND_SetFrequency@8");
  328.     F_GETPROC(FSOUND_SetVolume, "_FSOUND_SetVolume@8");
  329.     F_GETPROC(FSOUND_SetVolumeAbsolute, "_FSOUND_SetVolumeAbsolute@8");
  330.     F_GETPROC(FSOUND_SetPan, "_FSOUND_SetPan@8");
  331.     F_GETPROC(FSOUND_SetSurround, "_FSOUND_SetSurround@8");
  332.     F_GETPROC(FSOUND_SetMute, "_FSOUND_SetMute@8");
  333.     F_GETPROC(FSOUND_SetPriority, "_FSOUND_SetPriority@8");
  334.     F_GETPROC(FSOUND_SetReserved, "_FSOUND_SetReserved@8");
  335.     F_GETPROC(FSOUND_SetPaused, "_FSOUND_SetPaused@8");
  336.     F_GETPROC(FSOUND_SetLoopMode, "_FSOUND_SetLoopMode@8");
  337.     F_GETPROC(FSOUND_IsPlaying, "_FSOUND_IsPlaying@4");
  338.     F_GETPROC(FSOUND_GetFrequency, "_FSOUND_GetFrequency@4");
  339.     F_GETPROC(FSOUND_GetVolume, "_FSOUND_GetVolume@4");
  340.     F_GETPROC(FSOUND_GetPan, "_FSOUND_GetPan@4");
  341.     F_GETPROC(FSOUND_GetSurround, "_FSOUND_GetSurround@4");
  342.     F_GETPROC(FSOUND_GetMute, "_FSOUND_GetMute@4");
  343.     F_GETPROC(FSOUND_GetPriority, "_FSOUND_GetPriority@4");
  344.     F_GETPROC(FSOUND_GetReserved, "_FSOUND_GetReserved@4");
  345.     F_GETPROC(FSOUND_GetPaused, "_FSOUND_GetPaused@4");
  346.     F_GETPROC(FSOUND_GetLoopMode, "_FSOUND_GetLoopMode@4");
  347.     F_GETPROC(FSOUND_GetCurrentPosition, "_FSOUND_GetCurrentPosition@4");
  348.     F_GETPROC(FSOUND_SetCurrentPosition, "_FSOUND_SetCurrentPosition@8");
  349.     F_GETPROC(FSOUND_GetCurrentSample, "_FSOUND_GetCurrentSample@4");
  350.     F_GETPROC(FSOUND_GetCurrentLevels, "_FSOUND_GetCurrentLevels@12");
  351.     F_GETPROC(FSOUND_FX_Enable, "_FSOUND_FX_Enable@8");
  352.     F_GETPROC(FSOUND_FX_Disable, "_FSOUND_FX_Disable@4");
  353.     F_GETPROC(FSOUND_FX_SetChorus, "_FSOUND_FX_SetChorus@32");
  354.     F_GETPROC(FSOUND_FX_SetCompressor, "_FSOUND_FX_SetCompressor@28");
  355.     F_GETPROC(FSOUND_FX_SetDistortion, "_FSOUND_FX_SetDistortion@24");
  356.     F_GETPROC(FSOUND_FX_SetEcho, "_FSOUND_FX_SetEcho@24");
  357.     F_GETPROC(FSOUND_FX_SetFlanger, "_FSOUND_FX_SetFlanger@32");
  358.     F_GETPROC(FSOUND_FX_SetGargle, "_FSOUND_FX_SetGargle@12");
  359.     F_GETPROC(FSOUND_FX_SetI3DL2Reverb, "_FSOUND_FX_SetI3DL2Reverb@52");
  360.     F_GETPROC(FSOUND_FX_SetParamEQ, "_FSOUND_FX_SetParamEQ@16");
  361.     F_GETPROC(FSOUND_FX_SetWavesReverb, "_FSOUND_FX_SetWavesReverb@20");
  362.     F_GETPROC(FSOUND_Update, "_FSOUND_Update@0");
  363.     F_GETPROC(FSOUND_3D_SetAttributes, "_FSOUND_3D_SetAttributes@12");
  364.     F_GETPROC(FSOUND_3D_GetAttributes, "_FSOUND_3D_GetAttributes@12");
  365.     F_GETPROC(FSOUND_3D_Listener_SetCurrent, "_FSOUND_3D_Listener_SetCurrent@8");
  366.     F_GETPROC(FSOUND_3D_Listener_SetAttributes, "_FSOUND_3D_Listener_SetAttributes@32");
  367.     F_GETPROC(FSOUND_3D_Listener_GetAttributes, "_FSOUND_3D_Listener_GetAttributes@32");
  368.     F_GETPROC(FSOUND_3D_SetDopplerFactor, "_FSOUND_3D_SetDopplerFactor@4");
  369.     F_GETPROC(FSOUND_3D_SetDistanceFactor, "_FSOUND_3D_SetDistanceFactor@4");
  370.     F_GETPROC(FSOUND_3D_SetRolloffFactor, "_FSOUND_3D_SetRolloffFactor@4");
  371.     F_GETPROC(FSOUND_Stream_OpenFile, "_FSOUND_Stream_OpenFile@12");
  372.     F_GETPROC(FSOUND_Stream_Create, "_FSOUND_Stream_Create@20");
  373.     F_GETPROC(FSOUND_Stream_Play, "_FSOUND_Stream_Play@8");
  374.     F_GETPROC(FSOUND_Stream_PlayEx, "_FSOUND_Stream_PlayEx@16");
  375.     F_GETPROC(FSOUND_Stream_Stop, "_FSOUND_Stream_Stop@4");
  376.     F_GETPROC(FSOUND_Stream_Close, "_FSOUND_Stream_Close@4");
  377.     F_GETPROC(FSOUND_Stream_SetEndCallback, "_FSOUND_Stream_SetEndCallback@12");
  378.     F_GETPROC(FSOUND_Stream_SetSynchCallback, "_FSOUND_Stream_SetSynchCallback@12");
  379.     F_GETPROC(FSOUND_Stream_GetSample, "_FSOUND_Stream_GetSample@4");
  380.     F_GETPROC(FSOUND_Stream_CreateDSP, "_FSOUND_Stream_CreateDSP@16");
  381.     F_GETPROC(FSOUND_Stream_SetBufferSize, "_FSOUND_Stream_SetBufferSize@4");
  382.     F_GETPROC(FSOUND_Stream_SetPosition, "_FSOUND_Stream_SetPosition@8");
  383.     F_GETPROC(FSOUND_Stream_GetPosition, "_FSOUND_Stream_GetPosition@4");
  384.     F_GETPROC(FSOUND_Stream_SetTime, "_FSOUND_Stream_SetTime@8");
  385.     F_GETPROC(FSOUND_Stream_GetTime, "_FSOUND_Stream_GetTime@4");
  386.     F_GETPROC(FSOUND_Stream_GetLength, "_FSOUND_Stream_GetLength@4");
  387.     F_GETPROC(FSOUND_Stream_GetLengthMs, "_FSOUND_Stream_GetLengthMs@4");
  388.     F_GETPROC(FSOUND_Stream_SetMode, "_FSOUND_Stream_SetMode@8");
  389.     F_GETPROC(FSOUND_Stream_GetMode, "_FSOUND_Stream_GetMode@4");
  390.     F_GETPROC(FSOUND_Stream_SetSubStream, "_FSOUND_Stream_SetSubStream@8");
  391.     F_GETPROC(FSOUND_Stream_GetNumSubStreams, "_FSOUND_Stream_GetNumSubStreams@4");
  392.     F_GETPROC(FSOUND_Stream_SetSubStreamSentence, "_FSOUND_Stream_SetSubStreamSentence@12");
  393.     F_GETPROC(FSOUND_Stream_SetLoopPoints, "_FSOUND_Stream_SetLoopPoints@12");
  394.     F_GETPROC(FSOUND_Stream_SetLoopCount, "_FSOUND_Stream_SetLoopCount@8");
  395.     F_GETPROC(FSOUND_Stream_AddSynchPoint, "_FSOUND_Stream_AddSynchPoint@12");
  396.     F_GETPROC(FSOUND_Stream_DeleteSynchPoint, "_FSOUND_Stream_DeleteSynchPoint@8");
  397.     F_GETPROC(FSOUND_Stream_GetNumSynchPoints, "_FSOUND_Stream_GetNumSynchPoints@4");
  398.     F_GETPROC(FSOUND_Stream_GetOpenState, "_FSOUND_Stream_GetOpenState@4");
  399.     F_GETPROC(FSOUND_CD_Play, "_FSOUND_CD_Play@8");
  400.     F_GETPROC(FSOUND_CD_SetPlayMode, "_FSOUND_CD_SetPlayMode@8");
  401.     F_GETPROC(FSOUND_CD_Stop, "_FSOUND_CD_Stop@4");
  402.     F_GETPROC(FSOUND_CD_SetPaused, "_FSOUND_CD_SetPaused@8");
  403.     F_GETPROC(FSOUND_CD_SetVolume, "_FSOUND_CD_SetVolume@8");
  404.     F_GETPROC(FSOUND_CD_SetTrackTime, "_FSOUND_CD_SetTrackTime@8");
  405.     F_GETPROC(FSOUND_CD_Eject, "_FSOUND_CD_Eject@4");
  406.     F_GETPROC(FSOUND_CD_GetPaused, "_FSOUND_CD_GetPaused@4");
  407.     F_GETPROC(FSOUND_CD_GetTrack, "_FSOUND_CD_GetTrack@4");
  408.     F_GETPROC(FSOUND_CD_GetNumTracks, "_FSOUND_CD_GetNumTracks@4");
  409.     F_GETPROC(FSOUND_CD_GetVolume, "_FSOUND_CD_GetVolume@4");
  410.     F_GETPROC(FSOUND_CD_GetTrackLength, "_FSOUND_CD_GetTrackLength@8");
  411.     F_GETPROC(FSOUND_CD_GetTrackTime, "_FSOUND_CD_GetTrackTime@4");
  412.     F_GETPROC(FSOUND_DSP_Create, "_FSOUND_DSP_Create@12");
  413.     F_GETPROC(FSOUND_DSP_Free, "_FSOUND_DSP_Free@4");
  414.     F_GETPROC(FSOUND_DSP_SetPriority, "_FSOUND_DSP_SetPriority@8");
  415.     F_GETPROC(FSOUND_DSP_GetPriority, "_FSOUND_DSP_GetPriority@4");
  416.     F_GETPROC(FSOUND_DSP_SetActive, "_FSOUND_DSP_SetActive@8");
  417.     F_GETPROC(FSOUND_DSP_GetActive, "_FSOUND_DSP_GetActive@4");
  418.     F_GETPROC(FSOUND_DSP_GetClearUnit, "_FSOUND_DSP_GetClearUnit@0");
  419.     F_GETPROC(FSOUND_DSP_GetSFXUnit, "_FSOUND_DSP_GetSFXUnit@0");
  420.     F_GETPROC(FSOUND_DSP_GetMusicUnit, "_FSOUND_DSP_GetMusicUnit@0");
  421.     F_GETPROC(FSOUND_DSP_GetClipAndCopyUnit, "_FSOUND_DSP_GetClipAndCopyUnit@0");
  422.     F_GETPROC(FSOUND_DSP_GetFFTUnit, "_FSOUND_DSP_GetFFTUnit@0");
  423.     F_GETPROC(FSOUND_DSP_MixBuffers, "_FSOUND_DSP_MixBuffers@28");
  424.     F_GETPROC(FSOUND_DSP_ClearMixBuffer, "_FSOUND_DSP_ClearMixBuffer@0");
  425.     F_GETPROC(FSOUND_DSP_GetBufferLength, "_FSOUND_DSP_GetBufferLength@0");
  426.     F_GETPROC(FSOUND_DSP_GetBufferLengthTotal, "_FSOUND_DSP_GetBufferLengthTotal@0");
  427.     F_GETPROC(FSOUND_DSP_GetSpectrum, "_FSOUND_DSP_GetSpectrum@0");
  428.     F_GETPROC(FSOUND_Reverb_SetProperties, "_FSOUND_Reverb_SetProperties@4");
  429.     F_GETPROC(FSOUND_Reverb_GetProperties, "_FSOUND_Reverb_GetProperties@4");
  430.     F_GETPROC(FSOUND_Reverb_SetChannelProperties, "_FSOUND_Reverb_SetChannelProperties@8");
  431.     F_GETPROC(FSOUND_Reverb_GetChannelProperties, "_FSOUND_Reverb_GetChannelProperties@8");
  432.     F_GETPROC(FSOUND_Record_SetDriver, "_FSOUND_Record_SetDriver@4");
  433.     F_GETPROC(FSOUND_Record_GetNumDrivers, "_FSOUND_Record_GetNumDrivers@0");
  434.     F_GETPROC(FSOUND_Record_GetDriverName, "_FSOUND_Record_GetDriverName@4");
  435.     F_GETPROC(FSOUND_Record_GetDriver, "_FSOUND_Record_GetDriver@0");
  436.     F_GETPROC(FSOUND_Record_StartSample, "_FSOUND_Record_StartSample@8");
  437.     F_GETPROC(FSOUND_Record_Stop, "_FSOUND_Record_Stop@0");
  438.     F_GETPROC(FSOUND_Record_GetPosition, "_FSOUND_Record_GetPosition@0");
  439.     F_GETPROC(FSOUND_File_SetCallbacks, "_FSOUND_File_SetCallbacks@20");
  440.     F_GETPROC(FMUSIC_LoadSong, "_FMUSIC_LoadSong@4");
  441.     F_GETPROC(FMUSIC_LoadSongEx, "_FMUSIC_LoadSongEx@20");
  442.     F_GETPROC(FMUSIC_GetOpenState, "_FMUSIC_GetOpenState@4");
  443.     F_GETPROC(FMUSIC_FreeSong, "_FMUSIC_FreeSong@4");
  444.     F_GETPROC(FMUSIC_PlaySong, "_FMUSIC_PlaySong@4");
  445.     F_GETPROC(FMUSIC_StopSong, "_FMUSIC_StopSong@4");
  446.     F_GETPROC(FMUSIC_StopAllSongs, "_FMUSIC_StopAllSongs@0");
  447.     F_GETPROC(FMUSIC_SetZxxCallback, "_FMUSIC_SetZxxCallback@8");
  448.     F_GETPROC(FMUSIC_SetRowCallback, "_FMUSIC_SetRowCallback@12");
  449.     F_GETPROC(FMUSIC_SetOrderCallback, "_FMUSIC_SetOrderCallback@12");
  450.     F_GETPROC(FMUSIC_SetInstCallback, "_FMUSIC_SetInstCallback@12");
  451.     F_GETPROC(FMUSIC_SetSample, "_FMUSIC_SetSample@12");
  452.     F_GETPROC(FMUSIC_SetUserData, "_FMUSIC_SetUserData@8");
  453.     F_GETPROC(FMUSIC_OptimizeChannels, "_FMUSIC_OptimizeChannels@12");
  454.     F_GETPROC(FMUSIC_SetReverb, "_FMUSIC_SetReverb@4");
  455.     F_GETPROC(FMUSIC_SetLooping, "_FMUSIC_SetLooping@8");
  456.     F_GETPROC(FMUSIC_SetOrder, "_FMUSIC_SetOrder@8");
  457.     F_GETPROC(FMUSIC_SetPaused, "_FMUSIC_SetPaused@8");
  458.     F_GETPROC(FMUSIC_SetMasterVolume, "_FMUSIC_SetMasterVolume@8");
  459.     F_GETPROC(FMUSIC_SetMasterSpeed, "_FMUSIC_SetMasterSpeed@8");
  460.     F_GETPROC(FMUSIC_SetPanSeperation, "_FMUSIC_SetPanSeperation@8");
  461.     F_GETPROC(FMUSIC_GetName, "_FMUSIC_GetName@4");
  462.     F_GETPROC(FMUSIC_GetType, "_FMUSIC_GetType@4");
  463.     F_GETPROC(FMUSIC_GetNumOrders, "_FMUSIC_GetNumOrders@4");
  464.     F_GETPROC(FMUSIC_GetNumPatterns, "_FMUSIC_GetNumPatterns@4");
  465.     F_GETPROC(FMUSIC_GetNumInstruments, "_FMUSIC_GetNumInstruments@4");
  466.     F_GETPROC(FMUSIC_GetNumSamples, "_FMUSIC_GetNumSamples@4");
  467.     F_GETPROC(FMUSIC_GetNumChannels, "_FMUSIC_GetNumChannels@4");
  468.     F_GETPROC(FMUSIC_GetSample, "_FMUSIC_GetSample@8");
  469.     F_GETPROC(FMUSIC_GetPatternLength, "_FMUSIC_GetPatternLength@8");
  470.     F_GETPROC(FMUSIC_IsFinished, "_FMUSIC_IsFinished@4");
  471.     F_GETPROC(FMUSIC_IsPlaying, "_FMUSIC_IsPlaying@4");
  472.     F_GETPROC(FMUSIC_GetMasterVolume, "_FMUSIC_GetMasterVolume@4");
  473.     F_GETPROC(FMUSIC_GetGlobalVolume, "_FMUSIC_GetGlobalVolume@4");
  474.     F_GETPROC(FMUSIC_GetOrder, "_FMUSIC_GetOrder@4");
  475.     F_GETPROC(FMUSIC_GetPattern, "_FMUSIC_GetPattern@4");
  476.     F_GETPROC(FMUSIC_GetSpeed, "_FMUSIC_GetSpeed@4");
  477.     F_GETPROC(FMUSIC_GetBPM, "_FMUSIC_GetBPM@4");
  478.     F_GETPROC(FMUSIC_GetRow, "_FMUSIC_GetRow@4");
  479.     F_GETPROC(FMUSIC_GetPaused, "_FMUSIC_GetPaused@4");
  480.     F_GETPROC(FMUSIC_GetTime, "_FMUSIC_GetTime@4");
  481.     F_GETPROC(FMUSIC_GetRealChannel, "_FMUSIC_GetRealChannel@8");
  482.     F_GETPROC(FMUSIC_GetUserData, "_FMUSIC_GetUserData@4");
  483.  
  484.     return instance;
  485. }
  486.  
  487. static void FMOD_FreeInstance(FMOD_INSTANCE *instance)
  488. {
  489.     if (instance)
  490.     {
  491.         if (instance->module)
  492.         {
  493. #ifdef WIN32
  494.             FreeLibrary((HMODULE)instance->module);
  495. #else
  496.             dlclose(instance->module);
  497. #endif
  498.         }
  499.         free(instance);
  500.     }
  501. }
  502.  
  503. #endif
  504.  
  505.