Important logic from 6.9 was either missing or incorrectly implemented. New
version is much simpler - we just use the RoundDownMaybe mode of round_to_bbt()
to ensure that the note start is always within the current grid even if the
mouse is more than halfway "through" it.
When loading a session, we now just set up port state, which will
populate the Port::_connections member, and then once all ports have
been created, use PortManager::reconnect_ports() to get everything connected.
If connecting ports using the port-engine fails,
ardour forgets the connection.
Internal backends only produced an error if a port was already
connected, when using ::connect (handle, other), but
ignore already existing connection when using port-names.
Various ports are connected twice when the engine connects
at session load. This worked fine for as long as the engine
was never stopped (saving the session asks the port-engine),
but failed when the engine went away and internal representation
is used.
During initial setup, PortManager::reestablish_ports(),
the jack client is not yet active and port_connect failed:
"Cannot connect ports owned by inactive clients".
Later hotplugged devices were likewise not connected because
"JACK: Cannot callback the server in notification thread!"
see also 2007bf2d5f
A physical input port must remain connected to ardour's
physical_midi_input_monitor_enable port, otherwise reading
its input can cause crashes.
Previously a MIDI input port was disconnected from all other
targets when "MIDI input follows selection" was enabled.
a negative beat position needs to be legal, so the assert was moved and modified. The only check
for a negative value is that the TempoPoint being used is at absolute zero.
This check might turn out to be wrong in the future, but for now we still require a tempo and
meter point at absolute zero