CLAM-Development
1.1
|
00001 /* 00002 * Copyright (c) 2001-2004 MUSIC TECHNOLOGY GROUP (MTG) 00003 * UNIVERSITAT POMPEU FABRA 00004 * 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 * 00020 */ 00021 00022 #include "Enum.hxx" 00023 00024 #ifndef _GlobalEnums_ 00025 #define _GlobalEnums_ 00026 00027 namespace CLAM { 00028 00029 00033 class EInterpolation: public Enum 00034 { 00035 public: 00036 00037 EInterpolation() : Enum(ValueTable(), eLinear) {} 00038 EInterpolation(tValue v) : Enum(ValueTable(), v) {}; 00039 EInterpolation(std::string s) : Enum(ValueTable(), s) {}; 00040 virtual Component* Species() const { return new EInterpolation; } 00041 00042 typedef enum { 00043 eStep, 00044 eRound, 00045 eLinear, 00046 eSpline, 00047 ePolynomial2, 00048 ePolynomial3, 00049 ePolynomial4, 00050 ePolynomial5, 00051 ePolynomialn 00052 } tEnum; 00053 00054 static tEnumValue * ValueTable() 00055 { 00056 static tEnumValue sValueTable[] = 00057 { 00058 {eStep,"Step"}, 00059 {eRound,"Round"}, 00060 {eLinear,"Linear"}, 00061 {eSpline,"Spline"}, 00062 {ePolynomial2,"2ond_order_Polynomial"}, 00063 {ePolynomial3,"3rd_order_Polynomial"}, 00064 {ePolynomial4,"4th_order_Polynomial"}, 00065 {ePolynomial5,"5th_order_Polynomial"}, 00066 {ePolynomialn,"nth_order_Polynomial"}, 00067 {0,NULL} 00068 }; 00069 return sValueTable; 00070 } 00071 }; 00072 00076 //TODO (may include different types of logarithmic scales?? 00077 class EScale : public Enum 00078 { 00079 public: 00080 00081 EScale() : Enum(ValueTable(), eLinear) {} 00082 EScale(tValue v) : Enum(ValueTable(), v) {}; 00083 EScale(std::string s) : Enum(ValueTable(), s) {}; 00084 virtual Component* Species() const { return new EScale; }; 00085 00086 enum { 00087 eLinear, 00088 eLog 00089 }; 00090 00091 static tEnumValue * ValueTable() 00092 { 00093 static tEnumValue sValueTable[] = 00094 { 00095 {EScale::eLinear,"Linear"}, 00096 {EScale::eLog,"Log"}, 00097 {0,NULL} 00098 }; 00099 return sValueTable; 00100 } 00101 }; 00102 00103 00104 class EWindowType : public Enum 00105 { 00106 public: 00107 00108 EWindowType() : Enum(ValueTable(), eHamming) {} 00109 EWindowType(tValue v) : Enum(ValueTable(), v) {}; 00110 EWindowType(std::string s) : Enum(ValueTable(), s) {}; 00111 virtual Component* Species() const { return new EWindowType(eHamming); } 00112 00113 enum { 00114 eNone, 00115 eKaiserBessel17, 00116 eKaiserBessel18, 00117 eKaiserBessel19, 00118 eKaiserBessel20, 00119 eKaiserBessel25, 00120 eKaiserBessel30, 00121 eKaiserBessel35, 00122 eBlackmanHarris74, 00123 eBlackmanHarris62, 00124 eBlackmanHarris70, 00125 eBlackmanHarris92, 00126 eHamming, 00127 eTriangular, 00128 eBlackmanHarris92TransMainLobe, 00129 eGaussian, 00130 eBlackmanHarrisLike, 00131 eSine, 00132 eSquare 00133 }; 00134 00135 static tEnumValue * ValueTable() 00136 { 00137 static tEnumValue sValueTable[] = 00138 { 00139 {eNone,"None"}, 00140 {eKaiserBessel17,"KaiserBessel17"}, 00141 {eKaiserBessel18,"KaiserBessel18"}, 00142 {eKaiserBessel19,"KaiserBessel19"}, 00143 {eKaiserBessel20,"KaiserBessel20"}, 00144 {eKaiserBessel25,"KaiserBessel25"}, 00145 {eKaiserBessel30,"KaiserBessel30"}, 00146 {eKaiserBessel35,"KaiserBessel35"}, 00147 {eBlackmanHarris74,"BlackmanHarris74"}, 00148 {eBlackmanHarris62,"BlackmanHarris62"}, 00149 {eBlackmanHarris70,"BlackmanHarris70"}, 00150 {eBlackmanHarris92,"BlackmanHarris92"}, 00151 {eHamming,"Hamming"}, 00152 {eTriangular,"Triangular"}, 00153 {eBlackmanHarris92TransMainLobe,"BlackmanHarris92 MainLobe"}, 00154 {eGaussian,"Gaussian"}, 00155 {eBlackmanHarrisLike,"BlackmanHarrisLike"}, 00156 {eSine,"Sine"}, 00157 {eSquare,"Square"}, 00158 {0,NULL} 00159 }; 00160 return sValueTable; 00161 } 00162 }; 00163 00164 00165 00166 } 00167 00168 #endif //_GlobalEnums_ 00169