diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-06 20:59:29 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-06 20:59:29 +0000 |
commit | 11f31c37e5fa4889d9989f10272f44845449cb7b (patch) | |
tree | 4383da04a76c497950d957fc6120b0fd0d9082c2 /src/gui/dialogs/AudioSplitDialog.cpp | |
parent | 832eb69d571e8e518db45d0c0e6fbc0f00690209 (diff) | |
download | rosegarden-11f31c37e5fa4889d9989f10272f44845449cb7b.tar.gz rosegarden-11f31c37e5fa4889d9989f10272f44845449cb7b.zip |
Initial TQt conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/rosegarden@1172292 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/gui/dialogs/AudioSplitDialog.cpp')
-rw-r--r-- | src/gui/dialogs/AudioSplitDialog.cpp | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/src/gui/dialogs/AudioSplitDialog.cpp b/src/gui/dialogs/AudioSplitDialog.cpp index 42290b3..b7a1b67 100644 --- a/src/gui/dialogs/AudioSplitDialog.cpp +++ b/src/gui/dialogs/AudioSplitDialog.cpp @@ -36,21 +36,21 @@ #include "gui/application/RosegardenApplication.h" #include "sound/AudioFileManager.h" #include <kdialogbase.h> -#include <qcanvas.h> -#include <qhbox.h> -#include <qlabel.h> -#include <qpalette.h> -#include <qscrollview.h> -#include <qspinbox.h> -#include <qstring.h> -#include <qvbox.h> -#include <qwidget.h> +#include <tqcanvas.h> +#include <tqhbox.h> +#include <tqlabel.h> +#include <tqpalette.h> +#include <tqscrollview.h> +#include <tqspinbox.h> +#include <tqstring.h> +#include <tqvbox.h> +#include <tqwidget.h> namespace Rosegarden { -AudioSplitDialog::AudioSplitDialog(QWidget *parent, +AudioSplitDialog::AudioSplitDialog(TQWidget *parent, Segment *segment, RosegardenGUIDoc *doc): KDialogBase(parent, 0, true, @@ -65,27 +65,27 @@ AudioSplitDialog::AudioSplitDialog(QWidget *parent, if (!segment || segment->getType() != Segment::Audio) reject(); - QVBox *w = makeVBoxMainWidget(); + TQVBox *w = makeVBoxMainWidget(); - new QLabel(i18n("AutoSplit Segment \"") + - strtoqstr(m_segment->getLabel()) + QString("\""), w); + new TQLabel(i18n("AutoSplit Segment \"") + + strtoqstr(m_segment->getLabel()) + TQString("\""), w); - m_canvas = new QCanvas(w); + m_canvas = new TQCanvas(w); m_canvas->resize(m_canvasWidth, m_canvasHeight); - m_canvasView = new QCanvasView(m_canvas, w); + m_canvasView = new TQCanvasView(m_canvas, w); m_canvasView->setFixedWidth(m_canvasWidth); m_canvasView->setFixedHeight(m_canvasHeight); - m_canvasView->setHScrollBarMode(QScrollView::AlwaysOff); - m_canvasView->setVScrollBarMode(QScrollView::AlwaysOff); + m_canvasView->setHScrollBarMode(TQScrollView::AlwaysOff); + m_canvasView->setVScrollBarMode(TQScrollView::AlwaysOff); m_canvasView->setDragAutoScroll(false); - QHBox *hbox = new QHBox(w); - new QLabel(i18n("Threshold"), hbox); - m_thresholdSpin = new QSpinBox(hbox); + TQHBox *hbox = new TQHBox(w); + new TQLabel(i18n("Threshold"), hbox); + m_thresholdSpin = new TQSpinBox(hbox); m_thresholdSpin->setSuffix(" %"); - connect(m_thresholdSpin, SIGNAL(valueChanged(int)), - SLOT(slotThresholdChanged(int))); + connect(m_thresholdSpin, TQT_SIGNAL(valueChanged(int)), + TQT_SLOT(slotThresholdChanged(int))); // ensure this is cleared m_previewBoxes.clear(); @@ -103,8 +103,8 @@ AudioSplitDialog::drawPreview() { // Delete everything on the canvas // - QCanvasItemList list = m_canvas->allItems(); - for (QCanvasItemList::Iterator it = list.begin(); it != list.end(); it++) + TQCanvasItemList list = m_canvas->allItems(); + for (TQCanvasItemList::Iterator it = list.begin(); it != list.end(); it++) delete *it; // empty the preview boxes @@ -113,13 +113,13 @@ AudioSplitDialog::drawPreview() // Draw a bounding box // int border = 5; - QCanvasRectangle *rect = new QCanvasRectangle(m_canvas); + TQCanvasRectangle *rect = new TQCanvasRectangle(m_canvas); rect->setSize(m_canvasWidth - border * 2, m_canvasHeight - border * 2); rect->setX(border); rect->setY(border); rect->setZ(1); - rect->setPen(kapp->palette().color(QPalette::Active, QColorGroup::Dark)); - rect->setBrush(kapp->palette().color(QPalette::Active, QColorGroup::Base)); + rect->setPen(kapp->palette().color(TQPalette::Active, TQColorGroup::Dark)); + rect->setBrush(kapp->palette().color(TQPalette::Active, TQColorGroup::Base)); rect->setVisible(true); // Get preview in vector form @@ -136,9 +136,9 @@ AudioSplitDialog::drawPreview() m_previewWidth, false); } catch (Exception e) { - QCanvasText *text = new QCanvasText(m_canvas); + TQCanvasText *text = new TQCanvasText(m_canvas); text->setColor(kapp->palette(). - color(QPalette::Active, QColorGroup::Shadow)); + color(TQPalette::Active, TQColorGroup::Shadow)); text->setText(i18n("<no preview generated for this audio file>")); text->setX(30); text->setY(30); @@ -182,28 +182,28 @@ AudioSplitDialog::drawPreview() endY = 0; } - QCanvasLine *line = new QCanvasLine(m_canvas); + TQCanvasLine *line = new TQCanvasLine(m_canvas); line->setPoints(startX + i, startY, startX + i, endY); line->setZ(3); line->setPen(kapp-> - palette().color(QPalette::Active, QColorGroup::Shadow)); + palette().color(TQPalette::Active, TQColorGroup::Shadow)); line->setBrush(kapp-> - palette().color(QPalette::Active, QColorGroup::Shadow)); + palette().color(TQPalette::Active, TQColorGroup::Shadow)); line->setVisible(true); } // Draw zero dc line // - rect = new QCanvasRectangle(m_canvas); + rect = new TQCanvasRectangle(m_canvas); rect->setX(startX); rect->setY(halfHeight - 1); rect->setSize(m_previewWidth, 2); - rect->setPen(kapp->palette().color(QPalette::Active, QColorGroup::Shadow)); - rect->setBrush(kapp->palette().color(QPalette::Active, QColorGroup::Shadow)); + rect->setPen(kapp->palette().color(TQPalette::Active, TQColorGroup::Shadow)); + rect->setBrush(kapp->palette().color(TQPalette::Active, TQColorGroup::Shadow)); rect->setZ(4); rect->setVisible(true); @@ -211,46 +211,46 @@ AudioSplitDialog::drawPreview() // char msecs[100]; sprintf(msecs, "%03d", m_segment->getAudioStartTime().msec()); - QString startText = QString("%1.%2s") + TQString startText = TQString("%1.%2s") .arg(m_segment->getAudioStartTime().sec) .arg(msecs); - QCanvasText *text = new QCanvasText(m_canvas); + TQCanvasText *text = new TQCanvasText(m_canvas); text->setColor( - kapp->palette().color(QPalette::Active, QColorGroup::Shadow)); + kapp->palette().color(TQPalette::Active, TQColorGroup::Shadow)); text->setText(startText); text->setX(startX - 20); text->setY(m_canvasHeight / 2 - m_previewHeight / 2 - 35); text->setZ(3); text->setVisible(true); - rect = new QCanvasRectangle(m_canvas); + rect = new TQCanvasRectangle(m_canvas); rect->setX(startX - 1); rect->setY(m_canvasHeight / 2 - m_previewHeight / 2 - 14); rect->setSize(1, m_previewHeight + 28); - rect->setPen(kapp->palette().color(QPalette::Active, QColorGroup::Shadow)); + rect->setPen(kapp->palette().color(TQPalette::Active, TQColorGroup::Shadow)); rect->setZ(3); rect->setVisible(true); // End time // sprintf(msecs, "%03d", m_segment->getAudioEndTime().msec()); - QString endText = QString("%1.%2s") + TQString endText = TQString("%1.%2s") .arg(m_segment->getAudioEndTime().sec) .arg(msecs); - text = new QCanvasText(m_canvas); + text = new TQCanvasText(m_canvas); text->setColor( - kapp->palette().color(QPalette::Active, QColorGroup::Shadow)); + kapp->palette().color(TQPalette::Active, TQColorGroup::Shadow)); text->setText(endText); text->setX(startX + m_previewWidth - 20); text->setY(m_canvasHeight / 2 - m_previewHeight / 2 - 35); text->setZ(3); text->setVisible(true); - rect = new QCanvasRectangle(m_canvas); + rect = new TQCanvasRectangle(m_canvas); rect->setX(startX + m_previewWidth - 1); rect->setY(m_canvasHeight / 2 - m_previewHeight / 2 - 14); rect->setSize(1, m_previewHeight + 28); - rect->setPen(kapp->palette().color(QPalette::Active, QColorGroup::Shadow)); + rect->setPen(kapp->palette().color(TQPalette::Active, TQColorGroup::Shadow)); rect->setZ(3); rect->setVisible(true); @@ -273,7 +273,7 @@ AudioSplitDialog::drawSplits(int threshold) threshold); std::vector<SplitPointPair>::iterator it; - std::vector<QCanvasRectangle*> tempRects; + std::vector<TQCanvasRectangle*> tempRects; RealTime length = endTime - startTime; double ticksPerUsec = double(m_previewWidth) / @@ -294,20 +294,20 @@ AudioSplitDialog::drawSplits(int threshold) x2 = int(ticksPerUsec * double(double(splitEnd.sec) * 1000000.0 + double(splitEnd.usec()))); - QCanvasRectangle *rect = new QCanvasRectangle(m_canvas); + TQCanvasRectangle *rect = new TQCanvasRectangle(m_canvas); rect->setX(startX + x1); rect->setY(halfHeight - m_previewHeight / 2 - overlapHeight / 2); rect->setZ(2); rect->setSize(x2 - x1, m_previewHeight + overlapHeight); rect->setPen(kapp-> - palette().color(QPalette::Active, QColorGroup::Mid)); + palette().color(TQPalette::Active, TQColorGroup::Mid)); rect->setBrush(kapp-> - palette().color(QPalette::Active, QColorGroup::Mid)); + palette().color(TQPalette::Active, TQColorGroup::Mid)); rect->setVisible(true); tempRects.push_back(rect); } - std::vector<QCanvasRectangle*>::iterator pIt; + std::vector<TQCanvasRectangle*>::iterator pIt; // We've written the new Rects, now delete the old ones // |