when inside Route::set_state() and calling set_name(), call the virtual method, rather than Route::set_name()

Without this, nothing in Track::set_name() is called, which means that tracks created from templates
do not get their name set appropriately
This commit is contained in:
Paul Davis 2020-02-19 19:20:58 -07:00
parent 585b61e58b
commit 998b88b521
2 changed files with 16 additions and 16 deletions

View File

@ -2605,7 +2605,7 @@ Route::set_state (const XMLNode& node, int version)
std::string route_name;
if (node.get_property (X_("name"), route_name)) {
Route::set_name (route_name);
set_name (route_name);
}
set_id (node);

View File

@ -401,20 +401,22 @@ Track::set_name (const string& str)
boost::shared_ptr<Track> me = boost::dynamic_pointer_cast<Track> (shared_from_this ());
if (_playlists[data_type()]->all_regions_empty () && _session.playlists()->playlists_for_track (me).size() == 1) {
/* Only rename the diskstream (and therefore the playlist) if
a) the playlist has never had a region added to it and
b) there is only one playlist for this track.
if (_playlists[data_type()]) {
if (_playlists[data_type()]->all_regions_empty () && _session.playlists()->playlists_for_track (me).size() == 1) {
/* Only rename the diskstream (and therefore the playlist) if
a) the playlist has never had a region added to it and
b) there is only one playlist for this track.
If (a) is not followed, people can get confused if, say,
they have notes about a playlist with a given name and then
it changes (see mantis #4759).
If (a) is not followed, people can get confused if, say,
they have notes about a playlist with a given name and then
it changes (see mantis #4759).
If (b) is not followed, we rename the current playlist and not
the other ones, which is a bit confusing (see mantis #4977).
*/
_disk_reader->set_name (str);
_disk_writer->set_name (str);
If (b) is not followed, we rename the current playlist and not
the other ones, which is a bit confusing (see mantis #4977).
*/
_disk_reader->set_name (str);
_disk_writer->set_name (str);
}
}
for (uint32_t n = 0; n < DataType::num_types; ++n) {
@ -660,7 +662,7 @@ Track::use_playlist (DataType dt, boost::shared_ptr<Playlist> p)
if (ret == 0) {
_playlists[dt] = p;
}
//allow all regions of prior and new playlists to update their visibility?
if (old) old->foreach_region(update_region_visibility);
if (p) p->foreach_region(update_region_visibility);
@ -1116,5 +1118,3 @@ Track::use_captured_audio_sources (SourceList& srcs, CaptureInfos const & captur
pl->set_capture_insertion_in_progress (false);
_session.add_command (new StatefulDiffCommand (pl));
}