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
note.h
Go to the documentation of this file.
1
8
#ifndef NOTE_H_
9
#define NOTE_H_
10
11
#include "
core/muselement.h
"
12
#include "
core/playable.h
"
13
#include "
core/slur.h
"
14
#include "
core/diatonicpitch.h
"
15
16
class
CAVoice
;
17
18
class
CANote
:
public
CAPlayable
{
19
public
:
20
enum
CAStemDirection
{
21
StemNeutral
,
22
StemUp
,
23
StemDown
,
24
StemPreferred
// voice's direction
25
};
26
27
CANote
(
CADiatonicPitch
pitch,
CAPlayableLength
length,
CAVoice
*
voice
,
int
timeStart
,
int
timeLength
=-1 );
28
CANote
*
clone
(
CAVoice
*
voice
=0);
29
30
virtual
~CANote
();
31
32
CAPlayableLength
noteLength
() {
return
_playableLength
; }
33
34
inline
CADiatonicPitch
&
diatonicPitch
() {
return
_diatonicPitch
; }
35
inline
void
setDiatonicPitch
(
CADiatonicPitch
& pitch ) {
36
_diatonicPitch
= pitch;
37
updateTies
();
38
}
39
40
CAStemDirection
stemDirection
() {
return
_stemDirection
; }
41
void
setStemDirection
(
CAStemDirection
direction);
42
43
int
notePosition
();
44
45
inline
CASlur
*
tieStart
() {
return
_tieStart
; }
46
inline
CASlur
*
tieEnd
() {
return
_tieEnd
; }
47
inline
CASlur
*
slurStart
() {
return
_slurStart
; }
48
inline
CASlur
*
slurEnd
() {
return
_slurEnd
; }
49
inline
CASlur
*
phrasingSlurStart
() {
return
_phrasingSlurStart
; }
50
inline
CASlur
*
phrasingSlurEnd
() {
return
_phrasingSlurEnd
; }
51
52
CAStemDirection
actualStemDirection
();
53
CASlur::CASlurDirection
actualSlurDirection
();
54
55
inline
void
setTieStart
(
CASlur
*
tieStart
) {
_tieStart
=
tieStart
; }
56
inline
void
setTieEnd
(
CASlur
*
tieEnd
) {
_tieEnd
=
tieEnd
; }
57
inline
void
setSlurStart
(
CASlur
*
slurStart
) {
_slurStart
=
slurStart
; }
58
inline
void
setSlurEnd
(
CASlur
*
slurEnd
) {
_slurEnd
=
slurEnd
; }
59
inline
void
setPhrasingSlurStart
(
CASlur
*pSlurStart ) {
_phrasingSlurStart
= pSlurStart; }
60
inline
void
setPhrasingSlurEnd
(
CASlur
*pSlurEnd ) {
_phrasingSlurEnd
= pSlurEnd; }
61
62
void
updateTies
();
63
64
bool
isPartOfChord
();
65
bool
isLastInChord
();
66
bool
isFirstInChord
();
67
QList<CANote*>
getChord
();
68
69
bool
forceAccidentals
() {
return
_forceAccidentals
; }
70
void
setForceAccidentals
(
bool
force) {
_forceAccidentals
= force; }
71
72
static
const
QString
generateNoteName
(
int
pitch,
int
accs);
73
74
static
const
QString
stemDirectionToString
(
CAStemDirection
);
75
static
CAStemDirection
stemDirectionFromString
(
const
QString);
76
77
int
compare
(
CAMusElement
* elt);
78
79
private
:
80
CADiatonicPitch
_diatonicPitch
;
81
CAStemDirection
_stemDirection
;
82
bool
_forceAccidentals
;
// Always draw notes accidentals.
83
85
// Slurs and ties //
87
CASlur
*
_tieStart
;
88
CASlur
*
_tieEnd
;
89
CASlur
*
_slurStart
;
90
CASlur
*
_slurEnd
;
91
CASlur
*
_phrasingSlurStart
;
92
CASlur
*
_phrasingSlurEnd
;
93
};
94
#endif
/* NOTE_H_*/
Generated on Fri Jan 11 2013 14:40:12 for Canorus by
1.8.3