diff options
Diffstat (limited to 'src/gui/widgets/Fader.cpp')
-rw-r--r-- | src/gui/widgets/Fader.cpp | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/src/gui/widgets/Fader.cpp b/src/gui/widgets/Fader.cpp index 2413323..fc77f8e 100644 --- a/src/gui/widgets/Fader.cpp +++ b/src/gui/widgets/Fader.cpp @@ -28,14 +28,14 @@ #include "misc/Debug.h" #include "base/AudioLevel.h" -#include <qcolor.h> -#include <qevent.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qpoint.h> -#include <qstring.h> -#include <qtimer.h> -#include <qwidget.h> +#include <tqcolor.h> +#include <tqevent.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqpoint.h> +#include <tqstring.h> +#include <tqtimer.h> +#include <tqwidget.h> #include <cmath> namespace Rosegarden @@ -45,8 +45,8 @@ Fader::PixmapCache Fader::m_pixmapCache; Fader::Fader(AudioLevel::FaderType type, - int w, int h, QWidget *parent) : - QWidget(parent), + int w, int h, TQWidget *parent) : + TQWidget(parent), m_integral(false), m_vertical(h > w), m_min(0), @@ -54,7 +54,7 @@ Fader::Fader(AudioLevel::FaderType type, m_type(type), m_clickMousePos( -1), m_float(new TextFloat(this)), - m_floatTimer(new QTimer()) + m_floatTimer(new TQTimer()) { setBackgroundMode(Qt::NoBackground); setFixedSize(w, h); // provisional @@ -78,20 +78,20 @@ Fader::Fader(AudioLevel::FaderType type, calculateGroovePixmap(); setFader(0.0); - connect(m_floatTimer, SIGNAL(timeout()), this, SLOT(slotFloatTimeout())); + connect(m_floatTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotFloatTimeout())); m_float->hide(); } Fader::Fader(int min, int max, int deflt, - int w, int h, QWidget *parent) : - QWidget(parent), + int w, int h, TQWidget *parent) : + TQWidget(parent), m_integral(true), m_vertical(h > w), m_min(min), m_max(max), m_clickMousePos( -1), m_float(new TextFloat(this)), - m_floatTimer(new QTimer()) + m_floatTimer(new TQTimer()) { setBackgroundMode(Qt::NoBackground); setFixedSize(w, h); // provisional @@ -115,20 +115,20 @@ Fader::Fader(int min, int max, int deflt, calculateGroovePixmap(); setFader(deflt); - connect(m_floatTimer, SIGNAL(timeout()), this, SLOT(slotFloatTimeout())); + connect(m_floatTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotFloatTimeout())); m_float->hide(); } Fader::Fader(int min, int max, int deflt, - bool vertical, QWidget *parent) : - QWidget(parent), + bool vertical, TQWidget *parent) : + TQWidget(parent), m_integral(true), m_vertical(vertical), m_min(min), m_max(max), m_clickMousePos( -1), m_float(new TextFloat(this)), - m_floatTimer(new QTimer()) + m_floatTimer(new TQTimer()) { setBackgroundMode(Qt::NoBackground); calculateButtonPixmap(); @@ -146,7 +146,7 @@ Fader::Fader(int min, int max, int deflt, calculateGroovePixmap(); setFader(deflt); - connect(m_floatTimer, SIGNAL(timeout()), this, SLOT(slotFloatTimeout())); + connect(m_floatTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotFloatTimeout())); m_float->hide(); } @@ -154,13 +154,13 @@ Fader::~Fader() {} void -Fader::setOutlineColour(QColor c) +Fader::setOutlineColour(TQColor c) { m_outlineColour = c; calculateGroovePixmap(); } -QPixmap * +TQPixmap * Fader::groovePixmap() { PixmapCache::iterator i = m_pixmapCache.find(SizeRec(width(), height())); @@ -173,7 +173,7 @@ Fader::groovePixmap() return 0; } -QPixmap * +TQPixmap * Fader::buttonPixmap() { PixmapCache::iterator i = m_pixmapCache.find(SizeRec(width(), height())); @@ -248,9 +248,9 @@ Fader::value_to_position(float value) } void -Fader::paintEvent(QPaintEvent *) +Fader::paintEvent(TQPaintEvent *) { - QPainter paint(this); + TQPainter paint(this); int position = value_to_position(m_value); if (m_vertical) { @@ -316,13 +316,13 @@ Fader::paintEvent(QPaintEvent *) } void -Fader::mousePressEvent(QMouseEvent *e) +Fader::mousePressEvent(TQMouseEvent *e) { m_clickMousePos = -1; if (e->button() == LeftButton) { - if (e->type() == QEvent::MouseButtonDblClick) { + if (e->type() == TQEvent::MouseButtonDblClick) { setFader(0); return ; } @@ -342,14 +342,14 @@ Fader::mousePressEvent(QMouseEvent *e) } void -Fader::mouseReleaseEvent(QMouseEvent *e) +Fader::mouseReleaseEvent(TQMouseEvent *e) { mouseMoveEvent(e); m_clickMousePos = -1; } void -Fader::mouseMoveEvent(QMouseEvent *e) +Fader::mouseMoveEvent(TQMouseEvent *e) { if (m_clickMousePos >= 0) { if (m_vertical) { @@ -368,7 +368,7 @@ Fader::mouseMoveEvent(QMouseEvent *e) } void -Fader::wheelEvent(QWheelEvent *e) +Fader::wheelEvent(TQWheelEvent *e) { int buttonPosition = value_to_position(m_value); if (e->state() & ShiftButton) { @@ -394,15 +394,15 @@ Fader::showFloatText() { // draw on the float text - QString text; + TQString text; if (m_integral) { - text = QString("%1").arg(int(m_value)); + text = TQString("%1").arg(int(m_value)); } else if (m_value == AudioLevel::DB_FLOOR) { text = "Off"; } else { float v = fabs(m_value); - text = QString("%1%2.%3%4%5 dB") + text = TQString("%1%2.%3%4%5 dB") .arg(m_value < 0 ? '-' : '+') .arg(int(v)) .arg(int(v * 10) % 10) @@ -415,8 +415,8 @@ Fader::showFloatText() // Reposition - we need to sum the relative positions up to the // topLevel or dialog to please move(). // - QWidget *par = parentWidget(); - QPoint totalPos = this->pos(); + TQWidget *par = parentWidget(); + TQPoint totalPos = this->pos(); while (par->parentWidget() && !par->isTopLevel() && !par->isDialog()) { totalPos += par->pos(); @@ -425,7 +425,7 @@ Fader::showFloatText() // Move just top/right // - m_float->move(totalPos + QPoint(width() + 2, 0)); + m_float->move(totalPos + TQPoint(width() + 2, 0)); // Show m_float->show(); @@ -443,12 +443,12 @@ Fader::slotFloatTimeout() void Fader::calculateGroovePixmap() { - QPixmap *& map = m_pixmapCache[SizeRec(width(), height())].first[m_outlineColour.pixel()]; + TQPixmap *& map = m_pixmapCache[SizeRec(width(), height())].first[m_outlineColour.pixel()]; delete map; - map = new QPixmap(width(), height()); + map = new TQPixmap(width(), height()); map->fill(colorGroup().background()); - QPainter paint(map); + TQPainter paint(map); paint.setBrush(colorGroup().background()); if (m_vertical) { @@ -494,7 +494,7 @@ Fader::calculateButtonPixmap() if (i != m_pixmapCache.end() && i->second.second) return ; - QPixmap *& map = m_pixmapCache[SizeRec(width(), height())].second; + TQPixmap *& map = m_pixmapCache[SizeRec(width(), height())].second; if (m_vertical) { @@ -510,13 +510,13 @@ Fader::calculateButtonPixmap() if (buttonWidth > width() - 2) buttonWidth = width() - 2; - map = new QPixmap(buttonWidth, buttonHeight); + map = new TQPixmap(buttonWidth, buttonHeight); map->fill(colorGroup().background()); int x = 0; int y = 0; - QPainter paint(map); + TQPainter paint(map); paint.setPen(colorGroup().light()); paint.drawLine(x + 1, y, x + buttonWidth - 2, y); |