audio_device: Make AudioDeviceName constructor constexpr

These are used as read-only arrays, so we can make the data read-only
and available at compile-time.

Now constructing an AudioDevice no longer needs to initialize some
tables
This commit is contained in:
Lioncash 2022-09-14 03:32:14 -04:00
parent 1be456db83
commit 1c7dae966d
5 changed files with 30 additions and 17 deletions

View file

@ -246,9 +246,8 @@ void AudOutU::ListAudioOuts(Kernel::HLERequestContext& ctx) {
const auto write_count =
static_cast<u32>(ctx.GetWriteBufferSize() / sizeof(AudioDevice::AudioDeviceName));
std::vector<AudioDevice::AudioDeviceName> device_names{};
std::string print_names{};
if (write_count > 0) {
device_names.push_back(AudioDevice::AudioDeviceName("DeviceOut"));
device_names.emplace_back("DeviceOut");
LOG_DEBUG(Service_Audio, "called. \nName=DeviceOut");
} else {
LOG_DEBUG(Service_Audio, "called. Empty buffer passed in.");