properly use and publish private/public port latency values for JACK latency API
git-svn-id: svn://localhost/ardour2/branches/3.0@9130 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
88d5649511
commit
c7dd29e167
|
@ -522,7 +522,7 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember,
|
||||||
void set_mute_master_solo ();
|
void set_mute_master_solo ();
|
||||||
|
|
||||||
void set_processor_positions ();
|
void set_processor_positions ();
|
||||||
framecnt_t update_port_latencies (const PortSet& ports, const PortSet& feeders, bool playback, framecnt_t) const;
|
framecnt_t update_port_latencies (PortSet& ports, PortSet& feeders, bool playback, framecnt_t) const;
|
||||||
|
|
||||||
void setup_invisible_processors ();
|
void setup_invisible_processors ();
|
||||||
|
|
||||||
|
|
|
@ -1156,7 +1156,7 @@ IO::latency () const
|
||||||
/* io lock not taken - must be protected by other means */
|
/* io lock not taken - must be protected by other means */
|
||||||
|
|
||||||
for (PortSet::const_iterator i = _ports.begin(); i != _ports.end(); ++i) {
|
for (PortSet::const_iterator i = _ports.begin(); i != _ports.end(); ++i) {
|
||||||
if ((latency = i->public_latency_range (_direction == Output).max) > max_latency) {
|
if ((latency = i->private_latency_range (_direction == Output).max) > max_latency) {
|
||||||
max_latency = latency;
|
max_latency = latency;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -265,6 +265,10 @@ Port::set_private_latency_range (jack_latency_range_t& range, bool playback)
|
||||||
_private_playback_latency.min,
|
_private_playback_latency.min,
|
||||||
_private_playback_latency.max));
|
_private_playback_latency.max));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* push to public (JACK) location so that everyone else can see it */
|
||||||
|
|
||||||
|
set_public_latency_range (range, playback);
|
||||||
}
|
}
|
||||||
|
|
||||||
const jack_latency_range_t&
|
const jack_latency_range_t&
|
||||||
|
|
|
@ -3595,7 +3595,7 @@ Route::unknown_processors () const
|
||||||
|
|
||||||
|
|
||||||
framecnt_t
|
framecnt_t
|
||||||
Route::update_port_latencies (const PortSet& from, const PortSet& to, bool playback, framecnt_t our_latency) const
|
Route::update_port_latencies (PortSet& from, PortSet& to, bool playback, framecnt_t our_latency) const
|
||||||
{
|
{
|
||||||
/* we assume that all our input ports feed all our output ports. its not
|
/* we assume that all our input ports feed all our output ports. its not
|
||||||
universally true, but the alternative is way too corner-case to worry about.
|
universally true, but the alternative is way too corner-case to worry about.
|
||||||
|
@ -3610,7 +3610,7 @@ Route::update_port_latencies (const PortSet& from, const PortSet& to, bool playb
|
||||||
connections to the "outside" (outside of this Route).
|
connections to the "outside" (outside of this Route).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for (PortSet::const_iterator p = from.begin(); p != from.end(); ++p) {
|
for (PortSet::iterator p = from.begin(); p != from.end(); ++p) {
|
||||||
|
|
||||||
jack_latency_range_t range;
|
jack_latency_range_t range;
|
||||||
|
|
||||||
|
@ -3622,8 +3622,8 @@ Route::update_port_latencies (const PortSet& from, const PortSet& to, bool playb
|
||||||
|
|
||||||
/* set the "from" port latencies to the max/min range of all their connections */
|
/* set the "from" port latencies to the max/min range of all their connections */
|
||||||
|
|
||||||
for (PortSet::const_iterator p = from.begin(); p != from.end(); ++p) {
|
for (PortSet::iterator p = from.begin(); p != from.end(); ++p) {
|
||||||
p->set_public_latency_range (all_connections, playback);
|
p->set_private_latency_range (all_connections, playback);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set the ports "in the direction of the flow" to the same value as above plus our own signal latency */
|
/* set the ports "in the direction of the flow" to the same value as above plus our own signal latency */
|
||||||
|
@ -3631,8 +3631,8 @@ Route::update_port_latencies (const PortSet& from, const PortSet& to, bool playb
|
||||||
all_connections.min += our_latency;
|
all_connections.min += our_latency;
|
||||||
all_connections.max += our_latency;
|
all_connections.max += our_latency;
|
||||||
|
|
||||||
for (PortSet::const_iterator p = to.begin(); p != to.end(); ++p) {
|
for (PortSet::iterator p = to.begin(); p != to.end(); ++p) {
|
||||||
p->set_public_latency_range (all_connections, playback);
|
p->set_private_latency_range (all_connections, playback);
|
||||||
}
|
}
|
||||||
|
|
||||||
return all_connections.max;
|
return all_connections.max;
|
||||||
|
|
|
@ -4154,7 +4154,7 @@ Session::unknown_processors () const
|
||||||
void
|
void
|
||||||
Session::update_latency (bool playback)
|
Session::update_latency (bool playback)
|
||||||
{
|
{
|
||||||
DEBUG_TRACE (DEBUG::Latency, string_compose ("\n\nJACK latency callback: %1\n", (playback ? "PLAYBACK" : "CAPTURE")));
|
DEBUG_TRACE (DEBUG::Latency, string_compose ("JACK latency callback: %1\n", (playback ? "PLAYBACK" : "CAPTURE")));
|
||||||
|
|
||||||
boost::shared_ptr<RouteList> r = routes.reader ();
|
boost::shared_ptr<RouteList> r = routes.reader ();
|
||||||
framecnt_t max_latency = 0;
|
framecnt_t max_latency = 0;
|
||||||
|
@ -4168,11 +4168,11 @@ Session::update_latency (bool playback)
|
||||||
max_latency = max (max_latency, (*i)->set_private_port_latencies (playback));
|
max_latency = max (max_latency, (*i)->set_private_port_latencies (playback));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
DEBUG_TRACE (DEBUG::Latency, string_compose ("Set public port latencies to %1\n", max_latency));
|
DEBUG_TRACE (DEBUG::Latency, string_compose ("Set public port latencies to %1\n", max_latency));
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
||||||
(*i)->set_public_port_latencies (max_latency, playback);
|
(*i)->set_public_port_latencies (max_latency, playback);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
DEBUG_TRACE (DEBUG::Latency, "JACK latency callback: DONE\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user