home *** CD-ROM | disk | FTP | other *** search
/ PC Musician 2000 / PC_Musician_2000.iso / PCMUSIC / NOTATION / SILENCE / RAWWVIN.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-18  |  1.2 KB  |  48 lines

  1. /*******************************************/
  2. /*  NonInterpolating One-Shot Raw Sound-   */
  3. /*  file Class, by Perry R. Cook, 1995-96  */ 
  4. /*  This Object can open a raw 16bit data  */
  5. /*  (signed integers) file, and play back  */
  6. /*  the data once, with no interpolation   */
  7. /*  on playback.  Once finished, it closes */        
  8. /*  the file, the file is reopened with    */
  9. /*  the reset() method.                    */
  10. /*  This is useful for small memory model, */  
  11. /*  applications, or for streaming from    */
  12. /*  disk (and generally non real-time      */
  13. /*  applications).                         */
  14. /*******************************************/
  15.  
  16. #if !defined(__RawWvIn_h)
  17. #define __RawWvIn_h
  18.  
  19. #include "Object.h"
  20.  
  21. class RawWvIn : public Object
  22. {
  23.   protected:  
  24.     long length;
  25.     long lastTime;
  26.     int finished;
  27.     short data;
  28.     char fileNm[128];
  29.     FILE *myFile;
  30.     MY_FLOAT rate;
  31.     MY_FLOAT time;
  32.     MY_FLOAT gain;
  33.     MY_FLOAT lastOutput;
  34.   public:
  35.     RawWvIn(char *fileName);
  36.     ~RawWvIn();
  37.     void reset();
  38.     void normalize();
  39.     void normalize(MY_FLOAT newPeak);
  40.     void setRate(MY_FLOAT aRate);
  41.     void finish();
  42.     MY_FLOAT tick();
  43.     int informTick();
  44.     MY_FLOAT lastOut();
  45. };
  46.  
  47. #endif
  48.