source: trunk/third/audiofile/libaudiofile/units.h @ 18227

Revision 18227, 2.8 KB checked in by ghudson, 22 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r18226, which included commits to RCS files with non-trunk default branches.
Line 
1/*
2        Audio File Library
3        Copyright (C) 2000, Michael Pruett <michael@68k.org>
4
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.
9
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.
14
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.
19*/
20
21/*
22        units.h
23
24        This file defines the internal _Unit and _CompressionUnit
25        structures for the Audio File Library.
26*/
27
28#ifndef UNIT_H
29#define UNIT_H
30
31#ifdef HAVE_CONFIG_H
32#include <config.h>
33#endif
34
35#include "audiofile.h"
36#include "afinternal.h"
37
38typedef struct _Unit
39{
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 */
45
46        int (*getversion) (AFfilehandle handle);
47        AFfilesetup (*completesetup) (AFfilesetup setup);
48
49        struct
50        {
51                bool (*recognize) (AFvirtualfile *fh);
52                status (*init) (AFfilesetup, AFfilehandle);
53        } read;
54
55        struct
56        {
57                status (*init) (AFfilesetup, AFfilehandle);
58                bool (*instparamvalid) (AFfilehandle, AUpvlist, int);
59                status (*update) (AFfilehandle);
60        } write;
61
62        int defaultSampleFormat;
63        int defaultSampleWidth;
64
65        int compressionTypeCount;
66        int *compressionTypes;
67
68        int markerCount;
69
70        int instrumentCount;
71        int loopPerInstrumentCount;
72
73        int instrumentParameterCount;
74        _InstParamInfo *instrumentParameters;
75} _Unit;
76
77typedef struct _CompressionUnit
78{
79        int     compressionID;  /* AF_COMPRESSION_... */
80        bool    implemented;
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);
90
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);
95} _CompressionUnit;
96
97#define _AF_NUM_UNITS 6
98#define _AF_NUM_COMPRESSION 5
99
100#endif /* UNIT_H */
Note: See TracBrowser for help on using the repository browser.