提交 5585ae0e 编写于 作者: J jp9000

Rename volume control if audio source renamed

上级 23a83054
......@@ -95,6 +95,16 @@ void VolControl::SliderChanged(int vol)
volLabel->setText(QString::number(vol));
}
QString VolControl::GetName() const
{
return nameLabel->text();
}
void VolControl::SetName(const QString &newName)
{
nameLabel->setText(newName);
}
VolControl::VolControl(OBSSource source_)
: source (source_),
signalChanged (true),
......
......@@ -36,4 +36,7 @@ public:
~VolControl();
inline obs_source_t GetSource() const {return source;}
QString GetName() const;
void SetName(const QString &newName);
};
......@@ -741,6 +741,11 @@ void OBSBasic::RenameSources(QString newName, QString prevName)
{
RenameListValues(ui->scenes, newName, prevName);
RenameListValues(ui->sources, newName, prevName);
for (size_t i = 0; i < volumes.size(); i++) {
if (volumes[i]->GetName().compare(prevName) == 0)
volumes[i]->SetName(newName);
}
}
void OBSBasic::MoveSceneItem(OBSSceneItem item, order_movement movement)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册