2018-02-25 04:34:16 +00:00
|
|
|
using Ryujinx.Core.OsHle.Ipc;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
2018-03-20 20:00:00 +00:00
|
|
|
namespace Ryujinx.Core.OsHle.Services.Aud
|
2018-02-25 04:34:16 +00:00
|
|
|
{
|
2018-03-21 23:30:10 +00:00
|
|
|
class IAudioRendererManager : IpcService
|
2018-02-25 04:34:16 +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-25 04:34:16 +00:00
|
|
|
|
2018-03-21 23:30:10 +00:00
|
|
|
public IAudioRendererManager()
|
2018-02-25 04:34:16 +00:00
|
|
|
{
|
|
|
|
m_Commands = new Dictionary<int, ServiceProcessRequest>()
|
|
|
|
{
|
2018-03-12 19:29:06 +00:00
|
|
|
{ 0, OpenAudioRenderer },
|
|
|
|
{ 1, GetAudioRendererWorkBufferSize },
|
|
|
|
{ 2, GetAudioDevice }
|
2018-02-25 04:34:16 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
public long OpenAudioRenderer(ServiceCtx Context)
|
|
|
|
{
|
|
|
|
MakeObject(Context, new IAudioRenderer());
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public long GetAudioRendererWorkBufferSize(ServiceCtx Context)
|
|
|
|
{
|
|
|
|
int SampleRate = Context.RequestData.ReadInt32();
|
|
|
|
int Unknown4 = Context.RequestData.ReadInt32();
|
|
|
|
int Unknown8 = Context.RequestData.ReadInt32();
|
|
|
|
int UnknownC = Context.RequestData.ReadInt32();
|
|
|
|
int Unknown10 = Context.RequestData.ReadInt32();
|
|
|
|
int Unknown14 = Context.RequestData.ReadInt32();
|
|
|
|
int Unknown18 = Context.RequestData.ReadInt32();
|
|
|
|
int Unknown1c = Context.RequestData.ReadInt32();
|
|
|
|
int Unknown20 = Context.RequestData.ReadInt32();
|
|
|
|
int Unknown24 = Context.RequestData.ReadInt32();
|
|
|
|
int Unknown28 = Context.RequestData.ReadInt32();
|
|
|
|
int Unknown2c = Context.RequestData.ReadInt32();
|
|
|
|
int Rev1Magic = Context.RequestData.ReadInt32();
|
|
|
|
|
2018-04-17 00:24:42 +00:00
|
|
|
Logging.Stub(LogClass.ServiceAudio, "BufferSize = 0x400L");
|
|
|
|
|
2018-02-25 04:34:16 +00:00
|
|
|
Context.ResponseData.Write(0x400L);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2018-03-12 05:07:48 +00:00
|
|
|
|
2018-03-12 19:29:06 +00:00
|
|
|
public long GetAudioDevice(ServiceCtx Context)
|
2018-03-12 05:07:48 +00:00
|
|
|
{
|
2018-03-12 19:29:06 +00:00
|
|
|
long UserId = Context.RequestData.ReadInt64();
|
|
|
|
|
2018-04-22 04:21:49 +00:00
|
|
|
MakeObject(Context, new IAudioDevice());
|
2018-03-12 05:07:48 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2018-02-25 04:34:16 +00:00
|
|
|
}
|
|
|
|
}
|