summaryrefslogtreecommitdiff
path: root/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp
authorwaspe <waspe>2004-01-24 13:44:29 (UTC)
committer waspe <waspe>2004-01-24 13:44:29 (UTC)
commit5f333c6832ff429a00498e6a36be950525541a2a (patch) (side-by-side diff)
tree035616d3cc11622f6d9b14245372362620327a46 /noncore/multimedia/tonleiter/tonleiterdatahelper.cpp
parentd542ba6a426f9868d521dbd9eb502184086535fc (diff)
downloadopie-5f333c6832ff429a00498e6a36be950525541a2a.zip
opie-5f333c6832ff429a00498e6a36be950525541a2a.tar.gz
opie-5f333c6832ff429a00498e6a36be950525541a2a.tar.bz2
new color scheme on fretboard, maekes each ocatave appear in different color
Diffstat (limited to 'noncore/multimedia/tonleiter/tonleiterdatahelper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/tonleiter/tonleiterdatahelper.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp b/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp
index 156dba5..d904a71 100644
--- a/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp
+++ b/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp
@@ -76,9 +76,18 @@ int Instrument::string(int id)
//****************************************************************************
int Instrument::noOfOctaves()
{
- int lowest=strings[0];
- int highest=strings[strings.count()-1]+frets;
- return (int) ceil((highest-lowest)/12.0);
+ return (int) ceil((highestNote()-lowestNote())/12.0);
+}
+//****************************************************************************
+int Instrument::lowestNote()
+{
+ return strings[0];
+
+}
+//****************************************************************************
+int Instrument::highestNote()
+{
+ return strings[strings.count()-1]+frets;
}
//****************************************************************************
//****************************************************************************