mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-23 07:06:23 +01:00
remove certain ControlProtocol signals related to stripable selection
includes change to Mackie support so that strips listen for PropertyChange on the stripables they represent, no global selection change used anymore.
This commit is contained in:
parent
b130db2c60
commit
3eaa6c0389
8 changed files with 23 additions and 124 deletions
|
|
@ -803,11 +803,9 @@ Editor::Editor ()
|
||||||
ControlProtocol::VerticalZoomInSelected.connect (*this, invalidator (*this), boost::bind (&Editor::control_vertical_zoom_in_selected, this), gui_context());
|
ControlProtocol::VerticalZoomInSelected.connect (*this, invalidator (*this), boost::bind (&Editor::control_vertical_zoom_in_selected, this), gui_context());
|
||||||
ControlProtocol::VerticalZoomOutSelected.connect (*this, invalidator (*this), boost::bind (&Editor::control_vertical_zoom_out_selected, this), gui_context());
|
ControlProtocol::VerticalZoomOutSelected.connect (*this, invalidator (*this), boost::bind (&Editor::control_vertical_zoom_out_selected, this), gui_context());
|
||||||
|
|
||||||
ControlProtocol::AddStripableToSelection.connect (*this, invalidator (*this), boost::bind (&Editor::control_select, this, _1, Selection::Add), gui_context());
|
ControlProtocol::AddStripableSelection.connect (*this, invalidator (*this), boost::bind (&Editor::control_select, this, _1, Selection::Add), gui_context());
|
||||||
ControlProtocol::RemoveStripableFromSelection.connect (*this, invalidator (*this), boost::bind (&Editor::control_select, this, _1, Selection::Toggle), gui_context());
|
|
||||||
ControlProtocol::SetStripableSelection.connect (*this, invalidator (*this), boost::bind (&Editor::control_select, this, _1, Selection::Set), gui_context());
|
|
||||||
ControlProtocol::ToggleStripableSelection.connect (*this, invalidator (*this), boost::bind (&Editor::control_select, this, _1, Selection::Toggle), gui_context());
|
ControlProtocol::ToggleStripableSelection.connect (*this, invalidator (*this), boost::bind (&Editor::control_select, this, _1, Selection::Toggle), gui_context());
|
||||||
ControlProtocol::ClearStripableSelection.connect (*this, invalidator (*this), boost::bind (&Editor::control_unselect, this), gui_context());
|
ControlProtocol::SetStripableSelection.connect (*this, invalidator (*this), boost::bind (&Editor::control_select, this, _1, Selection::Set), gui_context());
|
||||||
|
|
||||||
BasicUI::AccessAction.connect (*this, invalidator (*this), boost::bind (&Editor::access_action, this, _1, _2), gui_context());
|
BasicUI::AccessAction.connect (*this, invalidator (*this), boost::bind (&Editor::access_action, this, _1, _2), gui_context());
|
||||||
|
|
||||||
|
|
@ -1011,7 +1009,7 @@ Editor::control_unselect ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::control_select (PresentationInfo::order_t global_order, Selection::Operation op)
|
Editor::control_select (PresentationInfo::order_t order, Selection::Operation op)
|
||||||
{
|
{
|
||||||
/* handles the (static) signal from the ControlProtocol class that
|
/* handles the (static) signal from the ControlProtocol class that
|
||||||
* requests setting the selected track to a given RID
|
* requests setting the selected track to a given RID
|
||||||
|
|
@ -1021,22 +1019,7 @@ Editor::control_select (PresentationInfo::order_t global_order, Selection::Opera
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PresentationInfo::Flag select_flags;
|
boost::shared_ptr<Stripable> s = _session->get_nth_stripable (order);
|
||||||
|
|
||||||
if (global_order & ~0xffffffff) {
|
|
||||||
/* some flags are set, so the PresentationInfo constructor
|
|
||||||
* will use them
|
|
||||||
*/
|
|
||||||
select_flags = PresentationInfo::Flag (0);
|
|
||||||
} else {
|
|
||||||
/* no type flags set in the global order ID, so assume caller
|
|
||||||
* wants to select a Route
|
|
||||||
*/
|
|
||||||
select_flags = PresentationInfo::Route;
|
|
||||||
}
|
|
||||||
|
|
||||||
PresentationInfo pi (global_order, select_flags);
|
|
||||||
boost::shared_ptr<Stripable> s = _session->get_remote_nth_stripable (pi.order(), pi.flags());
|
|
||||||
|
|
||||||
/* selected object may not be a Route */
|
/* selected object may not be a Route */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,10 +50,9 @@ PBD::Signal0<void> ControlProtocol::StepTracksDown;
|
||||||
PBD::Signal0<void> ControlProtocol::StepTracksUp;
|
PBD::Signal0<void> ControlProtocol::StepTracksUp;
|
||||||
|
|
||||||
PBD::Signal1<void,StripableNotificationListPtr> ControlProtocol::StripableSelectionChanged;
|
PBD::Signal1<void,StripableNotificationListPtr> ControlProtocol::StripableSelectionChanged;
|
||||||
PBD::Signal1<void,uint64_t> ControlProtocol::AddStripableToSelection;
|
PBD::Signal1<void,uint64_t> ControlProtocol::AddStripableSelection;
|
||||||
PBD::Signal1<void,uint64_t> ControlProtocol::SetStripableSelection;
|
PBD::Signal1<void,uint64_t> ControlProtocol::SetStripableSelection;
|
||||||
PBD::Signal1<void,uint64_t> ControlProtocol::ToggleStripableSelection;
|
PBD::Signal1<void,uint64_t> ControlProtocol::ToggleStripableSelection;
|
||||||
PBD::Signal1<void,uint64_t> ControlProtocol::RemoveStripableFromSelection;
|
|
||||||
PBD::Signal0<void> ControlProtocol::ClearStripableSelection;
|
PBD::Signal0<void> ControlProtocol::ClearStripableSelection;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,10 +78,9 @@ class LIBCONTROLCP_API ControlProtocol : public PBD::Stateful, public PBD::Scope
|
||||||
static PBD::Signal0<void> StepTracksDown;
|
static PBD::Signal0<void> StepTracksDown;
|
||||||
static PBD::Signal0<void> StepTracksUp;
|
static PBD::Signal0<void> StepTracksUp;
|
||||||
|
|
||||||
static PBD::Signal1<void,uint64_t> AddStripableToSelection;
|
static PBD::Signal1<void,uint64_t> AddStripableSelection;
|
||||||
static PBD::Signal1<void,uint64_t> SetStripableSelection;
|
static PBD::Signal1<void,uint64_t> SetStripableSelection;
|
||||||
static PBD::Signal1<void,uint64_t> ToggleStripableSelection;
|
static PBD::Signal1<void,uint64_t> ToggleStripableSelection;
|
||||||
static PBD::Signal1<void,uint64_t> RemoveStripableFromSelection;
|
|
||||||
static PBD::Signal0<void> ClearStripableSelection;
|
static PBD::Signal0<void> ClearStripableSelection;
|
||||||
|
|
||||||
/* signals that one UI (e.g. the GUI) can emit to get all other UI's to
|
/* signals that one UI (e.g. the GUI) can emit to get all other UI's to
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,6 @@ MackieControlProtocol::MackieControlProtocol (Session& session)
|
||||||
_last_bank[i] = 0;
|
_last_bank[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
StripableSelectionChanged.connect (gui_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::gui_track_selection_changed, this, _1, true), this);
|
|
||||||
PresentationInfo::Change.connect (gui_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_presentation_info_changed, this), this);
|
PresentationInfo::Change.connect (gui_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_presentation_info_changed, this), this);
|
||||||
|
|
||||||
_instance = this;
|
_instance = this;
|
||||||
|
|
@ -437,10 +436,6 @@ MackieControlProtocol::switch_banks (uint32_t initial, bool force)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* make sure selection is correct */
|
|
||||||
|
|
||||||
_gui_track_selection_changed (&_last_selected_stripables, false, false);
|
|
||||||
|
|
||||||
/* current bank has not been saved */
|
/* current bank has not been saved */
|
||||||
session->set_dirty();
|
session->set_dirty();
|
||||||
|
|
||||||
|
|
@ -1926,68 +1921,6 @@ MackieControlProtocol::force_special_stripable_to_strip (boost::shared_ptr<Strip
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
MackieControlProtocol::gui_track_selection_changed (ARDOUR::StripableNotificationListPtr rl, bool save_list)
|
|
||||||
{
|
|
||||||
_gui_track_selection_changed (rl.get(), save_list, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
MackieControlProtocol::_gui_track_selection_changed (ARDOUR::StripableNotificationList* rl, bool save_list, bool gui_selection_did_change)
|
|
||||||
{
|
|
||||||
/* We need to keep a list of the most recently selected routes around,
|
|
||||||
but we are not allowed to keep shared_ptr<Stripable> unless we want to
|
|
||||||
handle the complexities of route deletion. So instead, the GUI sends
|
|
||||||
us a notification using weak_ptr<Stripable>, which we keep a copy
|
|
||||||
of. For efficiency's sake, however, we convert the weak_ptr's into
|
|
||||||
shared_ptr<Stripable> before passing them to however many surfaces (and
|
|
||||||
thus strips) that we have.
|
|
||||||
*/
|
|
||||||
|
|
||||||
StrongStripableNotificationList srl;
|
|
||||||
|
|
||||||
for (ARDOUR::StripableNotificationList::const_iterator i = rl->begin(); i != rl->end(); ++i) {
|
|
||||||
boost::shared_ptr<ARDOUR::Stripable> r = (*i).lock();
|
|
||||||
if (r) {
|
|
||||||
srl.push_back (r);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
Glib::Threads::Mutex::Lock lm (surfaces_lock);
|
|
||||||
|
|
||||||
for (Surfaces::iterator s = surfaces.begin(); s != surfaces.end(); ++s) {
|
|
||||||
(*s)->gui_selection_changed (srl);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (save_list) {
|
|
||||||
_last_selected_stripables = *rl;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gui_selection_did_change) {
|
|
||||||
|
|
||||||
check_fader_automation_state ();
|
|
||||||
|
|
||||||
/* note: this method is also called when we switch banks.
|
|
||||||
* But ... we don't allow bank switching when in subview mode.
|
|
||||||
*
|
|
||||||
* so .. we only have to care about subview mode if the
|
|
||||||
* GUI selection has changed.
|
|
||||||
*
|
|
||||||
* It is possible that first_selected_stripable() may return null if we
|
|
||||||
* are no longer displaying/mapping that route. In that case,
|
|
||||||
* we will exit subview mode. If first_selected_stripable() is
|
|
||||||
* null, and subview mode is not None, then the first call to
|
|
||||||
* set_subview_mode() will fail, and we will reset to None.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (set_subview_mode (_subview_mode, first_selected_stripable())) {
|
|
||||||
set_subview_mode (None, boost::shared_ptr<Stripable>());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MackieControlProtocol::check_fader_automation_state ()
|
MackieControlProtocol::check_fader_automation_state ()
|
||||||
{
|
{
|
||||||
|
|
@ -2102,18 +2035,21 @@ MackieControlProtocol::select_range ()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cerr << "Main modifier state = " << hex << main_modifier_state() << dec << endl;
|
||||||
|
|
||||||
for (StripableList::iterator s = stripables.begin(); s != stripables.end(); ++s) {
|
for (StripableList::iterator s = stripables.begin(); s != stripables.end(); ++s) {
|
||||||
|
|
||||||
if (main_modifier_state() == MODIFIER_SHIFT) {
|
if (main_modifier_state() == MODIFIER_CONTROL) {
|
||||||
/* XXX can only use order part of PresentationInfo at present */
|
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("toggle selection of %1 (%2)\n", (*s)->name(), (*s)->presentation_info().order()));
|
||||||
|
cerr << "Toggle selection\n";
|
||||||
ToggleStripableSelection ((*s)->presentation_info ().order());
|
ToggleStripableSelection ((*s)->presentation_info ().order());
|
||||||
} else {
|
} else {
|
||||||
if (s == stripables.begin()) {
|
if (s == stripables.begin()) {
|
||||||
/* XXX can only use order part of PresentationInfo at present */
|
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("set selection of %1 (%2)\n", (*s)->name(), (*s)->presentation_info().order()));
|
||||||
SetStripableSelection ((*s)->presentation_info().order());
|
SetStripableSelection ((*s)->presentation_info().order());
|
||||||
} else {
|
} else {
|
||||||
/* XXX can only use order part of PresentationInfo at present */
|
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("add to selection %1 (%2)\n", (*s)->name(), (*s)->presentation_info().order()));
|
||||||
AddStripableToSelection ((*s)->presentation_info().order());
|
AddStripableSelection ((*s)->presentation_info().order());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -215,6 +215,7 @@ Strip::set_stripable (boost::shared_ptr<Stripable> r, bool /*with_messages*/)
|
||||||
|
|
||||||
_stripable->gain_control()->Changed.connect(stripable_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_gain_changed, this, false), ui_context());
|
_stripable->gain_control()->Changed.connect(stripable_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_gain_changed, this, false), ui_context());
|
||||||
_stripable->PropertyChanged.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_property_changed, this, _1), ui_context());
|
_stripable->PropertyChanged.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_property_changed, this, _1), ui_context());
|
||||||
|
_stripable->presentation_info().PropertyChanged.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_property_changed, this, _1), ui_context());
|
||||||
|
|
||||||
boost::shared_ptr<AutomationControl> rec_enable_control = _stripable->rec_enable_control ();
|
boost::shared_ptr<AutomationControl> rec_enable_control = _stripable->rec_enable_control ();
|
||||||
|
|
||||||
|
|
@ -275,6 +276,7 @@ Strip::notify_all()
|
||||||
notify_mute_changed ();
|
notify_mute_changed ();
|
||||||
notify_gain_changed ();
|
notify_gain_changed ();
|
||||||
notify_property_changed (PBD::PropertyChange (ARDOUR::Properties::name));
|
notify_property_changed (PBD::PropertyChange (ARDOUR::Properties::name));
|
||||||
|
notify_property_changed (PBD::PropertyChange (ARDOUR::Properties::selected));
|
||||||
notify_panner_azi_changed ();
|
notify_panner_azi_changed ();
|
||||||
notify_panner_width_changed ();
|
notify_panner_width_changed ();
|
||||||
notify_record_enable_changed ();
|
notify_record_enable_changed ();
|
||||||
|
|
@ -372,11 +374,15 @@ Strip::notify_processor_changed (bool force_update)
|
||||||
void
|
void
|
||||||
Strip::notify_property_changed (const PropertyChange& what_changed)
|
Strip::notify_property_changed (const PropertyChange& what_changed)
|
||||||
{
|
{
|
||||||
if (!what_changed.contains (ARDOUR::Properties::name)) {
|
if (what_changed.contains (ARDOUR::Properties::name)) {
|
||||||
return;
|
show_stripable_name ();
|
||||||
}
|
}
|
||||||
|
|
||||||
show_stripable_name ();
|
if (what_changed.contains (ARDOUR::Properties::selected)) {
|
||||||
|
if (_stripable) {
|
||||||
|
_surface->write (_select->set_state (_stripable->presentation_info().selected()));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -1306,19 +1312,6 @@ Strip::unlock_controls ()
|
||||||
_controls_locked = false;
|
_controls_locked = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
Strip::gui_selection_changed (const ARDOUR::StrongStripableNotificationList& rl)
|
|
||||||
{
|
|
||||||
for (ARDOUR::StrongStripableNotificationList::const_iterator i = rl.begin(); i != rl.end(); ++i) {
|
|
||||||
if ((*i) == _stripable) {
|
|
||||||
_surface->write (_select->set_state (on));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_surface->write (_select->set_state (off));
|
|
||||||
}
|
|
||||||
|
|
||||||
string
|
string
|
||||||
Strip::vpot_mode_string ()
|
Strip::vpot_mode_string ()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -84,8 +84,6 @@ public:
|
||||||
void unlock_controls ();
|
void unlock_controls ();
|
||||||
bool locked() const { return _controls_locked; }
|
bool locked() const { return _controls_locked; }
|
||||||
|
|
||||||
void gui_selection_changed (const ARDOUR::StrongStripableNotificationList&);
|
|
||||||
|
|
||||||
void notify_metering_state_changed();
|
void notify_metering_state_changed();
|
||||||
|
|
||||||
void block_screen_display_for (uint32_t msecs);
|
void block_screen_display_for (uint32_t msecs);
|
||||||
|
|
|
||||||
|
|
@ -1141,14 +1141,6 @@ Surface::update_view_mode_display (bool with_helpful_text)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
Surface::gui_selection_changed (const ARDOUR::StrongStripableNotificationList& stripables)
|
|
||||||
{
|
|
||||||
for (Strips::iterator s = strips.begin(); s != strips.end(); ++s) {
|
|
||||||
(*s)->gui_selection_changed (stripables);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Surface::say_hello ()
|
Surface::say_hello ()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -155,7 +155,6 @@ public:
|
||||||
void update_view_mode_display (bool with_helpful_text);
|
void update_view_mode_display (bool with_helpful_text);
|
||||||
void update_flip_mode_display ();
|
void update_flip_mode_display ();
|
||||||
|
|
||||||
void gui_selection_changed (const ARDOUR::StrongStripableNotificationList&);
|
|
||||||
void subview_mode_changed ();
|
void subview_mode_changed ();
|
||||||
|
|
||||||
MackieControlProtocol& mcp() const { return _mcp; }
|
MackieControlProtocol& mcp() const { return _mcp; }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue