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

TScorePartwise.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 __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

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