00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef __TScorePartwise__
00026 #define __TScorePartwise__
00027
00028 #include "exports.h"
00029 #include "TMeasure.h"
00030 #include "TPart.h"
00031 #include "TScore.h"
00032 #include "TScoreHeader.h"
00033 #include "TScoreVisitor.h"
00034 #include "smartpointer.h"
00035
00036 namespace MusicXML
00037 {
00038
00042 class EXP TPWMeasure : public TMeasure {
00043
00044 public:
00045 enum { allVoices=-1 };
00046 EXP friend SMARTP<TPWMeasure> newPWMeasure(string num);
00047 EXP friend SMARTP<TPWMeasure> newPWMeasure(long num);
00048 virtual void accept(TScoreVisitor& visitor);
00049
00051 long add (const SMusicData& data);
00052 vvector<SMusicData>& data() { return fData; }
00053 unsigned long getDuration(long voice=allVoices);
00054
00055 protected:
00056 TPWMeasure(string num) : TMeasure(num) {}
00057 TPWMeasure(long num) : TMeasure(num) {}
00058 virtual ~TPWMeasure() {}
00059 private:
00060 vvector<SMusicData> fData;
00061 };
00062 typedef SMARTP<TPWMeasure> SPWMeasure;
00063
00067 class EXP TPWPart : public TPart {
00068 public:
00069 EXP friend SMARTP<TPWPart> newPWPart(string id);
00070 virtual void accept(TScoreVisitor& visitor);
00071
00073 long add (const SPWMeasure& measure);
00074 vvector<SPWMeasure>& measures() { return fMeasures; }
00075
00076 protected:
00077 TPWPart(const string& id) : TPart(id) {}
00078 virtual ~TPWPart() {}
00079 private:
00080 vvector<SPWMeasure> fMeasures;
00081
00082 };
00083 typedef SMARTP<TPWPart> SPWPart;
00084
00088 class EXP TScorePartwise : public TScore {
00089 public:
00090 EXP friend SMARTP<TScorePartwise> newScorePartwise();
00091
00093 long add(const SPWPart& part);
00094 vvector<SPWPart>& partList() { return fPartList; }
00095
00096 virtual void accept(TScoreVisitor& visitor);
00097
00098 protected:
00099 TScorePartwise();
00100 virtual ~TScorePartwise() {}
00101 private:
00102 vvector<SPWPart> fPartList;
00103 };
00104 typedef SMARTP<TScorePartwise> SScorePartwise;
00105
00106 }
00107
00108 #endif