Canorus
0.7
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
core
muselementfactory.h
Go to the documentation of this file.
1
10
#ifndef MUSELEMENTFACTORY_H_
11
#define MUSELEMENTFACTORY_H_
12
#include "
core/barline.h
"
13
14
#include "
core/staff.h
"
15
#include "
core/muselement.h
"
16
#include "
core/clef.h
"
17
#include "
core/keysignature.h
"
18
#include "
core/timesignature.h
"
19
#include "
core/voice.h
"
20
#include "
core/rest.h
"
21
#include "
core/slur.h
"
22
#include "
core/functionmark.h
"
23
#include "
core/lyricscontext.h
"
24
#include "
core/syllable.h
"
25
#include "
core/mark.h
"
26
#include "
core/articulation.h
"
27
#include "
core/fermata.h
"
28
#include "
core/tempo.h
"
29
#include "
core/ritardando.h
"
30
#include "
core/crescendo.h
"
31
#include "
core/repeatmark.h
"
32
#include "
core/fingering.h
"
33
#include "
core/playablelength.h
"
34
#include "
core/diatonickey.h
"
35
36
class
CAMusElement
;
37
38
class
CAMusElementFactory
{
39
public
:
40
CAMusElementFactory
();
41
~CAMusElementFactory
();
42
43
CAMusElement
*
createMusElem
();
44
45
void
removeMusElem
(
bool
bReallyRemove =
false
);
46
47
void
configureMusElem
(
CAMusElement
&roMusElement );
48
49
inline
CAMusElement
*
musElement
() {
return
mpoMusElement
; };
50
inline
void
setMusElement
(
CAMusElement
*elt ) {
mpoMusElement
= elt; }
51
52
inline
void
cloneMusElem
() {
mpoMusElement
=
mpoMusElement
->
clone
(); }
53
inline
void
emptyMusElem
() {
mpoMusElement
=
mpoEmpty
; }
54
55
bool
configureClef
(
CAStaff
*staff,
56
CAMusElement
*right );
57
58
bool
configureKeySignature
(
CAStaff
*staff,
59
CAMusElement
*right );
60
61
bool
configureTimeSignature
(
CAStaff
*staff,
62
CAMusElement
*right );
63
64
bool
configureBarline
(
CAStaff
*staff,
65
CAMusElement
*right );
66
67
bool
configureRest
(
CAVoice
*voice,
68
CAMusElement
*right );
69
70
71
bool
configureNote
(
int
pitch,
72
CAVoice
*voice,
73
CAMusElement
*right,
74
bool
addToChord
75
);
76
77
static
void
placeAutoBar
(
CAPlayable
* elt );
78
79
bool
configureTuplet
( QList<CAPlayable*> listOfNotes );
80
81
bool
configureSlur
(
CAStaff
*staff,
82
CANote
*noteStart,
CANote
*noteEnd );
83
84
bool
configureMark
(
CAMusElement
*elt );
85
86
bool
configureFunctionMark
(
CAFunctionMarkContext
*fmc,
87
int
timeStart,
int
timeLength );
88
89
inline
CAMusElement::CAMusElementType
musElementType
() {
return
_musElementType
; }
90
void
setMusElementType
(
CAMusElement::CAMusElementType
eMEType ) {
_musElementType
= eMEType; }
91
92
inline
CAPlayableLength
&
playableLength
() {
return
_playableLength
; }
93
94
inline
void
setPlayableLength
(
CAPlayableLength
&
playableLength
)
95
{
_playableLength
=
playableLength
; };
96
97
void
addPlayableDotted
(
int
add,
CAPlayableLength
curLength );
98
99
inline
CANote::CAStemDirection
noteStemDirection
() {
return
_eNoteStemDirection
; }
100
101
inline
void
setNoteStemDirection
(
CANote::CAStemDirection
eDir )
102
{
_eNoteStemDirection
= eDir; }
103
104
inline
int
noteAccs
() {
return
_iNoteAccs
; };
105
106
inline
void
setNoteAccs
(
int
iNoteAccs )
107
{
_iNoteAccs
= iNoteAccs; };
108
109
inline
void
addNoteAccs
(
int
iAdd )
110
{
if
(
_iNoteAccs
+iAdd < 3)
_iNoteAccs
+= iAdd; };
111
112
inline
void
subNoteAccs
(
int
iSub )
113
{
if
(
_iNoteAccs
-iSub > -3)
_iNoteAccs
-= iSub; };
114
115
inline
int
diatonicKeyNumberOfAccs
() {
return
_diatonicKeyNumberOfAccs
; }
116
inline
void
setDiatonicKeyNumberOfAccs
(
int
accs) {
_diatonicKeyNumberOfAccs
= accs; }
117
inline
CADiatonicKey::CAGender
diatonicKeyGender
() {
return
_diatonicKeyGender
; }
118
inline
void
setDiatonicKeyGender
(
CADiatonicKey::CAGender
g ) {
_diatonicKeyGender
= g; }
119
120
inline
int
noteExtraAccs
() {
return
_iNoteExtraAccs
; };
121
122
inline
void
setNoteExtraAccs
(
int
iNoteExtraAccs )
123
{
_iNoteExtraAccs
= iNoteExtraAccs; };
124
125
inline
void
addNoteExtraAccs
(
int
iAdd )
126
{
_iNoteExtraAccs
+= iAdd; };
127
128
inline
void
subNoteExtraAccs
(
int
iSub )
129
{
_iNoteExtraAccs
-= iSub; };
130
131
inline
CARest::CARestType
restType
() {
return
_eRestType
; }
132
133
inline
void
setRestType
(
CARest::CARestType
eType)
134
{
_eRestType
= eType; }
135
136
inline
int
timeSigBeats
() {
return
_iTimeSigBeats
; }
137
inline
void
setTimeSigBeats
(
int
iTimeSigBeats )
138
{
_iTimeSigBeats
= iTimeSigBeats; };
139
140
inline
int
timeSigBeat
() {
return
_iTimeSigBeat
; }
141
inline
void
setTimeSigBeat
(
int
iTimeSigBeat )
142
{
_iTimeSigBeat
= iTimeSigBeat; };
143
144
inline
CAClef::CAPredefinedClefType
clef
() {
return
_eClef
; }
145
inline
void
setClef
(
CAClef::CAPredefinedClefType
eClefType )
146
{
_eClef
= eClefType; };
147
148
inline
int
clefOffset
() {
return
_iClefOffset
; }
// readable offset interval, not internal offset
149
inline
void
setClefOffset
(
int
offset )
150
{
_iClefOffset
= offset; };
151
152
inline
CABarline::CABarlineType
barlineType
() {
return
_eBarlineType
; }
153
inline
void
setBarlineType
(
CABarline::CABarlineType
type)
154
{
_eBarlineType
= type; }
155
156
inline
int
tupletNumber
() {
return
_tupletNumber
; }
157
inline
void
setTupletNumber
(
int
number ) {
_tupletNumber
= number; }
158
159
inline
int
tupletActualNumber
() {
return
_tupletActualNumber
; }
160
inline
void
setTupletActualNumber
(
int
actualNumber ) {
_tupletActualNumber
= actualNumber; }
161
162
inline
CASlur::CASlurType
slurType
() {
return
_eSlurType
; }
163
inline
void
setSlurType
(
CASlur::CASlurType
type ) {
_eSlurType
= type; }
164
165
inline
CASlur::CASlurStyle
slurStyle
() {
return
_slurStyle
; }
166
inline
void
setSlurStyle
(
CASlur::CASlurStyle
style ) {
_slurStyle
= style; }
167
168
inline
CAMark::CAMarkType
markType
() {
return
_markType
; }
169
inline
void
setMarkType
(
CAMark::CAMarkType
t ) {
_markType
= t; }
170
171
inline
CAArticulation::CAArticulationType
articulationType
() {
return
_articulationType
; }
172
inline
void
setArticulationType
(
CAArticulation::CAArticulationType
t ) {
_articulationType
= t; }
173
174
inline
CAFunctionMark::CAFunctionType
fmFunction
() {
return
_fmFunction
; }
175
inline
void
setFMFunction
(
CAFunctionMark::CAFunctionType
f ) {
_fmFunction
= f; }
176
177
inline
CAFunctionMark::CAFunctionType
fmChordArea
() {
return
_fmChordArea
; }
178
inline
void
setFMChordArea
(
CAFunctionMark::CAFunctionType
c ) {
_fmChordArea
= c; }
179
180
inline
CAFunctionMark::CAFunctionType
fmTonicDegree
() {
return
_fmTonicDegree
; }
181
inline
void
setFMTonicDegree
(
CAFunctionMark::CAFunctionType
td ) {
_fmTonicDegree
= td; }
182
183
inline
bool
isFMFunctionMinor
() {
return
_fmFunctionMinor
; }
184
inline
void
setFMFunctionMinor
(
bool
m ) {
_fmFunctionMinor
= m; }
185
186
inline
bool
isFMTonicDegreeMinor
() {
return
_fmTonicDegreeMinor
; }
187
inline
void
setFMTonicDegreeMinor
(
bool
m ) {
_fmTonicDegreeMinor
= m; }
188
189
inline
bool
isFMChordAreaMinor
() {
return
_fmChordAreaMinor
; }
190
inline
void
setFMChordAreaMinor
(
bool
m ) {
_fmChordAreaMinor
= m; }
191
192
inline
bool
isFMEllipse
() {
return
_fmEllipse
; }
193
inline
void
setFMEllipse
(
bool
e ) {
_fmEllipse
= e; }
194
195
inline
const
QString
dynamicText
() {
return
_dynamicText
; }
196
inline
void
setDynamicText
(
const
QString t ) {
_dynamicText
= t; }
197
198
inline
const
int
dynamicVolume
() {
return
_dynamicVolume
; }
199
inline
void
setDynamicVolume
(
const
int
vol ) {
_dynamicVolume
= vol; }
200
201
inline
const
int
instrument
() {
return
_instrument
; }
202
inline
void
setInstrument
(
const
int
instrument
) {
_instrument
=
instrument
; }
203
204
inline
const
CAFermata::CAFermataType
fermataType
() {
return
_fermataType
; }
205
inline
void
setFermataType
(
const
CAFermata::CAFermataType
type ) {
_fermataType
= type; }
206
207
inline
const
int
tempoBpm
() {
return
_tempoBpm
; }
208
inline
void
setTempoBpm
(
const
int
tempoBpm
) {
_tempoBpm
=
tempoBpm
; }
209
210
inline
CAPlayableLength
&
tempoBeat
() {
return
_tempoBeat
; }
211
inline
void
setTempoBeat
(
CAPlayableLength
& length ) {
_tempoBeat
= length; }
212
213
inline
const
CARitardando::CARitardandoType
ritardandoType
() {
return
_ritardandoType
; }
214
inline
void
setRitardandoType
(
CARitardando::CARitardandoType
t ) {
_ritardandoType
= t; }
215
216
inline
const
int
crescendoFinalVolume
() {
return
_crescendoFinalVolume
; }
217
inline
void
setCrescendoFinalVolume
(
const
int
v ) {
_crescendoFinalVolume
= v; }
218
219
inline
const
CACrescendo::CACrescendoType
crescendoType
() {
return
_crescendoType
; }
220
inline
void
setCrescendoType
(
const
CACrescendo::CACrescendoType
t ) {
_crescendoType
= t; }
221
222
inline
const
CARepeatMark::CARepeatMarkType
repeatMarkType
() {
return
_repeatMarkType
; }
223
inline
void
setRepeatMarkType
(
const
CARepeatMark::CARepeatMarkType
t ) {
_repeatMarkType
= t; }
224
225
inline
const
int
repeatMarkVoltaNumber
() {
return
_repeatMarkVoltaNumber
; }
226
inline
void
setRepeatMarkVoltaNumber
(
const
int
n ) {
_repeatMarkVoltaNumber
= n; }
227
228
inline
const
CAFingering::CAFingerNumber
fingeringFinger
() {
return
_fingeringFinger
; }
229
inline
void
setFingeringFinger
(
const
CAFingering::CAFingerNumber
f ) {
_fingeringFinger
= f; }
230
231
inline
const
bool
isFingeringOriginal
() {
return
_fingeringOriginal
; }
232
inline
void
setFingeringOriginal
(
const
int
o ) {
_fingeringOriginal
= o; }
233
private
:
234
CAMusElement
*
mpoMusElement
;
// Newly created music element itself
235
CAMusElement
*
mpoEmpty
;
// An empty (dummy) element.
236
238
// Element creation parameters //
240
CAMusElement::CAMusElementType
_musElementType
;
// Music element type
241
242
// Staff music elements
243
CAPlayableLength
_playableLength
;
// Length of note/rest to be added
244
CANote::CAStemDirection
_eNoteStemDirection
;
// Note stem direction to be inserted
245
CASlur::CASlurType
_eSlurType
;
// Slur type to be placed
246
int
_tupletNumber
;
// Tuplet number of notes
247
int
_tupletActualNumber
;
// Tuplet actual number of notes
248
int
_iPlayableDotted
;
// Number of dots to be inserted for the note/rest
249
int
_iNoteExtraAccs
;
// Extra note accidentals for new notes which user adds/removes with +/- keys
250
int
_iNoteAccs
;
// Note accidentals at specific coordinates updated regularily when in insert mode
251
CARest::CARestType
_eRestType
;
// Hidden/Normal rest
252
int
_diatonicKeyNumberOfAccs
;
// Key signature number of accidentals
253
CADiatonicKey::CAGender
_diatonicKeyGender
;
// Major/Minor gender of the key signature
254
int
_iTimeSigBeats
;
// Time signature number of beats to be inserted
255
int
_iTimeSigBeat
;
// Time signature beat to be inserted
256
CAClef::CAPredefinedClefType
_eClef
;
// Type of the clef to be inserted
257
int
_iClefOffset
;
// Interval offset for the clef
258
CABarline::CABarlineType
_eBarlineType
;
// Type of the barline
259
CAMark::CAMarkType
_markType
;
// Type of the mark
260
CAArticulation::CAArticulationType
_articulationType
;
// Type of the articulation mark
261
CASlur::CASlurStyle
_slurStyle
;
// Style of the slur (solid, dotted)
262
263
// Function Mark
264
CAFunctionMark::CAFunctionType
_fmFunction
;
// Name of the function
265
CAFunctionMark::CAFunctionType
_fmChordArea
;
// Chord area of the function
266
CAFunctionMark::CAFunctionType
_fmTonicDegree
;
// Tonic degree of the function
267
bool
_fmFunctionMinor
;
268
bool
_fmChordAreaMinor
;
269
bool
_fmTonicDegreeMinor
;
270
bool
_fmEllipse
;
271
272
// Marks
273
QString
_dynamicText
;
274
int
_dynamicVolume
;
275
int
_instrument
;
276
CAFermata::CAFermataType
_fermataType
;
277
CAPlayableLength
_tempoBeat
;
278
int
_tempoBpm
;
279
CARitardando::CARitardandoType
_ritardandoType
;
280
int
_crescendoFinalVolume
;
281
CACrescendo::CACrescendoType
_crescendoType
;
282
CARepeatMark::CARepeatMarkType
_repeatMarkType
;
283
int
_repeatMarkVoltaNumber
;
284
CAFingering::CAFingerNumber
_fingeringFinger
;
285
int
_fingeringOriginal
;
286
};
287
#endif // MUSELEMENTFACTORY_H_
Generated on Fri Jan 11 2013 14:40:12 for Canorus by
1.8.3