00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __TTimeSign__
00024 #define __TTimeSign__
00025
00026 #include "exports.h"
00027 #include "bimap.h"
00028 #include "TRational.h"
00029 #include "TScoreVisitor.h"
00030 #include <string>
00031
00032 namespace MusicXML
00033 {
00034
00055 class EXP TTimeSign : public visitable, public smartable {
00056
00057 public:
00058 enum { undefined = -1, groupbeats = -1, common=1, cut, single_number, normal, last=normal };
00059
00060 EXP friend SMARTP<TTimeSign> newTimeSign();
00061
00062 virtual void accept(TScoreVisitor& visitor);
00063
00064 void setSymbol(int symbol);
00065 int getSymbol() const { return fSymbol; }
00066
00068 long add (long beat, long type);
00070 bool measured () const { return fBeat.size() > 0; }
00072 TRational rational();
00073
00074 vector<long>& getBeats() { return fBeat; }
00075 vector<long>& getBeatTypes() { return fBeatType; }
00076
00078 static const string xmlsymbol (int d);
00080 static int xmlsymbol (const string str);
00081
00082 protected:
00084 TTimeSign() : fSymbol(undefined) {}
00085 virtual ~TTimeSign() {}
00086
00087 private:
00088 vector<long> fBeat;
00089 vector<long> fBeatType;
00090 int fSymbol;
00091
00092 static bimap<string, int> fSymbol2String;
00093 static int fSymbolTbl[];
00094 static string fSymbolStrings[];
00095 };
00096 typedef SMARTP<TTimeSign> STimeSign;
00097
00098 }
00099
00100
00101 #endif