PitchNote.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 _PitchNote_
00023 #define _PitchNote_
00024 #include <typeinfo>
00025 
00026 #include "DynamicType.hxx"
00027 #include "DataTypes.hxx"
00028 #include "OSDefines.hxx"
00029 #include "Err.hxx"
00030 #include "ProcessingData.hxx"
00031 #include "Enum.hxx"
00032 
00033 namespace CLAM
00034 {
00035 
00036         // Class EPitch
00037         class EPitch : public Enum
00038         {
00039         public:
00040                 EPitch() : Enum(ValueTable(), eNone) {}
00041                 EPitch(tValue v) : Enum(ValueTable(), v) {};
00042                 EPitch(std::string s) : Enum(ValueTable(), s) {};
00043                 
00044                 typedef enum {
00045                         eC,eDb,eD,eEb,eE,eF,eGb,eG,eAb,eA,eBb,eB,eNone
00046                 } tEnum;        
00047 
00048                 virtual Component* Species() const
00049                 {
00050                         return (Component*) new EPitch();
00051                 };
00052                 static tEnumValue * ValueTable()
00053                 {
00054                         static tEnumValue sEnumValues[] = {     
00055                                 {eC, "C"},
00056                                 {eDb,"Db"},
00057                                 {eD, "D"},
00058                                 {eEb,"Eb"},
00059                                 {eE, "E"},
00060                                 {eF, "F"},
00061                                 {eGb,"Gb"},
00062                                 {eG, "G"},
00063                                 {eAb,"Ab"},
00064                                 {eA, "A"},
00065                                 {eBb,"Bb"},
00066                                 {eB, "B"},
00067                                 {eNone,"NotSet"},
00068                                 {0,NULL}
00069                         };
00070                         return sEnumValues;
00071                 }
00072         };
00073         
00074 
00076         // Class PitchNote:
00077         //
00078 
00081         class PitchNote: public ProcessingData
00082         {
00083         public:
00084                 DYNAMIC_TYPE_USING_INTERFACE (PitchNote, 2, ProcessingData);
00085                 DYN_ATTRIBUTE (0, public, EPitch, Pitch);   
00086                 DYN_ATTRIBUTE (1, public, int,    Octave);
00087                 
00088                 void SetMIDIPitch(int);
00089         protected:
00090                 void DefaultInit();
00091         };
00092         
00093 } // namespace CLAM
00094 
00095 #endif // _PitchNote_
00096 
00097 
Generated by  doxygen 1.6.3