13
0

Add Inline Control Port Property

This allows to indicate that a control should by default be displayed
inline in the mixer-strip.

Previously that was hard-coded for and enabled for send-level
controls only.
This commit is contained in:
Robin Gareus 2019-12-14 15:00:34 +01:00
parent d4ad9e3486
commit 93180ceea9
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
6 changed files with 23 additions and 6 deletions

View File

@ -112,6 +112,7 @@ struct LIBARDOUR_API ParameterDescriptor : public Evoral::ParameterDescriptor
bool integer_step;
bool sr_dependent;
bool enumeration;
bool inline_ctrl;
};
} // namespace ARDOUR

View File

@ -213,6 +213,7 @@ public:
LilvNode* auto_automation_controlled; // lv2:portProperty
LilvNode* auto_automation_controller; // lv2:portProperty
LilvNode* inline_display_in_gui; // lv2:optionalFeature
LilvNode* inline_mixer_control; // lv2:PortProperty
#endif
private:
@ -2279,6 +2280,10 @@ LV2Plugin::get_parameter_descriptor(uint32_t which, ParameterDescriptor& desc) c
desc.enumeration = lilv_port_has_property(_impl->plugin, port, _world.lv2_enumeration);
desc.scale_points = get_scale_points(which);
#ifdef LV2_EXTENDED
desc.inline_ctrl = lilv_port_has_property(_impl->plugin, port, _world.inline_mixer_control);
#endif
if (steps) {
desc.rangesteps = lilv_node_as_float (steps);
}
@ -3323,6 +3328,7 @@ LV2World::LV2World()
auto_automation_controlled = lilv_new_uri(world, LV2_AUTOMATE_URI__controlled);
auto_automation_controller = lilv_new_uri(world, LV2_AUTOMATE_URI__controller);
inline_display_in_gui = lilv_new_uri(world, LV2_INLINEDISPLAY__in_gui);
inline_mixer_control = lilv_new_uri(world, "http://ardour.org/lv2/ext#inlineMixerControl");
#endif
bufz_powerOf2BlockLength = lilv_new_uri(world, LV2_BUF_SIZE__powerOf2BlockLength);
bufz_fixedBlockLength = lilv_new_uri(world, LV2_BUF_SIZE__fixedBlockLength);
@ -3346,6 +3352,8 @@ LV2World::~LV2World()
lilv_node_free(auto_automation_control);
lilv_node_free(auto_automation_controlled);
lilv_node_free(auto_automation_controller);
lilv_node_free(inline_display_in_gui);
lilv_node_free(inline_mixer_control);
#endif
lilv_node_free(patch_Message);
lilv_node_free(opts_requiredOptions);

View File

@ -53,8 +53,10 @@ ParameterDescriptor::ParameterDescriptor(const Evoral::Parameter& parameter)
/* Note: defaults in Evoral::ParameterDescriptor */
switch((AutomationType)parameter.type()) {
case GainAutomation:
case BusSendLevel:
inline_ctrl = true;
/* fallthrough */
case GainAutomation:
upper = Config->get_max_gain();
normal = 1.0f;
break;
@ -150,6 +152,7 @@ ParameterDescriptor::ParameterDescriptor()
, integer_step(false)
, sr_dependent(false)
, enumeration(false)
, inline_ctrl(false)
{}
void

View File

@ -486,9 +486,12 @@ PluginInsert::create_automatable_parameters ()
boost::shared_ptr<AutomationList> list(new AutomationList(param, desc));
boost::shared_ptr<AutomationControl> c (new PluginControl(this, param, desc, list));
if (!automatable || (limit_automatables > 0 && i > limit_automatables)) {
if (!automatable || (limit_automatables > 0 && what_can_be_automated ().size() > limit_automatables)) {
c->set_flags (Controllable::Flag ((int)c->flags() | Controllable::NotAutomatable));
}
if (desc.inline_ctrl) {
c->set_flags (Controllable::Flag ((int)c->flags() | Controllable::InlineControl));
}
add_control (c);
plugin->set_automation_control (i, c);
}

View File

@ -102,6 +102,7 @@ Send::Send (Session& s, boost::shared_ptr<Pannable> p, boost::shared_ptr<MuteMas
boost::shared_ptr<AutomationList> gl (new AutomationList (Evoral::Parameter (GainAutomation)));
_gain_control = boost::shared_ptr<GainControl> (new GainControl (_session, Evoral::Parameter(BusSendLevel), gl));
_gain_control->set_flags (Controllable::Flag ((int)_gain_control->flags() | Controllable::InlineControl));
add_control (_gain_control);
_amp.reset (new Amp (_session, _("Fader"), _gain_control, true));

View File

@ -73,10 +73,11 @@ class LIBPBD_API Controllable : public PBD::StatefulDestructible, public boost::
{
public:
enum Flag {
Toggle = 0x1,
GainLike = 0x2,
RealTime = 0x4,
NotAutomatable = 0x8,
Toggle = 0x01,
GainLike = 0x02,
RealTime = 0x04,
NotAutomatable = 0x08,
InlineControl = 0x10,
};
Controllable (const std::string& name, Flag f = Flag (0));