Mercurial > hg > easaier-soundaccess
comparison layer/SpectrogramLayer.cpp @ 191:be6d31baecb9
compilation under linux - kunbuntu V7.10 (without video support)
author | lbajardsilogic |
---|---|
date | Wed, 28 Nov 2007 13:03:45 +0000 |
parents | 61681a2bc1e6 |
children |
comparison
equal
deleted
inserted
replaced
190:61681a2bc1e6 | 191:be6d31baecb9 |
---|---|
10 modify it under the terms of the GNU General Public License as | 10 modify it under the terms of the GNU General Public License as |
11 published by the Free Software Foundation; either version 2 of the | 11 published by the Free Software Foundation; either version 2 of the |
12 License, or (at your option) any later version. See the file | 12 License, or (at your option) any later version. See the file |
13 COPYING included with this distribution for more information. | 13 COPYING included with this distribution for more information. |
14 */ | 14 */ |
15 | |
16 #include <iostream> | |
17 | |
18 #include <cassert> | |
19 #include <cmath> | |
20 | |
21 #include "system/System.h" | |
15 | 22 |
16 #include "SpectrogramLayer.h" | 23 #include "SpectrogramLayer.h" |
17 | 24 |
18 #include "view/View.h" | 25 #include "view/View.h" |
19 #include "base/Profiler.h" | 26 #include "base/Profiler.h" |
29 #include <QPixmap> | 36 #include <QPixmap> |
30 #include <QRect> | 37 #include <QRect> |
31 #include <QTimer> | 38 #include <QTimer> |
32 #include <QApplication> | 39 #include <QApplication> |
33 #include <QMessageBox> | 40 #include <QMessageBox> |
34 | |
35 #include <iostream> | |
36 | |
37 #include <cassert> | |
38 #include <cmath> | |
39 | 41 |
40 //#define DEBUG_SPECTROGRAM_REPAINT 1 | 42 //#define DEBUG_SPECTROGRAM_REPAINT 1 |
41 | 43 |
42 SpectrogramLayer::SpectrogramLayer(Configuration config) : | 44 SpectrogramLayer::SpectrogramLayer(Configuration config) : |
43 m_model(0), | 45 m_model(0), |
2809 QString text = QString("%1").arg(freq); | 2811 QString text = QString("%1").arg(freq); |
2810 if (bin == 1) text = tr("%1Hz").arg(freq); // bin 0 is DC | 2812 if (bin == 1) text = tr("%1Hz").arg(freq); // bin 0 is DC |
2811 paint.drawLine(cw + 7, h - vy, w - pkw - 1, h - vy); | 2813 paint.drawLine(cw + 7, h - vy, w - pkw - 1, h - vy); |
2812 | 2814 |
2813 if (h - vy - textHeight >= -2) { | 2815 if (h - vy - textHeight >= -2) { |
2814 int tx = w - 3 - paint.fontMetrics().width(text) - max(tickw, pkw); | 2816 int tx = w - 3 - paint.fontMetrics().width(text) - MAX(tickw, pkw); |
2815 paint.drawText(tx, h - vy + toff, text); | 2817 paint.drawText(tx, h - vy + toff, text); |
2816 } | 2818 } |
2817 | 2819 |
2818 py = vy; | 2820 py = vy; |
2819 } | 2821 } |