home *** CD-ROM | disk | FTP | other *** search
/ Openstep 4.2 (Developer) / Openstep Developer 4.2.iso / NextLibrary / Frameworks / NEXTIME.framework / Versions / A / Headers / NTSampleFIFO.h < prev    next >
Encoding:
Text File  |  1995-08-30  |  1.3 KB  |  61 lines

  1. /*
  2.  *  NTSampleFIFO.h
  3.  *     Copyright 1993, NeXT Computer, Inc.
  4.  *    
  5.  *
  6.  *
  7.  *    23 Nov 1993 mpaque Created.
  8.  */
  9. #import <Foundation/NSObject.h>
  10. #import "NTSampleBuffer.h"
  11. #import "NTSampleProcessor.h"
  12.  
  13. @class NSLock;
  14.  
  15. @interface NTSampleFIFO: NSObject  <NTSampleConsumer>
  16. {
  17. @private
  18.     id <NTSampleBuffer> *    fifo;
  19.     int            head;
  20.     int            tail;
  21.     int            capacity;
  22.     
  23.     id <NTSampleBuffer>    pushBack;
  24.  
  25.     NSLock *        lock;        // (optional) lock
  26.     double            FIFODepth;    // in seconds
  27.     double            headTime;    // in seconds
  28.     double            tailTime;    // in seconds
  29.     
  30.     BOOL            atEndOfData;    // FIFO source is exhausted
  31. }
  32.  
  33. + (void)initialize;
  34. + (void)useLockForFIFOAccess:(BOOL)useLock;
  35.  
  36. - init;
  37. - (void)dealloc;
  38.  
  39. /* Control API */
  40. - (void)setFIFODepth:(double)seconds;
  41. - (double)FIFODepth;
  42. - (void)reset;
  43.  
  44. /* Write to FIFO API */
  45. - (void)writeSample:(id <NTSampleBuffer>)sample;
  46. - (void)markEndOfData;
  47. - (double)timeTilNextAppend;            // Negative if FIFO is below
  48.                         // set depth in seconds.
  49.  
  50. /* Read from FIFO API */
  51. - (id <NTSampleBuffer>)nextSample;        // Returns nil if FIFO is empty
  52. - (void) requeueSample:(id <NTSampleBuffer>)sample; // Push a sample back onto
  53.                         // the FIFO.  One level of
  54.                         // pushback is supported.
  55. - (double)nextSampleTime;            // Returns -1.0 if empty
  56. - (BOOL)atEndOfData;                // Returns YES if empty
  57.                         // and writer has issued
  58.                         // markEndOfData.
  59.  
  60. @end
  61.