Rename volume control if audio source renamed
parent
23a83054b5
commit
5585ae0eff
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue