The core selection can be (a) stripables (b) automation controls (c) possibly a combination of both
Any given selection op might pass (a) or (b) or (c), so we need to handle the
case where (a) is null.
We now have two basic methods for CoreSelection
* when selecting a stripable, use ::select_stripable_and_maybe_group() with
appropriate arguments to cover the group selection aspects.
* when selecting an automation control that is part of a stripable, call
::select_stripable_with_control()
The old, more simply named methods (set/add/toggle etc.) have all been
made private, and their internal implementations changed somewhat.
This commit includes changes to control surfaces that use CoreSelection directly.
This is mostly a simple lexical search+replace but the absence of operator< for
std::weak_ptr<T> leads to some complications, particularly with Evoral::Sequence
and ExportPortChannel.
"While 'atomic' has a volatile qualifier, this is a historical
artifact and the pointer passed to it should not be volatile."
Furthermore "It is very important that all accesses to a
particular integer or pointer be performed using only this API"
(from https://developer.gnome.org/glib/2.68/glib-Atomic-Operations.html)
Hence initialization of atomic variables is changed to also use
this API, instead of directly initializing the value.
This also fixes a few cases where atomic variables were
accessed directly.
see also libs/pbd/pbd/g_atomic_compat.h
This fixes MIDI Input follows MIDI track selection (and maybe other
issues) and hopefully breaks nothing else (most places subscribe to
both Stripable::PropertyChanged and PresentationInfo::PropertyChanged).