Make BusSendLevel 1st class citizen (1/2)
Equivalent to Gain and Trim (gain-coefficient, not dB) and use it for Sends.
This commit is contained in:
parent
d2facbf9c1
commit
d4e023e1cb
@ -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 == TrimAutomation || desc.type == EnvelopeAutomation) {
|
} else if (desc.type == GainAutomation || desc.type == BusSendLevel || desc.type == TrimAutomation || desc.type == EnvelopeAutomation) {
|
||||||
snprintf(buf, sizeof(buf), "%.1f dB", accurate_coefficient_to_dB (v));
|
snprintf(buf, sizeof(buf), "%.1f dB", accurate_coefficient_to_dB (v));
|
||||||
} else if (desc.type == PanWidthAutomation) {
|
} else if (desc.type == PanWidthAutomation) {
|
||||||
snprintf (buf, sizeof (buf), "%d%%", (int) floor (100.0 * v));
|
snprintf (buf, sizeof (buf), "%d%%", (int) floor (100.0 * v));
|
||||||
|
@ -190,6 +190,8 @@ Automatable::describe_parameter (Evoral::Parameter param)
|
|||||||
|
|
||||||
if (param == Evoral::Parameter(GainAutomation)) {
|
if (param == Evoral::Parameter(GainAutomation)) {
|
||||||
return _("Fader");
|
return _("Fader");
|
||||||
|
} else if (param.type() == BusSendLevel) {
|
||||||
|
return _("Send");
|
||||||
} else if (param.type() == TrimAutomation) {
|
} else if (param.type() == TrimAutomation) {
|
||||||
return _("Trim");
|
return _("Trim");
|
||||||
} else if (param.type() == MuteAutomation) {
|
} else if (param.type() == MuteAutomation) {
|
||||||
@ -542,6 +544,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() == BusSendLevel) {
|
||||||
|
control = new GainControl(_a_session, param);
|
||||||
} else if (param.type() == PanAzimuthAutomation || param.type() == PanWidthAutomation || param.type() == PanElevationAutomation) {
|
} else if (param.type() == PanAzimuthAutomation || param.type() == PanWidthAutomation || param.type() == PanElevationAutomation) {
|
||||||
Pannable* pannable = dynamic_cast<Pannable*>(this);
|
Pannable* pannable = dynamic_cast<Pannable*>(this);
|
||||||
if (pannable) {
|
if (pannable) {
|
||||||
|
@ -153,6 +153,7 @@ AutomationList::create_curve_if_necessary()
|
|||||||
{
|
{
|
||||||
switch (_parameter.type()) {
|
switch (_parameter.type()) {
|
||||||
case GainAutomation:
|
case GainAutomation:
|
||||||
|
case BusSendLevel:
|
||||||
case TrimAutomation:
|
case TrimAutomation:
|
||||||
case PanAzimuthAutomation:
|
case PanAzimuthAutomation:
|
||||||
case PanElevationAutomation:
|
case PanElevationAutomation:
|
||||||
|
@ -135,6 +135,8 @@ EventTypeMap::from_symbol(const string& str) const
|
|||||||
|
|
||||||
if (str == "gain") {
|
if (str == "gain") {
|
||||||
p_type = GainAutomation;
|
p_type = GainAutomation;
|
||||||
|
} else if (str == "send") {
|
||||||
|
p_type = BusSendLevel;
|
||||||
} else if (str == "trim") {
|
} else if (str == "trim") {
|
||||||
p_type = TrimAutomation;
|
p_type = TrimAutomation;
|
||||||
} else if (str == "solo") {
|
} else if (str == "solo") {
|
||||||
@ -235,6 +237,8 @@ EventTypeMap::to_symbol(const Evoral::Parameter& param) const
|
|||||||
|
|
||||||
if (t == GainAutomation) {
|
if (t == GainAutomation) {
|
||||||
return "gain";
|
return "gain";
|
||||||
|
} else if (t == BusSendLevel) {
|
||||||
|
return "send";
|
||||||
} else if (t == TrimAutomation) {
|
} else if (t == TrimAutomation) {
|
||||||
return "trim";
|
return "trim";
|
||||||
} else if (t == PanAzimuthAutomation) {
|
} else if (t == PanAzimuthAutomation) {
|
||||||
|
@ -38,7 +38,7 @@ using namespace std;
|
|||||||
GainControl::GainControl (Session& session, const Evoral::Parameter ¶m, boost::shared_ptr<AutomationList> al)
|
GainControl::GainControl (Session& session, const Evoral::Parameter ¶m, boost::shared_ptr<AutomationList> al)
|
||||||
: SlavableAutomationControl (session, param, ParameterDescriptor(param),
|
: SlavableAutomationControl (session, param, ParameterDescriptor(param),
|
||||||
al ? al : boost::shared_ptr<AutomationList> (new AutomationList (param)),
|
al ? al : boost::shared_ptr<AutomationList> (new AutomationList (param)),
|
||||||
param.type() == GainAutomation ? X_("gaincontrol") : X_("trimcontrol"),
|
(param.type() == GainAutomation || param.type() == BusSendLevel) ? X_("gaincontrol") : X_("trimcontrol"),
|
||||||
Controllable::GainLike)
|
Controllable::GainLike)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -1865,6 +1865,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 ("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))
|
||||||
|
@ -195,7 +195,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) {
|
} else if (type == GainAutomation || type == TrimAutomation || type == BusSendLevel) {
|
||||||
/* 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. */
|
||||||
|
@ -101,7 +101,7 @@ Send::Send (Session& s, boost::shared_ptr<Pannable> p, boost::shared_ptr<MuteMas
|
|||||||
//boost_debug_shared_ptr_mark_interesting (this, "send");
|
//boost_debug_shared_ptr_mark_interesting (this, "send");
|
||||||
|
|
||||||
boost::shared_ptr<AutomationList> gl (new AutomationList (Evoral::Parameter (GainAutomation)));
|
boost::shared_ptr<AutomationList> gl (new AutomationList (Evoral::Parameter (GainAutomation)));
|
||||||
_gain_control = boost::shared_ptr<GainControl> (new GainControl (_session, Evoral::Parameter(GainAutomation), gl));
|
_gain_control = boost::shared_ptr<GainControl> (new GainControl (_session, Evoral::Parameter(BusSendLevel), gl));
|
||||||
add_control (_gain_control);
|
add_control (_gain_control);
|
||||||
|
|
||||||
_amp.reset (new Amp (_session, _("Fader"), _gain_control, true));
|
_amp.reset (new Amp (_session, _("Fader"), _gain_control, true));
|
||||||
|
@ -885,6 +885,7 @@ Strip::do_parameter_display (ARDOUR::ParameterDescriptor const& desc, float val,
|
|||||||
|
|
||||||
switch (desc.type) {
|
switch (desc.type) {
|
||||||
case GainAutomation:
|
case GainAutomation:
|
||||||
|
case BusSendLevel:
|
||||||
case TrimAutomation:
|
case TrimAutomation:
|
||||||
// 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) {
|
||||||
@ -897,24 +898,6 @@ Strip::do_parameter_display (ARDOUR::ParameterDescriptor const& desc, float val,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BusSendLevel:
|
|
||||||
if (Profile->get_mixbus()) { //Mixbus sends are already stored in dB
|
|
||||||
// TODO remove after merge - PluginAutomation w/print_fmt
|
|
||||||
snprintf (buf, sizeof (buf), "%2.1f", val);
|
|
||||||
pending_display[1] = buf;
|
|
||||||
screen_hold = true;
|
|
||||||
} else {
|
|
||||||
if (val == 0.0) {
|
|
||||||
pending_display[1] = " -inf ";
|
|
||||||
} else {
|
|
||||||
float dB = accurate_coefficient_to_dB (val);
|
|
||||||
snprintf (buf, sizeof (buf), "%6.1f", dB);
|
|
||||||
pending_display[1] = buf;
|
|
||||||
screen_hold = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PanAzimuthAutomation:
|
case PanAzimuthAutomation:
|
||||||
if (Profile->get_mixbus()) {
|
if (Profile->get_mixbus()) {
|
||||||
// XXX no _stripable check?
|
// XXX no _stripable check?
|
||||||
|
Loading…
Reference in New Issue
Block a user