BufferMixEffect.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using Ryujinx.Audio.Renderer.Common;
  2. using Ryujinx.Audio.Renderer.Parameter;
  3. using Ryujinx.Audio.Renderer.Parameter.Effect;
  4. using Ryujinx.Audio.Renderer.Server.MemoryPool;
  5. using System.Diagnostics;
  6. using System.Runtime.InteropServices;
  7. namespace Ryujinx.Audio.Renderer.Server.Effect
  8. {
  9. /// <summary>
  10. /// Server state for a buffer mix effect.
  11. /// </summary>
  12. public class BufferMixEffect : BaseEffect
  13. {
  14. /// <summary>
  15. /// The buffer mix parameter.
  16. /// </summary>
  17. public BufferMixParameter Parameter;
  18. public override EffectType TargetEffectType => EffectType.BufferMix;
  19. public override void Update(out BehaviourParameter.ErrorInfo updateErrorInfo, ref EffectInParameterVersion1 parameter, PoolMapper mapper)
  20. {
  21. Update(out updateErrorInfo, ref parameter, mapper);
  22. }
  23. public override void Update(out BehaviourParameter.ErrorInfo updateErrorInfo, ref EffectInParameterVersion2 parameter, PoolMapper mapper)
  24. {
  25. Update(out updateErrorInfo, ref parameter, mapper);
  26. }
  27. public void Update<T>(out BehaviourParameter.ErrorInfo updateErrorInfo, ref T parameter, PoolMapper mapper) where T : unmanaged, IEffectInParameter
  28. {
  29. Debug.Assert(IsTypeValid(ref parameter));
  30. UpdateParameterBase(ref parameter);
  31. Parameter = MemoryMarshal.Cast<byte, BufferMixParameter>(parameter.SpecificData)[0];
  32. IsEnabled = parameter.IsEnabled;
  33. updateErrorInfo = new BehaviourParameter.ErrorInfo();
  34. }
  35. public override void UpdateForCommandGeneration()
  36. {
  37. UpdateUsageStateForCommandGeneration();
  38. }
  39. }
  40. }