Rename volume control if audio source renamed

master
jp9000 2014-07-08 11:58:48 -07:00
parent 23a83054b5
commit 5585ae0eff
3 changed files with 18 additions and 0 deletions

View File

@ -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),

View File

@ -36,4 +36,7 @@ public:
~VolControl();
inline obs_source_t GetSource() const {return source;}
QString GetName() const;
void SetName(const QString &newName);
};

View File

@ -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)