Misc: Swap make_array() for size deduction
This commit is contained in:
@ -2,12 +2,12 @@
|
||||
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
|
||||
|
||||
#include "audio_stream.h"
|
||||
#include "host.h"
|
||||
|
||||
#include "common/align.h"
|
||||
#include "common/assert.h"
|
||||
#include "common/intrin.h"
|
||||
#include "common/log.h"
|
||||
#include "common/make_array.h"
|
||||
#include "common/timer.h"
|
||||
|
||||
#include "SoundTouch.h"
|
||||
@ -54,8 +54,10 @@ u32 AudioStream::GetMSForBufferSize(u32 sample_rate, u32 buffer_size)
|
||||
return (buffer_size * 1000u) / sample_rate;
|
||||
}
|
||||
|
||||
static constexpr const auto s_stretch_mode_names = make_array("None", "Resample", "TimeStretch");
|
||||
static constexpr const auto s_stretch_mode_display_names = make_array("None", "Resampling", "Time Stretching");
|
||||
static constexpr const std::array s_stretch_mode_names = {"None", "Resample", "TimeStretch"};
|
||||
static constexpr const std::array s_stretch_mode_display_names = {TRANSLATE_NOOP("AudioStream", "None"),
|
||||
TRANSLATE_NOOP("AudioStream", "Resampling"),
|
||||
TRANSLATE_NOOP("AudioStream", "Time Stretching")};
|
||||
|
||||
const char* AudioStream::GetStretchModeName(AudioStretchMode mode)
|
||||
{
|
||||
@ -65,7 +67,7 @@ const char* AudioStream::GetStretchModeName(AudioStretchMode mode)
|
||||
const char* AudioStream::GetStretchModeDisplayName(AudioStretchMode mode)
|
||||
{
|
||||
return (static_cast<u32>(mode) < s_stretch_mode_display_names.size()) ?
|
||||
s_stretch_mode_display_names[static_cast<u32>(mode)] :
|
||||
Host::TranslateToCString("AudioStream", s_stretch_mode_display_names[static_cast<u32>(mode)]) :
|
||||
"";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user