summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/io.h
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-10-28 17:04:09 +0000
committerCarl Hetherington <carl@carlh.net>2011-10-28 17:04:09 +0000
commit7bdcc127e3e42bd76b997b56ecd938b1127d790b (patch)
treef1e9856094ee5a54cc28957508f2b693fbcd043a /libs/ardour/ardour/io.h
parentf65e3f287b48fef6d4fdb8c4456c0eada4c4431c (diff)
Use shared_ptr for Port in the AudioEngine; improves thread-safety of the audio engine's port list as a writer cannot destroy a port in one thread while the port list is being iterated in another.
git-svn-id: svn://localhost/ardour2/branches/3.0@10327 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/io.h')
-rw-r--r--libs/ardour/ardour/io.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/libs/ardour/ardour/io.h b/libs/ardour/ardour/io.h
index e318258e19..c7c91a6cf3 100644
--- a/libs/ardour/ardour/io.h
+++ b/libs/ardour/ardour/io.h
@@ -102,9 +102,9 @@ class IO : public SessionObject, public Latent
boost::shared_ptr<Bundle> bundle () { return _bundle; }
int add_port (std::string connection, void *src, DataType type = DataType::NIL);
- int remove_port (Port *, void *src);
- int connect (Port *our_port, std::string other_port, void *src);
- int disconnect (Port *our_port, std::string other_port, void *src);
+ int remove_port (boost::shared_ptr<Port>, void *src);
+ int connect (boost::shared_ptr<Port> our_port, std::string other_port, void *src);
+ int disconnect (boost::shared_ptr<Port> our_port, std::string other_port, void *src);
int disconnect (void *src);
bool connected_to (boost::shared_ptr<const IO>) const;
bool connected_to (const std::string&) const;
@@ -117,20 +117,20 @@ class IO : public SessionObject, public Latent
PortSet& ports() { return _ports; }
const PortSet& ports() const { return _ports; }
- bool has_port (Port *) const;
+ bool has_port (boost::shared_ptr<Port>) const;
- Port *nth (uint32_t n) const {
+ boost::shared_ptr<Port> nth (uint32_t n) const {
if (n < _ports.num_ports()) {
return _ports.port(n);
} else {
- return 0;
+ return boost::shared_ptr<Port> ();
}
}
- Port* port_by_name (const std::string& str) const;
+ boost::shared_ptr<Port> port_by_name (const std::string& str) const;
- AudioPort* audio(uint32_t n) const;
- MidiPort* midi(uint32_t n) const;
+ boost::shared_ptr<AudioPort> audio(uint32_t n) const;
+ boost::shared_ptr<MidiPort> midi(uint32_t n) const;
const ChanCount& n_ports () const { return _ports.count(); }