cmProc.h/c: cmAudioFileRd now recognizes 'endSmpIdx' == 0 as an indication to

read 'procSmpCnt' blocks until the end-of-file is reached.
This commit is contained in:
Kevin Larke 2014-08-10 13:00:17 -07:00
parent c79a1d592a
commit b05255c443
2 changed files with 3 additions and 2 deletions

View File

@ -124,7 +124,7 @@ cmRC_t cmAudioFileRdOpen( cmAudioFileRd* p, unsigned procSmpCnt,
p->lastReadFrmCnt = 0;
p->eofFl = false;
p->begFrmIdx = begFrmIdx;
p->endFrmIdx = endFrmIdx;
p->endFrmIdx = endFrmIdx==0 ? p->info.frameCnt : endFrmIdx;
p->curFrmIdx = p->begFrmIdx;
if( p->begFrmIdx > 0 )

View File

@ -26,7 +26,8 @@ extern "C" {
/// set p to NULL to dynamically allocate the object
/// fn and chIdx are optional - set fn to NULL to allocate the reader without opening a file.
/// If fn is valid then chIdx must also be valid.
/// Set 'endSmpIdx' to cmInvalidIdx to not limit the range of samples returned.
/// Set 'endSmpIdx' to cmInvalidIdx to return the entire signal in cmAudioFileRdRead().
/// Set 'endSmpIdx' to 0 to return all samples between 0 and the end of the file.
cmAudioFileRd* cmAudioFileRdAlloc( cmCtx* c, cmAudioFileRd* p, unsigned procSmpCnt, const char* fn, unsigned chIdx, unsigned begSmpIdx, unsigned endSmpIdx );
cmRC_t cmAudioFileRdFree( cmAudioFileRd** p );
cmRC_t cmAudioFileRdOpen( cmAudioFileRd* p, unsigned procSmpCnt, const cmChar_t* fn, unsigned chIdx, unsigned begSmpIdx, unsigned endSmpIdx );