summaryrefslogtreecommitdiff
path: root/noncore/multimedia/tonleiter/tonleiterdatahelper.h
blob: 061c781ce62a3f33d8ccfe393d23c67df814b5a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef TONLEITER_DATA_HELPER_H
#define TONLEITER_DATA_HELPER_H

#include <qstring.h>
#include <qvaluelist.h>

namespace Data
{
    namespace Note
    {
        const QString notenames[]={"A","Bb","B","C","C#","D","D#","E","F","F#","G","G#"};

        int getOctaveOfNote(int note);
        QString getNameOfNote(int note);
        int getNoteFromName(QString name,int octave);
        int octaveOfBaseNote(int base,int note);
    };

    class Instrument
    {
    private:
        QString name;
        int frets;
        QValueList<int> strings;
    public:
        Instrument();
        Instrument(QString name,int frets,QValueList<int> strings);
        ~Instrument();
    public:
        int noOfStrings();
        int noOfFrets();
        QString instName();
        int string(int id);
        int noOfOctaves();
        int lowestNote();
        int highestNote();
    };

    class Scale
    {
    private:
        QValueList<int> halftones;
        QString name;
    public:
        Scale();
        Scale(QString name,QValueList<int> halftones);
        ~Scale();
    public:
        int noOfHaltones();
        int getHalfTone(int id);
        QString scaleName();
        bool noteInScale(int base,int note);
    };
};

#endif //TONLEITER_DATA_HELPER_H