13
0

Add method to check for ambiguous port latency

This commit is contained in:
Robin Gareus 2020-04-06 23:45:20 +02:00
parent 6c6bea26ad
commit 597837022a
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 26 additions and 0 deletions

View File

@ -109,6 +109,8 @@ class LIBARDOUR_API PortManager
virtual void add_pending_port_deletion (Port*) = 0;
PBD::RingBuffer<Port*>& port_deletions_pending () { return _port_deletions_pending; }
bool check_for_amibiguous_latency (bool log = false) const;
/* per-Port monitoring */
bool can_request_input_monitoring () const;

View File

@ -1374,3 +1374,27 @@ PortManager::set_port_buffer_sizes (pframes_t n)
p->second->set_buffer_size (n);
}
}
bool
PortManager::check_for_amibiguous_latency (bool log) const
{
bool rv = false;
boost::shared_ptr<Ports> plist = ports.reader();
for (Ports::iterator p = plist->begin(); p != plist->end(); ++p) {
for (int c = 0; c < 1; ++c) {
LatencyRange range;
p->second->get_connected_latency_range (range, c ? true : false);
if (range.min != range.max) {
if (log) {
warning << string_compose(_("PortEngine: ambiguous %1 latency for port '%2' (%3, %4)"),
(c ? "playback" : "capture"), p->second->name(), range.min, range.max)
<< endmsg;
rv = true;
} else {
return true;
}
}
}
}
return rv;
}