| 1 |
afQuery(3) |
| 2 |
========== |
| 3 |
|
| 4 |
NAME |
| 5 |
---- |
| 6 |
afQuery, afQueryLong, afQueryDouble, afQueryPointer - query the |
| 7 |
capabilities of the Audio File Library |
| 8 |
|
| 9 |
SYNOPSIS |
| 10 |
-------- |
| 11 |
#include <audiofile.h> |
| 12 |
|
| 13 |
AUpvlist afQuery (int querytype, int arg1, int arg2, int arg3, int arg4); |
| 14 |
|
| 15 |
long afQueryLong (int querytype, int arg1, int arg2, int arg3, int arg4); |
| 16 |
|
| 17 |
double afQueryDouble (int querytype, int arg1, int arg2, int arg3, |
| 18 |
int arg4); |
| 19 |
|
| 20 |
void *afQueryPointer (int querytype, int arg1, int arg2, int arg3, |
| 21 |
int arg4); |
| 22 |
|
| 23 |
PARAMETERS |
| 24 |
---------- |
| 25 |
'querytype' can be one of the following: |
| 26 |
|
| 27 |
* `AF_QUERYTYPE_FILEFMT` |
| 28 |
* `AF_QUERYTYPE_INST` |
| 29 |
* `AF_QUERYTYPE_INSTPARAM` |
| 30 |
* `AF_QUERYTYPE_COMPRESSION` |
| 31 |
* `AF_QUERYTYPE_COMPRESSIONPARAM` |
| 32 |
* `AF_QUERYTYPE_MISC` |
| 33 |
* `AF_QUERYTYPE_MARK` |
| 34 |
* `AF_QUERYTYPE_LOOP` |
| 35 |
|
| 36 |
'arg1', 'arg2', 'arg3', and 'arg4' are integer selectors whose |
| 37 |
meaning depends upon 'querytype'. |
| 38 |
|
| 39 |
|
| 40 |
RETURN VALUE |
| 41 |
------------ |
| 42 |
Upon success, `afQuery` will return a non-null `AUpvlist` value. |
| 43 |
Upon failure, `afQuery` will return null while `afQueryLong` and |
| 44 |
`afQueryDouble` will return -1 and `afQueryPointer` will return |
| 45 |
null. |
| 46 |
|
| 47 |
Pointers representing character strings are owned by the Audio File |
| 48 |
Library and must not be freed; all other pointer values must be |
| 49 |
freed by the caller. |
| 50 |
|
| 51 |
DESCRIPTION |
| 52 |
----------- |
| 53 |
For `AF_QUERYTYPE_FILEFMT`, the following selectors are valid values for 'arg1': |
| 54 |
|
| 55 |
`AF_QUERY_LABEL`:: Request a short label string for the format (e.g., "aiff"). |
| 56 |
|
| 57 |
`AF_QUERY_NAME`:: Request a short name for the format (e.g., "MS RIFF WAVE"). |
| 58 |
|
| 59 |
`AF_QUERY_DESC`:: Request a descriptive name for the format (e.g., "Audio |
| 60 |
Interchange File Format"). |
| 61 |
|
| 62 |
`AF_QUERY_IMPLEMENTED`:: Request a boolean value indicating whether the |
| 63 |
format is implemented for reading and writing in the Audio File Library. |
| 64 |
|
| 65 |
`AF_QUERY_ID_COUNT`:: Request the total number of formats implemented. |
| 66 |
|
| 67 |
`AF_QUERY_IDS`:: Request an integer array of the id token values of all |
| 68 |
implemented file formats. |
| 69 |
|
| 70 |
`AF_QUERY_COMPRESSION_TYPES`:: Used with the selector AF_QUERY_VALUE_COUNT |
| 71 |
in 'arg2', this will return a long integer containing the number of |
| 72 |
compression schemes available for use within the format specified in 'arg3'. |
| 73 |
Used with selector `AF_QUERY_VALUES`, it returns a pointer to an integer |
| 74 |
array containing the compression id values of the compression schemes |
| 75 |
supported by the format specified in 'arg3'. |
| 76 |
|
| 77 |
`AF_QUERY_SAMPLE_FORMATS`:: Used with the selector AF_QUERY_DEFAULT in 'arg2', |
| 78 |
this will return the default sample format for the file format specified in |
| 79 |
'arg3'. |
| 80 |
|
| 81 |
`AF_QUERY_SAMPLE_SIZES`:: Used with selector AF_QUERY_DEFAULT in 'arg2', this |
| 82 |
will return the default sample width for the file format specified in 'arg3'. |
| 83 |
|
| 84 |
|
| 85 |
For `AF_QUERYTYPE_INST`, the following selectors are valid for 'arg1': |
| 86 |
|
| 87 |
`AF_QUERY_SUPPORTED`:: Request a boolean value indicating whether |
| 88 |
the file format in 'arg2' supports instruments. |
| 89 |
|
| 90 |
`AF_QUERY_MAX_NUMBER`:: Request an integer value indicating the |
| 91 |
maximum number of instruments supported by the file format in 'arg2'. |
| 92 |
|
| 93 |
|
| 94 |
For `AF_QUERYTYPE_INSTPARAM`, the following selectors are valid for 'arg1': |
| 95 |
|
| 96 |
`AF_QUERY_SUPPORTED`:: Request a boolean value indicating whether |
| 97 |
the file format in 'arg2' supports instrument parameters. |
| 98 |
|
| 99 |
`AF_QUERY_ID_COUNT`:: Request an integer value indicating the number |
| 100 |
of instrument parameters supported by the file format in 'arg2'. |
| 101 |
|
| 102 |
`AF_QUERY_IDS`:: Request an integer array containing the instrument |
| 103 |
parameter values for the file format in 'arg2'. |
| 104 |
|
| 105 |
`AF_QUERY_TYPE`:: For the file format in 'arg2', request the type |
| 106 |
of the instrument parameter in 'arg3'. |
| 107 |
|
| 108 |
`AF_QUERY_NAME`:: For the file format in 'arg2', request the name |
| 109 |
of the instrument parameter in 'arg3'. |
| 110 |
|
| 111 |
`AF_QUERY_DEFAULT`:: For the file format in 'arg2', request the |
| 112 |
default value of the instrument parameter in 'arg3'. |
| 113 |
|
| 114 |
|
| 115 |
ERRORS |
| 116 |
------ |
| 117 |
afQuery can produce the following errors: |
| 118 |
|
| 119 |
`AF_BAD_QUERYTYPE`:: The query type is unsupported. |
| 120 |
`AF_BAD_QUERY`:: The arguments to the query are bad. |
| 121 |
|
| 122 |
AUTHOR |
| 123 |
------ |
| 124 |
Michael Pruett <[email protected]> |