mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
Add dedicated InsertReturnLevel type
This is preparation for PortInsert Send and Return level control.
This commit is contained in:
parent
f3423b8a77
commit
2939ed3164
12 changed files with 28 additions and 2 deletions
|
|
@ -170,6 +170,7 @@ enum AutomationType {
|
||||||
MonitoringAutomation,
|
MonitoringAutomation,
|
||||||
BusSendLevel,
|
BusSendLevel,
|
||||||
BusSendEnable,
|
BusSendEnable,
|
||||||
|
InsertReturnLevel,
|
||||||
MainOutVolume,
|
MainOutVolume,
|
||||||
|
|
||||||
/* used only by Controllable Descriptor to access send parameters */
|
/* used only by Controllable Descriptor to access send parameters */
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ value_as_string(const ARDOUR::ParameterDescriptor& desc,
|
||||||
// Value is not a scale point, print it normally
|
// Value is not a scale point, print it normally
|
||||||
if (desc.unit == ARDOUR::ParameterDescriptor::MIDI_NOTE) {
|
if (desc.unit == ARDOUR::ParameterDescriptor::MIDI_NOTE) {
|
||||||
snprintf(buf, sizeof(buf), "%s", ParameterDescriptor::midi_note_name (rint(v)).c_str());
|
snprintf(buf, sizeof(buf), "%s", ParameterDescriptor::midi_note_name (rint(v)).c_str());
|
||||||
} else if (desc.type == GainAutomation || desc.type == BusSendLevel || desc.type == TrimAutomation || desc.type == EnvelopeAutomation || desc.type == MainOutVolume) {
|
} else if (desc.type == GainAutomation || desc.type == BusSendLevel || desc.type == TrimAutomation || desc.type == EnvelopeAutomation || desc.type == MainOutVolume || desc.type == InsertReturnLevel) {
|
||||||
#ifdef PLATFORM_WINDOWS
|
#ifdef PLATFORM_WINDOWS
|
||||||
if (v < GAIN_COEFF_SMALL) {
|
if (v < GAIN_COEFF_SMALL) {
|
||||||
snprintf(buf, sizeof(buf), "-inf dB");
|
snprintf(buf, sizeof(buf), "-inf dB");
|
||||||
|
|
|
||||||
|
|
@ -193,6 +193,8 @@ Automatable::describe_parameter (Evoral::Parameter param)
|
||||||
return _("Fader");
|
return _("Fader");
|
||||||
} else if (param.type() == BusSendLevel) {
|
} else if (param.type() == BusSendLevel) {
|
||||||
return _("Send");
|
return _("Send");
|
||||||
|
} else if (param.type() == InsertReturnLevel) {
|
||||||
|
return _("Return");
|
||||||
} else if (param.type() == TrimAutomation) {
|
} else if (param.type() == TrimAutomation) {
|
||||||
return _("Trim");
|
return _("Trim");
|
||||||
} else if (param.type() == MainOutVolume) {
|
} else if (param.type() == MainOutVolume) {
|
||||||
|
|
@ -561,6 +563,8 @@ Automatable::control_factory(const Evoral::Parameter& param)
|
||||||
control = new GainControl(_a_session, param);
|
control = new GainControl(_a_session, param);
|
||||||
} else if (param.type() == TrimAutomation) {
|
} else if (param.type() == TrimAutomation) {
|
||||||
control = new GainControl(_a_session, param);
|
control = new GainControl(_a_session, param);
|
||||||
|
} else if (param.type() == InsertReturnLevel) {
|
||||||
|
control = new GainControl(_a_session, param);
|
||||||
} else if (param.type() == MainOutVolume) {
|
} else if (param.type() == MainOutVolume) {
|
||||||
control = new GainControl(_a_session, param);
|
control = new GainControl(_a_session, param);
|
||||||
} else if (param.type() == BusSendLevel) {
|
} else if (param.type() == BusSendLevel) {
|
||||||
|
|
|
||||||
|
|
@ -158,6 +158,7 @@ AutomationList::create_curve_if_necessary()
|
||||||
switch (_parameter.type()) {
|
switch (_parameter.type()) {
|
||||||
case GainAutomation:
|
case GainAutomation:
|
||||||
case BusSendLevel:
|
case BusSendLevel:
|
||||||
|
case InsertReturnLevel:
|
||||||
case TrimAutomation:
|
case TrimAutomation:
|
||||||
case PanAzimuthAutomation:
|
case PanAzimuthAutomation:
|
||||||
case PanElevationAutomation:
|
case PanElevationAutomation:
|
||||||
|
|
@ -232,6 +233,7 @@ AutomationList::default_interpolation () const
|
||||||
switch (_parameter.type()) {
|
switch (_parameter.type()) {
|
||||||
case GainAutomation:
|
case GainAutomation:
|
||||||
case BusSendLevel:
|
case BusSendLevel:
|
||||||
|
case InsertReturnLevel:
|
||||||
case EnvelopeAutomation:
|
case EnvelopeAutomation:
|
||||||
return ControlList::Exponential;
|
return ControlList::Exponential;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -204,6 +204,7 @@ setup_enum_writer ()
|
||||||
REGISTER_ENUM (MonitoringAutomation);
|
REGISTER_ENUM (MonitoringAutomation);
|
||||||
REGISTER_ENUM (BusSendLevel);
|
REGISTER_ENUM (BusSendLevel);
|
||||||
REGISTER_ENUM (BusSendEnable);
|
REGISTER_ENUM (BusSendEnable);
|
||||||
|
REGISTER_ENUM (InsertReturnLevel);
|
||||||
REGISTER_ENUM (MainOutVolume);
|
REGISTER_ENUM (MainOutVolume);
|
||||||
REGISTER (_AutomationType);
|
REGISTER (_AutomationType);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -131,6 +131,8 @@ EventTypeMap::from_symbol(const string& str) const
|
||||||
p_type = GainAutomation;
|
p_type = GainAutomation;
|
||||||
} else if (str == "send") {
|
} else if (str == "send") {
|
||||||
p_type = BusSendLevel;
|
p_type = BusSendLevel;
|
||||||
|
} else if (str == "return") {
|
||||||
|
p_type = InsertReturnLevel;
|
||||||
} else if (str == "trim") {
|
} else if (str == "trim") {
|
||||||
p_type = TrimAutomation;
|
p_type = TrimAutomation;
|
||||||
} else if (str == "main-out-volume") {
|
} else if (str == "main-out-volume") {
|
||||||
|
|
@ -233,6 +235,8 @@ EventTypeMap::to_symbol(const Evoral::Parameter& param) const
|
||||||
return "gain";
|
return "gain";
|
||||||
} else if (t == BusSendLevel) {
|
} else if (t == BusSendLevel) {
|
||||||
return "send";
|
return "send";
|
||||||
|
} else if (t == InsertReturnLevel) {
|
||||||
|
return "return";
|
||||||
} else if (t == TrimAutomation) {
|
} else if (t == TrimAutomation) {
|
||||||
return "trim";
|
return "trim";
|
||||||
} else if (t == MainOutVolume) {
|
} else if (t == MainOutVolume) {
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,8 @@ static std::string gain_control_name (Evoral::Parameter const& param)
|
||||||
case GainAutomation:
|
case GainAutomation:
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
case BusSendLevel:
|
case BusSendLevel:
|
||||||
|
/* fallthrough */
|
||||||
|
case InsertReturnLevel:
|
||||||
return X_("gaincontrol");
|
return X_("gaincontrol");
|
||||||
case TrimAutomation:
|
case TrimAutomation:
|
||||||
return X_("trimcontrol");
|
return X_("trimcontrol");
|
||||||
|
|
@ -62,6 +64,8 @@ static boost::shared_ptr<AutomationList> automation_list_new (Evoral::Parameter
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
case BusSendLevel:
|
case BusSendLevel:
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
|
case InsertReturnLevel:
|
||||||
|
/* fallthrough */
|
||||||
case TrimAutomation:
|
case TrimAutomation:
|
||||||
return boost::shared_ptr<AutomationList> (new AutomationList (param, Temporal::AudioTime));
|
return boost::shared_ptr<AutomationList> (new AutomationList (param, Temporal::AudioTime));
|
||||||
case MainOutVolume:
|
case MainOutVolume:
|
||||||
|
|
|
||||||
|
|
@ -2270,6 +2270,7 @@ LuaBindings::common (lua_State* L)
|
||||||
.beginNamespace ("AutomationType")
|
.beginNamespace ("AutomationType")
|
||||||
.addConst ("GainAutomation", ARDOUR::AutomationType(GainAutomation))
|
.addConst ("GainAutomation", ARDOUR::AutomationType(GainAutomation))
|
||||||
.addConst ("BusSendLevel", ARDOUR::AutomationType(BusSendLevel))
|
.addConst ("BusSendLevel", ARDOUR::AutomationType(BusSendLevel))
|
||||||
|
.addConst ("InsertReturnLevel", ARDOUR::AutomationType(InsertReturnLevel))
|
||||||
.addConst ("PluginAutomation", ARDOUR::AutomationType(PluginAutomation))
|
.addConst ("PluginAutomation", ARDOUR::AutomationType(PluginAutomation))
|
||||||
.addConst ("SoloAutomation", ARDOUR::AutomationType(SoloAutomation))
|
.addConst ("SoloAutomation", ARDOUR::AutomationType(SoloAutomation))
|
||||||
.addConst ("SoloIsolateAutomation", ARDOUR::AutomationType(SoloIsolateAutomation))
|
.addConst ("SoloIsolateAutomation", ARDOUR::AutomationType(SoloIsolateAutomation))
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,8 @@ ParameterDescriptor::ParameterDescriptor(const Evoral::Parameter& parameter)
|
||||||
|
|
||||||
switch((AutomationType)parameter.type()) {
|
switch((AutomationType)parameter.type()) {
|
||||||
case BusSendLevel:
|
case BusSendLevel:
|
||||||
|
/* fallthrough */
|
||||||
|
case InsertReturnLevel:
|
||||||
inline_ctrl = true;
|
inline_ctrl = true;
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
case GainAutomation:
|
case GainAutomation:
|
||||||
|
|
@ -207,7 +209,7 @@ ParameterDescriptor::update_steps()
|
||||||
if (unit == ParameterDescriptor::MIDI_NOTE) {
|
if (unit == ParameterDescriptor::MIDI_NOTE) {
|
||||||
step = smallstep = 1; // semitone
|
step = smallstep = 1; // semitone
|
||||||
largestep = 12; // octave
|
largestep = 12; // octave
|
||||||
} else if (type == GainAutomation || type == TrimAutomation || type == BusSendLevel || type == MainOutVolume) {
|
} else if (type == GainAutomation || type == TrimAutomation || type == BusSendLevel || type == MainOutVolume || type == InsertReturnLevel) {
|
||||||
/* dB_coeff_step gives a step normalized for [0, max_gain]. This is
|
/* dB_coeff_step gives a step normalized for [0, max_gain]. This is
|
||||||
like "slider position", so we convert from "slider position" to gain
|
like "slider position", so we convert from "slider position" to gain
|
||||||
to have the correct unit here. */
|
to have the correct unit here. */
|
||||||
|
|
@ -326,6 +328,8 @@ ParameterDescriptor::to_interface (float val, bool rotary) const
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
case BusSendLevel:
|
case BusSendLevel:
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
|
case InsertReturnLevel:
|
||||||
|
/* fallthrough */
|
||||||
case EnvelopeAutomation:
|
case EnvelopeAutomation:
|
||||||
val = gain_to_slider_position_with_max (val, upper);
|
val = gain_to_slider_position_with_max (val, upper);
|
||||||
break;
|
break;
|
||||||
|
|
@ -384,6 +388,7 @@ ParameterDescriptor::from_interface (float val, bool rotary) const
|
||||||
case GainAutomation:
|
case GainAutomation:
|
||||||
case EnvelopeAutomation:
|
case EnvelopeAutomation:
|
||||||
case BusSendLevel:
|
case BusSendLevel:
|
||||||
|
case InsertReturnLevel:
|
||||||
val = slider_position_to_gain_with_max (val, upper);
|
val = slider_position_to_gain_with_max (val, upper);
|
||||||
break;
|
break;
|
||||||
case TrimAutomation:
|
case TrimAutomation:
|
||||||
|
|
@ -443,6 +448,7 @@ ParameterDescriptor::is_linear () const
|
||||||
case GainAutomation:
|
case GainAutomation:
|
||||||
case EnvelopeAutomation:
|
case EnvelopeAutomation:
|
||||||
case BusSendLevel:
|
case BusSendLevel:
|
||||||
|
case InsertReturnLevel:
|
||||||
return false;
|
return false;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -715,6 +715,7 @@ Strip::format_parameter_for_display(
|
||||||
case GainAutomation:
|
case GainAutomation:
|
||||||
case BusSendLevel:
|
case BusSendLevel:
|
||||||
case TrimAutomation:
|
case TrimAutomation:
|
||||||
|
case InsertReturnLevel:
|
||||||
// we can't use value_as_string() that'll suffix "dB" and also use "-inf" w/o space :(
|
// we can't use value_as_string() that'll suffix "dB" and also use "-inf" w/o space :(
|
||||||
if (val == 0.0) {
|
if (val == 0.0) {
|
||||||
formatted_parameter_display = " -inf ";
|
formatted_parameter_display = " -inf ";
|
||||||
|
|
|
||||||
|
|
@ -223,6 +223,7 @@ Maschine2Knob::controllable_changed ()
|
||||||
|
|
||||||
case ARDOUR::GainAutomation:
|
case ARDOUR::GainAutomation:
|
||||||
case ARDOUR::BusSendLevel:
|
case ARDOUR::BusSendLevel:
|
||||||
|
case ARDOUR::InsertReturnLevel:
|
||||||
case ARDOUR::TrimAutomation:
|
case ARDOUR::TrimAutomation:
|
||||||
snprintf (buf, sizeof (buf), "%+4.1f dB", accurate_coefficient_to_dB (_controllable->get_value()));
|
snprintf (buf, sizeof (buf), "%+4.1f dB", accurate_coefficient_to_dB (_controllable->get_value()));
|
||||||
text->set (buf);
|
text->set (buf);
|
||||||
|
|
|
||||||
|
|
@ -326,6 +326,7 @@ Push2Knob::controllable_changed ()
|
||||||
|
|
||||||
case ARDOUR::GainAutomation:
|
case ARDOUR::GainAutomation:
|
||||||
case ARDOUR::BusSendLevel:
|
case ARDOUR::BusSendLevel:
|
||||||
|
case ARDOUR::InsertReturnLevel:
|
||||||
case ARDOUR::TrimAutomation:
|
case ARDOUR::TrimAutomation:
|
||||||
set_gain_text (_val);
|
set_gain_text (_val);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue