# HG changeset patch # User Chris Cannam # Date 1481798201 0 # Node ID 306c24eeab1099fee3fd887ffd8dbeb7081cfad8 # Parent 8665e0ffa0d8fac26fa49b7b31dd8032d9d3ea56 Moving around some UI bits diff -r 8665e0ffa0d8 -r 306c24eeab10 widgets/LevelPanToolButton.cpp --- a/widgets/LevelPanToolButton.cpp Wed Dec 14 14:28:41 2016 +0000 +++ b/widgets/LevelPanToolButton.cpp Thu Dec 15 10:36:41 2016 +0000 @@ -110,6 +110,13 @@ } void +LevelPanToolButton::setMonitoringLevels(float left, float right) +{ + m_lpw->setMonitoringLevels(left, right); + update(); +} + +void LevelPanToolButton::setIncludeMute(bool include) { m_lpw->setIncludeMute(include); diff -r 8665e0ffa0d8 -r 306c24eeab10 widgets/LevelPanToolButton.h --- a/widgets/LevelPanToolButton.h Wed Dec 14 14:28:41 2016 +0000 +++ b/widgets/LevelPanToolButton.h Thu Dec 15 10:36:41 2016 +0000 @@ -47,6 +47,9 @@ /// Set pan in the range [-1,1] -- will be rounded void setPan(float); + /// Set left and right peak monitoring levels in the range [0,1] + void setMonitoringLevels(float, float); + /// Specify whether the level range should include muting or not void setIncludeMute(bool); diff -r 8665e0ffa0d8 -r 306c24eeab10 widgets/PropertyBox.cpp --- a/widgets/PropertyBox.cpp Wed Dec 14 14:28:41 2016 +0000 +++ b/widgets/PropertyBox.cpp Thu Dec 15 10:36:41 2016 +0000 @@ -158,41 +158,23 @@ #ifdef DEBUG_PROPERTY_BOX SVDEBUG << "PropertyBox::populateViewPlayFrame: container " << m_container << " (name " << m_container->getPropertyContainerName() << ") params " << params << endl; #endif - - if (layer) { - QLabel *showLabel = new QLabel(tr("Show")); - layout->addWidget(showLabel); - layout->setAlignment(showLabel, Qt::AlignVCenter); - - m_showButton = new LEDButton(Qt::blue); - layout->addWidget(m_showButton); - connect(m_showButton, SIGNAL(stateChanged(bool)), - this, SIGNAL(showLayer(bool))); - connect(m_showButton, SIGNAL(mouseEntered()), - this, SLOT(mouseEnteredWidget())); - connect(m_showButton, SIGNAL(mouseLeft()), - this, SLOT(mouseLeftWidget())); - layout->setAlignment(m_showButton, Qt::AlignVCenter); - } if (params) { - layout->insertStretch(-1, 10); - - if (params->getPlayClipId() != "") { - NotifyingPushButton *playParamButton = new NotifyingPushButton; - playParamButton->setObjectName("playParamButton"); - playParamButton->setIcon(IconLoader().load("faders")); - playParamButton->setFixedWidth(WidgetScale::scalePixelSize(24)); - playParamButton->setFixedHeight(WidgetScale::scalePixelSize(24)); - layout->addWidget(playParamButton); - connect(playParamButton, SIGNAL(clicked()), - this, SLOT(editPlayParameters())); - connect(playParamButton, SIGNAL(mouseEntered()), - this, SLOT(mouseEnteredWidget())); - connect(playParamButton, SIGNAL(mouseLeft()), - this, SLOT(mouseLeftWidget())); - } + m_playButton = new NotifyingPushButton; + m_playButton->setCheckable(true); + m_playButton->setIcon(IconLoader().load("speaker")); + m_playButton->setChecked(!params->isPlayMuted()); + layout->addWidget(m_playButton); + connect(m_playButton, SIGNAL(toggled(bool)), + this, SLOT(playAudibleButtonChanged(bool))); + connect(m_playButton, SIGNAL(mouseEntered()), + this, SLOT(mouseEnteredWidget())); + connect(m_playButton, SIGNAL(mouseLeft()), + this, SLOT(mouseLeftWidget())); + connect(params, SIGNAL(playAudibleChanged(bool)), + this, SLOT(playAudibleChanged(bool))); + layout->setAlignment(m_playButton, Qt::AlignVCenter); LevelPanToolButton *levelPan = new LevelPanToolButton; layout->addWidget(levelPan); @@ -209,24 +191,39 @@ connect(levelPan, SIGNAL(mouseLeft()), this, SLOT(mouseLeftWidget())); - m_playButton = new NotifyingPushButton; - m_playButton->setCheckable(true); - m_playButton->setIcon(IconLoader().load("speaker")); - m_playButton->setChecked(!params->isPlayMuted()); - layout->addWidget(m_playButton); - connect(m_playButton, SIGNAL(toggled(bool)), - this, SLOT(playAudibleButtonChanged(bool))); - connect(m_playButton, SIGNAL(mouseEntered()), + if (params->getPlayClipId() != "") { + NotifyingPushButton *playParamButton = new NotifyingPushButton; + playParamButton->setObjectName("playParamButton"); + playParamButton->setIcon(IconLoader().load("faders")); + playParamButton->setFixedWidth(WidgetScale::scalePixelSize(24)); + playParamButton->setFixedHeight(WidgetScale::scalePixelSize(24)); + layout->addWidget(playParamButton); + connect(playParamButton, SIGNAL(clicked()), + this, SLOT(editPlayParameters())); + connect(playParamButton, SIGNAL(mouseEntered()), + this, SLOT(mouseEnteredWidget())); + connect(playParamButton, SIGNAL(mouseLeft()), + this, SLOT(mouseLeftWidget())); + } + } + + layout->insertStretch(-1, 10); + + if (layer) { + + QLabel *showLabel = new QLabel(tr("Show")); + layout->addWidget(showLabel); + layout->setAlignment(showLabel, Qt::AlignVCenter); + + m_showButton = new LEDButton(Qt::blue); + layout->addWidget(m_showButton); + connect(m_showButton, SIGNAL(stateChanged(bool)), + this, SIGNAL(showLayer(bool))); + connect(m_showButton, SIGNAL(mouseEntered()), this, SLOT(mouseEnteredWidget())); - connect(m_playButton, SIGNAL(mouseLeft()), + connect(m_showButton, SIGNAL(mouseLeft()), this, SLOT(mouseLeftWidget())); - connect(params, SIGNAL(playAudibleChanged(bool)), - this, SLOT(playAudibleChanged(bool))); - layout->setAlignment(m_playButton, Qt::AlignVCenter); - - } else { - - layout->insertStretch(-1, 10); + layout->setAlignment(m_showButton, Qt::AlignVCenter); } }