/// <summary> /// Update the internal state from a user parameter. /// </summary> /// <param name="updateErrorInfo">The possible <see cref="ErrorInfo"/> that was generated.</param> /// <param name="parameter">The user parameter.</param> /// <param name="mapper">The mapper to use.</param> public virtual void Update(out ErrorInfo updateErrorInfo, ref EffectInParameter parameter, PoolMapper mapper) { Debug.Assert(IsTypeValid(ref parameter)); updateErrorInfo = new ErrorInfo(); }
public override void Update(out BehaviourParameter.ErrorInfo updateErrorInfo, ref EffectInParameter parameter, PoolMapper mapper) { Debug.Assert(IsTypeValid(ref parameter)); ref Reverb3dParameter reverbParameter = ref MemoryMarshal.Cast <byte, Reverb3dParameter>(parameter.SpecificData)[0];
/// <summary> /// Update the internal common parameters from a user parameter. /// </summary> /// <param name="parameter">The user parameter.</param> protected void UpdateParameterBase(ref EffectInParameter parameter) { MixId = parameter.MixId; ProcessingOrder = parameter.ProcessingOrder; }
/// <summary> /// Check if the <see cref="EffectType"/> sent by the user match the internal <see cref="EffectType"/>. /// </summary> /// <param name="parameter">The user parameter.</param> /// <returns>Returns true if the <see cref="EffectType"/> sent by the user matches the internal <see cref="EffectType"/>.</returns> public bool IsTypeValid(ref EffectInParameter parameter) { return(parameter.Type == TargetEffectType); }
/// <summary> /// Check if the <see cref="ChannelCountMax"/> is valid. /// </summary> /// <returns>Returns true if the <see cref="ChannelCountMax"/> is valid.</returns> public bool IsChannelCountMaxValid() { return(EffectInParameter.IsChannelCountValid(ChannelCountMax)); }
public override void Update(out BehaviourParameter.ErrorInfo updateErrorInfo, ref EffectInParameter parameter, PoolMapper mapper) { Debug.Assert(IsTypeValid(ref parameter)); UpdateParameterBase(ref parameter); Parameter = MemoryMarshal.Cast <byte, AuxiliaryBufferParameter>(parameter.SpecificData)[0]; IsEnabled = parameter.IsEnabled; updateErrorInfo = new BehaviourParameter.ErrorInfo(); if (BufferUnmapped || parameter.IsNew) { ulong bufferSize = (ulong)Unsafe.SizeOf <int>() * Parameter.BufferStorageSize + (ulong)Unsafe.SizeOf <AuxiliaryBufferHeader>() * 2; bool sendBufferUnmapped = !mapper.TryAttachBuffer(out updateErrorInfo, ref WorkBuffers[0], Parameter.SendBufferInfoAddress, bufferSize); bool returnBufferUnmapped = !mapper.TryAttachBuffer(out updateErrorInfo, ref WorkBuffers[1], Parameter.ReturnBufferInfoAddress, bufferSize); BufferUnmapped = sendBufferUnmapped && returnBufferUnmapped; if (!BufferUnmapped) { DspAddress sendDspAddress = WorkBuffers[0].GetReference(false); DspAddress returnDspAddress = WorkBuffers[1].GetReference(false); State.SendBufferInfo = sendDspAddress + (uint)Unsafe.SizeOf <AuxiliaryBufferHeader>(); State.SendBufferInfoBase = sendDspAddress + (uint)Unsafe.SizeOf <AuxiliaryBufferHeader>() * 2; State.ReturnBufferInfo = returnDspAddress + (uint)Unsafe.SizeOf <AuxiliaryBufferHeader>(); State.ReturnBufferInfoBase = returnDspAddress + (uint)Unsafe.SizeOf <AuxiliaryBufferHeader>() * 2; } } }
public override void Update(out BehaviourParameter.ErrorInfo updateErrorInfo, ref EffectInParameter parameter, PoolMapper mapper) { Debug.Assert(IsTypeValid(ref parameter)); UpdateParameterBase(ref parameter); Parameter = MemoryMarshal.Cast <byte, BufferMixParameter>(parameter.SpecificData)[0]; IsEnabled = parameter.IsEnabled; updateErrorInfo = new BehaviourParameter.ErrorInfo(); }