aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/Aud/AudioOut/IAudioOut.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Aud/AudioOut/IAudioOut.cs')
-rw-r--r--Ryujinx.HLE/HOS/Services/Aud/AudioOut/IAudioOut.cs44
1 files changed, 21 insertions, 23 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Aud/AudioOut/IAudioOut.cs b/Ryujinx.HLE/HOS/Services/Aud/AudioOut/IAudioOut.cs
index 5270a041..1c078fba 100644
--- a/Ryujinx.HLE/HOS/Services/Aud/AudioOut/IAudioOut.cs
+++ b/Ryujinx.HLE/HOS/Services/Aud/AudioOut/IAudioOut.cs
@@ -4,42 +4,24 @@ using Ryujinx.HLE.HOS.Ipc;
using Ryujinx.HLE.HOS.Kernel.Common;
using Ryujinx.HLE.HOS.Kernel.Threading;
using System;
-using System.Collections.Generic;
namespace Ryujinx.HLE.HOS.Services.Aud.AudioOut
{
class IAudioOut : IpcService, IDisposable
{
- private Dictionary<int, ServiceProcessRequest> _commands;
-
- public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => _commands;
-
private IAalOutput _audioOut;
-
- private KEvent _releaseEvent;
-
- private int _track;
+ private KEvent _releaseEvent;
+ private int _track;
public IAudioOut(IAalOutput audioOut, KEvent releaseEvent, int track)
{
- _commands = new Dictionary<int, ServiceProcessRequest>
- {
- { 0, GetAudioOutState },
- { 1, StartAudioOut },
- { 2, StopAudioOut },
- { 3, AppendAudioOutBuffer },
- { 4, RegisterBufferEvent },
- { 5, GetReleasedAudioOutBuffer },
- { 6, ContainsAudioOutBuffer },
- { 7, AppendAudioOutBufferAuto },
- { 8, GetReleasedAudioOutBufferAuto }
- };
-
_audioOut = audioOut;
_releaseEvent = releaseEvent;
_track = track;
}
+ [Command(0)]
+ // GetAudioOutState() -> u32 state
public long GetAudioOutState(ServiceCtx context)
{
context.ResponseData.Write((int)_audioOut.GetState(_track));
@@ -47,6 +29,8 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioOut
return 0;
}
+ [Command(1)]
+ // StartAudioOut()
public long StartAudioOut(ServiceCtx context)
{
_audioOut.Start(_track);
@@ -54,6 +38,8 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioOut
return 0;
}
+ [Command(2)]
+ // StopAudioOut()
public long StopAudioOut(ServiceCtx context)
{
_audioOut.Stop(_track);
@@ -61,11 +47,15 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioOut
return 0;
}
+ [Command(3)]
+ // AppendAudioOutBuffer(u64 tag, buffer<nn::audio::AudioOutBuffer, 5>)
public long AppendAudioOutBuffer(ServiceCtx context)
{
return AppendAudioOutBufferImpl(context, context.Request.SendBuff[0].Position);
}
+ [Command(4)]
+ // RegisterBufferEvent() -> handle<copy>
public long RegisterBufferEvent(ServiceCtx context)
{
if (context.Process.HandleTable.GenerateHandle(_releaseEvent.ReadableEvent, out int handle) != KernelResult.Success)
@@ -78,6 +68,8 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioOut
return 0;
}
+ [Command(5)]
+ // GetReleasedAudioOutBuffer() -> (u32 count, buffer<nn::audio::AudioOutBuffer, 6>)
public long GetReleasedAudioOutBuffer(ServiceCtx context)
{
long position = context.Request.ReceiveBuff[0].Position;
@@ -86,6 +78,8 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioOut
return GetReleasedAudioOutBufferImpl(context, position, size);
}
+ [Command(6)]
+ // ContainsAudioOutBuffer(u64 tag) -> b8
public long ContainsAudioOutBuffer(ServiceCtx context)
{
long tag = context.RequestData.ReadInt64();
@@ -95,6 +89,8 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioOut
return 0;
}
+ [Command(7)] // 3.0.0+
+ // AppendAudioOutBufferAuto(u64 tag, buffer<nn::audio::AudioOutBuffer, 0x21>)
public long AppendAudioOutBufferAuto(ServiceCtx context)
{
(long position, long size) = context.Request.GetBufferType0x21();
@@ -119,6 +115,8 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioOut
return 0;
}
+ [Command(8)] // 3.0.0+
+ // GetReleasedAudioOutBufferAuto() -> (u32 count, buffer<nn::audio::AudioOutBuffer, 0x22>)
public long GetReleasedAudioOutBufferAuto(ServiceCtx context)
{
(long position, long size) = context.Request.GetBufferType0x22();
@@ -162,4 +160,4 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioOut
}
}
}
-}
+} \ No newline at end of file