From 0dc992bcf7f5e2ace58fb3cec05f2cff05a5ffbc Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 5 Jul 2012 00:02:13 +0000 Subject: [PATCH] Don't rename playlists on rename track if the track has >1 playlist; hopefully helps with the confusion in mantis #4977. git-svn-id: svn://localhost/ardour2/branches/3.0@12990 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/track.cc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/libs/ardour/track.cc b/libs/ardour/track.cc index 1c45460088..0dc0a9f676 100644 --- a/libs/ardour/track.cc +++ b/libs/ardour/track.cc @@ -28,6 +28,7 @@ #include "ardour/processor.h" #include "ardour/route_group_specialized.h" #include "ardour/session.h" +#include "ardour/session_playlists.h" #include "ardour/track.h" #include "ardour/utils.h" @@ -329,12 +330,18 @@ Track::set_name (const string& str) return false; } - if (_diskstream->playlist()->all_regions_empty ()) { + boost::shared_ptr me = boost::dynamic_pointer_cast (shared_from_this ()); + if (_diskstream->playlist()->all_regions_empty () && _session.playlists->playlists_for_track (me).size() == 1) { /* Only rename the diskstream (and therefore the playlist) if - the playlist has never had a region added to it. Otherwise - people can get confused if, say, they have notes about a - playlist with a given name and then it changes (see mantis - #4759). + 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). */ _diskstream->set_name (str); }