1 /* 2 Audio File Library 3 Copyright (C) 1998-2000, Michael Pruett <michael@68k.org> 4 Copyright (C) 2000, Silicon Graphics, Inc. 5 6 This library is free software; you can redistribute it and/or 7 modify it under the terms of the GNU Lesser General Public 8 License as published by the Free Software Foundation; either 9 version 2.1 of the License, or (at your option) any later version. 10 11 This library is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 Lesser General Public License for more details. 15 16 You should have received a copy of the GNU Lesser General Public 17 License along with this library; if not, write to the 18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 Boston, MA 02110-1301 USA 20 */ 21 22 /* 23 afinternal.h 24 25 This file defines the internal structures for the Audio File Library. 26 */ 27 28 #ifndef AFINTERNAL_H 29 #define AFINTERNAL_H 30 31 #include <sys/types.h> 32 #include "audiofile.h" 33 #include "error.h" 34 35 enum status 36 { 37 AF_SUCCEED = 0, 38 AF_FAIL = -1 39 }; 40 41 union AFPVu 42 { 43 long l; 44 double d; 45 void *v; 46 }; 47 48 struct InstParamInfo 49 { 50 int id; 51 int type; 52 const char *name; 53 AFPVu defaultValue; 54 }; 55 56 struct Loop 57 { 58 int id; 59 int mode; /* AF_LOOP_MODE_... */ 60 int count; /* how many times the loop is played */ 61 int beginMarker, endMarker; 62 int trackid; 63 }; 64 65 struct LoopSetup 66 { 67 int id; 68 }; 69 70 struct Miscellaneous 71 { 72 int id; 73 int type; 74 int size; 75 76 void *buffer; 77 78 int position; // offset within the miscellaneous chunk 79 }; 80 81 struct MiscellaneousSetup 82 { 83 int id; 84 int type; 85 int size; 86 }; 87 88 struct TrackSetup; 89 90 class File; 91 struct Track; 92 93 enum 94 { 95 _AF_VALID_FILEHANDLE = 38212, 96 _AF_VALID_FILESETUP = 38213 97 }; 98 99 enum 100 { 101 _AF_READ_ACCESS = 1, 102 _AF_WRITE_ACCESS = 2 103 }; 104 105 // The following are tokens for compression parameters in PV lists. 106 enum 107 { 108 _AF_MS_ADPCM_NUM_COEFFICIENTS = 800, /* type: long */ 109 _AF_MS_ADPCM_COEFFICIENTS = 801, /* type: array of int16_t[2] */ 110 _AF_IMA_ADPCM_TYPE = 810, 111 _AF_IMA_ADPCM_TYPE_WAVE = 1, 112 _AF_IMA_ADPCM_TYPE_QT = 2, 113 _AF_CODEC_DATA = 900, // type: pointer 114 _AF_CODEC_DATA_SIZE = 901 // type: long 115 }; 116 117 /* NeXT/Sun sampling rate */ 118 #define _AF_SRATE_CODEC (8012.8210513) 119 120 #endif 121