diff options
author | Robin Gareus <robin@gareus.org> | 2017-11-26 09:38:32 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-11-26 09:51:00 +0100 |
commit | f149fd265315fc47488e56dd19e74ae45c7dbd96 (patch) | |
tree | bca807d4e8583c9193db9eb5419829445bffb26e | |
parent | da467cf39b73e2a4ddc243bfa1791306625b5302 (diff) |
Add convenience methods to set port latencies
-rw-r--r-- | libs/ardour/ardour/io.h | 3 | ||||
-rw-r--r-- | libs/ardour/io.cc | 20 |
2 files changed, 23 insertions, 0 deletions
diff --git a/libs/ardour/ardour/io.h b/libs/ardour/ardour/io.h index 1b85fa78ba..3f4fdc5797 100644 --- a/libs/ardour/ardour/io.h +++ b/libs/ardour/ardour/io.h @@ -120,6 +120,9 @@ public: samplecnt_t public_latency () const; samplecnt_t connected_latency (bool for_playback) const; + void set_private_port_latencies (samplecnt_t value, bool playback); + void set_public_port_latencies (samplecnt_t value, bool playback) const; + PortSet& ports() { return _ports; } const PortSet& ports() const { return _ports; } diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index 7eb85477d7..99cd41657f 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -1204,6 +1204,26 @@ IO::apply_pretty_name () } } +void +IO::set_private_port_latencies (samplecnt_t value, bool playback) +{ + LatencyRange lat; + lat.min = lat.max = value; + for (PortSet::iterator i = _ports.begin (); i != _ports.end(); ++i) { + i->set_private_latency_range (lat, playback); + } +} + +void +IO::set_public_port_latencies (samplecnt_t value, bool playback) const +{ + LatencyRange lat; + lat.min = lat.max = value; + for (PortSet::const_iterator i = _ports.begin (); i != _ports.end(); ++i) { + i->set_public_latency_range (lat, playback); + } +} + samplecnt_t IO::latency () const { |