diff options
Diffstat (limited to 'kradio3/plugins/recording/recording-datamonitor.cpp')
-rw-r--r-- | kradio3/plugins/recording/recording-datamonitor.cpp | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/kradio3/plugins/recording/recording-datamonitor.cpp b/kradio3/plugins/recording/recording-datamonitor.cpp index cd8e0f5..bfc1e3b 100644 --- a/kradio3/plugins/recording/recording-datamonitor.cpp +++ b/kradio3/plugins/recording/recording-datamonitor.cpp @@ -19,11 +19,11 @@ //#include "recording-context.h" #include <math.h> -#include <qpainter.h> -#include <qimage.h> -#include <qpixmap.h> +#include <tqpainter.h> +#include <tqimage.h> +#include <tqpixmap.h> #include <kimageeffect.h> // fading, blending, ... -#include <kpixmapio.h> // fast conversion between QPixmap/QImage +#include <kpixmapio.h> // fast conversion between TQPixmap/TQImage #include <limits.h> #include <stdlib.h> @@ -33,8 +33,8 @@ #define BLOCK_W_MIN 10 #define W_MIN (20 * (BLOCK_W_MIN)) -RecordingDataMonitor::RecordingDataMonitor(QWidget *parent, const char *name) - : QFrame(parent, name), +RecordingDataMonitor::RecordingDataMonitor(TQWidget *tqparent, const char *name) + : TQFrame(tqparent, name), m_channelsMax(NULL), m_channelsAvg(NULL), m_maxValue(INT_MAX), @@ -47,10 +47,10 @@ RecordingDataMonitor::RecordingDataMonitor(QWidget *parent, const char *name) setChannels(2); - setColors(QColor(20, 244, 20), - QColor(10, 117, 10)); + setColors(TQColor(20, 244, 20), + TQColor(10, 117, 10)); - setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); + tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding)); } @@ -90,34 +90,34 @@ void RecordingDataMonitor::setChannels(int n) m_channelsMax[i] = 0; m_channelsAvg[i] = 0; } - setMinimumSize(QSize(W_MIN, (m_channels + 1 )* CHANNEL_H_MIN)); + setMinimumSize(TQSize(W_MIN, (m_channels + 1 )* CHANNEL_H_MIN)); } // QT/KDE ... -void RecordingDataMonitor::drawContents(QPainter *painter) +void RecordingDataMonitor::drawContents(TQPainter *painter) { if (painter) internalDrawContents(*painter, true); } -void RecordingDataMonitor::internalDrawContents(QPainter &painter, bool repaintAll) +void RecordingDataMonitor::internalDrawContents(TQPainter &painter, bool tqrepaintAll) { if (m_channels <= 0) return; - QRect r = contentsRect(); + TQRect r = contentsRect(); - QPen activePen (colorGroup().color(QColorGroup::Text), 1); - QPen inactivePen (colorGroup().color(QColorGroup::Mid), 1); - QBrush activeBrush = colorGroup().brush(QColorGroup::Text); - QBrush inactiveBrush = colorGroup().brush(QColorGroup::Mid); - QBrush yellowBrush(QColor(255,255,0)); - QBrush orangeBrush(QColor(255,192,0)); - QBrush redBrush (QColor(255,0, 0)); + TQPen activePen (tqcolorGroup().color(TQColorGroup::Text), 1); + TQPen inactivePen (tqcolorGroup().color(TQColorGroup::Mid), 1); + TQBrush activeBrush = tqcolorGroup().brush(TQColorGroup::Text); + TQBrush inactiveBrush = tqcolorGroup().brush(TQColorGroup::Mid); + TQBrush yellowBrush(TQColor(255,255,0)); + TQBrush orangeBrush(TQColor(255,192,0)); + TQBrush redBrush (TQColor(255,0, 0)); double ranges [5] = { 0.75, 0.83, 0.91, 1.0, 999 }; - QBrush *brushes[5] = { &activeBrush, &yellowBrush, &orangeBrush, &redBrush, &redBrush }; + TQBrush *brushes[5] = { &activeBrush, &yellowBrush, &orangeBrush, &redBrush, &redBrush }; painter.setBrush( isEnabled() ? activeBrush : inactiveBrush); @@ -142,7 +142,7 @@ void RecordingDataMonitor::internalDrawContents(QPainter &painter, bool repaintA m_pActiveBlocks[c] = m_channelsMax[c] ? (int)rint(nBlocks * (min_dB - dBMax) / min_dB) : 0; - if (!repaintAll) { + if (!tqrepaintAll) { if (oldActiveBlocks > m_pActiveBlocks[c]) { startBlock = m_pActiveBlocks[c]; endBlock = oldActiveBlocks - 1; @@ -165,19 +165,19 @@ void RecordingDataMonitor::internalDrawContents(QPainter &painter, bool repaintA y += chHeight; } - if (repaintAll) { - QFont f("Helvetica"); + if (tqrepaintAll) { + TQFont f("Helvetica"); painter.setPen (activePen); f.setPixelSize(CHANNEL_H_MIN); painter.setFont(f); - int maxW = QFontMetrics(f).width(i18n("%1 dB").arg((int)min_dB)); + int maxW = TQFontMetrics(f).width(i18n("%1 dB").tqarg((int)min_dB)); int delta_dB = 5; while (abs((long)min_dB) / delta_dB * maxW * 2 > r.width()) delta_dB *= 2; for (int dB = 0; dB >= min_dB; dB -= delta_dB) { - QString txt = i18n("%1 dB").arg(dB); - int w = QFontMetrics(f).width(txt); + TQString txt = i18n("%1 dB").tqarg(dB); + int w = TQFontMetrics(f).width(txt); int x = x0 + (int)(nBlocks * BLOCK_W_MIN * (min_dB - dB) / min_dB) - w; if (x < x0) continue; painter.drawText(x, y + CHANNEL_H_MIN, txt); @@ -186,24 +186,24 @@ void RecordingDataMonitor::internalDrawContents(QPainter &painter, bool repaintA } -bool RecordingDataMonitor::setColors(const QColor &activeText, - const QColor &button) +bool RecordingDataMonitor::setColors(const TQColor &activeText, + const TQColor &button) { m_colorActiveText = activeText; m_colorButton = button; - QPalette pl = palette(); - QColorGroup cg = pl.inactive(); + TQPalette pl = palette(); + TQColorGroup cg = pl.inactive(); - QBrush fg = cg.brush(QColorGroup::Foreground), - btn = cg.brush(QColorGroup::Button), - lgt = cg.brush(QColorGroup::Light), - drk = cg.brush(QColorGroup::Dark), - mid = cg.brush(QColorGroup::Mid), - txt = cg.brush(QColorGroup::Text), - btx = cg.brush(QColorGroup::BrightText), - bas = cg.brush(QColorGroup::Base), - bg = cg.brush(QColorGroup::Background); + TQBrush fg = cg.brush(TQColorGroup::Foreground), + btn = cg.brush(TQColorGroup::Button), + lgt = cg.brush(TQColorGroup::Light), + drk = cg.brush(TQColorGroup::Dark), + mid = cg.brush(TQColorGroup::Mid), + txt = cg.brush(TQColorGroup::Text), + btx = cg.brush(TQColorGroup::BrightText), + bas = cg.brush(TQColorGroup::Base), + bg = cg.brush(TQColorGroup::Background); fg.setColor (m_colorActiveText); btn.setColor(m_colorButton); @@ -215,19 +215,19 @@ bool RecordingDataMonitor::setColors(const QColor &activeText, bas.setColor(m_colorButton); bg.setColor (m_colorButton); - QColorGroup ncg(fg, btn, lgt, drk, mid, txt, btx, bas, bg); + TQColorGroup ncg(fg, btn, lgt, drk, mid, txt, btx, bas, bg); pl.setInactive(ncg); pl.setActive(ncg); setPalette(pl); - if (parentWidget() && parentWidget()->backgroundPixmap() ){ + if (tqparentWidget() && tqparentWidget()->backgroundPixmap() ){ KPixmapIO io; - QImage i = io.convertToImage(*parentWidget()->backgroundPixmap()); - KImageEffect::fade(i, 0.5, colorGroup().color(QColorGroup::Dark)); + TQImage i = io.convertToImage(*tqparentWidget()->backgroundPixmap()); + KImageEffect::fade(i, 0.5, tqcolorGroup().color(TQColorGroup::Dark)); setPaletteBackgroundPixmap(io.convertToPixmap(i)); setBackgroundOrigin(WindowOrigin); } else { - setBackgroundColor(colorGroup().color(QColorGroup::Button)); + setBackgroundColor(tqcolorGroup().color(TQColorGroup::Button)); } return true; @@ -265,9 +265,9 @@ bool RecordingDataMonitor::noticeSoundStreamData(SoundStreamID /*id*/, for (int i = 0; i < m_channels; ++i) m_channelsAvg[i] /= nSamples; - QPainter paint(this); + TQPainter paint(this); if (m_maxValue != old_max) { - repaint(true); + tqrepaint(true); } else { internalDrawContents(paint, false); } |