From e53b03c43e5383f9d88bbba698a0f8acf0e793a2 Mon Sep 17 00:00:00 2001 From: bnnm Date: Thu, 21 Mar 2019 22:26:32 +0100 Subject: [PATCH] Move some mixing code --- src/mixing.c | 28 ---------------------------- src/plugins.c | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 28 deletions(-) diff --git a/src/mixing.c b/src/mixing.c index d168d7b7..579d714b 100644 --- a/src/mixing.c +++ b/src/mixing.c @@ -937,32 +937,4 @@ fail: return; } -void vgmstream_mixing_enable(VGMSTREAM* vgmstream, int32_t max_sample_count, int *input_channels, int *output_channels) { - mixing_setup(vgmstream, max_sample_count); - mixing_info(vgmstream, input_channels, output_channels); -} - -/* ********************************************************* */ - -void vgmstream_mixing_autodownmix(VGMSTREAM *vgmstream, int max_channels) { - mixing_data *data = vgmstream->mixing_data; - - if (!data) goto fail; - - if (max_channels <= 0) - return; - - /* guess mixing the best we can */ - - //todo: could use standard downmixing for known max_channels <> vgmstream->channels combos: - // https://www.audiokinetic.com/library/edge/?source=Help&id=downmix_tables#tbl_mono - // https://www.audiokinetic.com/library/edge/?source=Help&id=standard_configurations - - mixing_macro_layer(vgmstream, max_channels, 0, 0); - - return; -fail: - return; -} - #endif diff --git a/src/plugins.c b/src/plugins.c index 3c8370ff..b0ead332 100644 --- a/src/plugins.c +++ b/src/plugins.c @@ -1,5 +1,6 @@ #include "vgmstream.h" #include "plugins.h" +#include "mixing.h" #define VGMSTREAM_TAGS_LINE_MAX 2048 @@ -223,3 +224,23 @@ void vgmstream_tags_reset(VGMSTREAM_TAGS* tags, const char* target_filename) { strcpy(tags->targetname, target_filename); } } + + +void vgmstream_mixing_enable(VGMSTREAM* vgmstream, int32_t max_sample_count, int *input_channels, int *output_channels) { + mixing_setup(vgmstream, max_sample_count); + mixing_info(vgmstream, input_channels, output_channels); +} + +void vgmstream_mixing_autodownmix(VGMSTREAM *vgmstream, int max_channels) { + if (max_channels <= 0) + return; + + /* guess mixing the best we can */ + //todo: could use standard downmixing for known max_channels <> vgmstream->channels combos: + // https://www.audiokinetic.com/library/edge/?source=Help&id=downmix_tables#tbl_mono + // https://www.audiokinetic.com/library/edge/?source=Help&id=standard_configurations + + mixing_macro_layer(vgmstream, max_channels, 0, 0); + + return; +}