Move some mixing code

This commit is contained in:
bnnm 2019-03-21 22:26:32 +01:00
parent 1fd320bfcd
commit e53b03c43e
2 changed files with 21 additions and 28 deletions

View File

@ -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

View File

@ -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;
}