summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-07-07 14:16:33 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-07-07 14:16:33 +0000
commit5946e84fc50e506e7b203a80051d6413184107af (patch)
tree1179d6febacad506b57da88405501c6e6cc974c2
parent88688c8f5f58e5bed678e64005952edd9755e8b9 (diff)
fix audio-specific code in RouteTimeAxis::use_playlist (#4154)
git-svn-id: svn://localhost/ardour2/branches/3.0@9800 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/route_time_axis.cc83
1 files changed, 40 insertions, 43 deletions
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index 1869e9542f..37775adb39 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -1533,51 +1533,48 @@ RouteTimeAxisView::use_playlist (RadioMenuItem *item, boost::weak_ptr<Playlist>
return;
}
- boost::shared_ptr<AudioPlaylist> apl = boost::dynamic_pointer_cast<AudioPlaylist> (pl);
+ if (track()->playlist() == pl) {
+ // exit when use_playlist is called by the creation of the playlist menu
+ // or the playlist choice is unchanged
+ return;
+ }
- if (apl) {
- if (track()->playlist() == apl) {
- // exit when use_playlist is called by the creation of the playlist menu
- // or the playlist choice is unchanged
+ track()->use_playlist (pl);
+
+ RouteGroup* rg = route_group();
+
+ if (rg && rg->is_active() && rg->enabled_property (ARDOUR::Properties::edit.property_id)) {
+ std::string group_string = "." + rg->name() + ".";
+
+ std::string take_name = pl->name();
+ std::string::size_type idx = take_name.find(group_string);
+
+ if (idx == std::string::npos)
return;
- }
- track()->use_playlist (apl);
-
- RouteGroup* rg = route_group();
-
- if (rg && rg->is_active() && rg->enabled_property (ARDOUR::Properties::edit.property_id)) {
- std::string group_string = "." + rg->name() + ".";
-
- std::string take_name = apl->name();
- std::string::size_type idx = take_name.find(group_string);
-
- if (idx == std::string::npos)
- return;
-
- take_name = take_name.substr(idx + group_string.length()); // find the bit containing the take number / name
-
- boost::shared_ptr<RouteList> rl (rg->route_list());
-
- for (RouteList::const_iterator i = rl->begin(); i != rl->end(); ++i) {
- if ( (*i) == this->route()) {
- continue;
- }
-
- std::string playlist_name = (*i)->name()+group_string+take_name;
-
- boost::shared_ptr<Track> track = boost::dynamic_pointer_cast<Track>(*i);
- if (!track) {
- continue;
- }
-
- boost::shared_ptr<Playlist> ipl = session()->playlists->by_name(playlist_name);
- if (!ipl) {
- // No playlist for this track for this take yet, make it
- track->use_new_playlist();
- track->playlist()->set_name(playlist_name);
- } else {
- track->use_playlist(ipl);
- }
+
+ take_name = take_name.substr(idx + group_string.length()); // find the bit containing the take number / name
+
+ boost::shared_ptr<RouteList> rl (rg->route_list());
+
+ for (RouteList::const_iterator i = rl->begin(); i != rl->end(); ++i) {
+ if ( (*i) == this->route()) {
+ continue;
+ }
+
+ std::string playlist_name = (*i)->name()+group_string+take_name;
+
+ boost::shared_ptr<Track> track = boost::dynamic_pointer_cast<Track>(*i);
+ if (!track) {
+ continue;
+ }
+
+ boost::shared_ptr<Playlist> ipl = session()->playlists->by_name(playlist_name);
+ if (!ipl) {
+ // No playlist for this track for this take yet, make it
+ track->use_new_playlist();
+ track->playlist()->set_name(playlist_name);
+ } else {
+ track->use_playlist(ipl);
}
}
}