Explorar el Código

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

read 'procSmpCnt' blocks until the end-of-file is reached.
master
Kevin Larke hace 10 años
padre
commit
b05255c443
Se han modificado 2 ficheros con 3 adiciones y 2 borrados
  1. 1
    1
      cmProc.c
  2. 2
    1
      cmProc.h

+ 1
- 1
cmProc.c Ver fichero

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

+ 2
- 1
cmProc.h Ver fichero

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

Loading…
Cancelar
Guardar