summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2020-02-19 19:20:58 -0700
committerPaul Davis <paul@linuxaudiosystems.com>2020-02-19 19:21:11 -0700
commit998b88b521437fca98d01c2e57558387d66402ba (patch)
treee01a51da21d29bd76396f15edddcc1ef1026bdf5 /libs
parent585b61e58b9c1755bbd302b0e62934e66cef8cad (diff)
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
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/route.cc2
-rw-r--r--libs/ardour/track.cc34
2 files changed, 18 insertions, 18 deletions
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 9746c763fc..91c9a1a1cf 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -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);
diff --git a/libs/ardour/track.cc b/libs/ardour/track.cc
index a4c26a7ffb..7e162ee513 100644
--- a/libs/ardour/track.cc
+++ b/libs/ardour/track.cc
@@ -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 (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 (_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 (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));
}
-
-