Commit 132af6ff authored by David Reid's avatar David Reid

Add APIs for getting friendly names of backends and formats.

parent a0776ec3
...@@ -1435,6 +1435,12 @@ void mal_mutex_unlock(mal_mutex* pMutex); ...@@ -1435,6 +1435,12 @@ void mal_mutex_unlock(mal_mutex* pMutex);
// //
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Retrieves a friendly name for a backend.
const char* mal_get_backend_name(mal_backend backend);
// Retrieves a friendly name for a format.
const char* mal_get_format_name(mal_format format);
// Blends two frames in floating point format. // Blends two frames in floating point format.
void mal_blend_f32(float* pOut, float* pInA, float* pInB, float factor, mal_uint32 channels); void mal_blend_f32(float* pOut, float* pInA, float* pInB, float factor, mal_uint32 channels);
...@@ -10287,6 +10293,39 @@ mal_uint32 mal_convert_frames(void* pOut, mal_format formatOut, mal_uint32 chann ...@@ -10287,6 +10293,39 @@ mal_uint32 mal_convert_frames(void* pOut, mal_format formatOut, mal_uint32 chann
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const char* mal_get_backend_name(mal_backend backend)
{
switch (backend)
{
case mal_backend_null: return "Null";
case mal_backend_wasapi: return "WASAPI";
case mal_backend_dsound: return "DirectSound";
case mal_backend_winmm: return "WinMM";
case mal_backend_alsa: return "ALSA";
//case mal_backend_pulse: return "PulseAudio";
//case mal_backend_jack: return "JACK";
//case mal_backend_coreaudio: return "Core Audio";
case mal_backend_oss: return "OSS";
case mal_backend_opensl: return "OpenSL|ES";
case mal_backend_openal: return "OpenAL";
default: return "Unknown";
}
}
const char* mal_get_format_name(mal_format format)
{
switch (format)
{
case mal_format_unknown: return "Unknown";
case mal_format_u8: return "8-bit Unsigned Integer";
case mal_format_s16: return "16-bit Signed Integer";
case mal_format_s24: return "24-bit Signed Integer (Tightly Packed)";
case mal_format_s32: return "32-bit Signed Integer";
case mal_format_f32: return "32-bit IEEE Floating Point";
default: return "Invalid";
}
}
void mal_blend_f32(float* pOut, float* pInA, float* pInB, float factor, mal_uint32 channels) void mal_blend_f32(float* pOut, float* pInA, float* pInB, float factor, mal_uint32 channels)
{ {
for (mal_uint32 i = 0; i < channels; ++i) { for (mal_uint32 i = 0; i < channels; ++i) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment