Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

setupmikmod.cpp

Go to the documentation of this file.
00001 #include "API/MikMod/streamed_mikmod_sample.h"
00002 #include "resourcetype_module.h"
00003 #include "API/MikMod/setupmikmod.h"
00004 
00005 static CL_Res_Module *restype_module = NULL;
00006 
00007 /*
00008  * This structure is the ClanLib driver for MikMod. It's a "standard" driver
00009  * since it re-uses lots of functions from libMikMod, indeed the big
00010  * ClanLib-specific stuff is the update function, which is mapped to
00011  * CL_Streamed_MikModSample_Session::clanMikMod_Update
00012  */
00013 MDRIVER drv_clanlib = {
00014   NULL,
00015   "clanMikMod driver",
00016   "0.1",
00017   255,
00018   255, 
00019   "clanmikmod",
00020   NULL, // Command line
00021   CL_Streamed_MikModSample_Session::clanMikMod_IsPresent, // IsPresent
00022   VC_SampleLoad,
00023   VC_SampleUnload,
00024   VC_SampleSpace,
00025   VC_SampleLength,
00026   VC_Init,
00027   VC_Exit,
00028   NULL, // Reset
00029   VC_SetNumVoices,
00030   VC_PlayStart,
00031   VC_PlayStop,
00032   CL_Streamed_MikModSample_Session::clanMikMod_Update,
00033   NULL, // Pause
00034   VC_VoiceSetVolume,
00035   VC_VoiceGetVolume,
00036   VC_VoiceSetFrequency,
00037   VC_VoiceGetFrequency,
00038   VC_VoiceSetPanning,
00039   VC_VoiceGetPanning,
00040   VC_VoicePlay,
00041   VC_VoiceStop,
00042   VC_VoiceStopped,
00043   VC_VoiceGetPosition,
00044   VC_VoiceRealVolume
00045 };
00046 
00047 
00048 void CL_SetupMikMod::init()
00049 {
00050         /* Register the loaders we want to use:  */
00051         MikMod_RegisterAllLoaders();
00052         
00053         /* Register the drivers we want to use: */
00054         MikMod_RegisterDriver(&drv_clanlib);
00055 
00056 #if LIBMIKMOD_VERSION >= ((3 << 16) | (1 << 8) | (7))
00057         MikMod_Init("");
00058 #else
00059         MikMod_Init();
00060 #endif
00061 
00062         md_mode |= DMODE_INTERP;        
00063 
00064         restype_module = new CL_Res_Module();
00065 }
00066 
00067 void CL_SetupMikMod::deinit()
00068 {
00069         delete restype_module;
00070 
00071         restype_module = NULL;
00072 
00073         MikMod_Exit();
00074 }

Generated at Wed Apr 4 19:54:03 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001