2018-08-16 23:47:36 +00:00
|
|
|
using Ryujinx.HLE.HOS.Ipc;
|
2018-06-11 00:46:42 +00:00
|
|
|
using Ryujinx.HLE.Logging;
|
2018-02-10 00:14:55 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
2018-08-16 23:47:36 +00:00
|
|
|
namespace Ryujinx.HLE.HOS.Services.Am
|
2018-02-10 00:14:55 +00:00
|
|
|
{
|
2018-03-19 18:58:46 +00:00
|
|
|
class IAudioController : IpcService
|
2018-02-10 00:14:55 +00:00
|
|
|
{
|
|
|
|
private Dictionary<int, ServiceProcessRequest> m_Commands;
|
|
|
|
|
2018-03-19 18:58:46 +00:00
|
|
|
public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
|
2018-02-10 00:14:55 +00:00
|
|
|
|
|
|
|
public IAudioController()
|
|
|
|
{
|
|
|
|
m_Commands = new Dictionary<int, ServiceProcessRequest>()
|
|
|
|
{
|
2018-04-18 01:39:27 +00:00
|
|
|
{ 0, SetExpectedMasterVolume },
|
|
|
|
{ 1, GetMainAppletExpectedMasterVolume },
|
|
|
|
{ 2, GetLibraryAppletExpectedMasterVolume },
|
2018-04-24 18:57:39 +00:00
|
|
|
{ 3, ChangeMainAppletMasterVolume },
|
2018-04-18 01:39:27 +00:00
|
|
|
{ 4, SetTransparentVolumeRate }
|
2018-02-10 00:14:55 +00:00
|
|
|
};
|
|
|
|
}
|
2018-04-18 01:39:27 +00:00
|
|
|
|
|
|
|
public long SetExpectedMasterVolume(ServiceCtx Context)
|
|
|
|
{
|
2018-04-23 03:02:30 +00:00
|
|
|
float AppletVolume = Context.RequestData.ReadSingle();
|
|
|
|
float LibraryAppletVolume = Context.RequestData.ReadSingle();
|
2018-04-18 01:39:27 +00:00
|
|
|
|
2018-08-16 23:47:36 +00:00
|
|
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
2018-04-18 01:39:27 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public long GetMainAppletExpectedMasterVolume(ServiceCtx Context)
|
|
|
|
{
|
|
|
|
Context.ResponseData.Write(1f);
|
|
|
|
|
2018-08-16 23:47:36 +00:00
|
|
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
2018-04-18 01:39:27 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public long GetLibraryAppletExpectedMasterVolume(ServiceCtx Context)
|
|
|
|
{
|
|
|
|
Context.ResponseData.Write(1f);
|
|
|
|
|
2018-08-16 23:47:36 +00:00
|
|
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
2018-04-18 01:39:27 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public long ChangeMainAppletMasterVolume(ServiceCtx Context)
|
|
|
|
{
|
|
|
|
float Unknown0 = Context.RequestData.ReadSingle();
|
|
|
|
long Unknown1 = Context.RequestData.ReadInt64();
|
|
|
|
|
2018-08-16 23:47:36 +00:00
|
|
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
2018-04-18 01:39:27 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public long SetTransparentVolumeRate(ServiceCtx Context)
|
|
|
|
{
|
|
|
|
float Unknown0 = Context.RequestData.ReadSingle();
|
|
|
|
|
2018-08-16 23:47:36 +00:00
|
|
|
Context.Device.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
|
2018-04-18 01:39:27 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2018-02-10 00:14:55 +00:00
|
|
|
}
|
2018-04-18 01:39:27 +00:00
|
|
|
}
|