mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
add a new AutomationType enum, LargeGainAutomation that provides +24dB of gain
This commit is contained in:
parent
02764ae317
commit
ba49f074b3
19 changed files with 42 additions and 8 deletions
|
|
@ -335,6 +335,7 @@ Amp::state () const
|
||||||
XMLNode& node (Processor::state ());
|
XMLNode& node (Processor::state ());
|
||||||
switch (_gain_control->parameter().type()) {
|
switch (_gain_control->parameter().type()) {
|
||||||
case GainAutomation:
|
case GainAutomation:
|
||||||
|
case LargeGainAutomation:
|
||||||
node.set_property("type", "amp");
|
node.set_property("type", "amp");
|
||||||
break;
|
break;
|
||||||
case TrimAutomation:
|
case TrimAutomation:
|
||||||
|
|
|
||||||
|
|
@ -45,5 +45,3 @@ static inline double dB_coeff_step(double max_coeff) {
|
||||||
return 0.1 * (max_coeff / max_db);
|
return 0.1 * (max_coeff / max_db);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern double zero_db_as_fraction;
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,7 @@ enum InsertMergePolicy {
|
||||||
*/
|
*/
|
||||||
enum AutomationType {
|
enum AutomationType {
|
||||||
NullAutomation,
|
NullAutomation,
|
||||||
|
LargeGainAutomation,
|
||||||
GainAutomation,
|
GainAutomation,
|
||||||
PanAzimuthAutomation,
|
PanAzimuthAutomation,
|
||||||
PanElevationAutomation,
|
PanElevationAutomation,
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,9 @@ 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 || desc.type == SurroundSendLevel || desc.type == InsertReturnLevel) {
|
} else if (desc.type == LargeGainAutomation || desc.type == GainAutomation || desc.type == BusSendLevel ||
|
||||||
|
desc.type == TrimAutomation || desc.type == EnvelopeAutomation || desc.type == MainOutVolume ||
|
||||||
|
desc.type == SurroundSendLevel || 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");
|
||||||
|
|
|
||||||
|
|
@ -194,6 +194,8 @@ Automatable::describe_parameter (Evoral::Parameter param)
|
||||||
|
|
||||||
if (param == Evoral::Parameter(GainAutomation)) {
|
if (param == Evoral::Parameter(GainAutomation)) {
|
||||||
return _("Fader");
|
return _("Fader");
|
||||||
|
} else if (param == Evoral::Parameter(LargeGainAutomation)) {
|
||||||
|
return _("Fader");
|
||||||
} else if (param.type() == BusSendLevel) {
|
} else if (param.type() == BusSendLevel) {
|
||||||
return _("Send");
|
return _("Send");
|
||||||
} else if (param.type() == SurroundSendLevel) {
|
} else if (param.type() == SurroundSendLevel) {
|
||||||
|
|
@ -588,7 +590,7 @@ Automatable::control_factory(const Evoral::Parameter& param)
|
||||||
} else {
|
} else {
|
||||||
warning << "PluginPropertyAutomation for non-Plugin" << endl;
|
warning << "PluginPropertyAutomation for non-Plugin" << endl;
|
||||||
}
|
}
|
||||||
} else if (param.type() == GainAutomation) {
|
} else if (param.type() == GainAutomation || param.type() == GainAutomation) {
|
||||||
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);
|
||||||
|
|
|
||||||
|
|
@ -157,6 +157,7 @@ AutomationList::create_curve_if_necessary()
|
||||||
{
|
{
|
||||||
switch (_parameter.type()) {
|
switch (_parameter.type()) {
|
||||||
case GainAutomation:
|
case GainAutomation:
|
||||||
|
case LargeGainAutomation:
|
||||||
case BusSendLevel:
|
case BusSendLevel:
|
||||||
case SurroundSendLevel:
|
case SurroundSendLevel:
|
||||||
case InsertReturnLevel:
|
case InsertReturnLevel:
|
||||||
|
|
@ -234,6 +235,7 @@ AutomationList::default_interpolation () const
|
||||||
{
|
{
|
||||||
switch (_parameter.type()) {
|
switch (_parameter.type()) {
|
||||||
case GainAutomation:
|
case GainAutomation:
|
||||||
|
case LargeGainAutomation:
|
||||||
case BusSendLevel:
|
case BusSendLevel:
|
||||||
case SurroundSendLevel:
|
case SurroundSendLevel:
|
||||||
case InsertReturnLevel:
|
case InsertReturnLevel:
|
||||||
|
|
|
||||||
|
|
@ -227,6 +227,7 @@ ControlGroup::fill_from_stripable_list (StripableList& sl, Evoral::Parameter con
|
||||||
|
|
||||||
switch (p.type()) {
|
switch (p.type()) {
|
||||||
case GainAutomation:
|
case GainAutomation:
|
||||||
|
case LargeGainAutomation:
|
||||||
for (auto & s : sl) {
|
for (auto & s : sl) {
|
||||||
std::shared_ptr<AutomationControl> ac = s->gain_control ();
|
std::shared_ptr<AutomationControl> ac = s->gain_control ();
|
||||||
if (ac) {
|
if (ac) {
|
||||||
|
|
|
||||||
|
|
@ -184,6 +184,7 @@ setup_enum_writer ()
|
||||||
|
|
||||||
REGISTER_ENUM (NullAutomation);
|
REGISTER_ENUM (NullAutomation);
|
||||||
REGISTER_ENUM (GainAutomation);
|
REGISTER_ENUM (GainAutomation);
|
||||||
|
REGISTER_ENUM (LargeGainAutomation);
|
||||||
REGISTER_ENUM (PanAzimuthAutomation);
|
REGISTER_ENUM (PanAzimuthAutomation);
|
||||||
REGISTER_ENUM (PanElevationAutomation);
|
REGISTER_ENUM (PanElevationAutomation);
|
||||||
REGISTER_ENUM (PanWidthAutomation);
|
REGISTER_ENUM (PanWidthAutomation);
|
||||||
|
|
|
||||||
|
|
@ -130,6 +130,8 @@ EventTypeMap::from_symbol(const string& str) const
|
||||||
|
|
||||||
if (str == "gain") {
|
if (str == "gain") {
|
||||||
p_type = GainAutomation;
|
p_type = GainAutomation;
|
||||||
|
} else if (str == "large-gain") {
|
||||||
|
p_type = LargeGainAutomation;
|
||||||
} else if (str == "send") {
|
} else if (str == "send") {
|
||||||
p_type = BusSendLevel;
|
p_type = BusSendLevel;
|
||||||
} else if (str == "surround-send") {
|
} else if (str == "surround-send") {
|
||||||
|
|
@ -258,6 +260,8 @@ EventTypeMap::to_symbol(const Evoral::Parameter& param) const
|
||||||
|
|
||||||
if (t == GainAutomation) {
|
if (t == GainAutomation) {
|
||||||
return "gain";
|
return "gain";
|
||||||
|
} else if (t == LargeGainAutomation) {
|
||||||
|
return "large-gain";
|
||||||
} else if (t == BusSendLevel) {
|
} else if (t == BusSendLevel) {
|
||||||
return "send";
|
return "send";
|
||||||
} else if (t == BusSendEnable) {
|
} else if (t == BusSendEnable) {
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,8 @@ using namespace std;
|
||||||
static std::string gain_control_name (Evoral::Parameter const& param)
|
static std::string gain_control_name (Evoral::Parameter const& param)
|
||||||
{
|
{
|
||||||
switch (param.type()) {
|
switch (param.type()) {
|
||||||
|
case LargeGainAutomation:
|
||||||
|
/* fallthrough */
|
||||||
case GainAutomation:
|
case GainAutomation:
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
case BusSendLevel:
|
case BusSendLevel:
|
||||||
|
|
@ -62,6 +64,8 @@ static std::string gain_control_name (Evoral::Parameter const& param)
|
||||||
static std::shared_ptr<AutomationList> automation_list_new (Evoral::Parameter const& param)
|
static std::shared_ptr<AutomationList> automation_list_new (Evoral::Parameter const& param)
|
||||||
{
|
{
|
||||||
switch (param.type()) {
|
switch (param.type()) {
|
||||||
|
case LargeGainAutomation:
|
||||||
|
/* fallthrough */
|
||||||
case GainAutomation:
|
case GainAutomation:
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
case BusSendLevel:
|
case BusSendLevel:
|
||||||
|
|
|
||||||
|
|
@ -2481,6 +2481,7 @@ LuaBindings::common (lua_State* L)
|
||||||
|
|
||||||
.beginNamespace ("AutomationType")
|
.beginNamespace ("AutomationType")
|
||||||
.addConst ("GainAutomation", ARDOUR::AutomationType(GainAutomation))
|
.addConst ("GainAutomation", ARDOUR::AutomationType(GainAutomation))
|
||||||
|
.addConst ("LargeGainAutomation", ARDOUR::AutomationType(LargeGainAutomation))
|
||||||
.addConst ("BusSendLevel", ARDOUR::AutomationType(BusSendLevel))
|
.addConst ("BusSendLevel", ARDOUR::AutomationType(BusSendLevel))
|
||||||
.addConst ("SurroundSendLevel", ARDOUR::AutomationType(SurroundSendLevel))
|
.addConst ("SurroundSendLevel", ARDOUR::AutomationType(SurroundSendLevel))
|
||||||
.addConst ("InsertReturnLevel", ARDOUR::AutomationType(InsertReturnLevel))
|
.addConst ("InsertReturnLevel", ARDOUR::AutomationType(InsertReturnLevel))
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,10 @@ ParameterDescriptor::ParameterDescriptor(const Evoral::Parameter& parameter)
|
||||||
upper = Config->get_max_gain();
|
upper = Config->get_max_gain();
|
||||||
normal = 1.0f;
|
normal = 1.0f;
|
||||||
break;
|
break;
|
||||||
|
case LargeGainAutomation:
|
||||||
|
upper = 15.85; /* +24dB */
|
||||||
|
normal = 1.0f;
|
||||||
|
break;
|
||||||
case BusSendEnable:
|
case BusSendEnable:
|
||||||
upper = 1.f;
|
upper = 1.f;
|
||||||
normal = 1.f;
|
normal = 1.f;
|
||||||
|
|
@ -286,11 +290,11 @@ 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 || type == SurroundSendLevel || type == InsertReturnLevel) {
|
} else if (type == LargeGainAutomation || type == GainAutomation || type == TrimAutomation || type == BusSendLevel || type == MainOutVolume || type == SurroundSendLevel || 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. */
|
||||||
largestep = position_to_gain (dB_coeff_step(upper));
|
largestep = position_to_gain (dB_coeff_step (upper));
|
||||||
step = position_to_gain (largestep / 10.0);
|
step = position_to_gain (largestep / 10.0);
|
||||||
smallstep = step;
|
smallstep = step;
|
||||||
} else if (logarithmic) {
|
} else if (logarithmic) {
|
||||||
|
|
@ -401,6 +405,8 @@ ParameterDescriptor::to_interface (float val, bool rotary) const
|
||||||
{
|
{
|
||||||
val = std::min (upper, std::max (lower, val));
|
val = std::min (upper, std::max (lower, val));
|
||||||
switch(type) {
|
switch(type) {
|
||||||
|
case LargeGainAutomation:
|
||||||
|
/* fallthrough */
|
||||||
case GainAutomation:
|
case GainAutomation:
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
case BusSendLevel:
|
case BusSendLevel:
|
||||||
|
|
@ -468,6 +474,7 @@ ParameterDescriptor::from_interface (float val, bool rotary) const
|
||||||
|
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case GainAutomation:
|
case GainAutomation:
|
||||||
|
case LargeGainAutomation:
|
||||||
case EnvelopeAutomation:
|
case EnvelopeAutomation:
|
||||||
case BusSendLevel:
|
case BusSendLevel:
|
||||||
case InsertReturnLevel:
|
case InsertReturnLevel:
|
||||||
|
|
@ -532,6 +539,7 @@ ParameterDescriptor::is_linear () const
|
||||||
}
|
}
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case GainAutomation:
|
case GainAutomation:
|
||||||
|
case LargeGainAutomation:
|
||||||
case EnvelopeAutomation:
|
case EnvelopeAutomation:
|
||||||
case BusSendLevel:
|
case BusSendLevel:
|
||||||
case SurroundSendLevel:
|
case SurroundSendLevel:
|
||||||
|
|
|
||||||
|
|
@ -3074,7 +3074,8 @@ Route::set_state_2X (const XMLNode& node, int version)
|
||||||
_main_outs->panner_shell()->set_state(*io_child, version);
|
_main_outs->panner_shell()->set_state(*io_child, version);
|
||||||
} else if (io_child->name() == X_("Automation")) {
|
} else if (io_child->name() == X_("Automation")) {
|
||||||
/* IO's automation is for the fader */
|
/* IO's automation is for the fader */
|
||||||
_amp->set_automation_xml_state (*io_child, Evoral::Parameter (GainAutomation));
|
AutomationType at = is_master() ? LargeGainAutomation : GainAutomation;
|
||||||
|
_amp->set_automation_xml_state (*io_child, Evoral::Parameter (at));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -369,7 +369,7 @@ Send::set_state (const XMLNode& node, int version)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Evoral::Parameter param = EventTypeMap::instance().from_symbol (id_prop->value());
|
Evoral::Parameter param = EventTypeMap::instance().from_symbol (id_prop->value());
|
||||||
if (param.type() != GainAutomation) {
|
if (param.type() != GainAutomation && param.type() != LargeGainAutomation) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
XMLNode xn (**i);
|
XMLNode xn (**i);
|
||||||
|
|
|
||||||
|
|
@ -2103,6 +2103,7 @@ MackieControlProtocol::down_controls (AutomationType p, uint32_t pressed)
|
||||||
pull_stripable_range (m->second, stripables, pressed);
|
pull_stripable_range (m->second, stripables, pressed);
|
||||||
|
|
||||||
switch (p) {
|
switch (p) {
|
||||||
|
case LargeGainAutomation:
|
||||||
case GainAutomation:
|
case GainAutomation:
|
||||||
for (StripableList::iterator s = stripables.begin(); s != stripables.end(); ++s) {
|
for (StripableList::iterator s = stripables.begin(); s != stripables.end(); ++s) {
|
||||||
controls.push_back ((*s)->gain_control());
|
controls.push_back ((*s)->gain_control());
|
||||||
|
|
|
||||||
|
|
@ -713,6 +713,7 @@ Strip::format_parameter_for_display(
|
||||||
|
|
||||||
switch (desc.type) {
|
switch (desc.type) {
|
||||||
case GainAutomation:
|
case GainAutomation:
|
||||||
|
case LargeGainAutomation:
|
||||||
case BusSendLevel:
|
case BusSendLevel:
|
||||||
case TrimAutomation:
|
case TrimAutomation:
|
||||||
case SurroundSendLevel:
|
case SurroundSendLevel:
|
||||||
|
|
|
||||||
|
|
@ -222,6 +222,7 @@ Maschine2Knob::controllable_changed ()
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ARDOUR::GainAutomation:
|
case ARDOUR::GainAutomation:
|
||||||
|
case ARDOUR::LargeGainAutomation:
|
||||||
case ARDOUR::BusSendLevel:
|
case ARDOUR::BusSendLevel:
|
||||||
case ARDOUR::SurroundSendLevel:
|
case ARDOUR::SurroundSendLevel:
|
||||||
case ARDOUR::InsertReturnLevel:
|
case ARDOUR::InsertReturnLevel:
|
||||||
|
|
|
||||||
|
|
@ -1639,6 +1639,7 @@ US2400Protocol::down_controls (AutomationType p, uint32_t pressed)
|
||||||
|
|
||||||
switch (p) {
|
switch (p) {
|
||||||
case GainAutomation:
|
case GainAutomation:
|
||||||
|
case LargeGainAutomation:
|
||||||
for (StripableList::iterator s = stripables.begin(); s != stripables.end(); ++s) {
|
for (StripableList::iterator s = stripables.begin(); s != stripables.end(); ++s) {
|
||||||
controls.push_back ((*s)->gain_control());
|
controls.push_back ((*s)->gain_control());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,8 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
#include "ardour/utils.h"
|
||||||
|
|
||||||
#include "gtkmm2ext/cairo_widget.h"
|
#include "gtkmm2ext/cairo_widget.h"
|
||||||
#include "gtkmm2ext/colors.h"
|
#include "gtkmm2ext/colors.h"
|
||||||
#include "gtkmm2ext/keyboard.h"
|
#include "gtkmm2ext/keyboard.h"
|
||||||
|
|
@ -59,6 +61,8 @@ ArdourFader::ArdourFader (Gtk::Adjustment& adj, int orientation, int fader_lengt
|
||||||
, have_explicit_fg (false)
|
, have_explicit_fg (false)
|
||||||
, outline_color (0)
|
, outline_color (0)
|
||||||
{
|
{
|
||||||
|
adj.signal_changed().connect (sigc::mem_fun (*this, &ArdourFader::update_unity_position));
|
||||||
|
|
||||||
update_unity_position ();
|
update_unity_position ();
|
||||||
|
|
||||||
add_events (Gdk::TOUCH_UPDATE_MASK);
|
add_events (Gdk::TOUCH_UPDATE_MASK);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue