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
keysignature.h
Go to the documentation of this file.
1
8
#ifndef KEYSIGNATURE_H_
9
#define KEYSIGNATURE_H_
10
11
#include <QString>
12
13
#include "
core/muselement.h
"
14
#include "
core/diatonickey.h
"
15
#include "
core/staff.h
"
16
17
class
CAContext
;
18
19
class
CAKeySignature
:
public
CAMusElement
{
20
public
:
21
enum
CAKeySignatureType
{
22
MajorMinor
,
// Marks the standard 7-level Major/Minor
23
Modus
,
24
Custom
25
};
26
27
enum
CAModus
{
28
Ionian
,
29
Dorian
,
30
Phrygian
,
31
Lydian
,
32
Mixolydian
,
33
Aeolian
,
34
Locrian
,
35
Hypodorian
,
36
Hypolydian
,
37
Hypomixolydian
,
38
Hypophrygian
39
};
40
41
CAKeySignature
(
CADiatonicKey
k,
CAStaff
*
staff
,
int
timeStart
);
42
CAKeySignature
(
CAModus
m,
CAStaff
*
staff
,
int
timeStart
);
43
~CAKeySignature
();
44
CAKeySignature
*
clone
(
CAContext
*
context
=0);
45
CAStaff
*
staff
() {
return
static_cast<
CAStaff
*
>
(
context
()); }
46
47
inline
CAKeySignatureType
keySignatureType
() {
return
_keySignatureType
; }
48
inline
void
setKeySignatureType
(
CAKeySignatureType
type) {
_keySignatureType
= type; }
49
50
CADiatonicKey
diatonicKey
() {
return
_diatonicKey
; }
51
CAModus
modus
() {
return
_modus
; }
52
53
void
setDiatonicKey
(
CADiatonicKey
k) {
_diatonicKey
= k;
updateAccidentals
(); }
54
void
setModus
(
CAModus
modus
) {
_modus
=
modus
; }
55
56
signed
char
*
accidentals
() {
return
_accidentals
; }
57
58
int
compare
(
CAMusElement
* elt);
59
60
static
const
QString
keySignatureTypeToString
(
CAKeySignatureType
);
61
static
CAKeySignatureType
keySignatureTypeFromString
(
const
QString);
62
static
const
QString
modusToString
(
CAModus
);
63
static
CAModus
modusFromString
(
const
QString);
64
65
private
:
66
void
updateAccidentals
();
67
68
CAKeySignatureType
_keySignatureType
;
69
CAModus
_modus
;
70
CADiatonicKey
_diatonicKey
;
71
72
signed
char
_accidentals
[7];
// Accidentals configuration for each level
73
};
74
#endif
/* KEYSIGNATURE_H_ */
Generated on Fri Jan 11 2013 14:40:12 for Canorus by
1.8.3