00001
00002 #ifdef WIN32
00003 #pragma warning (disable:4786)
00004 #endif
00005
00006 #include "API/Sound/setupsound.h"
00007 #include "API/Sound/sound.h"
00008 #include "Sound/Sound/ClanSound/soundcard_clan.h"
00009 #include "Sound/Sound/ClanSound/cdaudio_win32.h"
00010 #include "Sound/System/Generic/setupsound_generic.h"
00011
00012 #define INITGUID
00013 #include <objbase.h>
00014 #include <initguid.h>
00015
00016 DEFINE_GUID(IID_IDirectSoundNotify, 0xb0210783, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
00017
00019
00020
00021 static int init_ref_count = 0;
00022
00023 void CL_SetupSound::init()
00024 {
00025 init_ref_count++;
00026 if (init_ref_count > 1) return;
00027
00028 CL_Sound::cards.push_back(new CL_SoundCard_ClanSound);
00029 CL_CDDrive_Win32::init_cdaudio();
00030
00031 CL_SetupSound_Generic::init();
00032 }
00033
00035
00036
00037 void CL_SetupSound::deinit()
00038 {
00039 init_ref_count--;
00040 if (init_ref_count > 0) return;
00041
00042 CL_SetupSound_Generic::deinit();
00043
00044 int size = CL_Sound::cards.size();
00045 for (int i = 0; i < size; i++)
00046 {
00047 delete CL_Sound::cards[i];
00048 }
00049
00050 CL_Sound::cards.clear();
00051 }
00052
00054