Commit 847897e3 authored by David Reid's avatar David Reid

Add mal_channel_router_config_init().

parent 81ae390c
......@@ -1860,6 +1860,8 @@ mal_result mal_channel_router_init_deinterleaved(const mal_channel_router_config
// Reads data from the channel router as deinterleaved channels.
mal_uint64 mal_channel_router_read_frames_deinterleaved(mal_channel_router* pRouter, mal_uint64 frameCount, void** ppSamplesOut);
// Helper for initializing a channel router config.
mal_channel_router_config mal_channel_router_config_init(mal_uint32 channelsIn, mal_channel channelMapIn[MAL_MAX_CHANNELS], mal_uint32 channelsOut, mal_channel channelMapOut[MAL_MAX_CHANNELS], mal_channel_mix_mode mixingMode);
///////////////////////////////////////////////////////////////////////////////
......@@ -17776,6 +17778,26 @@ mal_uint64 mal_channel_router_read_frames_deinterleaved(mal_channel_router* pRou
return totalFramesRead;
}
mal_channel_router_config mal_channel_router_config_init(mal_uint32 channelsIn, mal_channel channelMapIn[MAL_MAX_CHANNELS], mal_uint32 channelsOut, mal_channel channelMapOut[MAL_MAX_CHANNELS], mal_channel_mix_mode mixingMode)
{
mal_channel_router_config config;
mal_zero_object(&config);
config.channelsIn = channelsIn;
for (mal_uint32 iChannel = 0; iChannel < channelsIn; ++iChannel) {
config.channelMapIn[iChannel] = channelMapIn[iChannel];
}
config.channelsOut = channelsOut;
for (mal_uint32 iChannel = 0; iChannel < channelsOut; ++iChannel) {
config.channelMapOut[iChannel] = channelMapOut[iChannel];
}
config.mixingMode = mixingMode;
return config;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
......
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