Main Page | Modules | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | Related Pages

conversions.h

00001 /*
00002 
00003   MusicXML Library
00004   Copyright (C) 2003  Grame
00005 
00006   This library is free software; you can redistribute it and/or
00007   modify it under the terms of the GNU Lesser General Public
00008   License as published by the Free Software Foundation; either
00009   version 2.1 of the License, or (at your option) any later version.
00010 
00011   This library 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 GNU
00014   Lesser General Public License for more details.
00015 
00016   You should have received a copy of the GNU Lesser General Public
00017   License along with this library; if not, write to the Free Software
00018   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 
00020   Grame Research Laboratory, 9 rue du Garet, 69001 Lyon - France
00021   grame@grame.fr
00022 
00023 */
00024 
00025 #ifndef __conversions__
00026 #define __conversions__
00027 
00028 #include "exports.h"
00029 #include "TRational.h"
00030 #include "bimap.h"
00031 #include <string>
00032 
00033 using namespace std;
00034 
00035 namespace MusicXML 
00036 {
00037 
00041 class EXP FullCue {
00042     public:
00043     enum type { undefined, full, cue, last=cue };
00044 
00046     static const string xml (type d);
00048     static       type   xml (const string str);
00049 
00050     private:
00051     static bimap<string, type> fFC2String;
00052     static type         fFCTbl[];
00053     static string       fFCStrings[];        
00054 };
00055 
00059 class EXP YesNo {
00060     public:
00061     enum type { undefined, yes, no, last=no };
00062 
00064     static const string xml (type d);
00066     static       type   xml (const string str);
00067 
00068     private:
00069     static bimap<string, type> fYN2String;
00070     static type     fYNTbl[];
00071     static string   fYNStrings[];        
00072 };
00073 
00077 class EXP StartStop {
00078     public:
00079     enum type { undefined, start, stop, cont, last=cont };
00080 
00082     static const string xml (type d);
00084     static       type   xml (const string str);
00085 
00086     private:
00087     static bimap<string, type> fStartStop2String;
00088     static type     fStartStopTbl[];
00089     static string   fStartStopStrings[];        
00090 };
00091 
00095 class EXP LineType {
00096     public:
00097     enum type { undefined, solid, dashed, dotted, wavy, last=wavy };
00098 
00100     static const string xml (type d);
00102     static       type   xml (const string str);
00103 
00104     private:
00105     static bimap<string, type> fLineType2String;
00106     static type     fLineTypeTbl[];
00107     static string   fLineTypeStrings[];        
00108 };
00109 
00117 class EXP NoteType {
00118     public:
00119         enum type { undefined,
00120                     t256th=1, t128th=1<<1, t64th=1<<2, t32nd=1<<3, 
00121                     t16th=1<<4, eighth=1<<5, quarter=1<<6, 
00122                     half=1<<7, whole=1<<8, breve=1<<9, tlong=1<<10, 
00123                     count=11 };
00124 
00126     static TRational& rational(type d, TRational& r); 
00128     static const string xml (type d);
00130     static       type   xml (const string str);
00131 
00132     private:
00133     static bimap<string, type> fType2String;
00134     static type     fTypeTbl[];
00135     static string   fTypeStrings[];        
00136 };
00137 
00138 } // namespace MusicXML
00139 
00140 #endif

Generated on Tue Mar 23 09:49:43 2004 for LibMusicXML by doxygen 1.3.3