1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #include "Tone.h"
-
- Tone::Tone(QString name, QColor color, bool flatTone): name(name), color(color), flatTone(flatTone){
-
- };
- Tone::Tone(){};
-
- int Tone::getKeyboardPosition()const{
- if(QString::compare(name, "c", Qt::CaseInsensitive)==0) return 0;
- if(QString::compare(name, "cis", Qt::CaseInsensitive)==0) return 0;
- if(QString::compare(name, "d", Qt::CaseInsensitive)==0) return 1;
- if(QString::compare(name, "dis", Qt::CaseInsensitive)==0) return 1;
- if(QString::compare(name, "e", Qt::CaseInsensitive)==0) return 2;
- if(QString::compare(name, "f", Qt::CaseInsensitive)==0) return 3;
- if(QString::compare(name, "fis", Qt::CaseInsensitive)==0) return 3;
- if(QString::compare(name, "g", Qt::CaseInsensitive)==0) return 4;
- if(QString::compare(name, "gis", Qt::CaseInsensitive)==0) return 4;
- if(QString::compare(name, "a", Qt::CaseInsensitive)==0) return 5;
- if(QString::compare(name, "ais", Qt::CaseInsensitive)==0) return 5;
- if(QString::compare(name, "h", Qt::CaseInsensitive)==0) return 6;
- return 7;
- };
-
- int Tone::getQuintenPosition()const{
- if(QString::compare(name, "c", Qt::CaseInsensitive)==0) return 0;
- if(QString::compare(name, "g", Qt::CaseInsensitive)==0) return 1;
- if(QString::compare(name, "d", Qt::CaseInsensitive)==0) return 2;
- if(QString::compare(name, "a", Qt::CaseInsensitive)==0) return 3;
- if(QString::compare(name, "e", Qt::CaseInsensitive)==0) return 4;
- if(QString::compare(name, "h", Qt::CaseInsensitive)==0) return 5;
- if(QString::compare(name, "fis", Qt::CaseInsensitive)==0) return 6;
- if(QString::compare(name, "cis", Qt::CaseInsensitive)==0) return 7;
- if(QString::compare(name, "gis", Qt::CaseInsensitive)==0) return 8;
- if(QString::compare(name, "dis", Qt::CaseInsensitive)==0) return 9;
- if(QString::compare(name, "ais", Qt::CaseInsensitive)==0) return 10;
- if(QString::compare(name, "f", Qt::CaseInsensitive)==0) return 11;
-
- return 30;
- };
-
- void Tone::setColor(QColor color){
- this->color = color;
- emit colorchanged();
- };
- void Tone::setName(QString name){
- this->name = name;
- };
- void Tone::setFlatTone(bool flatTone){
- this->flatTone = flatTone;
- };
-
- QString Tone::getName()const{
- return name;
- };
- QColor Tone::getColor()const{
- return color;
- };
- bool Tone::getFlatTone()const{
- return flatTone;
- };
-
- Tone::~Tone(){};
|