Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
16 public:
17  enum CAGender {
20  };
21 
22  enum CAShape {
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 
35  inline bool operator!=(CADiatonicKey p) { return !operator==(p); }
36 #ifndef SWIG
37  void operator=(const QString& key);
38 #endif
39 
41 
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_ */