home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / soundkit / NXPlayStream.h next >
Text File  |  1992-01-30  |  2KB  |  80 lines

  1. /*
  2.  * NXPlayStream.h
  3.  *
  4.  * Play sound data.
  5.  *
  6.  * Copyright (c) 1991, NeXT Computer, Inc.  All rights reserved. 
  7.  */
  8.  
  9. #import "NXSoundStream.h"
  10.  
  11. @interface NXPlayStream:NXSoundStream
  12. {
  13.     float        _leftGain;
  14.     float        _rightGain;
  15.     BOOL        _isDetectingPeaks;
  16.     unsigned int    _peakHistory;
  17.     int            _reserved1;
  18. }
  19.  
  20. /*
  21.  * Overridden from superclass
  22.  */
  23. - initOnDevice:anObject;
  24. - (NXSoundDeviceError)activate;
  25.  
  26. /*
  27.  * Get and set stream gain.
  28.  * Default 1.0.
  29.  */
  30. - getGainLeft:(float *)leftAmp right:(float *)rightAmp;
  31. - (NXSoundDeviceError)setGainLeft:(float)leftAmp right:(float)rightAmp;
  32.  
  33. /*
  34.  * Peak detection.
  35.  * Default is NO peak detection.
  36.  * Default peak history is one device buffer.
  37.  */
  38. - (BOOL)isDetectingPeaks;
  39. - (NXSoundDeviceError)setDetectPeaks:(BOOL)flag;
  40. - (unsigned int)peakHistory;
  41. - (NXSoundDeviceError)setPeakHistory:(unsigned int)bufferCount;
  42. - (NXSoundDeviceError)getPeakLeft:(float *)leftAmp
  43.                             right:(float *)rightAmp;
  44.  
  45. /*
  46.  * Enqueue playback buffer.
  47.  * Negative tags are reserved.
  48.  * Channels must be 1 or 2.
  49.  * Sampling rate must be 44100.0 or 22050.0.
  50.  * Stream gain is scaled by bufferGain to get final
  51.  * amplitude.
  52.  */
  53. - (NXSoundDeviceError)playBuffer:(void *)data
  54.                             size:(unsigned int)bytes
  55.                              tag:(int)anInt
  56.                     channelCount:(unsigned int)channels
  57.                     samplingRate:(float)rate
  58.                   bufferGainLeft:(float)leftAmp right:(float)rightAmp
  59.                     lowWaterMark:(unsigned int)lowWater
  60.                    highWaterMark:(unsigned int)highWater;
  61.  
  62. /*
  63.  * Play with unity bufferGain and default water marks.  LowWaterMark
  64.  * defaults to (512*1024) and highWaterMark defaults to (768*1024).
  65.  */
  66. - (NXSoundDeviceError)playBuffer:(void *)data
  67.                             size:(unsigned int)bytes
  68.                              tag:(int)anInt
  69.                     channelCount:(unsigned int)channels
  70.                     samplingRate:(float)rate;
  71.  
  72. @end
  73.  
  74. /*
  75.  * Delegate interface.
  76.  */
  77. @interface Object(NXPlayStreamDelegate)
  78. - soundS4Q$mDidUnderrun:sender;
  79. @end
  80.