Mercurial > hg > easaier-soundaccess
diff 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 |
line wrap: on
line diff
--- a/layer/SpectrogramLayer.cpp Tue Nov 27 13:26:04 2007 +0000 +++ b/layer/SpectrogramLayer.cpp Wed Nov 28 13:03:45 2007 +0000 @@ -13,6 +13,13 @@ COPYING included with this distribution for more information. */ +#include <iostream> + +#include <cassert> +#include <cmath> + +#include "system/System.h" + #include "SpectrogramLayer.h" #include "view/View.h" @@ -32,11 +39,6 @@ #include <QApplication> #include <QMessageBox> -#include <iostream> - -#include <cassert> -#include <cmath> - //#define DEBUG_SPECTROGRAM_REPAINT 1 SpectrogramLayer::SpectrogramLayer(Configuration config) : @@ -2014,8 +2016,8 @@ /*float ymag[h]; float ydiv[h]; float yval[maxbin + 1]; //!!! cache this?*/ - float *ymag = (float*) malloc(h*sizeof(float)); - float *ydiv = (float*) malloc(h*sizeof(float)); + float *ymag = (float*) malloc(h*sizeof(float)); + float *ydiv = (float*) malloc(h*sizeof(float)); float *yval = (float*) malloc((maxbin + 1)*sizeof(float)); size_t increment = getWindowIncrement(); @@ -2811,7 +2813,7 @@ paint.drawLine(cw + 7, h - vy, w - pkw - 1, h - vy); if (h - vy - textHeight >= -2) { - int tx = w - 3 - paint.fontMetrics().width(text) - max(tickw, pkw); + int tx = w - 3 - paint.fontMetrics().width(text) - MAX(tickw, pkw); paint.drawText(tx, h - vy + toff, text); } @@ -3034,26 +3036,26 @@ return Layer::toXmlString(indent, extraAttributes + " " + s); } -QString -SpectrogramLayer::toEasaierXmlString(QString indent, QString extraAttributes) const -{ - QString s; - - s += QString("channel=\"%1\" " - "windowSize=\"%2\" " - "windowType=\"%3\" " - "windowHopLevel=\"%4\" " - "gain=\"%5\" " - "threshold=\"%6\" ") - .arg(m_channel) - .arg(m_windowSize) - .arg(m_windowType) - .arg(m_windowHopLevel) - .arg(m_gain) - .arg(m_threshold); - - - +QString +SpectrogramLayer::toEasaierXmlString(QString indent, QString extraAttributes) const +{ + QString s; + + s += QString("channel=\"%1\" " + "windowSize=\"%2\" " + "windowType=\"%3\" " + "windowHopLevel=\"%4\" " + "gain=\"%5\" " + "threshold=\"%6\" ") + .arg(m_channel) + .arg(m_windowSize) + .arg(m_windowType) + .arg(m_windowHopLevel) + .arg(m_gain) + .arg(m_threshold); + + + s += QString("minFrequency=\"%1\" " "maxFrequency=\"%2\" " "colourScale=\"%3\" " @@ -3071,9 +3073,9 @@ .arg(m_frequencyScale) .arg(m_binDisplay) .arg(m_normalizeColumns ? "true" : "false") - .arg(m_normalizeVisibleArea ? "true" : "false"); - - return Layer::toEasaierXmlString(indent, extraAttributes + " " + s); + .arg(m_normalizeVisibleArea ? "true" : "false"); + + return Layer::toEasaierXmlString(indent, extraAttributes + " " + s); } void