summaryrefslogtreecommitdiffstats
path: root/noatun/modules/kjofol-skin/kjequalizer.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:43:15 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:43:15 +0000
commite654398e46e37abf457b2b1122ab898d2c51c49f (patch)
treed39ee6440f3c3663c3ead84a2d4cc2d034667e96 /noatun/modules/kjofol-skin/kjequalizer.cpp
parente4f29b18e19394b9352f52a6c0d0d0e3932cf511 (diff)
downloadtdemultimedia-e654398e46e37abf457b2b1122ab898d2c51c49f.tar.gz
tdemultimedia-e654398e46e37abf457b2b1122ab898d2c51c49f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1157644 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'noatun/modules/kjofol-skin/kjequalizer.cpp')
-rw-r--r--noatun/modules/kjofol-skin/kjequalizer.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/noatun/modules/kjofol-skin/kjequalizer.cpp b/noatun/modules/kjofol-skin/kjequalizer.cpp
index 3f0716e4..51d50e97 100644
--- a/noatun/modules/kjofol-skin/kjequalizer.cpp
+++ b/noatun/modules/kjofol-skin/kjequalizer.cpp
@@ -8,16 +8,16 @@
#include "kjequalizer.h"
#include "kjequalizer.moc"
-#include <qpainter.h>
-#include <qtimer.h>
+#include <tqpainter.h>
+#include <tqtimer.h>
#include <kdebug.h>
#include <kpixmap.h>
#include <noatun/vequalizer.h>
-KJEqualizer::KJEqualizer(const QStringList &l, KJLoader *p)
- : QObject(0), KJWidget(p), mBack(0), mView(0), mInterpEq(0)
+KJEqualizer::KJEqualizer(const TQStringList &l, KJLoader *p)
+ : TQObject(0), KJWidget(p), mBack(0), mView(0), mInterpEq(0)
{
int x=l[1].toInt();
int y=l[2].toInt();
@@ -32,12 +32,12 @@ KJEqualizer::KJEqualizer(const QStringList &l, KJLoader *p)
// background under equalizer
// needed to only blit onto screen ONCE and not for every band
- QPixmap tmp = p->pixmap(p->item("backgroundimage")[1]);
- mBack = new KPixmap ( QSize(xs,ys) );
+ TQPixmap tmp = p->pixmap(p->item("backgroundimage")[1]);
+ mBack = new KPixmap ( TQSize(xs,ys) );
bitBlt( mBack, 0, 0, &tmp, x, y, xs, ys, Qt::CopyROP );
// buffer for view
- mView = new QPixmap ( xs, ys );
+ mView = new TQPixmap ( xs, ys );
mBandWidth=parser()["EqualizerBmp"][1].toInt();
mBandHalfHeight=parser()["EqualizerBmp"][2].toInt();
@@ -47,7 +47,7 @@ KJEqualizer::KJEqualizer(const QStringList &l, KJLoader *p)
kdDebug(66666) << "[KJEqualizer] creating VInterpolation for " << mBands << " bands..." << endl;
mInterpEq = new VInterpolation(mBands);
// napp->vequalizer()->setBands(mBands); // FIXME: hack because spline sucks :P
- connect(napp->vequalizer(), SIGNAL(changed()), this, SLOT(slotUpdateBuffer()));
+ connect(napp->vequalizer(), TQT_SIGNAL(changed()), this, TQT_SLOT(slotUpdateBuffer()));
slotUpdateBuffer(); // fill mView pixmap with valid data
}
@@ -59,38 +59,38 @@ KJEqualizer::~KJEqualizer(void)
delete mBack;
}
-int KJEqualizer::barNum(const QPoint &pos) const
+int KJEqualizer::barNum(const TQPoint &pos) const
{
int x = pos.x();
x = x / mXSpace;
return mInterpEq->bands() * x / mBands;
}
-int KJEqualizer::level(const QPoint &pos) const
+int KJEqualizer::level(const TQPoint &pos) const
{
int y = ((-pos.y()) + mBandHalfHeight+1) * (200/mBandHalfHeight);
return y;
}
-void KJEqualizer::paint(QPainter *p, const QRect &)
+void KJEqualizer::paint(TQPainter *p, const TQRect &)
{
- QPixmap temp(rect().width(), rect().height());
+ TQPixmap temp(rect().width(), rect().height());
// draw background into buffer
bitBlt ( &temp, 0, 0, mBack, 0, 0, -1, -1, Qt::CopyROP );
// draw band sliders into buffer
bitBlt( &temp, 0, 0, mView, 0, 0, rect().width(), rect().height(), Qt::CopyROP);
// and draw it on screen
- bitBlt(p->device(), rect().topLeft(), &temp, QRect(0,0,-1,-1), Qt::CopyROP);
+ bitBlt(p->device(), rect().topLeft(), &temp, TQRect(0,0,-1,-1), Qt::CopyROP);
}
void KJEqualizer::slotUpdateBuffer()
{
// kdDebug(66666) << "[KJEqualizer] slotUpdateBuffer() called." << endl;
- QBitmap regionMask( rect().width(), rect().height(), true); // fully transparent mask
- QPainter mask( &regionMask );
+ TQBitmap regionMask( rect().width(), rect().height(), true); // fully transparent mask
+ TQPainter mask( &regionMask );
- QPoint destX = QPoint(0, 0);
+ TQPoint destX = TQPoint(0, 0);
for (int band=0; band<mBands; band++)
{
@@ -102,10 +102,10 @@ void KJEqualizer::slotUpdateBuffer()
// kdDebug(66666) << "[KJEqualizer] band=" << band << ", level=" << level << ", picNum=" << picNum << " @ xpos=" << xPos << "." << endl;
- bitBlt(mView, destX, &mBars, QRect(xPos,0,mBandWidth,rect().height()), Qt::CopyROP);
+ bitBlt(mView, destX, &mBars, TQRect(xPos,0,mBandWidth,rect().height()), Qt::CopyROP);
// make slider opaque in mask so you see something on screen
mask.fillRect ( destX.x(), 0, mBandWidth, rect().height(), Qt::color1 );
- destX += QPoint(mXSpace,0);
+ destX += TQPoint(mXSpace,0);
} // for()
// whole thingy has been drawn, now set the mask
@@ -113,13 +113,13 @@ void KJEqualizer::slotUpdateBuffer()
repaint();
}
-void KJEqualizer::mouseMove(const QPoint &p, bool in)
+void KJEqualizer::mouseMove(const TQPoint &p, bool in)
{
if (!in) return;
mousePress(p);
}
-bool KJEqualizer::mousePress(const QPoint &p)
+bool KJEqualizer::mousePress(const TQPoint &p)
{
kdDebug(66666) << "[KJEqualizer] setting band " << mBands << "/" << barNum(p)+1 << " to level " << level(p) << endl;
VBand b = mInterpEq->band( barNum(p) );