XX CMake Package
Loading...
Searching...
No Matches
XXScale.h
Go to the documentation of this file.
1#ifndef XXScaleH
2#define XXScaleH
3
4#include "XXMusicExportDef.h"
5
6#include <QMap>
7
8#include "XXNote.h"
9
10namespace XX
11{
14
15 class XXMUSIC_DECLSPEC Scale
16 {
17 public:
18 using List = QList<Scale>;
19 using KeyList = QList<bool>;
20
21 class Finder;
22
23 public:
24 static List getList();
26 static Scale getScaleByName(const QString& name, bool isMajor = true);
27
28 public:
29 const QString getOffset() const;
30 const QString& getMajorName() const;
31 const QString& getMinorName() const;
32 const Note& getMajorNote() const;
33
34 const KeyList& getActiveKeys() const;
35 bool isActive(const int index) const;
36
37 Note quantize(const Note& input) const;
38 bool noteInScale(const Note& note) const;
39
40 private:
41 using Map = QMap<int, Scale>;
42
43 private:
44 Scale();
45
46 private:
47 int offset;
48 QString majorName;
49 QString minorName;
50 Note majorNote;
51
52 KeyList active;
53
54 static const Map availableScales;
55 };
56
58 {
59 public:
61
62 public:
63 void addNote(const Note& note);
64 const Scale::List& getScales() const;
65
66 private:
67 Scale::List validScales;
68 };
69} // namespace XX
70
71#endif // NOT XXScaleH
#define XXMUSIC_DECLSPEC
Definition XXMusicExportDef.h:11
musical note
Definition XXNote.h:15
Definition XXScale.h:58
void addNote(const Note &note)
const Scale::List & getScales() const
static Scale getScaleByName(const QString &name, bool isMajor=true)
QList< bool > KeyList
Definition XXScale.h:19
static List getList()
Note quantize(const Note &input) const
const Note & getMajorNote() const
const QString & getMajorName() const
static KeyList emptyKeyList()
const KeyList & getActiveKeys() const
bool noteInScale(const Note &note) const
const QString getOffset() const
const QString & getMinorName() const
bool isActive(const int index) const
QList< Scale > List
Definition XXScale.h:18
Definition XXPopulatedAbstract.h:11