Update VGMStream plugin with new API changes a bit, and now force auto downmixing to 6ch
This commit is contained in:
parent
bb38853ee9
commit
4eb7a3eebf
2 changed files with 21 additions and 0 deletions
|
@ -28,6 +28,7 @@
|
||||||
@interface VGMDecoder : NSObject <CogDecoder> {
|
@interface VGMDecoder : NSObject <CogDecoder> {
|
||||||
VGMSTREAM *stream;
|
VGMSTREAM *stream;
|
||||||
|
|
||||||
|
BOOL playForever;
|
||||||
int sampleRate;
|
int sampleRate;
|
||||||
int channels;
|
int channels;
|
||||||
int bitrate;
|
int bitrate;
|
||||||
|
|
|
@ -198,12 +198,27 @@
|
||||||
if ( !stream )
|
if ( !stream )
|
||||||
return NO;
|
return NO;
|
||||||
|
|
||||||
|
vgmstream_mixing_autodownmix(stream, 6);
|
||||||
|
|
||||||
|
playForever = IsRepeatOneSet();
|
||||||
|
|
||||||
sampleRate = stream->sample_rate;
|
sampleRate = stream->sample_rate;
|
||||||
channels = stream->channels;
|
channels = stream->channels;
|
||||||
totalFrames = get_vgmstream_play_samples( 2.0, 10.0, 10.0, stream );
|
totalFrames = get_vgmstream_play_samples( 2.0, 10.0, 10.0, stream );
|
||||||
framesFade = stream->loop_flag ? sampleRate * 10 : 0;
|
framesFade = stream->loop_flag ? sampleRate * 10 : 0;
|
||||||
framesLength = totalFrames - framesFade;
|
framesLength = totalFrames - framesFade;
|
||||||
|
|
||||||
|
vgmstream_cfg_t vcfg = {0};
|
||||||
|
|
||||||
|
vcfg.allow_play_forever = 1;
|
||||||
|
vcfg.play_forever = playForever;
|
||||||
|
vcfg.loop_count = 2;
|
||||||
|
vcfg.fade_time = 10;
|
||||||
|
vcfg.fade_delay = 0;
|
||||||
|
vcfg.ignore_loop = 0;
|
||||||
|
|
||||||
|
vgmstream_apply_config(stream, &vcfg);
|
||||||
|
|
||||||
framesRead = 0;
|
framesRead = 0;
|
||||||
|
|
||||||
bitrate = get_vgmstream_average_bitrate(stream);
|
bitrate = get_vgmstream_average_bitrate(stream);
|
||||||
|
@ -232,6 +247,11 @@
|
||||||
{
|
{
|
||||||
BOOL repeatone = IsRepeatOneSet();
|
BOOL repeatone = IsRepeatOneSet();
|
||||||
|
|
||||||
|
if (repeatone != playForever) {
|
||||||
|
playForever = repeatone;
|
||||||
|
vgmstream_set_play_forever(stream, repeatone);
|
||||||
|
}
|
||||||
|
|
||||||
BOOL loopokay = repeatone && stream->loop_flag;
|
BOOL loopokay = repeatone && stream->loop_flag;
|
||||||
|
|
||||||
if (!loopokay) {
|
if (!loopokay) {
|
||||||
|
|
Loading…
Reference in a new issue