LibMusicXML  3.18
msrCredits.h
1 /*
2  MusicXML Library
3  Copyright (C) Grame 2006-2013
4 
5  This Source Code Form is subject to the terms of the Mozilla Public
6  License, v. 2.0. If a copy of the MPL was not distributed with this
7  file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9  Grame Research Laboratory, 11, cours de Verdun Gensoul 69002 Lyon - France
10  research@grame.fr
11 */
12 
13 #ifndef ___msrCredits___
14 #define ___msrCredits___
15 
16 #include "msrElements.h"
17 
18 #include "msrBasicTypes.h"
19 
20 
21 namespace MusicXML2
22 {
23 
24 //______________________________________________________________________________
25 class msrCreditWords : public msrElement
26 {
27  public:
28 
29  // creation from MusicXML
30  // ------------------------------------------------------
31 
32  static SMARTP<msrCreditWords> create (
33  int inputLineNumber,
34  string creditWordsContents,
35  string creditWordsFontFamily,
36  float creditWordsFontSize,
37  msrFontWeightKind creditWordsFontWeightKind,
38  msrFontStyleKind creditWordsFontStyleKind,
39  msrJustifyKind creditWordsJustifyKind,
40  msrHorizontalAlignmentKind creditWordsHorizontalAlignmentKind,
41  msrVerticalAlignmentKind creditWordsVerticalAlignmentKind,
42  msrXMLLangKind creditWordsXMLLang);
43 
44  protected:
45 
46  // constructors/destructor
47  // ------------------------------------------------------
48 
50  int inputLineNumber,
51  string creditWordsContents,
52  string creditWordsFontFamily,
53  float creditWordsFontSize,
54  msrFontWeightKind creditWordsFontWeightKind,
55  msrFontStyleKind creditWordsFontStyleKind,
56  msrJustifyKind creditWordsJustifyKind,
57  msrHorizontalAlignmentKind creditWordsHorizontalAlignmentKind,
58  msrVerticalAlignmentKind creditWordsVerticalAlignmentKind,
59  msrXMLLangKind creditWordsXMLLang);
60 
61  virtual ~msrCreditWords ();
62 
63  public:
64 
65  // set and get
66  // ------------------------------------------------------
67  string getCreditWordsContents () const
68  { return fCreditWordsContents; }
69 
70  string getCreditWordsFontFamily () const
71  { return fCreditWordsFontFamily; }
72 
73  float getCreditWordsFontSize () const
74  { return fCreditWordsFontSize; }
75 
76  msrFontWeightKind getCreditWordsFontWeightKind () const
77  { return fCreditWordsFontWeightKind; }
78 
79  msrFontStyleKind getCreditWordsFontStyleKind () const
80  { return fCreditWordsFontStyleKind; }
81 
82  msrJustifyKind getCreditWordsJustifyKind () const
83  { return fCreditWordsJustifyKind; }
84 
85  msrHorizontalAlignmentKind
86  getCreditWordsHorizontalAlignmentKind () const
87  { return fCreditWordsHorizontalAlignmentKind; }
88 
89  msrVerticalAlignmentKind
90  getCreditWordsVerticalAlignmentKind () const
91  { return fCreditWordsVerticalAlignmentKind; }
92 
93  msrXMLLangKind getCreditWordsXMLLang () const
94  { return fCreditWordsXMLLang; }
95 
96  // services
97  // ------------------------------------------------------
98 
99  public:
100 
101  // visitors
102  // ------------------------------------------------------
103 
104  virtual void acceptIn (basevisitor* v);
105  virtual void acceptOut (basevisitor* v);
106 
107  virtual void browseData (basevisitor* v);
108 
109  public:
110 
111  // print
112  // ------------------------------------------------------
113 
114  virtual void print (ostream& os) const;
115 
116  private:
117 
118  // fields
119  // ------------------------------------------------------
120 
121 /*
122  <credit-words default-x="607" default-y="1443" font-family="MS ゴシック" font-size="24" font-weight="bold" justify="center" valign="top" xml:lang="ja">越後獅子</credit-words>
123 */
124 
125  string fCreditWordsContents;
126 
127  string fCreditWordsFontFamily;
128  float fCreditWordsFontSize;
129  msrFontWeightKind fCreditWordsFontWeightKind;
130  msrFontStyleKind fCreditWordsFontStyleKind;
131  msrJustifyKind fCreditWordsJustifyKind;
132  msrHorizontalAlignmentKind
133  fCreditWordsHorizontalAlignmentKind;
134  msrVerticalAlignmentKind
135  fCreditWordsVerticalAlignmentKind;
136  msrXMLLangKind fCreditWordsXMLLang;
137 };
139 EXP ostream& operator<< (ostream& os, const S_msrCreditWords& elt);
140 
141 //______________________________________________________________________________
142 class msrCredit : public msrElement
143 {
144  public:
145 
146  // creation from MusicXML
147  // ------------------------------------------------------
148 
149  static SMARTP<msrCredit> create (
150  int inputLineNumber,
151  int creditPageNumber);
152 
153  protected:
154 
155  // constructors/destructor
156  // ------------------------------------------------------
157 
158  msrCredit (
159  int inputLineNumber,
160  int creditPageNumber);
161 
162  virtual ~msrCredit ();
163 
164  public:
165 
166  // set and get
167  // ------------------------------------------------------
168 
169  int getCreditPageNumber () const
170  { return fCreditPageNumber; }
171 
172  const vector<S_msrCreditWords>&
173  getCreditWordsList () const
174  { return fCreditWordsList; }
175 
176  // services
177  // ------------------------------------------------------
178 
179  void appendCreditWordsToCredit (
180  S_msrCreditWords creditWords);
181 
182  string asString () const;
183 
184  public:
185 
186  // visitors
187  // ------------------------------------------------------
188 
189  virtual void acceptIn (basevisitor* v);
190  virtual void acceptOut (basevisitor* v);
191 
192  virtual void browseData (basevisitor* v);
193 
194  public:
195 
196  // print
197  // ------------------------------------------------------
198 
199  virtual void print (ostream& os) const;
200 
201  private:
202 
203  // fields
204  // ------------------------------------------------------
205 
206  int fCreditPageNumber;
207 
208  vector<S_msrCreditWords>
209  fCreditWordsList;
210 };
212 EXP ostream& operator<< (ostream& os, const S_msrCredit& elt);
213 
214 
215 } // namespace MusicXML2
216 
217 
218 #endif
the smart pointer implementation
Definition: smartpointer.h:58
Definition: basevisitor.h:25
Definition: msrCredits.h:26
Definition: msrCredits.h:143
Definition: msrElements.h:26