00001 /* 00002 * Copyright: (C) 1999-2001 Bruce W. Forsberg 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Lesser General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 2.1 of the License, or any later version. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Lesser General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public 00015 * License along with this library; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 * 00018 * Bruce Forsberg forsberg@tns.net 00019 * 00020 */ 00021 00022 00023 #ifndef _AFLIBCONFIG_H_ 00024 #define _AFLIBCONFIG_H_ 00025 00026 00027 #ifdef HAVE_CONFIG_H 00028 #include <config.h> 00029 #endif 00030 00031 // Note that g++ does not really need this. If -O with compile func in .h will be inline 00032 #define INLINE inline 00033 00034 #include "aflib.h" 00035 00036 00045 class aflibConfig { 00046 00047 public: 00048 00049 aflibConfig(); 00050 00051 aflibConfig( 00052 int num_channels, 00053 aflib_data_size bits_per_sample, 00054 int samples_per_second); 00055 00056 ~aflibConfig(); 00057 00059 INLINE 00060 int 00061 getChannels() const 00062 { return (_channels); }; 00063 00065 INLINE 00066 void 00067 setChannels(int channels) 00068 { _channels = channels; }; 00069 00071 INLINE 00072 int 00073 getBitsPerSample() const 00074 { return (_bits_per_sample); }; 00075 00077 INLINE 00078 aflib_data_size 00079 getSampleSize() const 00080 { return (_sample_size); }; 00081 00083 INLINE 00084 void 00085 setSampleSize(aflib_data_size bits_per_sample) 00086 { _sample_size = bits_per_sample; _bits_per_sample = returnBitsPerSample(_sample_size); }; 00087 00089 INLINE 00090 int 00091 getSamplesPerSecond() const 00092 { return (_samples_per_second); }; 00093 00095 INLINE 00096 void 00097 setSamplesPerSecond(int samples_per_second) 00098 { _samples_per_second = samples_per_second; }; 00099 00101 INLINE 00102 aflib_data_orientation 00103 getDataOrientation() const 00104 { return (_data_orientation); }; 00105 00107 INLINE 00108 void 00109 setDataOrientation(aflib_data_orientation data_orientation) 00110 { _data_orientation = data_orientation; }; 00111 00113 INLINE 00114 aflib_data_endian 00115 getDataEndian() const 00116 { return (_data_endian); }; 00117 00119 INLINE 00120 void 00121 setDataEndian(aflib_data_endian data_endian) 00122 { _data_endian = data_endian; }; 00123 00125 INLINE 00126 long long 00127 getTotalSamples() const 00128 { return(_total_size); }; 00129 00131 INLINE 00132 void 00133 setTotalSamples(long long total) 00134 { _total_size = total; }; 00135 00136 private: 00137 00138 int 00139 returnBitsPerSample(aflib_data_size size); 00140 00141 int _channels; 00142 int _bits_per_sample; 00143 aflib_data_size _sample_size; 00144 int _samples_per_second; 00145 aflib_data_orientation _data_orientation; 00146 aflib_data_endian _data_endian; 00147 long long _total_size; 00148 00149 }; 00150 00151 00152 #endif