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
diatonickey.h
Go to the documentation of this file.
1
8
#ifndef DIATONICKEY_H_
9
#define DIATONICKEY_H_
10
11
#include "
core/diatonicpitch.h
"
12
#include <QString>
13
#include <QList>
14
15
class
CADiatonicKey
{
16
public
:
17
enum
CAGender
{
18
Major
,
19
Minor
20
};
21
22
enum
CAShape
{
23
Natural
,
24
Harmonic
,
25
Melodic
26
};
27
28
CADiatonicKey
();
29
CADiatonicKey
(
const
QString& key );
30
CADiatonicKey
(
const
int
&
numberOfAccs
,
const
CAGender
&
gender
);
31
CADiatonicKey
(
const
CADiatonicPitch
& pitch,
const
CAGender
&
gender
);
32
CADiatonicKey
(
const
CADiatonicPitch
& pitch,
const
CAGender
&
gender
,
const
CAShape
&
shape
);
33
34
bool
operator==
(
CADiatonicKey
);
35
inline
bool
operator!=
(
CADiatonicKey
p) {
return
!
operator==
(p); }
36
#ifndef SWIG
37
void
operator=
(
const
QString& key);
38
#endif
39
40
CADiatonicKey
operator+
(
CAInterval
);
41
42
inline
CADiatonicPitch
diatonicPitch
() {
return
_diatonicPitch
; }
43
inline
const
CAGender
gender
() {
return
_gender
; }
44
inline
const
CAShape
shape
() {
return
_shape
; }
45
46
inline
void
setDiatonicPitch
(
const
CADiatonicPitch
p ) {
_diatonicPitch
= p; }
47
inline
void
setGender
(
const
CAGender
g ) {
_gender
= g; }
48
inline
void
setShape
(
const
CAShape
s ) {
_shape
= s; }
49
50
static
const
QString
shapeToString
(
CAShape
);
51
static
CAShape
shapeFromString
(
const
QString );
52
static
const
QString
genderToString
(
CAGender
);
53
static
CAGender
genderFromString
(
const
QString );
54
55
static
const
QString
diatonicKeyToString
(
CADiatonicKey
k );
56
static
CADiatonicKey
diatonicKeyFromString
(
const
QString );
57
58
int
numberOfAccs
();
59
QList<int>
accsMatrix
();
60
int
noteAccs
(
int
noteName );
61
62
private
:
63
CADiatonicPitch
_diatonicPitch
;
// pitch of the key
64
CAGender
_gender
;
// major, minor
65
CAShape
_shape
;
// natural, harmonic, melodic
66
};
67
#endif
/* DIATONICKEY_H_ */
Generated on Fri Jan 11 2013 14:40:12 for Canorus by
1.8.3