trackviewitem: receive signal when mute is changed from another source

This commit is contained in:
itsmattkc
2020-04-19 16:26:48 +10:00
parent 410f3d25dc
commit 9d9825d8e1
3 changed files with 15 additions and 0 deletions
+6
View File
@@ -44,6 +44,7 @@ TrackOutput::TrackOutput() :
muted_input_ = new NodeInput("muted_in", NodeParam::kBoolean);
muted_input_->set_is_keyframable(false);
connect(muted_input_, &NodeInput::ValueChanged, this, &TrackOutput::MutedInputValueChanged);
AddInput(muted_input_);
// Set default height
@@ -574,4 +575,9 @@ void TrackOutput::BlockLengthChanged()
UpdateInOutFrom(index);
}
void TrackOutput::MutedInputValueChanged()
{
emit MutedChanged(IsMuted());
}
OLIVE_NAMESPACE_EXIT
+7
View File
@@ -178,6 +178,11 @@ signals:
*/
void TrackHeightChanged(int height);
/**
* @brief Signal emitted when the muted setting changes
*/
void MutedChanged(bool e);
protected:
private:
@@ -214,6 +219,8 @@ private slots:
void BlockLengthChanged();
void MutedInputValueChanged();
};
OLIVE_NAMESPACE_EXIT
@@ -60,6 +60,8 @@ TrackViewItem::TrackViewItem(TrackOutput* track, QWidget *parent) :
layout->addWidget(lock_button_);
setMinimumHeight(mute_button_->height());
connect(track, &TrackOutput::MutedChanged, mute_button_, &QPushButton::setChecked);
}
QPushButton *TrackViewItem::CreateMSLButton(const QString& text, const QColor& checked_color) const