aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Audio/Renderer/Device
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.Audio/Renderer/Device')
-rw-r--r--src/Ryujinx.Audio/Renderer/Device/VirtualDevice.cs2
-rw-r--r--src/Ryujinx.Audio/Renderer/Device/VirtualDeviceSessionRegistry.cs19
2 files changed, 19 insertions, 2 deletions
diff --git a/src/Ryujinx.Audio/Renderer/Device/VirtualDevice.cs b/src/Ryujinx.Audio/Renderer/Device/VirtualDevice.cs
index 2fa030a8..90692b00 100644
--- a/src/Ryujinx.Audio/Renderer/Device/VirtualDevice.cs
+++ b/src/Ryujinx.Audio/Renderer/Device/VirtualDevice.cs
@@ -45,7 +45,7 @@ namespace Ryujinx.Audio.Renderer.Device
/// <param name="name">The name of the <see cref="VirtualDevice"/>.</param>
/// <param name="channelCount">The count of channels supported by the <see cref="VirtualDevice"/>.</param>
/// <param name="isExternalOutput">Indicate if the <see cref="VirtualDevice"/> is provided by an external interface.</param>
- private VirtualDevice(string name, uint channelCount, bool isExternalOutput)
+ public VirtualDevice(string name, uint channelCount, bool isExternalOutput)
{
Name = name;
ChannelCount = channelCount;
diff --git a/src/Ryujinx.Audio/Renderer/Device/VirtualDeviceSessionRegistry.cs b/src/Ryujinx.Audio/Renderer/Device/VirtualDeviceSessionRegistry.cs
index 927e45ad..696af90f 100644
--- a/src/Ryujinx.Audio/Renderer/Device/VirtualDeviceSessionRegistry.cs
+++ b/src/Ryujinx.Audio/Renderer/Device/VirtualDeviceSessionRegistry.cs
@@ -1,3 +1,4 @@
+using Ryujinx.Audio.Integration;
using System.Collections.Generic;
namespace Ryujinx.Audio.Renderer.Device
@@ -22,7 +23,23 @@ namespace Ryujinx.Audio.Renderer.Device
/// The current active <see cref="VirtualDevice"/>.
/// </summary>
// TODO: make this configurable
- public VirtualDevice ActiveDevice = VirtualDevice.Devices[2];
+ public VirtualDevice ActiveDevice { get; }
+
+ public VirtualDeviceSessionRegistry(IHardwareDeviceDriver driver)
+ {
+ uint channelCount;
+
+ if (driver.GetRealDeviceDriver().SupportsChannelCount(6))
+ {
+ channelCount = 6;
+ }
+ else
+ {
+ channelCount = 2;
+ }
+
+ ActiveDevice = new VirtualDevice("AudioTvOutput", channelCount, false);
+ }
/// <summary>
/// Get the associated <see cref="T:VirtualDeviceSession[]"/> from an AppletResourceId.