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 __TScoreTimewise__ 00026 #define __TScoreTimewise__ 00027 00028 #include "exports.h" 00029 #include "TMeasure.h" 00030 #include "TPart.h" 00031 #include "TScore.h" 00032 #include "TScoreHeader.h" 00033 #include "smartpointer.h" 00034 00035 namespace MusicXML 00036 { 00037 00041 class EXP TTWPart : public TPart { 00042 public: 00043 EXP friend SMARTP<TTWPart> newTWPart(string id); 00044 virtual void accept(TScoreVisitor& visitor); 00045 00046 long add (const SMusicData& data); 00047 vvector<SMusicData>& data() { return fData; } 00048 00049 protected: 00050 TTWPart(string id) : TPart(id) {} 00051 virtual ~TTWPart() {} 00052 private: 00053 vvector<SMusicData> fData; 00054 00055 }; 00056 typedef SMARTP<TTWPart> STWPart; 00057 00061 class EXP TTWMeasure : public TMeasure { 00062 00063 public: 00064 EXP friend SMARTP<TTWMeasure> newTWMeasure(string num); 00065 EXP friend SMARTP<TTWMeasure> newTWMeasure(long num); 00066 00067 virtual void accept(TScoreVisitor& visitor); 00068 00069 long add (const SMARTP<TTWPart>& part); 00070 vvector< SMARTP<TTWPart> >& parts() { return fParts; } 00071 00072 protected: 00073 TTWMeasure(string num) : TMeasure(num) {} 00074 TTWMeasure(long num) : TMeasure(num) {} 00075 virtual ~TTWMeasure() {} 00076 private: 00077 vvector< SMARTP<TTWPart> > fParts; 00078 }; 00079 typedef SMARTP<TTWMeasure> STWMeasure; 00080 00084 class EXP TScoreTimewise : public TScore { 00085 public: 00086 EXP friend SMARTP<TScoreTimewise> newScoreTimewise(); 00087 virtual void accept(TScoreVisitor& visitor); 00088 00089 long add(const STWMeasure& part); 00090 vvector<STWMeasure>& measureList() { return fMeasureList; } 00091 00092 protected: 00093 TScoreTimewise(); 00094 virtual ~TScoreTimewise() {} 00095 private: 00096 vvector<STWMeasure> fMeasureList; 00097 }; 00098 typedef SMARTP<TScoreTimewise> SScoreTimewise; 00099 00100 } 00101 00102 #endif