reference player prototype

poor performance
no playback sync yet
This commit is contained in:
tildearrow 2025-10-27 05:15:47 -05:00
parent 9bbfdc6f43
commit f77aafb44d
13 changed files with 336 additions and 15 deletions

View file

@ -3237,6 +3237,19 @@ void DivEngine::nextBuf(float** in, float** out, int inChans, int outChans, unsi
renderPool->wait();
}
// process file player
// resize file player audio buffer if necessary
if (filePlayerBufLen<size) {
for (int i=0; i<DIV_MAX_OUTPUTS; i++) {
if (filePlayerBuf[i]!=NULL) delete[] filePlayerBuf[i];
filePlayerBuf[i]=new float[size];
}
filePlayerBufLen=size;
}
if (curFilePlayer!=NULL) {
curFilePlayer->mix(filePlayerBuf,outChans,size);
}
// process metronome
// resize the metronome's audio buffer if necessary
if (metroBufLen<size || metroBuf==NULL) {
@ -3317,6 +3330,11 @@ void DivEngine::nextBuf(float** in, float** out, int inChans, int outChans, unsi
out[destSubPort][j]+=((float)disCont[srcPortSet].bbOut[srcSubPort][j]/32768.0)*vol;
}
}
} else if (srcPortSet==0xffc) {
// file player
for (size_t j=0; j<size; j++) {
out[destSubPort][j]+=filePlayerBuf[srcSubPort][j];
}
} else if (srcPortSet==0xffd) {
// sample preview
for (size_t j=0; j<size; j++) {