summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-12-14 15:04:08 +0100
committerRobin Gareus <robin@gareus.org>2019-12-14 15:06:23 +0100
commitd4e023e1cbd783c2a46f8b4b231798c05f6b6708 (patch)
tree94c28a4bd8e44f2de803fefdd3f569c583961f7e /libs
parentd2facbf9c1116c192335ade77a4c07962e5473b9 (diff)
Make BusSendLevel 1st class citizen (1/2)
Equivalent to Gain and Trim (gain-coefficient, not dB) and use it for Sends.
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/value_as_string.h2
-rw-r--r--libs/ardour/automatable.cc4
-rw-r--r--libs/ardour/automation_list.cc1
-rw-r--r--libs/ardour/event_type_map.cc4
-rw-r--r--libs/ardour/gain_control.cc2
-rw-r--r--libs/ardour/luabindings.cc1
-rw-r--r--libs/ardour/parameter_descriptor.cc2
-rw-r--r--libs/ardour/send.cc2
-rw-r--r--libs/surfaces/mackie/strip.cc19
9 files changed, 15 insertions, 22 deletions
diff --git a/libs/ardour/ardour/value_as_string.h b/libs/ardour/ardour/value_as_string.h
index 861f8bfa93..2b95eb9141 100644
--- a/libs/ardour/ardour/value_as_string.h
+++ b/libs/ardour/ardour/value_as_string.h
@@ -53,7 +53,7 @@ value_as_string(const ARDOUR::ParameterDescriptor& desc,
// Value is not a scale point, print it normally
if (desc.unit == ARDOUR::ParameterDescriptor::MIDI_NOTE) {
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));
} else if (desc.type == PanWidthAutomation) {
snprintf (buf, sizeof (buf), "%d%%", (int) floor (100.0 * v));
diff --git a/libs/ardour/automatable.cc b/libs/ardour/automatable.cc
index d77aac71dd..3486812443 100644
--- a/libs/ardour/automatable.cc
+++ b/libs/ardour/automatable.cc
@@ -190,6 +190,8 @@ Automatable::describe_parameter (Evoral::Parameter param)
if (param == Evoral::Parameter(GainAutomation)) {
return _("Fader");
+ } else if (param.type() == BusSendLevel) {
+ return _("Send");
} else if (param.type() == TrimAutomation) {
return _("Trim");
} else if (param.type() == MuteAutomation) {
@@ -542,6 +544,8 @@ Automatable::control_factory(const Evoral::Parameter& param)
control = new GainControl(_a_session, param);
} else if (param.type() == TrimAutomation) {
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) {
Pannable* pannable = dynamic_cast<Pannable*>(this);
if (pannable) {
diff --git a/libs/ardour/automation_list.cc b/libs/ardour/automation_list.cc
index fa7854873c..1a3c1cc406 100644
--- a/libs/ardour/automation_list.cc
+++ b/libs/ardour/automation_list.cc
@@ -153,6 +153,7 @@ AutomationList::create_curve_if_necessary()
{
switch (_parameter.type()) {
case GainAutomation:
+ case BusSendLevel:
case TrimAutomation:
case PanAzimuthAutomation:
case PanElevationAutomation:
diff --git a/libs/ardour/event_type_map.cc b/libs/ardour/event_type_map.cc
index 17a1daef07..6b79c7825f 100644
--- a/libs/ardour/event_type_map.cc
+++ b/libs/ardour/event_type_map.cc
@@ -135,6 +135,8 @@ EventTypeMap::from_symbol(const string& str) const
if (str == "gain") {
p_type = GainAutomation;
+ } else if (str == "send") {
+ p_type = BusSendLevel;
} else if (str == "trim") {
p_type = TrimAutomation;
} else if (str == "solo") {
@@ -235,6 +237,8 @@ EventTypeMap::to_symbol(const Evoral::Parameter& param) const
if (t == GainAutomation) {
return "gain";
+ } else if (t == BusSendLevel) {
+ return "send";
} else if (t == TrimAutomation) {
return "trim";
} else if (t == PanAzimuthAutomation) {
diff --git a/libs/ardour/gain_control.cc b/libs/ardour/gain_control.cc
index 2e552813a9..370627b3ea 100644
--- a/libs/ardour/gain_control.cc
+++ b/libs/ardour/gain_control.cc
@@ -38,7 +38,7 @@ using namespace std;
GainControl::GainControl (Session& session, const Evoral::Parameter &param, boost::shared_ptr<AutomationList> al)
: SlavableAutomationControl (session, param, ParameterDescriptor(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)
{
}
diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc
index 691c32ddd3..73c503feb8 100644
--- a/libs/ardour/luabindings.cc
+++ b/libs/ardour/luabindings.cc
@@ -1865,6 +1865,7 @@ LuaBindings::common (lua_State* L)
.beginNamespace ("AutomationType")
.addConst ("GainAutomation", ARDOUR::AutomationType(GainAutomation))
+ .addConst ("BusSendLevel", ARDOUR::AutomationType(BusSendLevel))
.addConst ("PluginAutomation", ARDOUR::AutomationType(PluginAutomation))
.addConst ("SoloAutomation", ARDOUR::AutomationType(SoloAutomation))
.addConst ("SoloIsolateAutomation", ARDOUR::AutomationType(SoloIsolateAutomation))
diff --git a/libs/ardour/parameter_descriptor.cc b/libs/ardour/parameter_descriptor.cc
index 1269d69d1a..d959072fb5 100644
--- a/libs/ardour/parameter_descriptor.cc
+++ b/libs/ardour/parameter_descriptor.cc
@@ -195,7 +195,7 @@ ParameterDescriptor::update_steps()
if (unit == ParameterDescriptor::MIDI_NOTE) {
step = smallstep = 1; // semitone
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
like "slider position", so we convert from "slider position" to gain
to have the correct unit here. */
diff --git a/libs/ardour/send.cc b/libs/ardour/send.cc
index 950ee0b74d..78246eca82 100644
--- a/libs/ardour/send.cc
+++ b/libs/ardour/send.cc
@@ -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::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);
_amp.reset (new Amp (_session, _("Fader"), _gain_control, true));
diff --git a/libs/surfaces/mackie/strip.cc b/libs/surfaces/mackie/strip.cc
index 2aadfe5472..84ab1bb3fc 100644
--- a/libs/surfaces/mackie/strip.cc
+++ b/libs/surfaces/mackie/strip.cc
@@ -885,6 +885,7 @@ Strip::do_parameter_display (ARDOUR::ParameterDescriptor const& desc, float val,
switch (desc.type) {
case GainAutomation:
+ case BusSendLevel:
case TrimAutomation:
// we can't use value_as_string() that'll suffix "dB" and also use "-inf" w/o space :(
if (val == 0.0) {
@@ -897,24 +898,6 @@ Strip::do_parameter_display (ARDOUR::ParameterDescriptor const& desc, float val,
}
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:
if (Profile->get_mixbus()) {
// XXX no _stripable check?