home *** CD-ROM | disk | FTP | other *** search
/ Dave Lowe: S5 Stereo Sound Sampler / Lowe_S5StereoSoundSampler.adf / Progs / C / s5.h < prev    next >
Encoding:
C/C++ Source or Header  |  1986-12-10  |  3.3 KB  |  92 lines

  1. /****************************************************************************
  2. *****                                                                    *****
  3. *****                  S5.H  Header for S5                               *****
  4. *****                                                                    *****
  5. *****      \amiga\paul\s5.h  20-August-1987  18:00  PAR                  *****
  6. *****                                                                    *****
  7. ******************************************************************************
  8.  
  9.  
  10.  
  11. */
  12.  
  13.  
  14. #define S5NAME "s5.library"
  15. #define S5VERSION    1  /* library version */
  16. #define S5REVISION   1  /* library revision */
  17.  
  18.  
  19. #define  ENVMAX    32000 /* maximum value for an envelop point */
  20. #define  DEFAULT_INTERVALS 100 /* default number of segments in an envelope */
  21.  
  22.  
  23. struct EnvPnt
  24.     {
  25.     struct EnvPnt *Next;  /* continue to next point. NB x(n)>=x(n-1) */
  26.     USHORT    EnvX,EnvY;  /* actual values. ranging from 0000 to ENVMAX */
  27.     };
  28.  
  29.  
  30. struct Envelope
  31.     {
  32.     struct EnvPnt *First; /* 1st in a chain */
  33.     int    EnvPnts;       /* number of points in a chain */
  34.     int    Intervals;     /* how many places to fragment */
  35.     int    Enable;        /* switched on or off */
  36.     USHORT *Table;        /* data table */
  37.     };
  38.  
  39.  
  40. struct   Frag
  41.     {
  42.     BOOL  Fr_playenable;
  43.     BOOL  Fr_sampenable;
  44.     BOOL  Fr_playing;          /* whether or not a fragment is playing */
  45.     BOOL  Fr_fastmem;          /* whether chip (0) or fast (1) memory */
  46.     SHORT Fr_side;             /* prefered side, left(0) or right(1) */
  47.     SHORT Fr_volume;
  48.     int   Fr_playticks;        /* hardware tick counter */
  49.     int   Fr_playHz;           /* desired play frequency */
  50.     int   Fr_sampHz;           /* desired sample frequency */
  51.     int   Fr_sampticks_stereo; /* software timer ticks */
  52.     int   Fr_sampticks_mono;   /* software timer ticks */
  53.     long  Fr_cursor;       
  54.     long  Fr_start;            /* start of a block */
  55.     long  Fr_finish;           /* end of a block */
  56.     long  Fr_viewlo;           /* 1st element of displayed graph */
  57.     long  Fr_viewhi;           /* last+1 element of displayed graph */
  58.     int   Fr_repeats;
  59.     APTR  Fr_buffer;           /* OVERALL BUFFER */
  60.     long  Fr_buffsize;
  61.     char  *Fr_name;            /* text area to define a channel */
  62.     struct Envelope *Fr_VolumeEnv;
  63.     struct Envelope *Fr_PeriodEnv;
  64.     APTR  Fr_IOA;              /* IOAudio structure */
  65.     APTR  Fr_res1;             /* reserved for expansion */
  66.     APTR  Fr_res2;
  67.     APTR  Fr_res3;
  68.     };
  69.  
  70.  
  71. #define  FRAG_CHIP      0
  72. #define  FRAG_FAST      1
  73.  
  74.  
  75. /* standard errors */
  76.  
  77. #define  E_OK      (0)   /* no error */
  78. #define  E_MEM     (-1)  /* memory error */
  79. #define  E_PORT    (-2)  /* port error */
  80. #define  E_DEV     (-3)  /* device error */
  81. #define  E_OPEN    (-4)  /* file open error */
  82. #define  E_CLOSE   (-5)  /* file close error */
  83. #define  E_READ    (-6)  /* file read error */
  84. #define  E_WRITE   (-7)  /* file write error */
  85. #define  E_FORMAT  (-8)  /* unacceptable value in read data */
  86. #define  E_OKNULL  (-9)  /* Not a serious error - operation had no effect */
  87.  
  88. /**************************************************************************
  89. ******                    END OF S5.H                             *********
  90. **************************************************************************/
  91.  
  92.