//-------------------------------------------------- ChorusDSP::ChorusDSP( XMLParser& parser, XMLNode* chorusNode ) : DSP( MONKY_DSP_TYPE_CHORUS ) { const float NO_VALUE_SPECIFIED = -1000000000.0f; parser.validateXMLChildElements( chorusNode, "", "WetVolume" ); parser.validateXMLAttributes( chorusNode, "", "type,dryVolume,delayMS,modulationRate,modulationDepth" ); float dryVolume = parser.getXMLAttributeAsFloat( chorusNode, "dryVolume", NO_VALUE_SPECIFIED ); float delay = parser.getXMLAttributeAsFloat( chorusNode, "delayMS", NO_VALUE_SPECIFIED ); float modulationRate = parser.getXMLAttributeAsFloat( chorusNode, "modulationRate", NO_VALUE_SPECIFIED ); float modulationDepth = parser.getXMLAttributeAsFloat( chorusNode, "modulationDepth", NO_VALUE_SPECIFIED ); for( const XMLNode* wetNode = chorusNode->FirstChildElement( "WetVolume" ); wetNode != nullptr; wetNode = wetNode->NextSiblingElement( "WetVolume" ) ) { parser.validateXMLAttributes( wetNode, "channel,volume", "" ); int channel = parser.getXMLAttributeAsInt( wetNode, "channel", -1 ); float volume = parser.getXMLAttributeAsFloat( wetNode, "volume", 0.0f ); if( channel > 0 ) setWetMixVolume( channel, volume ); } if( dryVolume != NO_VALUE_SPECIFIED ) setDryMixVolume( dryVolume ); if( delay != NO_VALUE_SPECIFIED ) setDelayMS( delay ); if( modulationRate != NO_VALUE_SPECIFIED ) setModulationRate( modulationRate ); if( modulationDepth != NO_VALUE_SPECIFIED ) setModulationDepth( modulationDepth ); }
void EaxReverb::loadPreset(const EFXEAXREVERBPROPERTIES& prop) { // reflections and reverb pans are always 0 vectors, skip it setDensity(prop.flDensity); setDiffusion(prop.flDiffusion); setGain(prop.flGain); setGainHf(prop.flGainHF); setGainLf(prop.flGainLF); setDecayTime(prop.flDecayTime); setDecayHfRatio(prop.flDecayHFRatio); setDecayLfRatio(prop.flDecayLFRatio); setReflectionsGain(prop.flReflectionsGain); setReflectionsDelay(prop.flReflectionsDelay); setLateReverbGain(prop.flLateReverbGain); setLateReverbDelay(prop.flLateReverbDelay); setEchoTime(prop.flEchoTime); setEchoDepth(prop.flEchoDepth); setModulationTime(prop.flModulationTime); setModulationDepth(prop.flModulationDepth); setAirAbsorptionGainHf(prop.flAirAbsorptionGainHF); setHfReference(prop.flHFReference); setLfReference(prop.flLFReference); setRoomRolloffFactor(prop.flRoomRolloffFactor); setDecayHfLimit(prop.iDecayHFLimit ? true : false); }