summaryrefslogtreecommitdiff
path: root/gtk2_ardour/route_time_axis.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-12-10 03:25:32 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-12-10 03:25:32 +0000
commit61cade6d59118288e90a405e0f4fbc24d0108814 (patch)
treefe9083a4c005ac239bf5995c16252609dc547869 /gtk2_ardour/route_time_axis.cc
parentf18bcf0cc835ab401d8e28dcc18c72795977752a (diff)
drastic, deep and wide changes to make RouteGroup use boost::shared_ptr<Route> and boost::shared_ptr<RouteList> to better fit into emerging framework for "RT operations" ; torben's changes to MTC slaving code (sorry for bundling)
git-svn-id: svn://localhost/ardour2/branches/3.0@6334 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/route_time_axis.cc')
-rw-r--r--gtk2_ardour/route_time_axis.cc26
1 files changed, 17 insertions, 9 deletions
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index ef948307a2..4d828d4fd8 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -311,20 +311,28 @@ gint
RouteTimeAxisView::edit_click (GdkEventButton *ev)
{
if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
- _route->set_route_group (0, this);
- return FALSE;
+ if (_route->route_group()) {
+ _route->route_group()->remove (_route);
+ }
+ return false;
}
route_group_menu->rebuild (_route->route_group ());
route_group_menu->popup (ev->button, ev->time);
- return FALSE;
+ return false;
}
void
RouteTimeAxisView::set_route_group_from_menu (RouteGroup *eg)
{
- _route->set_route_group (eg, this);
+ if (eg) {
+ eg->add (_route);
+ } else {
+ if (_route->route_group()) {
+ _route->route_group()->remove (_route);
+ }
+ }
}
void
@@ -1572,14 +1580,16 @@ RouteTimeAxisView::use_playlist (boost::weak_ptr<Playlist> wpl)
take_name = take_name.substr(idx + group_string.length()); // find the bit containing the take number / name
- for (list<Route*>::const_iterator i = route_group()->route_list().begin(); i != route_group()->route_list().end(); ++i) {
- if ( (*i) == this->route().get()) {
+ boost::shared_ptr<RouteList> rl (route_group()->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;
- Track *track = dynamic_cast<Track *>(*i);
+ boost::shared_ptr<Track> track = boost::dynamic_pointer_cast<Track>(*i);
if (!track) {
std::cerr << "route " << (*i)->name() << " is not a Track" << std::endl;
continue;
@@ -1593,8 +1603,6 @@ RouteTimeAxisView::use_playlist (boost::weak_ptr<Playlist> wpl)
} else {
track->diskstream()->use_playlist(ipl);
}
-
- //(*i)->get_dis
}
}
}