1 | /* |
---|
2 | Audio File Library |
---|
3 | Copyright (C) 1998-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 | util.h |
---|
23 | |
---|
24 | This file contains some general utility functions for the Audio |
---|
25 | File Library. |
---|
26 | */ |
---|
27 | |
---|
28 | #ifndef UTIL_H |
---|
29 | #define UTIL_H |
---|
30 | |
---|
31 | #include <sys/types.h> |
---|
32 | #include "audiofile.h" |
---|
33 | #include "afinternal.h" |
---|
34 | |
---|
35 | bool _af_filesetup_ok (AFfilesetup setup); |
---|
36 | bool _af_filehandle_ok (AFfilehandle file); |
---|
37 | |
---|
38 | bool _af_filehandle_can_read (AFfilehandle file); |
---|
39 | |
---|
40 | void _af_printid (u_int32_t id); |
---|
41 | void _af_print_filehandle (AFfilehandle filehandle); |
---|
42 | void _af_print_tracks (AFfilehandle filehandle); |
---|
43 | void _af_print_channel_matrix (double *matrix, int fchans, int vchans); |
---|
44 | void _af_print_pvlist (AUpvlist list); |
---|
45 | |
---|
46 | void *_af_malloc (size_t size); |
---|
47 | void *_af_realloc (void *ptr, size_t size); |
---|
48 | void *_af_calloc (size_t nmemb, size_t size); |
---|
49 | char *_af_strdup (char *s); |
---|
50 | |
---|
51 | AUpvlist _af_pv_long (long val); |
---|
52 | AUpvlist _af_pv_double (double val); |
---|
53 | AUpvlist _af_pv_pointer (void *val); |
---|
54 | |
---|
55 | bool _af_pv_getlong (AUpvlist pvlist, int param, long *l); |
---|
56 | bool _af_pv_getdouble (AUpvlist pvlist, int param, double *d); |
---|
57 | bool _af_pv_getptr (AUpvlist pvlist, int param, void **v); |
---|
58 | |
---|
59 | _TrackSetup *_af_filesetup_get_tracksetup (AFfilesetup setup, int trackid); |
---|
60 | _Track *_af_filehandle_get_track (AFfilehandle file, int trackid); |
---|
61 | |
---|
62 | bool _af_unique_ids (int *ids, int nids, char *idname, int iderr); |
---|
63 | |
---|
64 | float _af_format_frame_size (_AudioFormat *format, bool stretch3to4); |
---|
65 | int _af_format_frame_size_uncompressed (_AudioFormat *format, bool stretch3to4); |
---|
66 | float _af_format_sample_size (_AudioFormat *format, bool stretch3to4); |
---|
67 | int _af_format_sample_size_uncompressed (_AudioFormat *format, bool stretch3to4); |
---|
68 | |
---|
69 | status _af_set_sample_format (_AudioFormat *f, int sampleFormat, int sampleWidth); |
---|
70 | |
---|
71 | bool _af_filehandle_can_read (AFfilehandle file); |
---|
72 | bool _af_filehandle_can_write (AFfilehandle file); |
---|
73 | |
---|
74 | void _af_print_audioformat (_AudioFormat *format); |
---|
75 | void _af_print_chunk (_AFchunk *chunk); |
---|
76 | void _af_print_frame (AFframecount frameno, double *frame, int nchannels, |
---|
77 | char *formatstring, int numberwidth, |
---|
78 | double slope, double intercept, double minclip, double maxclip); |
---|
79 | |
---|
80 | #endif |
---|