本文整理汇总了C++中sid_engine_t::calculate_samples方法的典型用法代码示例。如果您正苦于以下问题:C++ sid_engine_t::calculate_samples方法的具体用法?C++ sid_engine_t::calculate_samples怎么用?C++ sid_engine_t::calculate_samples使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sid_engine_t
的用法示例。
在下文中一共展示了sid_engine_t::calculate_samples方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sid_sound_machine_calculate_samples
int sid_sound_machine_calculate_samples(sound_t **psid, SWORD *pbuf, int nr, int soc, int scc, int *delta_t)
{
int i;
SWORD *tmp_buf1;
SWORD *tmp_buf2;
int tmp_nr = 0;
int tmp_delta_t = *delta_t;
if (soc == 1 && scc == 1) {
return sid_engine.calculate_samples(psid[0], pbuf, nr, 1, delta_t);
}
if (soc == 1 && scc == 2) {
tmp_buf1 = getbuf1(2 * nr);
tmp_nr = sid_engine.calculate_samples(psid[0], tmp_buf1, nr, 1, &tmp_delta_t);
tmp_nr = sid_engine.calculate_samples(psid[1], pbuf, nr, 1, delta_t);
for (i = 0; i < tmp_nr; i++) {
pbuf[i] = sound_audio_mix(pbuf[i], tmp_buf1[i]);
}
return tmp_nr;
}
if (soc == 1 && scc == 3) {
tmp_buf1 = getbuf1(2 * nr);
tmp_buf2 = getbuf2(2 * nr);
tmp_nr = sid_engine.calculate_samples(psid[0], tmp_buf1, nr, 1, &tmp_delta_t);
tmp_delta_t = *delta_t;
tmp_nr = sid_engine.calculate_samples(psid[2], tmp_buf2, nr, 1, &tmp_delta_t);
tmp_nr = sid_engine.calculate_samples(psid[1], pbuf, nr, 1, delta_t);
for (i = 0; i < tmp_nr; i++) {
pbuf[i] = sound_audio_mix(pbuf[i], tmp_buf1[i]);
pbuf[i] = sound_audio_mix(pbuf[i], tmp_buf2[i]);
}
return tmp_nr;
}
if (soc == 2 && scc == 1) {
tmp_nr = sid_engine.calculate_samples(psid[0], pbuf, nr, 2, delta_t);
for (i = 0; i < tmp_nr; i++) {
pbuf[(i * 2) + 1] = pbuf[i * 2];
}
return tmp_nr;
}
if (soc == 2 && scc == 2) {
tmp_nr = sid_engine.calculate_samples(psid[0], pbuf, nr, 2, &tmp_delta_t);
tmp_nr = sid_engine.calculate_samples(psid[1], pbuf + 1, nr, 2, delta_t);
return tmp_nr;
}
if (soc == 2 && scc == 3) {
tmp_buf1 = getbuf1(2 * nr);
tmp_nr = sid_engine.calculate_samples(psid[2], tmp_buf1, nr, 1, &tmp_delta_t);
tmp_delta_t = *delta_t;
tmp_nr = sid_engine.calculate_samples(psid[0], pbuf, nr, 2, &tmp_delta_t);
tmp_nr = sid_engine.calculate_samples(psid[1], pbuf + 1, nr, 2, delta_t);
for (i = 0; i < tmp_nr; i++) {
pbuf[i * 2] = sound_audio_mix(pbuf[i * 2], tmp_buf1[i]);
pbuf[(i * 2) + 1] = sound_audio_mix(pbuf[(i * 2) + 1], tmp_buf1[i]);
}
}
return tmp_nr;
}