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

TBarline.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 __TBarline__
00026 #define __TBarline__
00027 
00028 #include "exports.h"
00029 #include "TScoreVisitor.h"
00030 #include "common.h"
00031 #include <string>
00032 
00033 namespace MusicXML 
00034 {
00035 
00050 class EXP TEnding : public visitable, public smartable  {
00051     public:
00052         enum { start=1, stop, discontinue, last=discontinue };
00053         EXP friend SMARTP<TEnding> newEnding(long num, int type);
00054 
00055         virtual void accept(TScoreVisitor& visitor);
00056         
00057         void setNum (long num);
00058         void setType(int type);
00059         long getNum () const        { return fNum; }
00060         int  getType() const        { return fType; }
00061 
00063     static const string xmltype (int d);
00065     static int          xmltype (const string str);
00066 
00067     protected:
00068         TEnding(long num, int type) : fNum(num), fType(type) {}
00069         virtual ~TEnding() {}
00070 
00071     private:
00073         long    fNum;
00075         int     fType;
00076 
00077     static bimap<string, int> fType2String;
00078     static int      fTypeTbl[];
00079     static string   fTypeStrings[];
00080 };
00081 typedef SMARTP<TEnding> SEnding;
00082 
00094 class EXP TRepeat : public visitable, public smartable {
00095     public:
00096         enum { undefined = 0, backward, forward, last=forward };
00097         EXP friend SMARTP<TRepeat> newRepeat(int direction);
00098        
00099         virtual void accept(TScoreVisitor& visitor);
00100 
00101         int getDirection() const    { return fDirection; }
00102         int getTimes() const        { return fTimes; }
00103         void setDirection(int dir);
00104         void setTimes(int times);
00105 
00107     static const string xmldirection (int d);
00109     static int          xmldirection (const string str);
00110 
00111     protected:
00112         TRepeat(int direction) : fDirection(direction), fTimes(undefined) {}
00113         virtual ~TRepeat() {}
00114 
00115     private:
00116         int fDirection;
00117         int fTimes;
00118 
00119     static bimap<string, int> fDirection2String;
00120     static int      fDirectionTbl[];
00121     static string   fDirectionStrings[];
00122 };
00123 typedef SMARTP<TRepeat> SRepeat;
00124 
00144 class EXP TBarline : public TMusicData {
00145     
00146     public:
00147         enum { undefined=0, right=1, left, middle, lastloc= middle };
00148         enum { none=1, regular, dotted, heavy, light_light, 
00149                 light_heavy, heavy_light, heavy_heavy, last=heavy_heavy };
00150  
00151         EXP friend SMARTP<TBarline> newBarline();
00152  
00153         virtual void accept(TScoreVisitor& visitor);
00154 
00155         void        setLocation(int loc);
00156         void        setBarStyle(int style);
00157         int         getLocation()   const   { return fLocation; }
00158         int         getBarStyle()   const   { return fBarStyle; }
00159 
00160         SWavyLine&  wavyLine()      { return fWavyLine; }
00161         SSegno&     segno()         { return fSegno; }
00162         SCoda&      coda()          { return fCoda; }
00163         SFermata&   fermata()       { return fFermata; }
00164         SEnding&    ending()        { return fEnding; }
00165         SRepeat&    repeat()        { return fRepeat; }
00166        
00168     static const string xmllocation (int d);
00170     static int          xmllocation (const string str);
00172     static const string xmlstyle (int d);
00174     static int          xmlstyle (const string str);
00175 
00176     protected:
00177         TBarline() : fLocation(undefined), fBarStyle(undefined) {}
00178         virtual ~TBarline() {}
00179 
00180     private:
00182         int         fLocation;
00184         int         fBarStyle;
00185         SWavyLine   fWavyLine;
00186         SSegno      fSegno;
00187         SCoda       fCoda;
00188         SFermata    fFermata;
00189         SEnding     fEnding;
00190         SRepeat     fRepeat;
00191 
00192 
00193     static bimap<string, int> fLocation2String;
00194     static int      fLocationTbl[];
00195     static string   fLocationStrings[];
00196 
00197     static bimap<string, int> fStyle2String;
00198     static int      fStyleTbl[];
00199     static string   fStyleStrings[];
00200 };
00201 typedef SMARTP<TBarline> SBarline;
00202 
00203 } // namespace MusicXML
00204 
00205 #endif

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