aiffc.h 2.15 KB
#ifndef __aiffc__
#define __aiffc__

#define IFF_ID_FORM             'FORM'
#define IFF_ID_AIFC             'AIFC'
#define IFF_ID_AIFF             'AIFF'
#define IFF_ID_COMM             'COMM'
#define IFF_ID_SSND             'SSND'
#define IFF_ID_INST             'INST'
#define IFF_ID_APPL             'APPL'
#define IFF_ID_MARK             'MARK'

#define CODE_NAME               "VADPCMCODES"
#define LOOP_NAME               "VADPCMLOOPS"
#define VERSION                 1

#define NoLooping               0
#define ForwardLooping          1
#define ForwardBackwardLooping  2

typedef struct {
    unsigned long       ckID;
    long                ckSize;
} ChunkHeader;

typedef struct {
    unsigned long       ckID;
    long                ckSize;
    unsigned long       formType;
} Chunk;

typedef struct {
    short               numChannels;
    unsigned short      numFramesH;
    unsigned short      numFramesL;
    short               sampleSize;
    char	        sampleRate[10];
    unsigned short      compressionTypeH;        // Separated into HL to prevent alignment
    unsigned short      compressionTypeL;        /* note: string follows */
} CommonChunk;

typedef short MarkerID;

typedef struct {
    MarkerID            id;
    unsigned short      positionH;              // Separated into HL to prevent alignment
    unsigned short      positionL;              /* note: pstring follows */
} Marker;

typedef struct {
    short               playMode;
    MarkerID            beginLoop;
    MarkerID            endLoop;
} Loop;

typedef struct {
    char                baseNote;
    char                detune;
    char                lowNote;
    char                highNote;
    char                lowVelocity;
    char                highVelocity;
    short               gain;
    Loop                sustainLoop;
    Loop                releaseLoop;
} InstrumentChunk;

typedef struct {
    unsigned long       offset;
    unsigned long       blockSize;
} SoundDataChunk;

typedef struct {
    unsigned long   hi;
    unsigned long   lo;
} IEEE_DBL;

typedef struct {
    unsigned long   l1;
    unsigned long   l2;
    unsigned short  s1;
} SANE_EXT;


#endif // __aiffc__