3 Copyright (C) 2000, Michael Pruett <michael@68k.org>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with this library; if not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307 USA.
24 This file defines the internal _Unit and _CompressionUnit
25 structures for the Audio File Library.
35 #include "audiofile.h"
36 #include "afinternal.h"
40 int fileFormat
; /* AF_FILEFMT_... */
41 char *name
; /* a 2-3 word name of the file format */
42 char *description
; /* a more descriptive name for the format */
43 char *label
; /* a 4-character label for the format */
44 bool implemented
; /* if implemented */
46 int (*getversion
) (AFfilehandle handle
);
47 AFfilesetup (*completesetup
) (AFfilesetup setup
);
51 bool (*recognize
) (AFvirtualfile
*fh
);
52 status (*init
) (AFfilesetup
, AFfilehandle
);
57 status (*init
) (AFfilesetup
, AFfilehandle
);
58 bool (*instparamvalid
) (AFfilehandle
, AUpvlist
, int);
59 status (*update
) (AFfilehandle
);
62 int defaultSampleFormat
;
63 int defaultSampleWidth
;
65 int compressionTypeCount
;
66 int *compressionTypes
;
71 int loopPerInstrumentCount
;
73 int instrumentParameterCount
;
74 _InstParamInfo
*instrumentParameters
;
77 typedef struct _CompressionUnit
79 int compressionID
; /* AF_COMPRESSION_... */
81 char *label
; /* 4-character (approximately) label */
82 char *shortname
; /* short name in English */
83 char *name
; /* long name in English */
84 double squishFactor
; /* compression ratio */
85 int nativeSampleFormat
; /* AF_SAMPFMT_... */
86 int nativeSampleWidth
; /* sample width in bits */
87 bool needsRebuffer
; /* if there are chunk boundary requirements */
88 bool multiple_of
; /* can accept any multiple of chunksize */
89 bool (*fmtok
) (_AudioFormat
*format
);
91 _AFmoduleinst (*initcompress
) (_Track
*track
, AFvirtualfile
*fh
,
92 bool seekok
, bool headerless
, AFframecount
*chunkframes
);
93 _AFmoduleinst (*initdecompress
) (_Track
*track
, AFvirtualfile
*fh
,
94 bool seekok
, bool headerless
, AFframecount
*chunkframes
);
97 #define _AF_NUM_UNITS 15
98 #define _AF_NUM_COMPRESSION 5