// Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones // This file is part of the "cAudio Engine" // For conditions of distribution and use, see copyright notice in cAudio.h #include "../Headers/cAudioEffects.h" #include "../Headers/cFilter.h" #include "../Headers/cEffect.h" //Number of effect slots to try to create #define EFFECT_SLOTS_TO_TEST 256 namespace cAudio { cAudioEffects::cAudioEffects() : MaxEffectsSupported(0) { for(int i=0; iisValid()) return effect; return NULL; } IFilter* cAudioEffects::createFilter() { cAudioMutexBasicLock lock(Mutex); IFilter* filter = new cFilter(&EFXInterface); if(filter && filter->isValid()) return filter; return NULL; } unsigned int cAudioEffects::getMaxEffectsSupported() const { return MaxEffectsSupported; } bool cAudioEffects::isEffectSupported(const EffectTypes& type) const { return SupportedEffects[type]; } bool cAudioEffects::isFilterSupported(const FilterTypes& type) const { return SupportedFilters[type]; } cEFXFunctions* cAudioEffects::getEFXInterface() { return &EFXInterface; } void cAudioEffects::checkEFXSupportDetails() { cAudioMutexBasicLock lock(Mutex); if(EFXInterface.Supported) { cAudioMutexBasicLock lock(EFXInterface.Mutex); //Count the number of effect slots this device supports (limits the max number of effects available) unsigned int count = 0; ALuint effectSlots[EFFECT_SLOTS_TO_TEST]; for(count=0; count 0) { EFXInterface.alDeleteAuxiliaryEffectSlots(1, &effectSlots[--count]); } } } };