Diffstat (limited to 'noncore/multimedia/tonleiter') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/tonleiter/config.in | 2 | ||||
-rw-r--r-- | noncore/multimedia/tonleiter/editinst.cpp | 11 | ||||
-rw-r--r-- | noncore/multimedia/tonleiter/fretboard.cpp | 13 | ||||
-rw-r--r-- | noncore/multimedia/tonleiter/tonleiter.pro | 6 | ||||
-rw-r--r-- | noncore/multimedia/tonleiter/tonleiterdata.cpp | 11 | ||||
-rw-r--r-- | noncore/multimedia/tonleiter/tonleiterdatahelper.cpp | 6 |
6 files changed, 29 insertions, 20 deletions
diff --git a/noncore/multimedia/tonleiter/config.in b/noncore/multimedia/tonleiter/config.in index d580ad7..9bd167e 100644 --- a/noncore/multimedia/tonleiter/config.in +++ b/noncore/multimedia/tonleiter/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config TONLEITER | 1 | config TONLEITER |
2 | boolean "tonleiter (shows scales on sting instruments)" | 2 | boolean "tonleiter (shows scales on sting instruments)" |
3 | default "n" | 3 | default "n" |
4 | depends ( LIBQPE || LIBQPE-X11 ) | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE |
diff --git a/noncore/multimedia/tonleiter/editinst.cpp b/noncore/multimedia/tonleiter/editinst.cpp index ccb4560..a8c20c8 100644 --- a/noncore/multimedia/tonleiter/editinst.cpp +++ b/noncore/multimedia/tonleiter/editinst.cpp | |||
@@ -1,9 +1,14 @@ | |||
1 | #include "editinst.h" | 1 | #include "editinst.h" |
2 | 2 | ||
3 | #include <qpushbutton.h> | 3 | /* OPIE */ |
4 | 4 | #include <opie2/odebug.h> | |
5 | #include <qpe/config.h> | ||
5 | #include <qpe/qpeapplication.h> | 6 | #include <qpe/qpeapplication.h> |
7 | using namespace Opie::Core; | ||
8 | |||
9 | /* QT */ | ||
10 | #include <qpushbutton.h> | ||
6 | 11 | ||
7 | Menu::InstEditDialog::InstEditDialog(TonleiterData* data,QWidget* parent,const char* name) | 12 | Menu::InstEditDialog::InstEditDialog(TonleiterData* data,QWidget* parent,const char* name) |
8 | :QDialog(parent,name,true,0),data(data) | 13 | :QDialog(parent,name,true,0),data(data) |
9 | { | 14 | { |
@@ -99,9 +104,9 @@ void Menu::InstEditDialog::saveInstrument() | |||
99 | void Menu::InstEditDialog::loadInstrument() | 104 | void Menu::InstEditDialog::loadInstrument() |
100 | { | 105 | { |
101 | stringlist.clear(); | 106 | stringlist.clear(); |
102 | Instrument inst=data->getInstrument(instid); | 107 | Instrument inst=data->getInstrument(instid); |
103 | qDebug("load Instrument : %d strings",inst.noOfStrings()); | 108 | odebug << "load Instrument : " << inst.noOfStrings() << " strings" << oendl; |
104 | for(uint s=0;s<inst.noOfStrings();s++) | 109 | for(uint s=0;s<inst.noOfStrings();s++) |
105 | { | 110 | { |
106 | stringlist.append(new EditStringWidget(inst.string(s),stringwidget)); | 111 | stringlist.append(new EditStringWidget(inst.string(s),stringwidget)); |
107 | } | 112 | } |
diff --git a/noncore/multimedia/tonleiter/fretboard.cpp b/noncore/multimedia/tonleiter/fretboard.cpp index 7e63e01..58bdb86 100644 --- a/noncore/multimedia/tonleiter/fretboard.cpp +++ b/noncore/multimedia/tonleiter/fretboard.cpp | |||
@@ -1,6 +1,11 @@ | |||
1 | #include "fretboard.h" | 1 | #include "fretboard.h" |
2 | 2 | ||
3 | /* OPIE */ | ||
4 | #include <opie2/odebug.h> | ||
5 | using namespace Opie::Core; | ||
6 | |||
7 | /* QT */ | ||
3 | #include <qpainter.h> | 8 | #include <qpainter.h> |
4 | 9 | ||
5 | Graph::FretBoard::FretBoard(TonleiterData* data,QWidget* parent,const char* name,WFlags f) | 10 | Graph::FretBoard::FretBoard(TonleiterData* data,QWidget* parent,const char* name,WFlags f) |
6 | :QWidget(parent,name,f),data(data) | 11 | :QWidget(parent,name,f),data(data) |
@@ -26,9 +31,9 @@ void Graph::FretBoard::paintEvent(QPaintEvent* pe) | |||
26 | Q_UNUSED(pe); | 31 | Q_UNUSED(pe); |
27 | 32 | ||
28 | int instid=data->getCurrentInstrumentID(); | 33 | int instid=data->getCurrentInstrumentID(); |
29 | inst=data->getInstrument(instid); | 34 | inst=data->getInstrument(instid); |
30 | //qDebug("inst %d is %s",instid,inst.instName().data()); | 35 | //odebug << "inst " << instid << " is " << inst.instName().data() << "" << oendl; |
31 | 36 | ||
32 | QRect mysize=rect(); | 37 | QRect mysize=rect(); |
33 | 38 | ||
34 | xmargin=(int)(mysize.width()*0.05); | 39 | xmargin=(int)(mysize.width()*0.05); |
@@ -142,19 +147,19 @@ void Graph::FretBoard::paintScale(QPainter* p) | |||
142 | 147 | ||
143 | //no more than six octaves can be visualised (there is a zero octave) | 148 | //no more than six octaves can be visualised (there is a zero octave) |
144 | int octave=Note::octaveOfBaseNote(data->getCurrentBaseNote(),note)-baseoctave; | 149 | int octave=Note::octaveOfBaseNote(data->getCurrentBaseNote(),note)-baseoctave; |
145 | if(octave<0) | 150 | if(octave<0) |
146 | qDebug("%d,%d",octave,baseoctave); | 151 | odebug << "" << octave << "," << baseoctave << "" << oendl; |
147 | if(octave>5) | 152 | if(octave>5) |
148 | { | 153 | { |
149 | qDebug("octave out of range"); | 154 | odebug << "octave out of range" << oendl; |
150 | octave=5; | 155 | octave=5; |
151 | } | 156 | } |
152 | 157 | ||
153 | p->setPen(QColor(255,0,0)); | 158 | p->setPen(QColor(255,0,0)); |
154 | int c= ( (note-12*baseoctave) - (12*octave+data->getCurrentBaseNote()) )*15; | 159 | int c= ( (note-12*baseoctave) - (12*octave+data->getCurrentBaseNote()) )*15; |
155 | if(c<0 || c>255) | 160 | if(c<0 || c>255) |
156 | qDebug("%d = %d - ( %d + %d)",c,note,12*octave,data->getCurrentBaseNote()); | 161 | odebug << "" << c << " = " << note << " - ( " << 12*octave << " + " << data->getCurrentBaseNote() << ")" << oendl; |
157 | QColor dotcolor(255,255,255); | 162 | QColor dotcolor(255,255,255); |
158 | 163 | ||
159 | if(octave==0) | 164 | if(octave==0) |
160 | dotcolor=QColor(c,c,255); | 165 | dotcolor=QColor(c,c,255); |
diff --git a/noncore/multimedia/tonleiter/tonleiter.pro b/noncore/multimedia/tonleiter/tonleiter.pro index 4bd1bc2..4be3bef 100644 --- a/noncore/multimedia/tonleiter/tonleiter.pro +++ b/noncore/multimedia/tonleiter/tonleiter.pro | |||
@@ -1,13 +1,11 @@ | |||
1 | TEMPLATE = app | 1 | TEMPLATE = app |
2 | #CONFIG = qt warn_on | ||
3 | CONFIG = qt warn_on | 2 | CONFIG = qt warn_on |
4 | HEADERS = mainwidget.h tonleiterdata.h tonleiterdatahelper.h fretboard.h menuwidget.h editinst.h editstringwidget.h editscale.h pianoscale.h | 3 | HEADERS = mainwidget.h tonleiterdata.h tonleiterdatahelper.h fretboard.h menuwidget.h editinst.h editstringwidget.h editscale.h pianoscale.h |
5 | SOURCES = mainwidget.cpp tonleiterdata.cpp tonleiterdatahelper.cpp fretboard.cpp menuwidget.cpp main.cpp editinst.cpp editstringwidget.cpp editscale.cpp pianoscale.cpp | 4 | SOURCES = mainwidget.cpp tonleiterdata.cpp tonleiterdatahelper.cpp fretboard.cpp menuwidget.cpp main.cpp editinst.cpp editstringwidget.cpp editscale.cpp pianoscale.cpp |
6 | INCLUDEPATH += $(OPIEDIR)/include | 5 | INCLUDEPATH += $(OPIEDIR)/include |
7 | DEPENDPATH += $(OPIEDIR)/include | 6 | DEPENDPATH += $(OPIEDIR)/include |
8 | LIBS += -lqpe | 7 | LIBS += -lqpe -lopiecore2 |
9 | INTERFACES = | ||
10 | TARGET = tonleiter | 8 | TARGET = tonleiter |
11 | DESTDIR = $(OPIEDIR)/bin | 9 | DESTDIR = $(OPIEDIR)/bin |
12 | #TMAKE_CXXFLAGS += -DQT_QWS_VERCEL_IDR -DQWS -fno-exceptions -fno-rtti | 10 | |
13 | include ( $(OPIEDIR)/include.pro ) | 11 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/multimedia/tonleiter/tonleiterdata.cpp b/noncore/multimedia/tonleiter/tonleiterdata.cpp index 33b3c49..564b7f0 100644 --- a/noncore/multimedia/tonleiter/tonleiterdata.cpp +++ b/noncore/multimedia/tonleiter/tonleiterdata.cpp | |||
@@ -1,10 +1,11 @@ | |||
1 | #include "tonleiterdata.h" | 1 | #include "tonleiterdata.h" |
2 | |||
3 | #include <qpe/config.h> | ||
4 | |||
5 | using namespace Data; | 2 | using namespace Data; |
6 | 3 | ||
4 | /* OPIE */ | ||
5 | #include <opie2/odebug.h> | ||
6 | #include <qpe/config.h> | ||
7 | using namespace Opie::Core; | ||
7 | 8 | ||
8 | TonleiterData::TonleiterData(QObject* parent) | 9 | TonleiterData::TonleiterData(QObject* parent) |
9 | :QObject(parent) | 10 | :QObject(parent) |
10 | { | 11 | { |
@@ -151,9 +152,9 @@ Instrument TonleiterData::getInstrument(int id) | |||
151 | if(id>=0 && id<noOfInstruments()) | 152 | if(id>=0 && id<noOfInstruments()) |
152 | return instruments[id]; | 153 | return instruments[id]; |
153 | else | 154 | else |
154 | { | 155 | { |
155 | qDebug("undefined insrtument %d of %d",id,instruments.count()); | 156 | odebug << "undefined insrtument " << id << " of " << instruments.count() << "" << oendl; |
156 | return Instrument(); | 157 | return Instrument(); |
157 | } | 158 | } |
158 | 159 | ||
159 | } | 160 | } |
@@ -173,9 +174,9 @@ Scale TonleiterData::getScale(int id) | |||
173 | if(id>=0 && id<noOfScales()) | 174 | if(id>=0 && id<noOfScales()) |
174 | return scales[id]; | 175 | return scales[id]; |
175 | else | 176 | else |
176 | { | 177 | { |
177 | qDebug("Undefined scale"); | 178 | odebug << "Undefined scale" << oendl; |
178 | return Scale(); | 179 | return Scale(); |
179 | } | 180 | } |
180 | } | 181 | } |
181 | //**************************************************************************** | 182 | //**************************************************************************** |
diff --git a/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp b/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp index d904a71..285d2c1 100644 --- a/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp +++ b/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp | |||
@@ -33,9 +33,9 @@ int Note::getNoteFromName(QString name,int octave) | |||
33 | int Note::octaveOfBaseNote(int base,int note) | 33 | int Note::octaveOfBaseNote(int base,int note) |
34 | { | 34 | { |
35 | int normnote = (note>=base) ? note-base : (12-base)+note; | 35 | int normnote = (note>=base) ? note-base : (12-base)+note; |
36 | int octave=getOctaveOfNote(normnote); | 36 | int octave=getOctaveOfNote(normnote); |
37 | //qDebug("note %d of %d base is norm %d -> ocatve %d",note,base,normnote,octave); | 37 | //odebug << "note " << note << " of " << base << " base is norm " << normnote << " -> ocatve " << octave << "" << oendl; |
38 | return octave; | 38 | return octave; |
39 | } | 39 | } |
40 | //**************************************************************************** | 40 | //**************************************************************************** |
41 | //**************************************************************************** | 41 | //**************************************************************************** |
@@ -130,14 +130,14 @@ bool Scale::noteInScale(int base,int note) | |||
130 | int normnote = (note>=base) ? note-base : (12-base)+note; | 130 | int normnote = (note>=base) ? note-base : (12-base)+note; |
131 | 131 | ||
132 | if(halftones.contains(normnote)>0) | 132 | if(halftones.contains(normnote)>0) |
133 | { | 133 | { |
134 | //qDebug("OK : base : %d, note %d -> norm %d",base,note,normnote); | 134 | //odebug << "OK : base : " << base << ", note " << note << " -> norm " << normnote << "" << oendl; |
135 | return true; | 135 | return true; |
136 | } | 136 | } |
137 | else | 137 | else |
138 | { | 138 | { |
139 | //qDebug("BAD : base : %d, note %d -> norm %d",base,note,normnote); | 139 | //odebug << "BAD : base : " << base << ", note " << note << " -> norm " << normnote << "" << oendl; |
140 | return false; | 140 | return false; |
141 | } | 141 | } |
142 | } | 142 | } |
143 | //**************************************************************************** | 143 | //**************************************************************************** |