forked from suyu/suyu
16730c4c43
Audio devices use the supplied revision information in order to determine if USB audio output is able to be supported. In this case, we can only really handle using this revision information in ListAudioDeviceName(), where it checks if USB audio output is supported before supplying it as a device name. A few other scenarios exist where the revision info is checked, such as: - Early exiting from SetAudioDeviceOutputVolume if USB audio is attempted to be set when that device is unsupported. - Early exiting and returning 0.0f in GetAudioDeviceOutputVolume when USB output volume is queried and it's an unsupported device. - Falling back to AHUB headphones in GetActiveAudioDeviceName when the device type is USB output, but is unsupported based off the revision info. In order for these changes to also be implemented, a few other changes to the interface need to be made. Given we now properly handle everything about ListAudioDeviceName(), we no longer need to describe it as a stubbed function.
48 lines
1.3 KiB
C++
48 lines
1.3 KiB
C++
// Copyright 2018 yuzu emulator team
|
|
// Licensed under GPLv2 or any later version
|
|
// Refer to the license.txt file included.
|
|
|
|
#pragma once
|
|
|
|
#include "core/hle/service/service.h"
|
|
|
|
namespace Core {
|
|
class System;
|
|
}
|
|
|
|
namespace Kernel {
|
|
class HLERequestContext;
|
|
}
|
|
|
|
namespace Service::Audio {
|
|
|
|
class AudRenU final : public ServiceFramework<AudRenU> {
|
|
public:
|
|
explicit AudRenU(Core::System& system_);
|
|
~AudRenU() override;
|
|
|
|
private:
|
|
void OpenAudioRenderer(Kernel::HLERequestContext& ctx);
|
|
void GetAudioRendererWorkBufferSize(Kernel::HLERequestContext& ctx);
|
|
void GetAudioDeviceService(Kernel::HLERequestContext& ctx);
|
|
void OpenAudioRendererAuto(Kernel::HLERequestContext& ctx);
|
|
void GetAudioDeviceServiceWithRevisionInfo(Kernel::HLERequestContext& ctx);
|
|
|
|
void OpenAudioRendererImpl(Kernel::HLERequestContext& ctx);
|
|
|
|
std::size_t audren_instance_count = 0;
|
|
Core::System& system;
|
|
};
|
|
|
|
// Describes a particular audio feature that may be supported in a particular revision.
|
|
enum class AudioFeatures : u32 {
|
|
AudioUSBDeviceOutput,
|
|
Splitter,
|
|
PerformanceMetricsVersion2,
|
|
VariadicCommandBuffer,
|
|
};
|
|
|
|
// Tests if a particular audio feature is supported with a given audio revision.
|
|
bool IsFeatureSupported(AudioFeatures feature, u32_le revision);
|
|
|
|
} // namespace Service::Audio
|