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

TAttributes.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 __TAttributes__
00026 #define __TAttributes__
00027 
00028 #include "exports.h"
00029 
00030 #include "common.h"
00031 #include "TClef.h"
00032 #include "TKey.h"
00033 #include "TTimeSign.h"
00034 #include "TTranspose.h"
00035 #include "TScoreVisitor.h"
00036 
00037 namespace MusicXML 
00038 {
00051 class EXP TDirective : public visitable, public smartable {
00052 
00053     public:
00054         EXP friend SMARTP<TDirective> newDirective();
00055 
00056         virtual void accept(TScoreVisitor& visitor);
00057 
00059         void setLang(const string& lang);
00061         void setValue(const string& val);
00062 
00063         const string& getLang() const           { return fLang; }
00064         const string& getValue() const          { return fValue; }
00065 
00066     protected:
00067         TDirective() {}
00068         virtual ~TDirective() {};
00069         
00070     private:
00071         string  fLang;
00072         string  fValue;
00073 };
00074 typedef SMARTP<TDirective> SDirective;
00075 
00090 class EXP TAttributes : public TMusicData {
00091 
00092     public:
00093         enum { undefined = -1 };
00094         
00095         EXP friend SMARTP<TAttributes> newAttributes();
00096  
00097         virtual void accept(TScoreVisitor& visitor);
00098         
00099         void    setDivisions (long div);
00100         void    setStaves (long staves);
00101         void    setInstrument (long inst);
00102         long    getDivision () const        { return fDivision; }
00103         long    getStaves () const          { return fStaves; }
00104         long    getInstrument () const      { return fInstrument; }
00105         
00106         SKey&       key()                   { return fKey; }
00107         STimeSign&  timeSign()              { return fTimeSign; }
00108         STranspose& transpose()             { return fTranspose; }
00109         SDirective& directive()             { return fDirective; }
00110         vvector<SClef>& clefs()             { return fClefList; }
00111 
00112         long add (const SClef& clef);
00113 
00114     protected:
00115         TAttributes() : fDivision(undefined), fStaves(undefined),fInstrument(1) {}
00116         virtual ~TAttributes() {}
00117        
00118     private:
00119         long        fDivision;
00120         SKey        fKey;
00121         STimeSign   fTimeSign;
00122         long        fStaves;
00123         long        fInstrument;
00124         vvector<SClef> fClefList;
00125 // staff-details*
00126         STranspose  fTranspose;
00127         SDirective  fDirective;
00128 // measure-style*
00129 };
00130 typedef SMARTP<TAttributes> SAttributes;
00131 
00132 } // namespace MusicXML
00133 
00134 
00135 #endif

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