RendererSystemContext.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. //
  2. // Copyright (c) 2019-2020 Ryujinx
  3. //
  4. // This program is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU Lesser General Public License as published by
  6. // the Free Software Foundation, either version 3 of the License, or
  7. // (at your option) any later version.
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU Lesser General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU Lesser General Public License
  15. // along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. //
  17. using Ryujinx.Audio.Renderer.Server.Upsampler;
  18. using System;
  19. namespace Ryujinx.Audio.Renderer.Server
  20. {
  21. /// <summary>
  22. /// Represents a lite version of <see cref="AudioRenderSystem"/> used by the <see cref="Dsp.AudioProcessor"/>
  23. /// </summary>
  24. /// <remarks>
  25. /// This also allows to reduce dependencies on the <see cref="AudioRenderSystem"/> for unit testing.
  26. /// </remarks>
  27. public sealed class RendererSystemContext
  28. {
  29. /// <summary>
  30. /// The session id of the current renderer.
  31. /// </summary>
  32. public int SessionId;
  33. /// <summary>
  34. /// The target channel count for sink.
  35. /// </summary>
  36. /// <remarks>See <see cref="CommandGenerator.GenerateDevice(Sink.DeviceSink, ref Mix.MixState)"/> for usage.</remarks>
  37. public uint ChannelCount;
  38. /// <summary>
  39. /// The total count of mix buffer.
  40. /// </summary>
  41. public uint MixBufferCount;
  42. /// <summary>
  43. /// Instance of the <see cref="BehaviourContext"/> used to derive bug fixes and features of the current audio renderer revision.
  44. /// </summary>
  45. public BehaviourContext BehaviourContext;
  46. /// <summary>
  47. /// Instance of the <see cref="UpsamplerManager"/> used for upsampling (see <see cref="UpsamplerState"/>)
  48. /// </summary>
  49. public UpsamplerManager UpsamplerManager;
  50. /// <summary>
  51. /// The memory to use for depop processing.
  52. /// </summary>
  53. /// <remarks>
  54. /// See <see cref="Dsp.Command.DepopForMixBuffersCommand"/> and <see cref="Dsp.Command.DepopPrepareCommand"/>
  55. /// </remarks>
  56. public Memory<float> DepopBuffer;
  57. }
  58. }