Diffstat (limited to 'noncore/multimedia/tonleiter/tonleiterdatahelper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/tonleiter/tonleiterdatahelper.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp b/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp index c52e0da..5714cea 100644 --- a/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp +++ b/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp | |||
@@ -1,26 +1,28 @@ | |||
1 | #include "tonleiterdatahelper.h" | 1 | #include "tonleiterdatahelper.h" |
2 | 2 | ||
3 | using namespace Data; | ||
4 | |||
3 | int Note::getOctaveOfNote(int note) | 5 | int Note::getOctaveOfNote(int note) |
4 | { | 6 | { |
5 | int remain=note%12; | 7 | int remain=note%12; |
6 | return (note-remain)/12; | 8 | return (note-remain)/12; |
7 | } | 9 | } |
8 | //**************************************************************************** | 10 | //**************************************************************************** |
9 | QString Note::getNameOfNote(int note) | 11 | QString Note::getNameOfNote(int note) |
10 | { | 12 | { |
11 | int octave=getOctaveOfNote(note); | 13 | int octave=getOctaveOfNote(note); |
12 | return notenames[note-12*octave]; | 14 | return notenames[note-12*octave]; |
13 | } | 15 | } |
14 | //**************************************************************************** | 16 | //**************************************************************************** |
15 | int Note::getNoteFromName(QString name,int octave) | 17 | int Note::getNoteFromName(QString name,int octave) |
16 | { | 18 | { |
17 | int notevalue=0; | 19 | int notevalue=0; |
18 | for(int a=0;a<12;a++) | 20 | for(int a=0;a<12;a++) |
19 | { | 21 | { |
20 | if(name==notenames[a]) | 22 | if(name==notenames[a]) |
21 | { | 23 | { |
22 | notevalue=a; | 24 | notevalue=a; |
23 | break; | 25 | break; |
24 | } | 26 | } |
25 | } | 27 | } |
26 | return notevalue+12*octave; | 28 | return notevalue+12*octave; |