summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorSampo Savolainen <v2@iki.fi>2008-10-08 18:50:12 +0000
committerSampo Savolainen <v2@iki.fi>2008-10-08 18:50:12 +0000
commitbb07f59737c2b9c83a2cf4e103e65569182b07d8 (patch)
treeec32207a3ff65549d05a3eed91c9a8d0e839fb90 /gtk2_ardour
parent445d254d2f2bfd4e9155c81553181926cf3a9a77 (diff)
Fix for grouped playlist bug mentioned in the 3rd comment of bug report 1274.
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3889 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/route_time_axis.cc41
1 files changed, 19 insertions, 22 deletions
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index 7131be8fbd..93803f3a5c 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -882,33 +882,30 @@ RouteTimeAxisView::resolve_new_group_playlist_name(std::string &basename, vector
std::string group_string = "."+edit_group()->name()+".";
- if (basename.find(group_string) == string::npos) {
- int maxnumber = 0;
-
- // iterate through all playlists
- for (vector<boost::shared_ptr<Playlist> >::const_iterator i = playlists.begin(); i != playlists.end(); ++i) {
- std::string tmp = (*i)->name();
-
- std::string::size_type idx = tmp.find(group_string);
- // find those which belong to this group
- if (idx != string::npos) {
- tmp = tmp.substr(idx + group_string.length());
-
- // and find the largest current number
- int x = atoi(tmp.c_str());
- if (x > maxnumber) {
- maxnumber = x;
- }
+ // iterate through all playlists
+ int maxnumber = 0;
+ for (vector<boost::shared_ptr<Playlist> >::const_iterator i = playlists.begin(); i != playlists.end(); ++i) {
+ std::string tmp = (*i)->name();
+
+ std::string::size_type idx = tmp.find(group_string);
+ // find those which belong to this group
+ if (idx != string::npos) {
+ tmp = tmp.substr(idx + group_string.length());
+
+ // and find the largest current number
+ int x = atoi(tmp.c_str());
+ if (x > maxnumber) {
+ maxnumber = x;
}
}
+ }
- maxnumber++;
+ maxnumber++;
- char buf[32];
- snprintf (buf, sizeof(buf), "%d", maxnumber);
+ char buf[32];
+ snprintf (buf, sizeof(buf), "%d", maxnumber);
- ret = this->name()+"."+edit_group()->name()+"."+buf;
- }
+ ret = this->name()+"."+edit_group()->name()+"."+buf;
return ret;
}