info_updater.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // Copyright 2020 yuzu Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <vector>
  6. #include "audio_core/common.h"
  7. #include "common/common_types.h"
  8. namespace AudioCore {
  9. class BehaviorInfo;
  10. class ServerMemoryPoolInfo;
  11. class VoiceContext;
  12. class EffectContext;
  13. class MixContext;
  14. class SinkContext;
  15. class SplitterContext;
  16. class InfoUpdater {
  17. public:
  18. // TODO(ogniK): Pass process handle when we support it
  19. InfoUpdater(const std::vector<u8>& in_params_, std::vector<u8>& out_params_,
  20. BehaviorInfo& behavior_info_);
  21. ~InfoUpdater();
  22. bool UpdateBehaviorInfo(BehaviorInfo& in_behavior_info);
  23. bool UpdateMemoryPools(std::vector<ServerMemoryPoolInfo>& memory_pool_info);
  24. bool UpdateVoiceChannelResources(VoiceContext& voice_context);
  25. bool UpdateVoices(VoiceContext& voice_context,
  26. std::vector<ServerMemoryPoolInfo>& memory_pool_info,
  27. VAddr audio_codec_dsp_addr);
  28. bool UpdateEffects(EffectContext& effect_context, bool is_active);
  29. bool UpdateSplitterInfo(SplitterContext& splitter_context);
  30. ResultCode UpdateMixes(MixContext& mix_context, std::size_t mix_buffer_count,
  31. SplitterContext& splitter_context, EffectContext& effect_context);
  32. bool UpdateSinks(SinkContext& sink_context);
  33. bool UpdatePerformanceBuffer();
  34. bool UpdateErrorInfo(BehaviorInfo& in_behavior_info);
  35. bool UpdateRendererInfo(std::size_t elapsed_frame_count);
  36. bool CheckConsumedSize() const;
  37. bool WriteOutputHeader();
  38. private:
  39. const std::vector<u8>& in_params;
  40. std::vector<u8>& out_params;
  41. BehaviorInfo& behavior_info;
  42. AudioCommon::UpdateDataHeader input_header{};
  43. AudioCommon::UpdateDataHeader output_header{};
  44. std::size_t input_offset{sizeof(AudioCommon::UpdateDataHeader)};
  45. std::size_t output_offset{sizeof(AudioCommon::UpdateDataHeader)};
  46. };
  47. } // namespace AudioCore