diff --git a/obs/volume-control.cpp b/obs/volume-control.cpp index 6f6799d40..0c17d47f3 100644 --- a/obs/volume-control.cpp +++ b/obs/volume-control.cpp @@ -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), diff --git a/obs/volume-control.hpp b/obs/volume-control.hpp index ffc0ceaa3..e89181b2f 100644 --- a/obs/volume-control.hpp +++ b/obs/volume-control.hpp @@ -36,4 +36,7 @@ public: ~VolControl(); inline obs_source_t GetSource() const {return source;} + + QString GetName() const; + void SetName(const QString &newName); }; diff --git a/obs/window-basic-main.cpp b/obs/window-basic-main.cpp index 3608b932f..a6dfe1a0c 100644 --- a/obs/window-basic-main.cpp +++ b/obs/window-basic-main.cpp @@ -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)