AudioFileConfig.hxx

Go to the documentation of this file.
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 #ifndef _AudioFileConfig_
00023 #define _AudioFileConfig_
00024 
00025 #include <typeinfo> // for bad_cast definition
00026 #include "Processing.hxx"
00027 #include "ProcessingData.hxx"
00028 #include "DataTypes.hxx"
00029 #include "Enum.hxx"
00030 #include "Filename.hxx"
00031 
00032 namespace CLAM {
00033 
00034         class EAudioFileType : public Enum
00035         {
00036         public:
00037 
00038                 EAudioFileType() : Enum(ValueTable(), eRaw) {}
00039                 EAudioFileType(tValue v) : Enum(ValueTable(), v) {};
00040                 EAudioFileType(std::string s) : Enum(ValueTable(), s) {};
00041 
00042                 typedef enum {
00043                         eRaw,
00044                         eWave,
00045                         eAIFF,
00046                         eAuto,
00047                         eUnknown
00048                 }; 
00049                 
00050                 virtual Component* Species() const
00051                 {
00052                         // TODO: This is a xapusa, see also FDFilterGen.hxx
00053                         return (Component*) new EAudioFileType(eRaw);
00054                 };
00055                 static tEnumValue * ValueTable()
00056                 {
00057                         static tEnumValue sEnumValues[] = {
00058                                 {EAudioFileType::eRaw,"Raw"},
00059                                 {EAudioFileType::eWave,"Wave"},
00060                                 {EAudioFileType::eAIFF,"AIFF"},
00061                                 {EAudioFileType::eAuto,"Auto"},
00062                                 {EAudioFileType::eUnknown,"Unknown"},
00063                                 {0,NULL}
00064                         };
00065                         return sEnumValues;
00066                 }
00067 
00068         };
00069 
00072         struct AudioFileConfig: public ProcessingConfig {
00073         public:
00074                 DYNAMIC_TYPE_USING_INTERFACE
00075                         (AudioFileConfig, 7, ProcessingConfig);
00076                 DYN_ATTRIBUTE (0, public, Filename, Filename);
00077                 DYN_ATTRIBUTE (1, public, EAudioFileType, Filetype);
00078                 DYN_ATTRIBUTE (2, public, TData, SampleRate);
00079                 DYN_ATTRIBUTE (3, public, short, Channels);
00080                 DYN_ATTRIBUTE (4, public, bool, KeepFrameSizes);
00081                 DYN_ATTRIBUTE (5, public, int, FrameSize);
00082                 DYN_ATTRIBUTE (6, public, int, StartFrame);
00083         protected:
00087                 void DefaultInit(void);
00088         };
00089 
00090 };//namespace CLAM
00091 
00092 #endif // _AudioFileConfig_
00093 

Generated on Tue Jun 19 20:34:52 2007 for CLAM-Development by  doxygen 1.5.2