summaryrefslogtreecommitdiffstats
path: root/src/gui/editors/parameters/MIDIInstrumentParameterPanel.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-06 20:59:29 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-06 20:59:29 +0000
commit11f31c37e5fa4889d9989f10272f44845449cb7b (patch)
tree4383da04a76c497950d957fc6120b0fd0d9082c2 /src/gui/editors/parameters/MIDIInstrumentParameterPanel.cpp
parent832eb69d571e8e518db45d0c0e6fbc0f00690209 (diff)
downloadrosegarden-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/editors/parameters/MIDIInstrumentParameterPanel.cpp')
-rw-r--r--src/gui/editors/parameters/MIDIInstrumentParameterPanel.cpp120
1 files changed, 60 insertions, 60 deletions
diff --git a/src/gui/editors/parameters/MIDIInstrumentParameterPanel.cpp b/src/gui/editors/parameters/MIDIInstrumentParameterPanel.cpp
index fcd4247..61a9256 100644
--- a/src/gui/editors/parameters/MIDIInstrumentParameterPanel.cpp
+++ b/src/gui/editors/parameters/MIDIInstrumentParameterPanel.cpp
@@ -24,7 +24,7 @@
#include "MIDIInstrumentParameterPanel.h"
-#include <qlayout.h>
+#include <tqlayout.h>
#include "sound/Midi.h"
#include <klocale.h>
@@ -44,52 +44,52 @@
#include "sound/MappedInstrument.h"
#include <kcombobox.h>
#include <ksqueezedtextlabel.h>
-#include <qcheckbox.h>
-#include <qcolor.h>
-#include <qfontmetrics.h>
-#include <qframe.h>
-#include <qhbox.h>
-#include <qlabel.h>
-#include <qregexp.h>
-#include <qsignalmapper.h>
-#include <qstring.h>
-#include <qwidget.h>
+#include <tqcheckbox.h>
+#include <tqcolor.h>
+#include <tqfontmetrics.h>
+#include <tqframe.h>
+#include <tqhbox.h>
+#include <tqlabel.h>
+#include <tqregexp.h>
+#include <tqsignalmapper.h>
+#include <tqstring.h>
+#include <tqwidget.h>
#include <algorithm>
namespace Rosegarden
{
-MIDIInstrumentParameterPanel::MIDIInstrumentParameterPanel(RosegardenGUIDoc *doc, QWidget* parent):
+MIDIInstrumentParameterPanel::MIDIInstrumentParameterPanel(RosegardenGUIDoc *doc, TQWidget* parent):
InstrumentParameterPanel(doc, parent),
m_rotaryFrame(0),
- m_rotaryMapper(new QSignalMapper(this))
+ m_rotaryMapper(new TQSignalMapper(this))
{
- m_mainGrid = new QGridLayout(this, 10, 3, 2, 1);
+ m_mainGrid = new TQGridLayout(this, 10, 3, 2, 1);
m_connectionLabel = new KSqueezedTextLabel(this);
m_bankValue = new KComboBox(this);
m_channelValue = new KComboBox(this);
m_programValue = new KComboBox(this);
m_variationValue = new KComboBox(this);
- m_bankCheckBox = new QCheckBox(this);
- m_programCheckBox = new QCheckBox(this);
- m_variationCheckBox = new QCheckBox(this);
- m_percussionCheckBox = new QCheckBox(this);
+ m_bankCheckBox = new TQCheckBox(this);
+ m_programCheckBox = new TQCheckBox(this);
+ m_variationCheckBox = new TQCheckBox(this);
+ m_percussionCheckBox = new TQCheckBox(this);
m_bankValue->setSizeLimit(20);
m_programValue->setSizeLimit(20);
m_variationValue->setSizeLimit(20);
- m_bankLabel = new QLabel(i18n("Bank"), this);
- m_variationLabel = new QLabel(i18n("Variation"), this);
- m_programLabel = new QLabel(i18n("Program"), this);
- QLabel *channelLabel = new QLabel(i18n("Channel out"), this);
- QLabel *percussionLabel = new QLabel(i18n("Percussion"), this);
+ m_bankLabel = new TQLabel(i18n("Bank"), this);
+ m_variationLabel = new TQLabel(i18n("Variation"), this);
+ m_programLabel = new TQLabel(i18n("Program"), this);
+ TQLabel *channelLabel = new TQLabel(i18n("Channel out"), this);
+ TQLabel *percussionLabel = new TQLabel(i18n("Percussion"), this);
// Ensure a reasonable amount of space in the program dropdowns even
// if no instrument initially selected
- QFontMetrics metrics(m_programValue->font());
+ TQFontMetrics metrics(m_programValue->font());
int width22 = metrics.width("1234567890123456789012");
int width25 = metrics.width("1234567890123456789012345");
@@ -131,7 +131,7 @@ MIDIInstrumentParameterPanel::MIDIInstrumentParameterPanel(RosegardenGUIDoc *doc
// Populate channel lists
//
for (int i = 0; i < 16; i++) {
- m_channelValue->insertItem(QString("%1").arg(i + 1));
+ m_channelValue->insertItem(TQString("%1").arg(i + 1));
}
m_channelValue->setSizeLimit(16);
@@ -152,32 +152,32 @@ MIDIInstrumentParameterPanel::MIDIInstrumentParameterPanel(RosegardenGUIDoc *doc
// Connect up the toggle boxes
//
- connect(m_percussionCheckBox, SIGNAL(toggled(bool)),
- this, SLOT(slotTogglePercussion(bool)));
+ connect(m_percussionCheckBox, TQT_SIGNAL(toggled(bool)),
+ this, TQT_SLOT(slotTogglePercussion(bool)));
- connect(m_programCheckBox, SIGNAL(toggled(bool)),
- this, SLOT(slotToggleProgramChange(bool)));
+ connect(m_programCheckBox, TQT_SIGNAL(toggled(bool)),
+ this, TQT_SLOT(slotToggleProgramChange(bool)));
- connect(m_bankCheckBox, SIGNAL(toggled(bool)),
- this, SLOT(slotToggleBank(bool)));
+ connect(m_bankCheckBox, TQT_SIGNAL(toggled(bool)),
+ this, TQT_SLOT(slotToggleBank(bool)));
- connect(m_variationCheckBox, SIGNAL(toggled(bool)),
- this, SLOT(slotToggleVariation(bool)));
+ connect(m_variationCheckBox, TQT_SIGNAL(toggled(bool)),
+ this, TQT_SLOT(slotToggleVariation(bool)));
// Connect activations
//
- connect(m_bankValue, SIGNAL(activated(int)),
- this, SLOT(slotSelectBank(int)));
+ connect(m_bankValue, TQT_SIGNAL(activated(int)),
+ this, TQT_SLOT(slotSelectBank(int)));
- connect(m_variationValue, SIGNAL(activated(int)),
- this, SLOT(slotSelectVariation(int)));
+ connect(m_variationValue, TQT_SIGNAL(activated(int)),
+ this, TQT_SLOT(slotSelectVariation(int)));
- connect(m_programValue, SIGNAL(activated(int)),
- this, SLOT(slotSelectProgram(int)));
+ connect(m_programValue, TQT_SIGNAL(activated(int)),
+ this, TQT_SLOT(slotSelectProgram(int)));
- connect(m_channelValue, SIGNAL(activated(int)),
- this, SLOT(slotSelectChannel(int)));
+ connect(m_channelValue, TQT_SIGNAL(activated(int)),
+ this, TQT_SLOT(slotSelectChannel(int)));
// don't select any of the options in any dropdown
m_programValue->setCurrentItem( -1);
@@ -185,8 +185,8 @@ MIDIInstrumentParameterPanel::MIDIInstrumentParameterPanel(RosegardenGUIDoc *doc
m_channelValue->setCurrentItem( -1);
m_variationValue->setCurrentItem( -1);
- connect(m_rotaryMapper, SIGNAL(mapped(int)),
- this, SLOT(slotControllerChanged(int)));
+ connect(m_rotaryMapper, TQT_SIGNAL(mapped(int)),
+ this, TQT_SLOT(slotControllerChanged(int)));
}
void
@@ -210,18 +210,18 @@ MIDIInstrumentParameterPanel::setupForInstrument(Instrument *instrument)
// Set Studio Device name
//
- QString connection(strtoqstr(md->getConnection()));
+ TQString connection(strtoqstr(md->getConnection()));
if (connection == "") {
m_connectionLabel->setText(i18n("[ %1 ]").arg(i18n("No connection")));
} else {
// remove trailing "(duplex)", "(read only)", "(write only)" etc
- connection.replace(QRegExp("\\s*\\([^)0-9]+\\)\\s*$"), "");
+ connection.replace(TQRegExp("\\s*\\([^)0-9]+\\)\\s*$"), "");
- QString text = i18n("[ %1 ]").arg(connection);
- /*QString origText(text);
+ TQString text = i18n("[ %1 ]").arg(connection);
+ /*TQString origText(text);
- QFontMetrics metrics(m_connectionLabel->fontMetrics());
+ TQFontMetrics metrics(m_connectionLabel->fontMetrics());
int maxwidth = metrics.width
("Program: [X] Acoustic Grand Piano 123");// kind of arbitrary!
@@ -292,10 +292,10 @@ void
MIDIInstrumentParameterPanel::setupControllers(MidiDevice *md)
{
if (!m_rotaryFrame) {
- m_rotaryFrame = new QFrame(this);
+ m_rotaryFrame = new TQFrame(this);
m_mainGrid->addMultiCellWidget(m_rotaryFrame, 8, 8, 0, 2, Qt::AlignHCenter);
- m_rotaryGrid = new QGridLayout(m_rotaryFrame, 10, 3, 8, 1);
- m_rotaryGrid->addItem(new QSpacerItem(10, 4), 0, 1);
+ m_rotaryGrid = new TQGridLayout(m_rotaryFrame, 10, 3, 8, 1);
+ m_rotaryGrid->addItem(new TQSpacerItem(10, 4), 0, 1);
}
// To cut down on flicker, we avoid destroying and recreating
@@ -321,12 +321,12 @@ MIDIInstrumentParameterPanel::setupControllers(MidiDevice *md)
// Get the knob colour - only if the colour is non-default (>0)
//
- QColor knobColour = Qt::black; // special case for Rotary
+ TQColor knobColour = Qt::black; // special case for Rotary
if (it->getColourIndex() > 0) {
Colour c =
comp.getGeneralColourMap().getColourByIndex
(it->getColourIndex());
- knobColour = QColor(c.getRed(), c.getGreen(), c.getBlue());
+ knobColour = TQColor(c.getRed(), c.getGreen(), c.getBlue());
}
Rotary *rotary = 0;
@@ -367,14 +367,14 @@ MIDIInstrumentParameterPanel::setupControllers(MidiDevice *md)
// Update the controller name that is associated with
// with the existing rotary widget.
- QLabel *label = rmi->second.second;
+ TQLabel *label = rmi->second.second;
label->setText(strtoqstr(it->getName()));
++rmi;
} else {
- QHBox *hbox = new QHBox(m_rotaryFrame);
+ TQHBox *hbox = new TQHBox(m_rotaryFrame);
hbox->setSpacing(8);
float smallStep = 1.0;
@@ -400,7 +400,7 @@ MIDIInstrumentParameterPanel::setupControllers(MidiDevice *md)
rotary->setKnobColour(knobColour);
// Add a label
- QLabel *label = new KSqueezedTextLabel(strtoqstr(it->getName()), hbox);
+ TQLabel *label = new KSqueezedTextLabel(strtoqstr(it->getName()), hbox);
RG_DEBUG << "Adding new widget at " << (count / 2) << "," << (count % 2) << endl;
@@ -417,8 +417,8 @@ MIDIInstrumentParameterPanel::setupControllers(MidiDevice *md)
// Connect
//
- connect(rotary, SIGNAL(valueChanged(float)),
- m_rotaryMapper, SLOT(map()));
+ connect(rotary, TQT_SIGNAL(valueChanged(float)),
+ m_rotaryMapper, TQT_SLOT(map()));
rmi = m_rotaries.end();
}
@@ -640,7 +640,7 @@ MIDIInstrumentParameterPanel::populateProgramList()
for (unsigned int i = 0; i < programs.size(); ++i) {
std::string programName = programs[i].getName();
if (programName != "") {
- m_programValue->insertItem(QString("%1. %2")
+ m_programValue->insertItem(TQString("%1. %2")
.arg(programs[i].getProgram() + 1)
.arg(strtoqstr(programName)));
if (m_selectedInstrument->getProgram() == programs[i]) {
@@ -762,7 +762,7 @@ MIDIInstrumentParameterPanel::populateVariationList()
i18n("(default)") :
strtoqstr(programName));
*/
- m_variationValue->insertItem(QString("%1. %2")
+ m_variationValue->insertItem(TQString("%1. %2")
.arg(variations[i] + 1)
.arg(strtoqstr(programName)));
if (m_selectedInstrument->getProgram() == program) {