Add track/bus rename safeguards to the backend (handy for scripting)

This commit is contained in:
Robin Gareus 2017-03-13 18:44:37 +01:00
parent 837ad93e7c
commit 333e3c6019
2 changed files with 10 additions and 2 deletions

View File

@ -4017,6 +4017,10 @@ Route::save_as_template (const string& path, const string& name)
bool
Route::set_name (const string& str)
{
if (str.empty ()) {
return false;
}
if (str == name()) {
return true;
}

View File

@ -294,8 +294,12 @@ Track::set_name (const string& str)
{
bool ret;
if (_record_enable_control->get_value() && _session.actively_recording()) {
/* this messes things up if done while recording */
if (str.empty ()) {
return false;
}
if (_record_enable_control->get_value()) {
/* when re-arm'ed the file (named after the track) is already ready to rolll */
return false;
}