summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Schweer <ws.seh.de>2007-04-18 20:21:01 +0000
committerWerner Schweer <ws.seh.de>2007-04-18 20:21:01 +0000
commitc6bcf4333aa1051272b65b0e0b222536736c344e (patch)
tree654e82529393169852779c37cea72d563c87927e
parent5ab338e4e2f3bd6e28b37049653f664e045b0acf (diff)
updates
-rw-r--r--muse/CMakeLists.txt4
-rw-r--r--muse/ChangeLog1
-rw-r--r--muse/muse/arranger/arranger.cpp7
-rw-r--r--muse/muse/arranger/tlswidget.cpp3
-rw-r--r--muse/muse/gui.h4
-rw-r--r--muse/muse/mixer/astrip.cpp68
-rw-r--r--muse/muse/mixer/astrip.h2
-rw-r--r--muse/muse/mixer/mstrip.cpp161
-rw-r--r--muse/muse/mixer/mstrip.h2
-rw-r--r--muse/muse/mixer/strip.cpp20
-rw-r--r--muse/muse/mixer/strip.h8
-rw-r--r--muse/muse/widgets/utils.cpp13
12 files changed, 125 insertions, 168 deletions
diff --git a/muse/CMakeLists.txt b/muse/CMakeLists.txt
index 9ace7471..355f63d2 100644
--- a/muse/CMakeLists.txt
+++ b/muse/CMakeLists.txt
@@ -26,8 +26,8 @@ if (NOT CMAKE_INSTALL_LIBDIR)
SET(CMAKE_INSTALL_LIBDIR "lib")
endif (NOT CMAKE_INSTALL_LIBDIR)
-# set(CMAKE_BUILD_TYPE debug)
-set(CMAKE_BUILD_TYPE release)
+set(CMAKE_BUILD_TYPE debug)
+# set(CMAKE_BUILD_TYPE release)
# for debugging the make system uncomment next line:
# set(CMAKE_VERBOSE_MAKEFILE ON)
diff --git a/muse/ChangeLog b/muse/ChangeLog
index 66647c54..637980c3 100644
--- a/muse/ChangeLog
+++ b/muse/ChangeLog
@@ -1,4 +1,5 @@
18.04 (ws)
+ - simplify mixer strip geometry manager
- changed track list layout: track name now always uses one
textline; remove configure option for track name size
- fix ctrl dialog for plugin provided controller
diff --git a/muse/muse/arranger/arranger.cpp b/muse/muse/arranger/arranger.cpp
index 5f081a14..d0ad466e 100644
--- a/muse/muse/arranger/arranger.cpp
+++ b/muse/muse/arranger/arranger.cpp
@@ -883,9 +883,10 @@ void Arranger::toggleMixerStrip(bool val)
strip = new AudioStrip(0, (AudioTrack*)_curTrack, false);
break;
}
- strip->setFixedWidth(STRIP_WIDTH);
-// strip->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
-// strip->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
+ //
+ // it looks like the dock widget has a minimum
+ // width
+ strip->setFixedWidth(STRIP_WIDTH + 10);
mixerDock->setWidget(strip);
}
}
diff --git a/muse/muse/arranger/tlswidget.cpp b/muse/muse/arranger/tlswidget.cpp
index 5e7ad434..23b7fbc1 100644
--- a/muse/muse/arranger/tlswidget.cpp
+++ b/muse/muse/arranger/tlswidget.cpp
@@ -105,7 +105,8 @@ void TLSLayout::setGeometry(const QRect& rect)
item = itemList.at(1);
size = item->sizeHint();
- item->setGeometry(QRect(x1, rect.y(), size.width(), trackRowHeight));
+ item->setGeometry(QRect(x1, rect.y(),
+ rect.width() - x1 - 2, trackRowHeight));
}
//---------------------------------------------------------
diff --git a/muse/muse/gui.h b/muse/muse/gui.h
index 30264347..784e58e2 100644
--- a/muse/muse/gui.h
+++ b/muse/muse/gui.h
@@ -40,8 +40,10 @@ static const int trackSeparator = 1;
static const int yTrackOffset = -2; // -4;
// mixer:
-static const int STRIP_WIDTH = 66+4+4;
+static const int STRIP_WIDTH = 60;
static const int LABEL_HEIGHT = 20;
+static const int BUTTON_HEIGHT = STRIP_WIDTH / 3;
+static const int ENTRY_HEIGHT = 17;
static const int ICON_WIDTH = 18;
static const QSize ICON_SIZE(ICON_WIDTH, ICON_WIDTH);
diff --git a/muse/muse/mixer/astrip.cpp b/muse/muse/mixer/astrip.cpp
index 301f69de..1f1326e2 100644
--- a/muse/muse/mixer/astrip.cpp
+++ b/muse/muse/mixer/astrip.cpp
@@ -59,13 +59,12 @@ AudioStrip::AudioStrip(Mixer* m, AudioTrack* t, bool align)
rack1 = new EffectRack(this, t, true);
rack1->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
rack1->setFixedHeight(rack1->sizeHint().height() + 2);
- layout->addWidget(rack1);
+ grid->addWidget(rack1, 1, 0, 1, 2);
//---------------------------------------------------
// mono/stereo pre/post
//---------------------------------------------------
- QHBoxLayout* ppBox = new QHBoxLayout;
stereo = newStereoButton();
stereo->setChecked(channel == 2);
stereo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
@@ -82,9 +81,8 @@ AudioStrip::AudioStrip(Mixer* m, AudioTrack* t, bool align)
pre->setFixedHeight(LABEL_HEIGHT);
connect(pre, SIGNAL(clicked(bool)), SLOT(preToggled(bool)));
- ppBox->addWidget(stereo);
- ppBox->addWidget(pre);
- layout->addLayout(ppBox);
+ grid->addWidget(stereo, 2, 0);
+ grid->addWidget(pre, 2, 1);
//---------------------------------------------------
// slider, label
@@ -99,7 +97,7 @@ AudioStrip::AudioStrip(Mixer* m, AudioTrack* t, bool align)
if (ctrl)
vol = ctrl->curVal().f;
slider->setValue(vol);
- layout->addWidget(slider, 100, Qt::AlignRight);
+ grid->addWidget(slider, 3, 0, 1, 2); // 100, Qt::AlignRight);
sl = new Awl::VolEntry(this);
sl->setFont(config.fonts[1]);
@@ -114,13 +112,13 @@ AudioStrip::AudioStrip(Mixer* m, AudioTrack* t, bool align)
connect(slider, SIGNAL(sliderPressed(int)), SLOT(volumePressed()));
connect(slider, SIGNAL(sliderReleased(int)), SLOT(volumeReleased()));
connect(slider, SIGNAL(meterClicked()), SLOT(resetPeaks()));
- layout->addWidget(sl);
+ grid->addWidget(sl, 4, 0, 1, 2);
//---------------------------------------------------
// pan, balance
//---------------------------------------------------
- pan = addPanKnob(&panl);
+ pan = addPanKnob(&panl, 5);
double panv = t->getController(AC_PAN)->curVal().f;
pan->setValue(panv);
panl->setValue(panv);
@@ -132,7 +130,7 @@ AudioStrip::AudioStrip(Mixer* m, AudioTrack* t, bool align)
rack2 = new EffectRack(this, t, false);
rack2->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
rack2->setFixedHeight(rack1->sizeHint().height() + 2);
- layout->addWidget(rack2);
+ grid->addWidget(rack2, 7, 0, 1, 2);
//---------------------------------------------------
// mute, solo, record
@@ -140,73 +138,63 @@ AudioStrip::AudioStrip(Mixer* m, AudioTrack* t, bool align)
Track::TrackType type = t->type();
- QHBoxLayout* smBox1 = new QHBoxLayout(0);
- QHBoxLayout* smBox2 = new QHBoxLayout(0);
-
mute = newMuteButton();
mute->setChecked(t->mute());
- mute->setFixedSize(buttonSize);
+ mute->setFixedHeight(BUTTON_HEIGHT);
connect(mute, SIGNAL(clicked(bool)), SLOT(muteToggled(bool)));
connect(t, SIGNAL(muteChanged(bool)), mute, SLOT(setChecked(bool)));
- smBox2->addWidget(mute);
solo = newSoloButton();
solo->setDisabled(true);
- solo->setFixedSize(buttonSize);
- smBox2->addWidget(solo);
+ solo->setFixedHeight(BUTTON_HEIGHT);
connect(solo, SIGNAL(clicked(bool)), SLOT(soloToggled(bool)));
connect(t, SIGNAL(soloChanged(bool)), solo, SLOT(setChecked(bool)));
off = newOffButton();
- off->setFixedSize(buttonSize);
+ off->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
+ off->setFixedHeight(BUTTON_HEIGHT);
off->setChecked(t->off());
connect(off, SIGNAL(clicked(bool)), SLOT(offToggled(bool)));
connect(t, SIGNAL(offChanged(bool)), this, SLOT(updateOffState()));
- smBox1->addWidget(off);
-
if (track->canRecord()) {
record = newRecordButton();
- record->setFixedSize(buttonSize);
+ record->setFixedHeight(BUTTON_HEIGHT);
if (type == Track::AUDIO_OUTPUT)
record->setToolTip(tr("record downmix"));
record->setChecked(t->recordFlag());
connect(record, SIGNAL(clicked(bool)), SLOT(recordToggled(bool)));
connect(t, SIGNAL(recordChanged(bool)), record, SLOT(setChecked(bool)));
- smBox1->addWidget(record);
}
- else {
+ else
record = 0;
- smBox1->addStretch(100);
- }
- layout->addLayout(smBox1);
- layout->addLayout(smBox2);
+ grid->addWidget(off, 8, 0);
+ if (record)
+ grid->addWidget(record, 8, 1);
+ grid->addWidget(mute, 9, 0);
+ grid->addWidget(solo, 9, 1);
//---------------------------------------------------
// automation read write
//---------------------------------------------------
- addAutomationButtons();
+ addAutomationButtons(10);
//---------------------------------------------------
// routing
//---------------------------------------------------
- QHBoxLayout* rBox = new QHBoxLayout(0);
-
iR = newInRouteButton();
- rBox->addWidget(iR);
+ grid->addWidget(iR, 12, 0);
connect(iR->menu(), SIGNAL(aboutToShow()), SLOT(iRouteShow()));
connect(iR->menu(), SIGNAL(triggered(QAction*)), song, SLOT(routeChanged(QAction*)));
oR = newOutRouteButton();
- rBox->addWidget(oR);
+ grid->addWidget(oR, 12, 1);
connect(oR->menu(), SIGNAL(aboutToShow()), SLOT(oRouteShow()));
connect(oR->menu(), SIGNAL(triggered(QAction*)), song, SLOT(routeChanged(QAction*)));
- layout->addLayout(rBox);
-
if (off) {
updateOffState(); // init state
}
@@ -409,11 +397,11 @@ void AudioStrip::updateChannels()
// addPanKnob
//---------------------------------------------------------
-Awl::PanKnob* AudioStrip::addPanKnob(Awl::PanEntry** dlabel)
+Awl::PanKnob* AudioStrip::addPanKnob(Awl::PanEntry** dlabel, int row)
{
Awl::PanKnob* knob = new Awl::PanKnob(this);
knob->setToolTip(tr("panorama"));
- knob->setFixedSize(buttonSize.width(), entrySize.height() * 2);
+ knob->setFixedHeight(entrySize.height() * 2);
Awl::PanEntry* pl = new Awl::PanEntry(this);
pl->setPrecision(2);
@@ -432,13 +420,9 @@ Awl::PanKnob* AudioStrip::addPanKnob(Awl::PanEntry** dlabel)
plb->setFixedSize(entrySize);
plb->setAlignment(Qt::AlignCenter);
- QGridLayout* pangrid = new QGridLayout;
- pangrid->setMargin(0);
- pangrid->setSpacing(0);
- pangrid->addWidget(plb, 0, 0);
- pangrid->addWidget(pl, 1, 0);
- pangrid->addWidget(knob, 0, 1, 2, 1);
- layout->addLayout(pangrid);
+ grid->addWidget(plb, row, 0);
+ grid->addWidget(pl, row+1, 0);
+ grid->addWidget(knob, row, 1, 2, 1);
connect(knob, SIGNAL(valueChanged(double,int)), SLOT(panChanged(double)));
connect(pl, SIGNAL(valueChanged(double,int)), SLOT(panChanged(double)));
diff --git a/muse/muse/mixer/astrip.h b/muse/muse/mixer/astrip.h
index c7f59dcc..f3710382 100644
--- a/muse/muse/mixer/astrip.h
+++ b/muse/muse/mixer/astrip.h
@@ -58,7 +58,7 @@ class AudioStrip : public Strip {
QToolButton* stereo;
QToolButton* pre;
- Awl::PanKnob* addPanKnob(Awl::PanEntry**);
+ Awl::PanKnob* addPanKnob(Awl::PanEntry**, int);
QToolButton* iR;
QToolButton* oR;
diff --git a/muse/muse/mixer/mstrip.cpp b/muse/muse/mixer/mstrip.cpp
index 30ce4558..5c88ab43 100644
--- a/muse/muse/mixer/mstrip.cpp
+++ b/muse/muse/mixer/mstrip.cpp
@@ -157,21 +157,20 @@ static void addSyntiPorts(QMenu* menu, Track* strack, int channel)
//---------------------------------------------------------
void MidiStrip::addKnob(int ctrl, int idx, const QString& tt, const QString& label,
- const char* slot, bool enabled)
+ const char* slot, bool enabled, int row)
{
Awl::FloatEntry* dl;
Awl::Knob* knob;
if (idx == KNOB_PAN) {
- dl = new Awl::MidiPanEntry(this);
+ dl = new Awl::MidiPanEntry(this);
knob = new Awl::MidiPanKnob(this);
}
else {
- dl = new Awl::MidiVolEntry(this);
+ dl = new Awl::MidiVolEntry(this);
knob = new Awl::Knob(this);
knob->setRange(0.0, 127.0);
}
-// knob->setFixedSize(buttonSize.width(), entrySize.height() * 2);
knob->setId(ctrl);
dl->setId(ctrl);
dl->setFrame(true);
@@ -192,13 +191,9 @@ void MidiStrip::addKnob(int ctrl, int idx, const QString& tt, const QString& lab
lb->setAlignment(Qt::AlignCenter);
lb->setEnabled(enabled);
- QGridLayout* grid = new QGridLayout;
- grid->setMargin(0);
- grid->setSpacing(0);
- grid->addWidget(lb, 0, 0);
- grid->addWidget(dl, 1, 0);
- grid->addWidget(knob, 0, 1, 2, 1);
- layout->addLayout(grid);
+ grid->addWidget(lb, row, 0);
+ grid->addWidget(dl, row+1, 0);
+ grid->addWidget(knob, row, 1, 2, 1);
connect(knob, SIGNAL(valueChanged(double,int)), slot);
connect(dl, SIGNAL(valueChanged(double,int)), slot);
@@ -219,9 +214,9 @@ MidiStrip::MidiStrip(Mixer* m, MidiTrack* t, bool align)
variSendTouched = false;
chorusSendTouched = false;
- addKnob(CTRL_VARIATION_SEND, KNOB_VAR_SEND, tr("VariationSend"), tr("Var"), SLOT(ctrlChanged(double,int)), true);
- addKnob(CTRL_REVERB_SEND, KNOB_REV_SEND, tr("ReverbSend"), tr("Rev"), SLOT(ctrlChanged(double,int)), true);
- addKnob(CTRL_CHORUS_SEND, KNOB_CHOR_SEND, tr("ChorusSend"), tr("Cho"), SLOT(ctrlChanged(double,int)), true);
+ addKnob(CTRL_VARIATION_SEND, KNOB_VAR_SEND, tr("VariationSend"), tr("Var"), SLOT(ctrlChanged(double,int)), true, 1);
+ addKnob(CTRL_REVERB_SEND, KNOB_REV_SEND, tr("ReverbSend"), tr("Rev"), SLOT(ctrlChanged(double,int)), true, 3);
+ addKnob(CTRL_CHORUS_SEND, KNOB_CHOR_SEND, tr("ChorusSend"), tr("Cho"), SLOT(ctrlChanged(double,int)), true, 5);
//---------------------------------------------------
// slider, label, meter
@@ -230,7 +225,7 @@ MidiStrip::MidiStrip(Mixer* m, MidiTrack* t, bool align)
slider = new Awl::MidiMeterSlider(this);
slider->setId(CTRL_VOLUME);
slider->setFixedWidth(40);
- layout->addWidget(slider, 100, Qt::AlignRight);
+ grid->addWidget(slider, 7, 0, 1, 2, Qt::AlignRight);
sl = new Awl::MidiVolEntry(this);
sl->setId(CTRL_VOLUME);
@@ -241,13 +236,13 @@ MidiStrip::MidiStrip(Mixer* m, MidiTrack* t, bool align)
connect(slider, SIGNAL(sliderPressed(int)), SLOT(sliderPressed(int)));
connect(slider, SIGNAL(sliderReleased(int)), SLOT(sliderReleased(int)));
connect(sl, SIGNAL(valueChanged(double,int)), SLOT(ctrlChanged(double, int)));
- layout->addWidget(sl);
+ grid->addWidget(sl, 8, 0, 1, 2);
//---------------------------------------------------
// pan, balance
//---------------------------------------------------
- addKnob(CTRL_PANPOT, KNOB_PAN, tr("Pan/Balance"), tr("Pan"), SLOT(ctrlChanged(double,int)), true);
+ addKnob(CTRL_PANPOT, KNOB_PAN, tr("Pan/Balance"), tr("Pan"), SLOT(ctrlChanged(double,int)), true, 9);
//---------------------------------------------------
// --- record
@@ -255,62 +250,52 @@ MidiStrip::MidiStrip(Mixer* m, MidiTrack* t, bool align)
//---------------------------------------------------
SimpleButton* monitor = newMonitorButton();
- monitor->setFixedSize(buttonSize);
+ monitor->setFixedHeight(BUTTON_HEIGHT);
monitor->setChecked(track->monitor());
connect(monitor, SIGNAL(clicked(bool)), SLOT(monitorToggled(bool)));
connect(t, SIGNAL(monitorChanged(bool)), monitor, SLOT(setChecked(bool)));
SimpleButton* record = newRecordButton();
- record->setFixedSize(buttonSize);
+ record->setFixedHeight(BUTTON_HEIGHT);
record->setChecked(track->recordFlag());
connect(record, SIGNAL(clicked(bool)), SLOT(recordToggled(bool)));
connect(t, SIGNAL(recordChanged(bool)), record, SLOT(setChecked(bool)));
mute = newMuteButton();
mute->setChecked(track->isMute());
- mute->setFixedSize(buttonSize);
+ mute->setFixedHeight(BUTTON_HEIGHT);
connect(mute, SIGNAL(clicked(bool)), SLOT(muteToggled(bool)));
solo = newSoloButton();
- solo->setFixedSize(buttonSize);
+ solo->setFixedHeight(BUTTON_HEIGHT);
solo->setChecked(track->solo());
connect(solo, SIGNAL(clicked(bool)), SLOT(soloToggled(bool)));
- QHBoxLayout* smBox1 = new QHBoxLayout(0);
- QHBoxLayout* smBox2 = new QHBoxLayout(0);
-
- smBox1->addWidget(monitor);
- smBox1->addWidget(record);
-
- smBox2->addWidget(mute);
- smBox2->addWidget(solo);
-
- layout->addLayout(smBox1);
- layout->addLayout(smBox2);
+ grid->addWidget(monitor, 11, 0);
+ grid->addWidget(record, 11, 1);
+ grid->addWidget(mute, 12, 0);
+ grid->addWidget(solo, 12, 1);
//---------------------------------------------------
// automation mode
//---------------------------------------------------
- addAutomationButtons();
+ addAutomationButtons(13);
//---------------------------------------------------
// routing
//---------------------------------------------------
- QHBoxLayout* rBox = new QHBoxLayout(0);
iR = newInRouteButton();
- rBox->addWidget(iR);
+ grid->addWidget(iR, 14, 0);
connect(iR->menu(), SIGNAL(aboutToShow()), SLOT(iRouteShow()));
connect(iR->menu(), SIGNAL(triggered(QAction*)), song, SLOT(routeChanged(QAction*)));
oR = newOutRouteButton();
- rBox->addWidget(oR);
+ grid->addWidget(oR, 14, 1);
connect(oR->menu(), SIGNAL(aboutToShow()), SLOT(oRouteShow()));
connect(oR->menu(), SIGNAL(triggered(QAction*)), song, SLOT(routeChanged(QAction*)));
- layout->addLayout(rBox);
-
connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int)));
connect(track, SIGNAL(muteChanged(bool)), mute, SLOT(setChecked(bool)));
connect(track, SIGNAL(soloChanged(bool)), solo, SLOT(setChecked(bool)));
@@ -542,13 +527,12 @@ MidiOutPortStrip::MidiOutPortStrip(Mixer* m, MidiOutPort* t, bool align)
//---------------------------------------------------
MidiRack* rack = new MidiRack(this, t);
-// rack->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
rack->setFixedHeight(rack->sizeHint().height()+2);
- layout->addWidget(rack);
+ grid->addWidget(rack, 1, 0, 1, 2);
if (_align)
- layout->addSpacing(STRIP_WIDTH/2);
+ grid->setRowMinimumHeight(2, STRIP_WIDTH/2);
volumeTouched = false;
@@ -560,7 +544,7 @@ MidiOutPortStrip::MidiOutPortStrip(Mixer* m, MidiOutPort* t, bool align)
slider->setId(CTRL_MASTER_VOLUME);
slider->setRange(0.0, 1024*16.0);
slider->setFixedWidth(40);
- layout->addWidget(slider, 100, Qt::AlignRight);
+ grid->addWidget(slider, 3, 0, 1, 2, Qt::AlignRight);
sl = new Awl::MidiVolEntry(this);
sl->setId(CTRL_MASTER_VOLUME);
@@ -574,14 +558,14 @@ MidiOutPortStrip::MidiOutPortStrip(Mixer* m, MidiOutPort* t, bool align)
connect(slider, SIGNAL(sliderPressed(int)), SLOT(sliderPressed(int)));
connect(slider, SIGNAL(sliderReleased(int)), SLOT(sliderReleased(int)));
connect(sl, SIGNAL(valueChanged(double,int)), SLOT(ctrlChanged(double, int)));
- layout->addWidget(sl);
+ grid->addWidget(sl, 4, 0, 1, 2);
//---------------------------------------------------
// pan, balance
//---------------------------------------------------
if (_align)
- layout->addSpacing(entrySize.height() * 2);
+ grid->setRowMinimumHeight(5, entrySize.height() * 2);
//---------------------------------------------------
// sync
@@ -589,54 +573,46 @@ MidiOutPortStrip::MidiOutPortStrip(Mixer* m, MidiOutPort* t, bool align)
//---------------------------------------------------
sync = newSyncButton();
- sync->setFixedHeight(buttonSize.height());
+ sync->setFixedHeight(BUTTON_HEIGHT);
sync->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
sync->setChecked(((MidiOutPort*)track)->sendSync());
- layout->addWidget(sync);
+ grid->addWidget(sync, 6, 0, 1, 2);
connect(sync, SIGNAL(clicked(bool)), SLOT(syncToggled(bool)));
connect(track, SIGNAL(sendSyncChanged(bool)), sync, SLOT(setChecked(bool)));
mute = newMuteButton();
mute->setChecked(track->isMute());
- mute->setFixedSize(buttonSize);
+ mute->setFixedHeight(BUTTON_HEIGHT);
connect(mute, SIGNAL(clicked(bool)), SLOT(muteToggled(bool)));
solo = newSoloButton();
- solo->setFixedSize(buttonSize);
+ solo->setFixedHeight(BUTTON_HEIGHT);
solo->setChecked(track->solo());
connect(solo, SIGNAL(clicked(bool)), SLOT(soloToggled(bool)));
- QHBoxLayout* smBox2 = new QHBoxLayout(0);
-
- smBox2->addWidget(mute);
- smBox2->addWidget(solo);
-
- layout->addLayout(smBox2);
+ grid->addWidget(mute, 7, 0);
+ grid->addWidget(solo, 7, 1);
//---------------------------------------------------
// automation mode
//---------------------------------------------------
- addAutomationButtons();
+ addAutomationButtons(8);
//---------------------------------------------------
// output routing
//---------------------------------------------------
- QHBoxLayout* rBox = new QHBoxLayout(0);
-
iR = newInRouteButton();
- rBox->addWidget(iR);
+ grid->addWidget(iR, 9, 0);
connect(iR->menu(), SIGNAL(aboutToShow()), SLOT(iRouteShow()));
connect(iR->menu(), SIGNAL(triggered(QAction*)), song, SLOT(routeChanged(QAction*)));
oR = newOutRouteButton();
- rBox->addWidget(oR);
+ grid->addWidget(oR, 9, 1);
connect(oR->menu(), SIGNAL(aboutToShow()), SLOT(oRouteShow()));
connect(oR->menu(), SIGNAL(triggered(QAction*)), song, SLOT(routeChanged(QAction*)));
- layout->addLayout(rBox);
-
connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int)));
connect(track, SIGNAL(muteChanged(bool)), mute, SLOT(setChecked(bool)));
connect(track, SIGNAL(soloChanged(bool)), solo, SLOT(setChecked(bool)));
@@ -848,15 +824,14 @@ MidiInPortStrip::MidiInPortStrip(Mixer* m, MidiInPort* t, bool align)
//---------------------------------------------------
MidiRack* rack = new MidiRack(this, t);
-// rack->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
rack->setFixedHeight(rack->sizeHint().height()+2);
- layout->addWidget(rack);
+ grid->addWidget(rack, 1, 0, 1, 2);
//---------------------------------------------------
// input activity
//---------------------------------------------------
- layout->addStretch(100);
+ grid->setRowStretch(2, 100);
QGridLayout* ag = new QGridLayout;
ag->setMargin(4);
@@ -890,7 +865,10 @@ MidiInPortStrip::MidiInPortStrip(Mixer* m, MidiInPort* t, bool align)
channelActivity[ch]->setPixmap(*activityOff);
activity[ch] = 0;
}
- layout->addLayout(ag, Qt::AlignHCenter);
+ grid->addLayout(ag, 3, 0, 2, Qt::AlignHCenter);
+
+ if (_align)
+ grid->setRowMinimumHeight(4, BUTTON_HEIGHT);
//---------------------------------------------------
// mute, solo
@@ -900,29 +878,23 @@ MidiInPortStrip::MidiInPortStrip(Mixer* m, MidiInPort* t, bool align)
mute = newMuteButton();
mute->setChecked(track->isMute());
- mute->setFixedSize(buttonSize);
+ mute->setFixedHeight(BUTTON_HEIGHT);
connect(mute, SIGNAL(clicked(bool)), SLOT(muteToggled(bool)));
solo = newSoloButton();
- solo->setFixedSize(buttonSize);
+ solo->setFixedHeight(BUTTON_HEIGHT);
solo->setChecked(track->solo());
connect(solo, SIGNAL(clicked(bool)), SLOT(soloToggled(bool)));
- QHBoxLayout* smBox1 = new QHBoxLayout(0);
- QHBoxLayout* smBox2 = new QHBoxLayout(0);
-
- smBox2->addWidget(mute);
- smBox2->addWidget(solo);
-
- layout->addLayout(smBox1);
- layout->addLayout(smBox2);
+ grid->addWidget(mute, 5, 0);
+ grid->addWidget(solo, 5, 1);
//---------------------------------------------------
// output routing
//---------------------------------------------------
if (_align)
- layout->addSpacing(STRIP_WIDTH/3); // automation row
+ grid->setRowMinimumHeight(6, BUTTON_HEIGHT);
iR = newInRouteButton();
connect(iR->menu(), SIGNAL(aboutToShow()), SLOT(iRouteShow()));
@@ -932,10 +904,8 @@ MidiInPortStrip::MidiInPortStrip(Mixer* m, MidiInPort* t, bool align)
connect(oR->menu(), SIGNAL(aboutToShow()), SLOT(oRouteShow()));
connect(oR->menu(), SIGNAL(triggered(QAction*)), song, SLOT(routeChanged(QAction*)));
- QHBoxLayout* rBox = new QHBoxLayout(0);
- rBox->addWidget(iR);
- rBox->addWidget(oR);
- layout->addLayout(rBox);
+ grid->addWidget(iR, 7, 0);
+ grid->addWidget(oR, 7, 1);
connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int)));
connect(track, SIGNAL(muteChanged(bool)), mute, SLOT(setChecked(bool)));
@@ -1047,7 +1017,7 @@ MidiSyntiStrip::MidiSyntiStrip(Mixer* m, MidiSynti* t, bool align)
: Strip(m, t, align)
{
if (_align)
- layout->addSpacing(STRIP_WIDTH/2 * 3);
+ grid->setRowMinimumHeight(1, STRIP_WIDTH/2 * 3);
volumeTouched = false;
@@ -1059,26 +1029,25 @@ MidiSyntiStrip::MidiSyntiStrip(Mixer* m, MidiSynti* t, bool align)
slider->setId(CTRL_MASTER_VOLUME);
slider->setRange(0.0, 1024*16.0);
slider->setFixedWidth(40);
- layout->addWidget(slider, 100, Qt::AlignRight);
+ grid->addWidget(slider, 2, 0, 1, 2, Qt::AlignRight);
sl = new Awl::MidiVolEntry(this);
sl->setId(CTRL_MASTER_VOLUME);
sl->setFont(config.fonts[1]);
-// sl->setFixedWidth(STRIP_WIDTH-2);
sl->setFixedHeight(entrySize.height());
connect(slider, SIGNAL(valueChanged(double,int)), SLOT(ctrlChanged(double, int)));
connect(slider, SIGNAL(sliderPressed(int)), SLOT(sliderPressed(int)));
connect(slider, SIGNAL(sliderReleased(int)), SLOT(sliderReleased(int)));
connect(sl, SIGNAL(valueChanged(double,int)), SLOT(ctrlChanged(double, int)));
- layout->addWidget(sl);
+ grid->addWidget(sl, 3, 0, 1, 2);
//---------------------------------------------------
// pan, balance
//---------------------------------------------------
if (_align)
- layout->addSpacing(STRIP_WIDTH);
+ grid->setRowMinimumHeight(4, STRIP_WIDTH);
//---------------------------------------------------
// sync
@@ -1087,45 +1056,37 @@ MidiSyntiStrip::MidiSyntiStrip(Mixer* m, MidiSynti* t, bool align)
mute = newMuteButton();
mute->setChecked(track->isMute());
- mute->setFixedSize(buttonSize);
+ mute->setFixedHeight(BUTTON_HEIGHT);
connect(mute, SIGNAL(clicked(bool)), SLOT(muteToggled(bool)));
solo = newSoloButton();
- solo->setFixedSize(buttonSize);
+ solo->setFixedHeight(BUTTON_HEIGHT);
solo->setChecked(track->solo());
connect(solo, SIGNAL(clicked(bool)), SLOT(soloToggled(bool)));
- QHBoxLayout* smBox2 = new QHBoxLayout(0);
-
- smBox2->addWidget(mute);
- smBox2->addWidget(solo);
-
- layout->addLayout(smBox2);
+ grid->addWidget(mute, 5, 0);
+ grid->addWidget(solo, 5, 1);
//---------------------------------------------------
// automation mode
//---------------------------------------------------
- addAutomationButtons();
+ addAutomationButtons(6);
//---------------------------------------------------
// output routing
//---------------------------------------------------
- QHBoxLayout* rBox = new QHBoxLayout(0);
-
iR = newInRouteButton();
- rBox->addWidget(iR);
+ grid->addWidget(iR, 7, 0);
connect(iR->menu(), SIGNAL(aboutToShow()), SLOT(iRouteShow()));
connect(iR->menu(), SIGNAL(triggered(QAction*)), song, SLOT(routeChanged(QAction*)));
oR = newOutRouteButton();
- rBox->addWidget(oR);
+ grid->addWidget(oR, 7, 1);
connect(oR->menu(), SIGNAL(aboutToShow()), SLOT(oRouteShow()));
connect(oR->menu(), SIGNAL(triggered(QAction*)), song, SLOT(routeChanged(QAction*)));
- layout->addLayout(rBox);
-
connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int)));
connect(track, SIGNAL(muteChanged(bool)), mute, SLOT(setChecked(bool)));
connect(track, SIGNAL(soloChanged(bool)), solo, SLOT(setChecked(bool)));
diff --git a/muse/muse/mixer/mstrip.h b/muse/muse/mixer/mstrip.h
index 61c3ea62..007be297 100644
--- a/muse/muse/mixer/mstrip.h
+++ b/muse/muse/mixer/mstrip.h
@@ -61,7 +61,7 @@ class MidiStrip : public Strip {
bool variSendTouched;
bool chorusSendTouched;
- void addKnob(int ctrl, int idx, const QString&, const QString&, const char*, bool);
+ void addKnob(int ctrl, int idx, const QString&, const QString&, const char*, bool, int row);
private slots:
virtual void controllerChanged(int id);
diff --git a/muse/muse/mixer/strip.cpp b/muse/muse/mixer/strip.cpp
index 6123e8cc..da73c00c 100644
--- a/muse/muse/mixer/strip.cpp
+++ b/muse/muse/mixer/strip.cpp
@@ -64,10 +64,10 @@ Strip::Strip(Mixer* m, Track* t, bool align)
setLineWidth(2);
track = t;
- layout = new QVBoxLayout;
- layout->setMargin(0);
- layout->setSpacing(0);
- setLayout(layout);
+ grid = new QGridLayout;
+ grid->setMargin(0);
+ grid->setSpacing(0);
+ setLayout(grid);
//---------------------------------------------
// label
@@ -80,7 +80,7 @@ Strip::Strip(Mixer* m, Track* t, bool align)
label->setLineWidth(2);
label->setFrameStyle(QFrame::Sunken | QFrame::StyledPanel);
updateLabel();
- layout->addWidget(label);
+ grid->addWidget(label, 0, 0, 1, 2);
connect(muse, SIGNAL(configChanged()), SLOT(configChanged()));
connect(track, SIGNAL(controllerChanged(int)), SLOT(controllerChanged(int)));
}
@@ -106,18 +106,18 @@ void Strip::configChanged()
// addAutomationButtons
//---------------------------------------------------------
-void Strip::addAutomationButtons()
+void Strip::addAutomationButtons(int row)
{
QHBoxLayout* aBox = new QHBoxLayout;
- SimpleButton* ar = newAutoReadButton();
- ar->setFixedSize(buttonSize);
+ SimpleButton* ar = newAutoReadButton();
+ ar->setFixedHeight(BUTTON_HEIGHT);
ar->setChecked(track->autoRead());
aBox->addWidget(ar);
SimpleButton* aw = newAutoWriteButton();
- aw->setFixedSize(buttonSize);
+ aw->setFixedHeight(BUTTON_HEIGHT);
aw->setChecked(track->autoWrite());
aBox->addWidget(aw);
- layout->addLayout(aBox);
+ grid->addLayout(aBox, row, 0, 1, 2);
connect(ar, SIGNAL(clicked(bool)), SLOT(autoReadToggled(bool)));
connect(aw, SIGNAL(clicked(bool)), SLOT(autoWriteToggled(bool)));
connect(track, SIGNAL(autoReadChanged(bool)), ar, SLOT(setChecked(bool)));
diff --git a/muse/muse/mixer/strip.h b/muse/muse/mixer/strip.h
index 259202b7..c4ef3604 100644
--- a/muse/muse/mixer/strip.h
+++ b/muse/muse/mixer/strip.h
@@ -29,8 +29,8 @@ class Meter;
class SimpleButton;
class Mixer;
-static const QSize buttonSize(STRIP_WIDTH/2-2, STRIP_WIDTH/3);
-static const QSize entrySize(STRIP_WIDTH/2-2, 17);
+// static const QSize buttonSize(STRIP_WIDTH/2-2, BUTTON_HEIGHT);
+static const QSize entrySize(STRIP_WIDTH/2-2, ENTRY_HEIGHT);
//---------------------------------------------------------
// Strip
@@ -43,7 +43,7 @@ class Strip : public QFrame {
Mixer* mixer;
Track* track;
QLabel* label;
- QVBoxLayout* layout;
+ QGridLayout* grid;
SimpleButton* solo;
SimpleButton* mute;
@@ -51,7 +51,7 @@ class Strip : public QFrame {
bool _align; // align elements for mixer app
void recordToggled(bool);
- void addAutomationButtons();
+ void addAutomationButtons(int row);
public slots:
void resetPeaks();
diff --git a/muse/muse/widgets/utils.cpp b/muse/muse/widgets/utils.cpp
index 16e45605..f95d121e 100644
--- a/muse/muse/widgets/utils.cpp
+++ b/muse/muse/widgets/utils.cpp
@@ -225,6 +225,7 @@ SimpleButton* newMuteButton()
mute->setFont(config.fonts[BFONT]);
mute->setCheckable(true);
mute->setToolTip(QT_TR_NOOP("mute"));
+ mute->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
return mute;
}
@@ -239,6 +240,7 @@ SimpleButton* newSoloButton()
solo->setFont(config.fonts[BFONT]);
solo->setCheckable(true);
solo->setToolTip(QT_TR_NOOP("solo"));
+ solo->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
return solo;
}
@@ -252,6 +254,7 @@ SimpleButton* newMonitorButton()
monitor->setFont(config.fonts[BFONT]);
monitor->setCheckable(true);
monitor->setToolTip(QT_TR_NOOP("monitor"));
+ monitor->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
return monitor;
}
@@ -286,7 +289,9 @@ SimpleButton* newOffButton()
SimpleButton* newRecordButton()
{
- return new RecordButton();
+ SimpleButton* record = new RecordButton();
+ record->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
+ return record;
}
//---------------------------------------------------------
@@ -367,13 +372,14 @@ QToolButton* newOutRouteButton()
{
QToolButton* oR = new QToolButton;
oR->setFont(config.fonts[BFONT]);
- oR->setFixedWidth((STRIP_WIDTH-4)/2);
+ oR->setFixedHeight(BUTTON_HEIGHT);
oR->setText(QT_TR_NOOP("oR"));
oR->setCheckable(false);
oR->setToolTip(QT_TR_NOOP("output routing"));
oR->setMenu(new QMenu);
oR->setPopupMode(QToolButton::InstantPopup);
oR->menu()->setSeparatorsCollapsible(false);
+ oR->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
return oR;
}
@@ -385,13 +391,14 @@ QToolButton* newInRouteButton()
{
QToolButton* iR = new QToolButton;
iR->setFont(config.fonts[BFONT]);
- iR->setFixedWidth((STRIP_WIDTH-4)/2);
+ iR->setFixedHeight(BUTTON_HEIGHT);
iR->setText(QT_TR_NOOP("iR"));
iR->setCheckable(false);
iR->setToolTip(QT_TR_NOOP("input routing"));
iR->setMenu(new QMenu);
iR->setPopupMode(QToolButton::InstantPopup);
iR->menu()->setSeparatorsCollapsible(false);
+ iR->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
return iR;
}