13
0

control protocols: add API to control selection by RID

This commit is contained in:
Paul Davis 2022-06-05 15:03:23 -06:00
parent c713841f39
commit 33b7c38e42
2 changed files with 41 additions and 0 deletions

View File

@ -383,6 +383,42 @@ ControlProtocol::remove_stripable_from_selection (boost::shared_ptr<ARDOUR::Stri
session->selection().remove (s, boost::shared_ptr<AutomationControl>());
}
void
ControlProtocol::add_rid_to_selection (int rid)
{
boost::shared_ptr<Stripable> s = session->get_remote_nth_stripable (rid, PresentationInfo::MixerStripables);
if (s) {
session->selection().add (s, boost::shared_ptr<AutomationControl>());
}
}
void
ControlProtocol::set_rid_selection (int rid)
{
boost::shared_ptr<Stripable> s = session->get_remote_nth_stripable (rid, PresentationInfo::MixerStripables);
if (s) {
session->selection().select_stripable_and_maybe_group (s, true, true, 0);
}
}
void
ControlProtocol::toggle_rid_selection (int rid)
{
boost::shared_ptr<Stripable> s = session->get_remote_nth_stripable (rid, PresentationInfo::MixerStripables);
if (s) {
session->selection().toggle (s, boost::shared_ptr<AutomationControl>());
}
}
void
ControlProtocol::remove_rid_from_selection (int rid)
{
boost::shared_ptr<Stripable> s = session->get_remote_nth_stripable (rid, PresentationInfo::MixerStripables);
if (s) {
session->selection().remove (s, boost::shared_ptr<AutomationControl>());
}
}
void
ControlProtocol::clear_stripable_selection ()
{

View File

@ -89,6 +89,11 @@ public:
void remove_stripable_from_selection (boost::shared_ptr<ARDOUR::Stripable>);
void clear_stripable_selection ();
void add_rid_to_selection (int rid);
void set_rid_selection (int rid);
void toggle_rid_selection (int rid);
void remove_rid_from_selection (int rid);
boost::shared_ptr<ARDOUR::Stripable> first_selected_stripable () const;
/* the model here is as follows: