Export extra sample values in clHCA_getInfo

This commit is contained in:
bnnm 2018-08-29 20:48:35 +02:00
parent 411fa498bb
commit 9a2a2e4c2e
4 changed files with 18 additions and 8 deletions

View File

@ -49,8 +49,13 @@ typedef struct clHCA_stInfo {
unsigned int blockSize;
unsigned int blockCount;
unsigned int loopEnabled;
unsigned int loopStart;
unsigned int loopEnd;
unsigned int loopStartBlock;
unsigned int loopEndBlock;
unsigned int loopStartDelay; /* samples in block before loop starts */
unsigned int loopEndPadding; /* samples in block after loop ends */
unsigned int encoderDelay; /* samples appended to the beginning */
unsigned int encoderPadding; /* samples appended to the end */
unsigned int samplesPerBlock;
const char *comment;
} clHCA_stInfo;

View File

@ -785,8 +785,13 @@ int clHCA_getInfo(clHCA *hca, clHCA_stInfo *info){
info->blockSize=hca->_blockSize;
info->blockCount=hca->_blockCount;
info->loopEnabled=hca->_loopFlg;
info->loopStart=hca->_loopStart;
info->loopEnd=hca->_loopEnd;
info->loopStartBlock=hca->_loopStart;
info->loopEndBlock=hca->_loopEnd;
info->loopStartDelay=hca->_loop_r01;
info->loopEndPadding=hca->_loop_r02;
info->encoderDelay=hca->_fmt_r01;
info->encoderPadding=hca->_fmt_r02;
info->samplesPerBlock = 0x80 * 8;
info->comment=hca->_comm_comment;
return 0;
}

View File

@ -130,7 +130,7 @@ void loop_hca(VGMSTREAM *vgmstream) {
hca_codec_data *data = (hca_codec_data *)(vgmstream->codec_data);
if (!data) return;
data->curblock = data->info.loopStart;
data->curblock = data->info.loopStartBlock;
data->sample_ptr = clHCA_samplesPerBlock;
data->samples_discard = 0;
}

View File

@ -56,9 +56,9 @@ VGMSTREAM * init_vgmstream_hca(STREAMFILE *streamFile) {
vgmstream->meta_type = meta_HCA;
vgmstream->sample_rate = hca_data->info.samplingRate;
vgmstream->num_samples = hca_data->info.blockCount * clHCA_samplesPerBlock;
vgmstream->loop_start_sample = hca_data->info.loopStart * clHCA_samplesPerBlock;
vgmstream->loop_end_sample = hca_data->info.loopEnd * clHCA_samplesPerBlock;
vgmstream->num_samples = hca_data->info.blockCount * hca_data->info.samplesPerBlock;
vgmstream->loop_start_sample = hca_data->info.loopStartBlock * hca_data->info.samplesPerBlock;
vgmstream->loop_end_sample = hca_data->info.loopEndBlock * hca_data->info.samplesPerBlock;
vgmstream->coding_type = coding_CRI_HCA;
vgmstream->layout_type = layout_none;