Add support for MainOutVolume in main-outs delivery

This commit is contained in:
Robin Gareus 2020-07-20 22:02:38 +02:00
parent d5f2dd4e7f
commit ebc8e47a71
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
3 changed files with 54 additions and 7 deletions

View File

@ -29,6 +29,7 @@
#include "ardour/types.h"
#include "ardour/chan_count.h"
#include "ardour/io_processor.h"
#include "ardour/gain_control.h"
namespace ARDOUR {
@ -100,6 +101,10 @@ public:
boost::shared_ptr<PannerShell> panner_shell() const { return _panshell; }
boost::shared_ptr<Panner> panner() const;
void add_gain (boost::shared_ptr<GainControl> gc) {
_gain_control = gc;
}
void unpan ();
void reset_panner ();
void defer_pan_reset ();
@ -116,14 +121,13 @@ protected:
gain_t _current_gain;
boost::shared_ptr<PannerShell> _panshell;
#ifdef MIXBUS
public: /* expose target_gain to mixbus processor Route::process_output_buffers */
#endif
gain_t target_gain ();
private:
bool _no_outs_cuz_we_no_monitor;
boost::shared_ptr<MuteMaster> _mute_master;
bool _no_outs_cuz_we_no_monitor;
boost::shared_ptr<MuteMaster> _mute_master;
boost::shared_ptr<GainControl> _gain_control;
static bool panners_legal;
static PBD::Signal0<void> PannersLegal;

View File

@ -571,6 +571,10 @@ Delivery::target_gain ()
gain_t desired_gain = _mute_master->mute_gain_at (mp);
if (_gain_control) {
desired_gain *= _gain_control->get_value();
}
if (_role == Listen && _session.monitor_out() && !_session.listening()) {
/* nobody is soloed, and this delivery is a listen-send to the

View File

@ -35,10 +35,49 @@
using namespace ARDOUR;
using namespace std;
static std::string gain_control_name (Evoral::Parameter const& param)
{
switch (param.type()) {
case GainAutomation:
/* fallthrough */
case BusSendLevel:
return X_("gaincontrol");
case TrimAutomation:
return X_("trimcontrol");
case MainOutVolume:
return X_("mastervolume");
default:
break;
}
/* default in AutomationControl c'tor uses
* EventTypeMap::instance().to_symbol(parameter)
*/
return "";
}
static boost::shared_ptr<AutomationList> automation_list_new (Evoral::Parameter const& param)
{
switch (param.type()) {
case GainAutomation:
/* fallthrough */
case BusSendLevel:
/* fallthrough */
case TrimAutomation:
return boost::shared_ptr<AutomationList> (new AutomationList (param));
case MainOutVolume:
/* not automatable */
break;
default:
assert (0);
break;
}
return boost::shared_ptr<AutomationList> ();
}
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 || param.type() == BusSendLevel) ? X_("gaincontrol") : X_("trimcontrol"),
al ? al : automation_list_new (param),
gain_control_name (param),
Controllable::GainLike)
{
}