summaryrefslogtreecommitdiff
path: root/libs/ardour/redirect.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-07-27 16:52:14 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-07-27 16:52:14 +0000
commitcc2767caf32486365a33814149e75c6e588e8603 (patch)
tree9d41c606a20ba2e2bb43be653e42050d38293a2e /libs/ardour/redirect.cc
parentd23fec7b9a0f076256dbd71faae254a78efbe37a (diff)
added RCU handling of Session route list, and major use of shared_ptr<T> everywhere else. plus a few bug fixes for issues discovered with -Wextra
git-svn-id: svn://localhost/ardour2/trunk@707 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/redirect.cc')
-rw-r--r--libs/ardour/redirect.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/libs/ardour/redirect.cc b/libs/ardour/redirect.cc
index 9800c5b1a2..1ab2f91cf0 100644
--- a/libs/ardour/redirect.cc
+++ b/libs/ardour/redirect.cc
@@ -60,25 +60,25 @@ Redirect::~Redirect ()
{
}
-Redirect*
-Redirect::clone (const Redirect& other)
+boost::shared_ptr<Redirect>
+Redirect::clone (boost::shared_ptr<const Redirect> other)
{
- const Send *send;
- const PortInsert *port_insert;
- const PluginInsert *plugin_insert;
-
- if ((send = dynamic_cast<const Send*>(&other)) != 0) {
- return new Send (*send);
- } else if ((port_insert = dynamic_cast<const PortInsert*>(&other)) != 0) {
- return new PortInsert (*port_insert);
- } else if ((plugin_insert = dynamic_cast<const PluginInsert*>(&other)) != 0) {
- return new PluginInsert (*plugin_insert);
+ boost::shared_ptr<const Send> send;
+ boost::shared_ptr<const PortInsert> port_insert;
+ boost::shared_ptr<const PluginInsert> plugin_insert;
+
+ if ((send = boost::dynamic_pointer_cast<const Send>(other)) != 0) {
+ return boost::shared_ptr<Redirect> (new Send (*send));
+ } else if ((port_insert = boost::dynamic_pointer_cast<const PortInsert>(other)) != 0) {
+ return boost::shared_ptr<Redirect> (new PortInsert (*port_insert));
+ } else if ((plugin_insert = boost::dynamic_pointer_cast<const PluginInsert>(other)) != 0) {
+ return boost::shared_ptr<Redirect> (new PluginInsert (*plugin_insert));
} else {
fatal << _("programming error: unknown Redirect type in Redirect::Clone!\n")
<< endmsg;
/*NOTREACHED*/
}
- return 0;
+ return boost::shared_ptr<Redirect>();
}
void