2008-06-02 17:41:35 -04:00
|
|
|
/*
|
2019-08-03 08:34:29 -04:00
|
|
|
* Copyright (C) 2006-2009 David Robillard <d@drobilla.net>
|
|
|
|
* Copyright (C) 2006-2017 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
* Copyright (C) 2015-2016 Tim Mayberry <mojofunk@gmail.com>
|
|
|
|
* Copyright (C) 2015-2017 Robin Gareus <robin@gareus.org>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
2008-06-02 17:41:35 -04:00
|
|
|
|
2015-08-15 09:11:18 -04:00
|
|
|
#include "pbd/convert.h"
|
2009-12-21 13:23:07 -05:00
|
|
|
#include "pbd/error.h"
|
2022-05-16 17:24:27 -04:00
|
|
|
#include "pbd/pthread_utils.h"
|
2009-12-21 13:23:07 -05:00
|
|
|
|
2020-11-29 14:46:53 -05:00
|
|
|
#include "temporal/superclock.h"
|
|
|
|
#include "temporal/tempo.h"
|
|
|
|
|
2017-05-12 12:49:09 -04:00
|
|
|
#include "ardour/control_protocol_manager.h"
|
2016-01-12 22:04:18 -05:00
|
|
|
#include "ardour/gain_control.h"
|
2009-06-09 16:21:19 -04:00
|
|
|
#include "ardour/session.h"
|
2016-05-27 16:11:55 -04:00
|
|
|
#include "ardour/record_enable_control.h"
|
2009-06-09 16:21:19 -04:00
|
|
|
#include "ardour/route.h"
|
|
|
|
#include "ardour/audio_track.h"
|
|
|
|
#include "ardour/meter.h"
|
|
|
|
#include "ardour/amp.h"
|
2020-10-17 21:10:19 -04:00
|
|
|
#include "ardour/selection.h"
|
2009-06-09 16:21:19 -04:00
|
|
|
#include "control_protocol/control_protocol.h"
|
2008-06-02 17:41:35 -04:00
|
|
|
|
|
|
|
using namespace ARDOUR;
|
|
|
|
using namespace std;
|
2009-12-21 13:23:07 -05:00
|
|
|
using namespace PBD;
|
2008-06-02 17:41:35 -04:00
|
|
|
|
2024-10-18 12:01:28 -04:00
|
|
|
PBD::Signal<void()> ControlProtocol::ZoomToSession;
|
|
|
|
PBD::Signal<void()> ControlProtocol::ZoomOut;
|
|
|
|
PBD::Signal<void()> ControlProtocol::ZoomIn;
|
|
|
|
PBD::Signal<void()> ControlProtocol::Enter;
|
|
|
|
PBD::Signal<void()> ControlProtocol::Undo;
|
|
|
|
PBD::Signal<void()> ControlProtocol::Redo;
|
|
|
|
PBD::Signal<void(float)> ControlProtocol::ScrollTimeline;
|
|
|
|
PBD::Signal<void(uint32_t)> ControlProtocol::GotoView;
|
|
|
|
PBD::Signal<void()> ControlProtocol::CloseDialog;
|
|
|
|
PBD::Signal<void()> ControlProtocol::VerticalZoomInAll;
|
|
|
|
PBD::Signal<void()> ControlProtocol::VerticalZoomOutAll;
|
|
|
|
PBD::Signal<void()> ControlProtocol::VerticalZoomInSelected;
|
|
|
|
PBD::Signal<void()> ControlProtocol::VerticalZoomOutSelected;
|
|
|
|
PBD::Signal<void()> ControlProtocol::StepTracksDown;
|
|
|
|
PBD::Signal<void()> ControlProtocol::StepTracksUp;
|
|
|
|
PBD::Signal<void(std::weak_ptr<PluginInsert> )> ControlProtocol::PluginSelected;
|
2016-05-16 16:36:01 -04:00
|
|
|
|
2016-07-06 13:36:55 -04:00
|
|
|
StripableNotificationList ControlProtocol::_last_selected;
|
2017-05-12 12:49:09 -04:00
|
|
|
PBD::ScopedConnection ControlProtocol::selection_connection;
|
|
|
|
bool ControlProtocol::selection_connected = false;
|
2016-07-06 13:36:55 -04:00
|
|
|
|
2013-12-21 15:27:57 -05:00
|
|
|
const std::string ControlProtocol::state_node_name ("Protocol");
|
|
|
|
|
2012-04-23 06:54:34 -04:00
|
|
|
ControlProtocol::ControlProtocol (Session& s, string str)
|
|
|
|
: BasicUI (s)
|
|
|
|
, _name (str)
|
2024-10-18 19:51:44 -04:00
|
|
|
, glib_event_callback (std::bind (&ControlProtocol::event_loop_precall, this))
|
2012-04-23 06:54:34 -04:00
|
|
|
, _active (false)
|
2008-06-02 17:41:35 -04:00
|
|
|
{
|
2017-05-12 12:49:09 -04:00
|
|
|
if (!selection_connected) {
|
|
|
|
/* this is all static, connect it only once (and early), for all ControlProtocols */
|
2024-10-18 19:51:44 -04:00
|
|
|
ControlProtocolManager::StripableSelectionChanged.connect_same_thread (selection_connection, std::bind (&ControlProtocol::notify_stripable_selection_changed, _1));
|
2017-05-12 12:49:09 -04:00
|
|
|
selection_connected = true;
|
|
|
|
}
|
2008-06-02 17:41:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
ControlProtocol::~ControlProtocol ()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2022-05-16 17:24:27 -04:00
|
|
|
void
|
|
|
|
ControlProtocol::event_loop_precall ()
|
|
|
|
{
|
|
|
|
/* reload the thread-local ptr to the tempo map */
|
|
|
|
Temporal::TempoMap::fetch ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ControlProtocol::install_precall_handler (Glib::RefPtr<Glib::MainContext> context)
|
|
|
|
{
|
|
|
|
glib_event_callback.attach (context);
|
|
|
|
}
|
|
|
|
|
2013-12-21 15:27:57 -05:00
|
|
|
int
|
|
|
|
ControlProtocol::set_active (bool yn)
|
|
|
|
{
|
|
|
|
_active = yn;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
void
|
|
|
|
ControlProtocol::next_track (uint32_t initial_id)
|
|
|
|
{
|
2016-05-16 07:30:28 -04:00
|
|
|
// STRIPABLE route_table[0] = _session->get_nth_stripable (++initial_id, RemoteControlID::Route);
|
2008-06-02 17:41:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ControlProtocol::prev_track (uint32_t initial_id)
|
|
|
|
{
|
2016-05-16 07:30:28 -04:00
|
|
|
if (!initial_id) {
|
|
|
|
return;
|
2008-06-02 17:41:35 -04:00
|
|
|
}
|
2016-05-16 07:30:28 -04:00
|
|
|
// STRIPABLE route_table[0] = _session->get_nth_stripable (--initial_id, RemoteControlID::Route);
|
2008-06-02 17:41:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ControlProtocol::set_route_table_size (uint32_t size)
|
|
|
|
{
|
|
|
|
while (route_table.size() < size) {
|
2023-02-16 18:33:28 -05:00
|
|
|
route_table.push_back (std::shared_ptr<Route> ((Route*) 0));
|
2008-06-02 17:41:35 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2023-02-16 18:33:28 -05:00
|
|
|
ControlProtocol::set_route_table (uint32_t table_index, std::shared_ptr<ARDOUR::Route> r)
|
2008-06-02 17:41:35 -04:00
|
|
|
{
|
|
|
|
if (table_index >= route_table.size()) {
|
|
|
|
return;
|
|
|
|
}
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
route_table[table_index] = r;
|
|
|
|
|
|
|
|
// XXX SHAREDPTR need to handle r->GoingAway
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
ControlProtocol::set_route_table (uint32_t table_index, uint32_t remote_control_id)
|
|
|
|
{
|
2016-05-16 07:30:28 -04:00
|
|
|
#if 0 // STRIPABLE
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Route> r = session->route_by_remote_id (remote_control_id);
|
2008-06-02 17:41:35 -04:00
|
|
|
|
|
|
|
if (!r) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
set_route_table (table_index, r);
|
2016-05-16 07:30:28 -04:00
|
|
|
#endif
|
2008-06-02 17:41:35 -04:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ControlProtocol::route_set_rec_enable (uint32_t table_index, bool yn)
|
|
|
|
{
|
2022-05-28 10:56:05 -04:00
|
|
|
if (table_index >= route_table.size()) {
|
2008-06-02 17:41:35 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Route> r = route_table[table_index];
|
2008-06-02 17:41:35 -04:00
|
|
|
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<AudioTrack> at = std::dynamic_pointer_cast<AudioTrack>(r);
|
2008-06-02 17:41:35 -04:00
|
|
|
|
|
|
|
if (at) {
|
2016-04-08 16:49:47 -04:00
|
|
|
at->rec_enable_control()->set_value (1.0, Controllable::UseGroup);
|
2008-06-02 17:41:35 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
ControlProtocol::route_get_rec_enable (uint32_t table_index)
|
|
|
|
{
|
2022-05-28 10:56:05 -04:00
|
|
|
if (table_index >= route_table.size()) {
|
2008-06-02 17:41:35 -04:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Route> r = route_table[table_index];
|
2008-06-02 17:41:35 -04:00
|
|
|
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<AudioTrack> at = std::dynamic_pointer_cast<AudioTrack>(r);
|
2008-06-02 17:41:35 -04:00
|
|
|
|
|
|
|
if (at) {
|
2016-04-08 16:49:47 -04:00
|
|
|
return at->rec_enable_control()->get_value();
|
2008-06-02 17:41:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
float
|
|
|
|
ControlProtocol::route_get_gain (uint32_t table_index)
|
|
|
|
{
|
2022-05-28 10:56:05 -04:00
|
|
|
if (table_index >= route_table.size()) {
|
2008-06-02 17:41:35 -04:00
|
|
|
return 0.0f;
|
|
|
|
}
|
|
|
|
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Route> r = route_table[table_index];
|
2008-06-02 17:41:35 -04:00
|
|
|
|
|
|
|
if (r == 0) {
|
|
|
|
return 0.0f;
|
|
|
|
}
|
|
|
|
|
2016-01-25 11:48:43 -05:00
|
|
|
return r->gain_control()->get_value();
|
2008-06-02 17:41:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ControlProtocol::route_set_gain (uint32_t table_index, float gain)
|
|
|
|
{
|
2022-05-28 10:56:05 -04:00
|
|
|
if (table_index >= route_table.size()) {
|
2008-06-02 17:41:35 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Route> r = route_table[table_index];
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
if (r != 0) {
|
2016-04-08 16:49:47 -04:00
|
|
|
r->gain_control()->set_value (gain, Controllable::UseGroup);
|
2008-06-02 17:41:35 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
float
|
|
|
|
ControlProtocol::route_get_effective_gain (uint32_t table_index)
|
|
|
|
{
|
2022-05-28 10:56:05 -04:00
|
|
|
if (table_index >= route_table.size()) {
|
2008-06-02 17:41:35 -04:00
|
|
|
return 0.0f;
|
|
|
|
}
|
|
|
|
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Route> r = route_table[table_index];
|
2008-06-02 17:41:35 -04:00
|
|
|
|
|
|
|
if (r == 0) {
|
|
|
|
return 0.0f;
|
|
|
|
}
|
|
|
|
|
2009-06-09 16:21:19 -04:00
|
|
|
return r->amp()->gain_control()->get_value();
|
2008-06-02 17:41:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
float
|
|
|
|
ControlProtocol::route_get_peak_input_power (uint32_t table_index, uint32_t which_input)
|
|
|
|
{
|
2022-05-28 10:56:05 -04:00
|
|
|
if (table_index >= route_table.size()) {
|
2008-06-02 17:41:35 -04:00
|
|
|
return 0.0f;
|
|
|
|
}
|
|
|
|
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Route> r = route_table[table_index];
|
2008-06-02 17:41:35 -04:00
|
|
|
|
|
|
|
if (r == 0) {
|
|
|
|
return 0.0f;
|
|
|
|
}
|
|
|
|
|
2016-03-07 15:00:17 -05:00
|
|
|
return r->peak_meter()->meter_level (which_input, MeterPeak);
|
2008-06-02 17:41:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
ControlProtocol::route_get_muted (uint32_t table_index)
|
|
|
|
{
|
2022-05-28 10:56:05 -04:00
|
|
|
if (table_index >= route_table.size()) {
|
2008-06-02 17:41:35 -04:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Route> r = route_table[table_index];
|
2008-06-02 17:41:35 -04:00
|
|
|
|
|
|
|
if (r == 0) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-04-08 16:49:47 -04:00
|
|
|
return r->mute_control()->muted ();
|
2008-06-02 17:41:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ControlProtocol::route_set_muted (uint32_t table_index, bool yn)
|
|
|
|
{
|
2022-05-28 10:56:05 -04:00
|
|
|
if (table_index >= route_table.size()) {
|
2008-06-02 17:41:35 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Route> r = route_table[table_index];
|
2008-06-02 17:41:35 -04:00
|
|
|
|
|
|
|
if (r != 0) {
|
2016-04-08 16:49:47 -04:00
|
|
|
r->mute_control()->set_value (yn ? 1.0 : 0.0, Controllable::UseGroup);
|
2008-06-02 17:41:35 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
ControlProtocol::route_get_soloed (uint32_t table_index)
|
|
|
|
{
|
2022-05-28 10:56:05 -04:00
|
|
|
if (table_index >= route_table.size()) {
|
2008-06-02 17:41:35 -04:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Route> r = route_table[table_index];
|
2008-06-02 17:41:35 -04:00
|
|
|
|
|
|
|
if (r == 0) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return r->soloed ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ControlProtocol::route_set_soloed (uint32_t table_index, bool yn)
|
|
|
|
{
|
2022-05-28 10:56:05 -04:00
|
|
|
if (table_index >= route_table.size()) {
|
2008-06-02 17:41:35 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Route> r = route_table[table_index];
|
2008-06-02 17:41:35 -04:00
|
|
|
|
|
|
|
if (r != 0) {
|
2020-10-18 09:28:10 -04:00
|
|
|
session->set_control (r->solo_control(), yn ? 1.0 : 0.0, Controllable::UseGroup);
|
2008-06-02 17:41:35 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
string
|
|
|
|
ControlProtocol:: route_get_name (uint32_t table_index)
|
|
|
|
{
|
2022-05-28 10:56:05 -04:00
|
|
|
if (table_index >= route_table.size()) {
|
2008-06-02 17:41:35 -04:00
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Route> r = route_table[table_index];
|
2008-06-02 17:41:35 -04:00
|
|
|
|
|
|
|
if (r == 0) {
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
return r->name();
|
|
|
|
}
|
|
|
|
|
2023-02-16 18:33:28 -05:00
|
|
|
list<std::shared_ptr<Bundle> >
|
2010-07-29 22:09:39 -04:00
|
|
|
ControlProtocol::bundles ()
|
|
|
|
{
|
2023-02-16 18:33:28 -05:00
|
|
|
return list<std::shared_ptr<Bundle> > ();
|
2013-12-21 15:27:57 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
XMLNode&
|
2022-04-06 23:56:32 -04:00
|
|
|
ControlProtocol::get_state () const
|
2013-12-21 15:27:57 -05:00
|
|
|
{
|
|
|
|
XMLNode* node = new XMLNode (state_node_name);
|
|
|
|
|
2016-08-29 09:40:33 -04:00
|
|
|
node->set_property ("name", _name);
|
|
|
|
node->set_property ("feedback", get_feedback());
|
2013-12-21 15:27:57 -05:00
|
|
|
|
|
|
|
return *node;
|
2010-07-29 22:09:39 -04:00
|
|
|
}
|
2015-06-24 13:46:07 -04:00
|
|
|
|
|
|
|
int
|
|
|
|
ControlProtocol::set_state (XMLNode const & node, int /* version */)
|
|
|
|
{
|
2016-08-29 09:40:33 -04:00
|
|
|
bool feedback;
|
|
|
|
if (node.get_property ("feedback", feedback)) {
|
|
|
|
set_feedback (feedback);
|
2015-06-24 13:46:07 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2016-07-06 13:36:55 -04:00
|
|
|
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Stripable>
|
2020-10-17 21:10:19 -04:00
|
|
|
ControlProtocol::first_selected_stripable () const
|
2016-07-06 13:36:55 -04:00
|
|
|
{
|
2020-10-17 21:10:19 -04:00
|
|
|
return session->selection().first_selected_stripable ();
|
2016-07-06 13:36:55 -04:00
|
|
|
}
|
|
|
|
|
2020-10-17 21:10:19 -04:00
|
|
|
void
|
2023-02-16 18:33:28 -05:00
|
|
|
ControlProtocol::add_stripable_to_selection (std::shared_ptr<ARDOUR::Stripable> s)
|
2017-02-01 05:46:42 -05:00
|
|
|
{
|
2024-08-02 13:46:08 -04:00
|
|
|
session->selection().select_stripable_and_maybe_group (s, SelectionAdd);
|
2017-02-01 05:46:42 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2023-02-16 18:33:28 -05:00
|
|
|
ControlProtocol::set_stripable_selection (std::shared_ptr<ARDOUR::Stripable> s)
|
2017-02-01 05:46:42 -05:00
|
|
|
{
|
2024-08-02 13:46:08 -04:00
|
|
|
session->selection().select_stripable_and_maybe_group (s, SelectionSet);
|
2017-02-01 05:46:42 -05:00
|
|
|
}
|
|
|
|
|
2016-07-06 13:36:55 -04:00
|
|
|
void
|
2023-02-16 18:33:28 -05:00
|
|
|
ControlProtocol::toggle_stripable_selection (std::shared_ptr<ARDOUR::Stripable> s)
|
2016-07-06 13:36:55 -04:00
|
|
|
{
|
2024-08-02 13:46:08 -04:00
|
|
|
session->selection().select_stripable_and_maybe_group (s, SelectionToggle);
|
2016-07-06 13:36:55 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2023-02-16 18:33:28 -05:00
|
|
|
ControlProtocol::remove_stripable_from_selection (std::shared_ptr<ARDOUR::Stripable> s)
|
2016-07-06 13:36:55 -04:00
|
|
|
{
|
2024-08-02 13:46:08 -04:00
|
|
|
session->selection().select_stripable_and_maybe_group (s, SelectionRemove);
|
2020-10-17 21:10:19 -04:00
|
|
|
}
|
2016-07-06 13:36:55 -04:00
|
|
|
|
2022-06-05 17:03:23 -04:00
|
|
|
void
|
|
|
|
ControlProtocol::add_rid_to_selection (int rid)
|
|
|
|
{
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Stripable> s = session->get_remote_nth_stripable (rid, PresentationInfo::MixerStripables);
|
2022-06-05 17:03:23 -04:00
|
|
|
if (s) {
|
2024-08-02 13:46:08 -04:00
|
|
|
session->selection().select_stripable_and_maybe_group (s, SelectionAdd);
|
2022-06-05 17:03:23 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ControlProtocol::set_rid_selection (int rid)
|
|
|
|
{
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Stripable> s = session->get_remote_nth_stripable (rid, PresentationInfo::MixerStripables);
|
2022-06-05 17:03:23 -04:00
|
|
|
if (s) {
|
2024-08-02 13:46:08 -04:00
|
|
|
session->selection().select_stripable_and_maybe_group (s, SelectionSet, true, true, 0);
|
2022-06-05 17:03:23 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ControlProtocol::toggle_rid_selection (int rid)
|
|
|
|
{
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Stripable> s = session->get_remote_nth_stripable (rid, PresentationInfo::MixerStripables);
|
2022-06-05 17:03:23 -04:00
|
|
|
if (s) {
|
2024-08-02 13:46:08 -04:00
|
|
|
session->selection().select_stripable_and_maybe_group (s, SelectionToggle);
|
2022-06-05 17:03:23 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ControlProtocol::remove_rid_from_selection (int rid)
|
|
|
|
{
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Stripable> s = session->get_remote_nth_stripable (rid, PresentationInfo::MixerStripables);
|
2022-06-05 17:03:23 -04:00
|
|
|
if (s) {
|
2024-08-02 13:46:08 -04:00
|
|
|
session->selection().select_stripable_and_maybe_group (s, SelectionRemove);
|
2022-06-05 17:03:23 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-17 21:10:19 -04:00
|
|
|
void
|
2020-10-17 22:04:28 -04:00
|
|
|
ControlProtocol::clear_stripable_selection ()
|
2020-10-17 21:10:19 -04:00
|
|
|
{
|
|
|
|
session->selection().clear_stripables ();
|
|
|
|
}
|
2016-07-06 13:36:55 -04:00
|
|
|
|
2020-10-17 21:10:19 -04:00
|
|
|
void
|
|
|
|
ControlProtocol::notify_stripable_selection_changed (StripableNotificationListPtr sp)
|
|
|
|
{
|
|
|
|
_last_selected = *sp;
|
2016-07-06 13:36:55 -04:00
|
|
|
}
|
2020-11-29 14:46:53 -05:00
|
|
|
|