FaderPort8 updates
* use 2 lines for Plugin Parameter Names * Expose Plugin Bypass/Enable per plugin - Shift + Select in Plugin Select Mode - Bypass Button in Plugin Parameter Edit Mode
This commit is contained in:
parent
dd3f922788
commit
773c31afc0
|
@ -20,6 +20,7 @@
|
|||
*/
|
||||
|
||||
#include "ardour/dB.h"
|
||||
#include "ardour/plugin_insert.h"
|
||||
#include "ardour/session.h"
|
||||
#include "ardour/session_configuration.h"
|
||||
#include "ardour/types.h"
|
||||
|
@ -94,7 +95,7 @@ FaderPort8::setup_actions ()
|
|||
_ctrls.button (FP8Controls::BtnParam).pressed.connect_same_thread (button_connections, boost::bind (&FaderPort8::button_parameter, this));
|
||||
|
||||
|
||||
BindAction (BtnBypass, "Mixer", "ab-plugins");
|
||||
BindMethod (BtnBypass, button_bypass);
|
||||
BindAction (BtnBypassAll, "Mixer", "ab-plugins"); // XXX
|
||||
|
||||
BindAction (BtnMacro, "Mixer", "show-editor");
|
||||
|
@ -156,6 +157,17 @@ FaderPort8::button_metronom ()
|
|||
Config->set_clicking (!Config->get_clicking ());
|
||||
}
|
||||
|
||||
void
|
||||
FaderPort8::button_bypass ()
|
||||
{
|
||||
boost::shared_ptr<PluginInsert> pi = _plugin_insert.lock();
|
||||
if (pi) {
|
||||
pi->enable (! pi->enabled ());
|
||||
} else {
|
||||
AccessAction ("Mixer", "ab-plugins");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
FaderPort8::button_automation (ARDOUR::AutoState as)
|
||||
{
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "ardour/plugin_insert.h"
|
||||
#include "ardour/session.h"
|
||||
#include "ardour/session_configuration.h"
|
||||
|
||||
|
@ -204,3 +205,16 @@ FaderPort8::notify_mute_changed ()
|
|||
#endif
|
||||
_ctrls.button (FP8Controls::BtnMuteClear).set_active (muted);
|
||||
}
|
||||
|
||||
void
|
||||
FaderPort8::notify_plugin_active_changed ()
|
||||
{
|
||||
boost::shared_ptr<PluginInsert> pi = _plugin_insert.lock();
|
||||
if (pi) {
|
||||
_ctrls.button (FP8Controls::BtnBypass).set_active (true);
|
||||
_ctrls.button (FP8Controls::BtnBypass).set_color (pi->enabled () ? 0x00ff00ff : 0xff0000ff);
|
||||
} else {
|
||||
_ctrls.button (FP8Controls::BtnBypass).set_active (false);
|
||||
_ctrls.button (FP8Controls::BtnBypass).set_color (0x888888ff);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -986,17 +986,19 @@ FaderPort8::assign_processor_ctrls ()
|
|||
uint8_t id = 0;
|
||||
for (size_t i = _parameter_off; i < (size_t)n_parameters; ++i) {
|
||||
if (i >= toggle_params.size ()) {
|
||||
_ctrls.strip(id).unset_controllables (FP8Strip::CTRL_ALL & ~FP8Strip::CTRL_FADER & ~FP8Strip::CTRL_TEXT0 & ~FP8Strip::CTRL_TEXT1);
|
||||
_ctrls.strip(id).unset_controllables (FP8Strip::CTRL_ALL & ~FP8Strip::CTRL_FADER & ~FP8Strip::CTRL_TEXT0 & ~FP8Strip::CTRL_TEXT1 & ~FP8Strip::CTRL_TEXT2);
|
||||
}
|
||||
else if (i >= slider_params.size ()) {
|
||||
_ctrls.strip(id).unset_controllables (FP8Strip::CTRL_ALL & ~FP8Strip::CTRL_SELECT & ~FP8Strip::CTRL_TEXT3);
|
||||
} else {
|
||||
_ctrls.strip(id).unset_controllables (FP8Strip::CTRL_ALL & ~FP8Strip::CTRL_FADER & ~FP8Strip::CTRL_TEXT0 & ~FP8Strip::CTRL_TEXT1 & ~FP8Strip::CTRL_SELECT & ~FP8Strip::CTRL_TEXT3);
|
||||
_ctrls.strip(id).unset_controllables (FP8Strip::CTRL_ALL & ~FP8Strip::CTRL_FADER & ~FP8Strip::CTRL_TEXT & ~FP8Strip::CTRL_SELECT);
|
||||
}
|
||||
|
||||
if (i < slider_params.size ()) {
|
||||
_ctrls.strip(id).set_fader_controllable (slider_params[i]->ac);
|
||||
_ctrls.strip(id).set_text_line (0, slider_params[i]->name);
|
||||
std::string param_name = slider_params[i]->name;
|
||||
_ctrls.strip(id).set_text_line (0, param_name.substr (0, 9));
|
||||
_ctrls.strip(id).set_text_line (1, param_name.length () > 9 ? param_name.substr (9) : "");
|
||||
}
|
||||
if (i < toggle_params.size ()) {
|
||||
_ctrls.strip(id).set_select_controllable (toggle_params[i]->ac);
|
||||
|
@ -1051,13 +1053,25 @@ void
|
|||
FaderPort8::select_plugin (int num)
|
||||
{
|
||||
// make sure drop_ctrl_connections() was called
|
||||
assert (_proc_params.size() == 0 && _showing_well_known == 0);
|
||||
assert (_proc_params.size() == 0 && _showing_well_known == 0 && _plugin_insert.expired());
|
||||
|
||||
boost::shared_ptr<Route> r = boost::dynamic_pointer_cast<Route> (first_selected_stripable());
|
||||
if (!r) {
|
||||
_ctrls.set_fader_mode (ModeTrack);
|
||||
return;
|
||||
}
|
||||
|
||||
// Toggle Bypass
|
||||
if (shift_mod ()) {
|
||||
if (num >= 0) {
|
||||
boost::shared_ptr<PluginInsert> pi = boost::dynamic_pointer_cast<PluginInsert> (r->nth_plugin (num));
|
||||
if (pi) {
|
||||
pi->enable (! pi->enabled ());
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (num < 0) {
|
||||
build_well_known_processor_ctrls (r, num == -1);
|
||||
assign_processor_ctrls ();
|
||||
|
@ -1072,6 +1086,21 @@ FaderPort8::select_plugin (int num)
|
|||
return;
|
||||
}
|
||||
|
||||
// disconnect signals from spill_plugins: processors_changed and ActiveChanged
|
||||
processor_connections.drop_connections ();
|
||||
r->DropReferences.connect (processor_connections, MISSING_INVALIDATOR, boost::bind (&FP8Controls::set_fader_mode, &_ctrls, ModeTrack), this);
|
||||
|
||||
boost::shared_ptr<PluginInsert> pi = boost::dynamic_pointer_cast<PluginInsert> (proc);
|
||||
assert (pi); // nth_plugin() always returns a PI.
|
||||
#ifdef MIXBUS
|
||||
if (!pi->is_channelstrip ())
|
||||
#endif
|
||||
{
|
||||
_plugin_insert = boost::weak_ptr<ARDOUR::PluginInsert> (pi);
|
||||
}
|
||||
|
||||
pi->ActiveChanged.connect (processor_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::notify_plugin_active_changed, this), this);
|
||||
|
||||
// switching to "Mode Track" -> calls FaderPort8::notify_fader_mode_changed()
|
||||
// which drops the references, disconnects the signal and re-spills tracks
|
||||
proc->DropReferences.connect (processor_connections, MISSING_INVALIDATOR, boost::bind (&FP8Controls::set_fader_mode, &_ctrls, ModeTrack), this);
|
||||
|
@ -1091,6 +1120,7 @@ FaderPort8::select_plugin (int num)
|
|||
|
||||
// display
|
||||
assign_processor_ctrls ();
|
||||
notify_plugin_active_changed ();
|
||||
}
|
||||
|
||||
/* short 4 chars at most */
|
||||
|
@ -1198,14 +1228,16 @@ FaderPort8::spill_plugins ()
|
|||
|
||||
_ctrls.strip(id).unset_controllables (FP8Strip::CTRL_ALL & ~FP8Strip::CTRL_TEXT & ~FP8Strip::CTRL_SELECT);
|
||||
_ctrls.strip(id).set_select_cb (cb);
|
||||
_ctrls.strip(id).select_button ().set_color (0x00ff00ff);
|
||||
_ctrls.strip(id).select_button ().set_active (true /*proc->enabled()*/);
|
||||
_ctrls.strip(id).select_button ().set_color (proc->enabled () ? 0x00ff00ff : 0xff0000ff);
|
||||
_ctrls.strip(id).select_button ().set_active (true);
|
||||
_ctrls.strip(id).select_button ().set_blinking (false);
|
||||
_ctrls.strip(id).set_text_line (0, proc->name());
|
||||
_ctrls.strip(id).set_text_line (1, pi->plugin()->maker());
|
||||
_ctrls.strip(id).set_text_line (2, plugintype (pi->type()));
|
||||
_ctrls.strip(id).set_text_line (3, "");
|
||||
|
||||
pi->ActiveChanged.connect (processor_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::spill_plugins, this), this);
|
||||
|
||||
if (++id == spillwidth) {
|
||||
break;
|
||||
}
|
||||
|
@ -1360,8 +1392,10 @@ void
|
|||
FaderPort8::drop_ctrl_connections ()
|
||||
{
|
||||
_proc_params.clear();
|
||||
_plugin_insert.reset ();
|
||||
processor_connections.drop_connections ();
|
||||
_showing_well_known = 0;
|
||||
notify_plugin_active_changed ();
|
||||
}
|
||||
|
||||
/* functor for FP8Strip's select button */
|
||||
|
|
|
@ -49,6 +49,7 @@ namespace ARDOUR {
|
|||
class Bundle;
|
||||
class Session;
|
||||
class Processor;
|
||||
class PluginInsert;
|
||||
}
|
||||
|
||||
namespace ArdourSurface {
|
||||
|
@ -196,6 +197,7 @@ private:
|
|||
boost::shared_ptr<ARDOUR::AutomationControl> ac;
|
||||
};
|
||||
std::list <ProcessorCtrl> _proc_params;
|
||||
boost::weak_ptr<ARDOUR::PluginInsert> _plugin_insert;
|
||||
int _showing_well_known;
|
||||
/* **************************************************************************/
|
||||
|
||||
|
@ -238,6 +240,7 @@ private:
|
|||
void notify_solo_changed ();
|
||||
void notify_mute_changed ();
|
||||
void notify_automation_mode_changed ();
|
||||
void notify_plugin_active_changed ();
|
||||
|
||||
/* actions */
|
||||
PBD::ScopedConnectionList button_connections;
|
||||
|
@ -246,6 +249,7 @@ private:
|
|||
void button_record ();
|
||||
void button_loop ();
|
||||
void button_metronom ();
|
||||
void button_bypass ();
|
||||
void button_varispeed (bool);
|
||||
#ifdef FP8_MUTESOLO_UNDO
|
||||
void button_solo_clear ();
|
||||
|
|
|
@ -506,7 +506,7 @@ FP8Strip::periodic_update_meter ()
|
|||
if (_displaymode == PluginParam) {
|
||||
if (_fader_ctrl) {
|
||||
set_bar_mode (2); // Fill
|
||||
set_text_line (0x01, value_as_string(_fader_ctrl->desc(), _fader_ctrl->get_value()));
|
||||
set_text_line (2, value_as_string(_fader_ctrl->desc(), _fader_ctrl->get_value()));
|
||||
float barpos = _fader_ctrl->internal_to_interface (_fader_ctrl->get_value());
|
||||
int val = std::min (127.f, std::max (0.f, barpos * 128.f));
|
||||
if (val != _last_barpos) {
|
||||
|
@ -515,7 +515,7 @@ FP8Strip::periodic_update_meter ()
|
|||
}
|
||||
} else {
|
||||
set_bar_mode (4); // Off
|
||||
set_text_line (0x01, "");
|
||||
set_text_line (0x02, "");
|
||||
}
|
||||
}
|
||||
else if (_displaymode == SendDisplay) {
|
||||
|
@ -605,7 +605,7 @@ FP8Strip::periodic ()
|
|||
{
|
||||
periodic_update_fader ();
|
||||
periodic_update_meter ();
|
||||
if (_displaymode != PluginSelect) {
|
||||
if (_displaymode != PluginSelect && _displaymode != PluginParam) {
|
||||
periodic_update_timecode ();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue