IAudioController.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using Ryujinx.Common.Logging;
  2. using Ryujinx.HLE.HOS.Ipc;
  3. using System.Collections.Generic;
  4. namespace Ryujinx.HLE.HOS.Services.Am
  5. {
  6. class IAudioController : IpcService
  7. {
  8. private Dictionary<int, ServiceProcessRequest> _commands;
  9. public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => _commands;
  10. public IAudioController()
  11. {
  12. _commands = new Dictionary<int, ServiceProcessRequest>
  13. {
  14. { 0, SetExpectedMasterVolume },
  15. { 1, GetMainAppletExpectedMasterVolume },
  16. { 2, GetLibraryAppletExpectedMasterVolume },
  17. { 3, ChangeMainAppletMasterVolume },
  18. { 4, SetTransparentVolumeRate }
  19. };
  20. }
  21. public long SetExpectedMasterVolume(ServiceCtx context)
  22. {
  23. float appletVolume = context.RequestData.ReadSingle();
  24. float libraryAppletVolume = context.RequestData.ReadSingle();
  25. Logger.PrintStub(LogClass.ServiceAm);
  26. return 0;
  27. }
  28. public long GetMainAppletExpectedMasterVolume(ServiceCtx context)
  29. {
  30. context.ResponseData.Write(1f);
  31. Logger.PrintStub(LogClass.ServiceAm);
  32. return 0;
  33. }
  34. public long GetLibraryAppletExpectedMasterVolume(ServiceCtx context)
  35. {
  36. context.ResponseData.Write(1f);
  37. Logger.PrintStub(LogClass.ServiceAm);
  38. return 0;
  39. }
  40. public long ChangeMainAppletMasterVolume(ServiceCtx context)
  41. {
  42. float unknown0 = context.RequestData.ReadSingle();
  43. long unknown1 = context.RequestData.ReadInt64();
  44. Logger.PrintStub(LogClass.ServiceAm);
  45. return 0;
  46. }
  47. public long SetTransparentVolumeRate(ServiceCtx context)
  48. {
  49. float unknown0 = context.RequestData.ReadSingle();
  50. Logger.PrintStub(LogClass.ServiceAm);
  51. return 0;
  52. }
  53. }
  54. }