summaryrefslogtreecommitdiff
path: root/muse2/muse/mixer
diff options
context:
space:
mode:
authorOrcan Ogetbil <oget.fedora@gmail.com>2011-08-17 05:09:27 +0000
committerOrcan Ogetbil <oget.fedora@gmail.com>2011-08-17 05:09:27 +0000
commit35c95c10cca9938210818c0b809b1ff4f9c4ad3d (patch)
treef31d516bb73b5edfd786f572bcd54330ed809c92 /muse2/muse/mixer
parent516a5fafd56fa9d70d6aba20978d6e177cdf5502 (diff)
Finished some remaining work on the port of ComboBox
Diffstat (limited to 'muse2/muse/mixer')
-rw-r--r--muse2/muse/mixer/astrip.cpp40
-rw-r--r--muse2/muse/mixer/mstrip.cpp23
-rw-r--r--muse2/muse/mixer/strip.cpp2
-rw-r--r--muse2/muse/mixer/strip.h2
4 files changed, 24 insertions, 43 deletions
diff --git a/muse2/muse/mixer/astrip.cpp b/muse2/muse/mixer/astrip.cpp
index 5644e6eb..658a4970 100644
--- a/muse2/muse/mixer/astrip.cpp
+++ b/muse2/muse/mixer/astrip.cpp
@@ -211,16 +211,14 @@ void AudioStrip::songChanged(int val)
autoType->setCurrentItem(track->automationType());
if(track->automationType() == AUTO_TOUCH || track->automationType() == AUTO_WRITE)
{
- //autoType->setPaletteBackgroundColor(Qt::red);
QPalette palette;
- palette.setColor(autoType->backgroundRole(), QColor(Qt::red));
+ palette.setColor(QPalette::Button, QColor(Qt::red));
autoType->setPalette(palette);
}
else
{
- //autoType->setPaletteBackgroundColor(qApp->palette().active().background());
QPalette palette;
- palette.setColor(autoType->backgroundRole(), qApp->palette().color(QPalette::Active, QPalette::Background));
+ palette.setColor(QPalette::Button, qApp->palette().color(QPalette::Active, QPalette::Background));
autoType->setPalette(palette);
}
@@ -927,41 +925,31 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at)
// automation type
//---------------------------------------------------
- autoType = new ComboBox(this);
+ autoType = new ComboBox();
autoType->setFont(config.fonts[1]);
autoType->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
- autoType->setAlignment(Qt::AlignCenter);
- autoType->insertItem(tr("Off"), AUTO_OFF);
- autoType->insertItem(tr("Read"), AUTO_READ);
- autoType->insertItem(tr("Touch"), AUTO_TOUCH);
- autoType->insertItem(tr("Write"), AUTO_WRITE);
+ autoType->addAction(tr("Off"), AUTO_OFF);
+ autoType->addAction(tr("Read"), AUTO_READ);
+ autoType->addAction(tr("Touch"), AUTO_TOUCH);
+ autoType->addAction(tr("Write"), AUTO_WRITE);
autoType->setCurrentItem(t->automationType());
- // FIXME: TODO: Convert ComboBox to QT4
- //autoType->insertItem(AUTO_OFF, tr("Off"));
- //autoType->insertItem(AUTO_READ, tr("Read"));
- //autoType->insertItem(AUTO_TOUCH, tr("Touch"));
- //autoType->insertItem(AUTO_WRITE, tr("Write"));
- //autoType->setCurrentIndex(t->automationType());
-
+
if(t->automationType() == AUTO_TOUCH || t->automationType() == AUTO_WRITE)
{
- // FIXME:
- //autoType->setPaletteBackgroundColor(Qt::red);
- QPalette palette;
- palette.setColor(autoType->backgroundRole(), QColor(Qt::red));
- autoType->setPalette(palette);
+ QPalette palette;
+ palette.setColor(QPalette::Button, QColor(Qt::red));
+ autoType->setPalette(palette);
}
else
{
- // FIXME:
- //autoType->setPaletteBackgroundColor(qApp->palette().active().background());
QPalette palette;
- palette.setColor(autoType->backgroundRole(), qApp->palette().color(QPalette::Active, QPalette::Background));
+ palette.setColor(QPalette::Button, qApp->palette().color(QPalette::Active, QPalette::Background));
autoType->setPalette(palette);
}
+
autoType->setToolTip(tr("automation type"));
- connect(autoType, SIGNAL(activated(int,int)), SLOT(setAutomationType(int,int)));
+ connect(autoType, SIGNAL(activated(int)), SLOT(setAutomationType(int)));
grid->addWidget(autoType, _curGridRow++, 0, 1, 2);
if (off) {
diff --git a/muse2/muse/mixer/mstrip.cpp b/muse2/muse/mixer/mstrip.cpp
index d773708a..ad21916d 100644
--- a/muse2/muse/mixer/mstrip.cpp
+++ b/muse2/muse/mixer/mstrip.cpp
@@ -405,28 +405,21 @@ MidiStrip::MidiStrip(QWidget* parent, MidiTrack* t)
// automation mode
//---------------------------------------------------
- autoType = new ComboBox(this);
+ autoType = new ComboBox();
autoType->setFont(config.fonts[1]);
autoType->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
- autoType->setAlignment(Qt::AlignCenter);
autoType->setEnabled(false);
// Removed by T356.
// Disabled for now. There is no midi automation mechanism yet...
- //autoType->insertItem(tr("Off"), AUTO_OFF);
- //autoType->insertItem(tr("Read"), AUTO_READ);
- //autoType->insertItem(tr("Touch"), AUTO_TOUCH);
- //autoType->insertItem(tr("Write"), AUTO_WRITE);
+ //autoType->addAction(tr("Off"), AUTO_OFF);
+ //autoType->addAction(tr("Read"), AUTO_READ);
+ //autoType->addAction(tr("Touch"), AUTO_TOUCH);
+ //autoType->addAction(tr("Write"), AUTO_WRITE);
//autoType->setCurrentItem(t->automationType());
- // TODO: Convert ComboBox to QT4
- //autoType->insertItem(AUTO_OFF, tr("Off"));
- //autoType->insertItem(AUTO_READ, tr("Read"));
- //autoType->insertItem(AUTO_TOUCH, tr("Touch"));
- //autoType->insertItem(AUTO_WRITE, tr("Write"));
- //autoType->setCurrentIndex(t->automationType());
- //autoType->setToolTip(tr("automation type"));
-
- //connect(autoType, SIGNAL(activated(int,int)), SLOT(setAutomationType(int,int)));
+ //autoType->setToolTip(tr("automation type"));
+ //connect(autoType, SIGNAL(activated(int)), SLOT(setAutomationType(int)));
+
grid->addWidget(autoType, _curGridRow++, 0, 1, 2);
connect(heartBeatTimer, SIGNAL(timeout()), SLOT(heartBeat()));
inHeartBeat = false;
diff --git a/muse2/muse/mixer/strip.cpp b/muse2/muse/mixer/strip.cpp
index 0c4059d8..3cf9765d 100644
--- a/muse2/muse/mixer/strip.cpp
+++ b/muse2/muse/mixer/strip.cpp
@@ -257,7 +257,7 @@ Strip::~Strip()
// setAutomationType
//---------------------------------------------------------
-void Strip::setAutomationType(int t,int)
+void Strip::setAutomationType(int t)
{
track->setAutomationType(AutomationType(t));
song->update(SC_AUTOMATION);
diff --git a/muse2/muse/mixer/strip.h b/muse2/muse/mixer/strip.h
index b138992e..cf3babe8 100644
--- a/muse2/muse/mixer/strip.h
+++ b/muse2/muse/mixer/strip.h
@@ -60,7 +60,7 @@ class Strip : public QFrame {
protected slots:
virtual void heartBeat();
- void setAutomationType(int t,int);
+ void setAutomationType(int t);
public slots:
void resetPeaks();