mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
Ctrl Surfaces: update bound controllables
Note: this only affects surfaces that use mapped_controls, and do not already subscribe to processors_changed/RouteProcessorChange signal.
This commit is contained in:
parent
c3ec93997c
commit
bfb22e2acc
8 changed files with 29 additions and 3 deletions
|
|
@ -545,6 +545,8 @@ Console1::set_current_stripable (std::shared_ptr<Stripable> r)
|
||||||
if (_current_stripable) {
|
if (_current_stripable) {
|
||||||
DEBUG_TRACE (DEBUG::Console1, "current_stripable found: \n");
|
DEBUG_TRACE (DEBUG::Console1, "current_stripable found: \n");
|
||||||
|
|
||||||
|
r->MappedControlsChanged.connect (stripable_connections, MISSING_INVALIDATOR, boost::bind (&Console1::set_current_stripable, this, r), this);
|
||||||
|
|
||||||
current_plugin_index = -1;
|
current_plugin_index = -1;
|
||||||
|
|
||||||
PresentationInfo pi = _current_stripable->presentation_info ();
|
PresentationInfo pi = _current_stripable->presentation_info ();
|
||||||
|
|
|
||||||
|
|
@ -1459,6 +1459,8 @@ FaderPort8::select_plugin (int num)
|
||||||
plugin->PresetLoaded.connect (processor_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::preset_changed, this), this);
|
plugin->PresetLoaded.connect (processor_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::preset_changed, this), this);
|
||||||
plugin->PresetDirty.connect (processor_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::preset_changed, this), this);
|
plugin->PresetDirty.connect (processor_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::preset_changed, this), this);
|
||||||
|
|
||||||
|
r->MappedControlsChanged.connect (processor_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::stripable_selection_changed, this), this);
|
||||||
|
|
||||||
if (_auto_pluginui) {
|
if (_auto_pluginui) {
|
||||||
pi->ShowUI (); /* EMIT SIGNAL */
|
pi->ShowUI (); /* EMIT SIGNAL */
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -980,7 +980,7 @@ GenericMidiControlProtocol::reset_controllables ()
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<Controllable>
|
std::shared_ptr<Controllable>
|
||||||
GenericMidiControlProtocol::lookup_controllable (const string & str) const
|
GenericMidiControlProtocol::lookup_controllable (const string & str, MIDIControllable& mc) const
|
||||||
{
|
{
|
||||||
std::shared_ptr<Controllable> c;
|
std::shared_ptr<Controllable> c;
|
||||||
|
|
||||||
|
|
@ -1394,6 +1394,7 @@ GenericMidiControlProtocol::lookup_controllable (const string & str) const
|
||||||
|
|
||||||
if (c) {
|
if (c) {
|
||||||
DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("found controllable \"%1\"\n", c->name()));
|
DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("found controllable \"%1\"\n", c->name()));
|
||||||
|
mc.bind_remap (r);
|
||||||
} else {
|
} else {
|
||||||
DEBUG_TRACE (DEBUG::GenericMidi, "no controllable found\n");
|
DEBUG_TRACE (DEBUG::GenericMidi, "no controllable found\n");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ public:
|
||||||
int set_feedback (bool yn);
|
int set_feedback (bool yn);
|
||||||
bool get_feedback () const;
|
bool get_feedback () const;
|
||||||
|
|
||||||
std::shared_ptr<PBD::Controllable> lookup_controllable (std::string const &) const;
|
std::shared_ptr<PBD::Controllable> lookup_controllable (std::string const &, MIDIControllable&) const;
|
||||||
|
|
||||||
void maybe_start_touch (std::shared_ptr<PBD::Controllable>);
|
void maybe_start_touch (std::shared_ptr<PBD::Controllable>);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@
|
||||||
#include "ardour/automation_control.h"
|
#include "ardour/automation_control.h"
|
||||||
#include "ardour/midi_ui.h"
|
#include "ardour/midi_ui.h"
|
||||||
#include "ardour/debug.h"
|
#include "ardour/debug.h"
|
||||||
|
#include "ardour/stripable.h"
|
||||||
|
|
||||||
#include "midicontrollable.h"
|
#include "midicontrollable.h"
|
||||||
#include "generic_midi_control_protocol.h"
|
#include "generic_midi_control_protocol.h"
|
||||||
|
|
@ -143,6 +144,7 @@ MIDIControllable::set_controllable (std::shared_ptr<PBD::Controllable> c)
|
||||||
} else {
|
} else {
|
||||||
_controllable.reset();
|
_controllable.reset();
|
||||||
last_controllable_value = 0.0f; // is there a better value?
|
last_controllable_value = 0.0f; // is there a better value?
|
||||||
|
controllable_remapped_connection.disconnect ();
|
||||||
}
|
}
|
||||||
|
|
||||||
last_incoming = 256;
|
last_incoming = 256;
|
||||||
|
|
@ -152,6 +154,16 @@ MIDIControllable::set_controllable (std::shared_ptr<PBD::Controllable> c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MIDIControllable::bind_remap (std::shared_ptr<ARDOUR::Stripable> s)
|
||||||
|
{
|
||||||
|
controllable_remapped_connection.disconnect ();
|
||||||
|
if (!s) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
s->MappedControlsChanged.connect (controllable_remapped_connection, MISSING_INVALIDATOR, boost::bind (&GenericMidiControlProtocol::lookup_controllable, this), this);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MIDIControllable::midi_rebind (channel_t c)
|
MIDIControllable::midi_rebind (channel_t c)
|
||||||
{
|
{
|
||||||
|
|
@ -264,7 +276,8 @@ MIDIControllable::lookup_controllable()
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<Controllable> c = _surface->lookup_controllable (_current_uri);
|
controllable_remapped_connection.disconnect ();
|
||||||
|
std::shared_ptr<Controllable> c = _surface->lookup_controllable (_current_uri, *this);
|
||||||
|
|
||||||
if (!c) {
|
if (!c) {
|
||||||
set_controllable (std::shared_ptr<PBD::Controllable>());
|
set_controllable (std::shared_ptr<PBD::Controllable>());
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ class GenericMidiControlProtocol;
|
||||||
|
|
||||||
namespace ARDOUR {
|
namespace ARDOUR {
|
||||||
class AsyncMIDIPort;
|
class AsyncMIDIPort;
|
||||||
|
class Stripable;
|
||||||
}
|
}
|
||||||
|
|
||||||
class MIDIControllable : public PBD::Stateful
|
class MIDIControllable : public PBD::Stateful
|
||||||
|
|
@ -114,6 +115,8 @@ public:
|
||||||
|
|
||||||
int lookup_controllable();
|
int lookup_controllable();
|
||||||
|
|
||||||
|
void bind_remap (std::shared_ptr<ARDOUR::Stripable>);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
int max_value_for_type () const;
|
int max_value_for_type () const;
|
||||||
|
|
@ -135,6 +138,7 @@ private:
|
||||||
PBD::ScopedConnection midi_sense_connection[2];
|
PBD::ScopedConnection midi_sense_connection[2];
|
||||||
PBD::ScopedConnection midi_learn_connection;
|
PBD::ScopedConnection midi_learn_connection;
|
||||||
PBD::ScopedConnection controllable_death_connection;
|
PBD::ScopedConnection controllable_death_connection;
|
||||||
|
PBD::ScopedConnection controllable_remapped_connection;
|
||||||
/** the type of MIDI message that is used for this control */
|
/** the type of MIDI message that is used for this control */
|
||||||
MIDI::eventType control_type;
|
MIDI::eventType control_type;
|
||||||
MIDI::byte control_additional;
|
MIDI::byte control_additional;
|
||||||
|
|
|
||||||
|
|
@ -252,6 +252,9 @@ OSCSelectObserver::refresh_strip (std::shared_ptr<ARDOUR::Stripable> new_strip,
|
||||||
_strip->mapped_control (Comp_Makeup)->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/comp_makeup"), _strip->mapped_control (Comp_Makeup)), OSC::instance());
|
_strip->mapped_control (Comp_Makeup)->Changed.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::change_message, this, X_("/select/comp_makeup"), _strip->mapped_control (Comp_Makeup)), OSC::instance());
|
||||||
change_message (X_("/select/comp_makeup"), _strip->mapped_control (Comp_Makeup));
|
change_message (X_("/select/comp_makeup"), _strip->mapped_control (Comp_Makeup));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_strip->MappedControlsChanged.connect (strip_connections, MISSING_INVALIDATOR, boost::bind (&OSCSelectObserver::eq_restart, this, 0), OSC::instance ());
|
||||||
|
|
||||||
renew_sends ();
|
renew_sends ();
|
||||||
renew_plugin ();
|
renew_plugin ();
|
||||||
eq_restart(0);
|
eq_restart(0);
|
||||||
|
|
|
||||||
|
|
@ -793,6 +793,7 @@ Strip::setup_trackview_vpot (std::shared_ptr<Stripable> r)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
r->MappedControlsChanged.connect (subview_connections, MISSING_INVALIDATOR, boost::bind (&Strip::subview_mode_changed, this), ui_context());
|
||||||
|
|
||||||
std::shared_ptr<AutomationControl> pc;
|
std::shared_ptr<AutomationControl> pc;
|
||||||
std::shared_ptr<Track> track = std::dynamic_pointer_cast<Track> (r);
|
std::shared_ptr<Track> track = std::dynamic_pointer_cast<Track> (r);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue