13
0

MIDI-region specific naming logic

plus slight cleanup of Region::set_name().

Note that issues with ARDOUR::legalize_for_path() not excluding colons still remain
This commit is contained in:
Paul Davis 2020-01-22 15:02:49 -07:00
parent 24f8a90278
commit 87a5990e54
3 changed files with 21 additions and 5 deletions

View File

@ -154,6 +154,8 @@ class LIBARDOUR_API MidiRegion : public Region
void recompute_at_start ();
void recompute_at_end ();
bool set_name (const std::string & str);
void set_position_internal (samplepos_t pos, bool allow_bbt_recompute, const int32_t sub_num);
void set_position_music_internal (double qn);
void set_length_internal (samplecnt_t len, const int32_t sub_num);

View File

@ -823,3 +823,17 @@ MidiRegion::trim_to_internal (samplepos_t position, samplecnt_t length, const in
send_change (what_changed);
}
}
bool
MidiRegion::set_name (const std::string& str)
{
if (_name == str) {
return true;
}
if (Session::session_name_is_legal (str) != 0) {
return false;
}
return Region::set_name (str);
}

View File

@ -447,13 +447,13 @@ Region::set_playlist (boost::weak_ptr<Playlist> wpl)
bool
Region::set_name (const std::string& str)
{
if (_name != str) {
SessionObject::set_name(str); // EMIT SIGNAL NameChanged()
assert(_name == str);
send_change (Properties::name);
if (_name == str) {
return true;
}
SessionObject::set_name (str); // EMIT SIGNAL NameChanged()
assert (_name == str);
send_change (Properties::name);
return true;
}