home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 199.lha / GimmeLib / sound.h < prev    next >
C/C++ Source or Header  |  1988-12-27  |  2KB  |  54 lines

  1. #ifndef GIMMELIB_SOUND_H
  2. #define GIMMELIB_SOUND_H
  3.  
  4. #ifdef I_AM_SOUND
  5. #define Mk(a,b,c,d)     (((ULONG)(a)<<24) | ((ULONG)(b)<<16) \
  6.                 | ((ULONG)(c)<<8) | (ULONG)(d))
  7. #define EVEN(p)         ((p+1) & ~1)
  8.  
  9. #define ID_FORM     Mk('F', 'O', 'R', 'M')
  10. #define ID_8SVX     Mk('8', 'S', 'V', 'X')
  11. #define ID_VHDR     Mk('V', 'H', 'D', 'R')
  12. #define ID_NAME     Mk('N', 'A', 'M', 'E')
  13. #define ID_COPY     Mk('(', 'c', ')', ' ')
  14. #define ID_AUTH     Mk('A', 'U', 'T', 'H')
  15. #define ID_ANNO     Mk('A', 'N', 'N', 'O')
  16. #define ID_ATAK     Mk('A', 'T', 'A', 'K')
  17. #define ID_RLSE     Mk('R', 'L', 'S', 'E')
  18. #define ID_BODY     Mk('B', 'O', 'D', 'Y')
  19. #endif I_AM_SOUND
  20.  
  21.  
  22. typedef LONG Fixed;        /* fixed point value 16bits.16bits */
  23.  
  24. #define Unity 0x10000L        /* Unity = Fixed 1.0 = maximum volume */
  25.  
  26. #define sCmpNone    0   /* not compressed */
  27. #define sCmpFibDelta    1   /* Fibonacci delta encoding */
  28.  
  29. typedef struct _gim_v8h {
  30.     ULONG oneShotHiSamples; /* # samples in the high octave 1-shot part */
  31.     LONG repeatHiSamples;   /* # samples in the high octave repeat part */
  32.     LONG samplesPerHiCycle; /* # samples/cycle in high octave, else 0 */
  33.     UWORD samplesPerSec;    /* data sampling rate */
  34.     UBYTE ctOctave;        /* # octaves of waveform */
  35.     UBYTE sCompression;     /* data compression technique used */
  36.     Fixed volume;        /* playback volume from 0 to Unity */
  37. } Voice8Header;
  38.  
  39. typedef struct {
  40.     UWORD duration;        /* segment duration in milliseconds, >0 */
  41.     Fixed dest;         /* destination volume factor */
  42. } EGPoint;
  43.  
  44.  
  45. typedef struct _gim_snd {
  46.     Voice8Header    vh;     /* info for this sound */
  47.     BYTE        *body;    /* pointer to body data */
  48.     LONG        bodylen;    /* actual body length from IFF file */
  49.     void        *memhead;    /* memory-chain allocated for this sound */
  50.     struct _gim_snd *next;    /* next sound (for future use) */
  51. } SOUND;
  52.  
  53. #endif !GIMMELIB_SOUND_H
  54.