summaryrefslogtreecommitdiff
path: root/noncore/multimedia/tonleiter/tonleiterdatahelper.h
blob: 94895eab03f4f6f825ae73f9676b10cfc9db7486 (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
#ifndef TONLEITER_DATA_HELPER_H
#define TONLEITER_DATA_HELPER_H

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

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

    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();
};

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