diff options
author | Carl Hetherington <carl@carlh.net> | 2012-07-05 00:02:13 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2012-07-05 00:02:13 +0000 |
commit | 0dc992bcf7f5e2ace58fb3cec05f2cff05a5ffbc (patch) | |
tree | 8b7f38124ce192601b71555b8c37e2f4b18151fa /libs/ardour/track.cc | |
parent | c1d4f87471d8925f64bff5ca08f4e78b22a82a7d (diff) |
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
Diffstat (limited to 'libs/ardour/track.cc')
-rw-r--r-- | libs/ardour/track.cc | 17 |
1 files 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<Track> me = boost::dynamic_pointer_cast<Track> (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); } |