uint32_t _current_phase;
};
+ class LIBARDOUR_API GroupGainControllable : public AutomationControl {
+ public:
+ GroupGainControllable (std::string name, boost::shared_ptr<Route>);
+ void set_value (double);
+ // We get the value from the amp where we get the changed signal from
+ //double get_value () const;
+ private:
+ boost::weak_ptr<Route> _route;
+ };
boost::shared_ptr<SoloControllable> solo_control() const {
return _solo_control;
return _phase_control;
}
+ boost::shared_ptr<GroupGainControllable> group_gain_control() const {
+ return _group_gain_control;
+ }
+
/* Route doesn't own these items, but sub-objects that it does own have them
and to make UI code a bit simpler, we provide direct access to them
here.
boost::shared_ptr<MuteControllable> _mute_control;
boost::shared_ptr<MuteMaster> _mute_master;
boost::shared_ptr<PhaseControllable> _phase_control;
+ boost::shared_ptr<GroupGainControllable> _group_gain_control;
virtual void act_on_mute () {}
_solo_control.reset (new SoloControllable (X_("solo"), shared_from_this ()));
_mute_control.reset (new MuteControllable (X_("mute"), shared_from_this ()));
_phase_control.reset (new PhaseControllable (X_("phase"), shared_from_this ()));
+ _group_gain_control.reset (new GroupGainControllable (X_("groupgain"), shared_from_this ()));
_solo_control->set_flags (Controllable::Flag (_solo_control->flags() | Controllable::Toggle));
_mute_control->set_flags (Controllable::Flag (_mute_control->flags() | Controllable::Toggle));
_phase_control->set_flags (Controllable::Flag (_phase_control->flags() | Controllable::Toggle));
+ _group_gain_control->set_flags (Controllable::Flag (_group_gain_control->flags() | Controllable::GainLike));
add_control (_solo_control);
add_control (_mute_control);
add_control (_phase_control);
+ add_control (_group_gain_control);
/* panning */
return (r && r->muted()) ? GAIN_COEFF_UNITY : GAIN_COEFF_ZERO;
}
+Route::GroupGainControllable::GroupGainControllable (std::string name, boost::shared_ptr<Route> r)
+ : AutomationControl (r->session(),
+ Evoral::Parameter (GainAutomation),
+ ParameterDescriptor (Evoral::Parameter (GainAutomation)),
+ boost::shared_ptr<AutomationList>(),
+ name)
+ , _route (r)
+{
+ boost::shared_ptr<AutomationList> gl(new AutomationList(Evoral::Parameter(GainAutomation)));
+ gl->set_interpolation(Evoral::ControlList::Discrete);
+ set_list (gl);
+}
+
+void
+Route::GroupGainControllable::set_value (double val)
+{
+ boost::shared_ptr<Route> r = _route.lock ();
+ // I am not sure why I need the * .5 to make this work
+ float normalized_position = r->gain_control()->interface_to_internal (val * 0.5);
+ r->set_gain ((gain_t)normalized_position, this);
+}
+
Route::PhaseControllable::PhaseControllable (std::string name, boost::shared_ptr<Route> r)
: AutomationControl (r->session(),
- Evoral::Parameter (PhaseAutomation),
- ParameterDescriptor (Evoral::Parameter (PhaseAutomation)),
- boost::shared_ptr<AutomationList>(),
- name)
+ Evoral::Parameter (PhaseAutomation),
+ ParameterDescriptor (Evoral::Parameter (PhaseAutomation)),
+ boost::shared_ptr<AutomationList>(),
+ name)
, _route (r)
{
boost::shared_ptr<AutomationList> gl(new AutomationList(Evoral::Parameter(PhaseAutomation)));
pannable = _route->pannable ();
if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) {
/* gain to vpot, pan azi to fader */
- _vpot->set_control (_route->gain_control());
+ _vpot->set_control (_route->group_gain_control());
control_by_parameter[GainAutomation] = _vpot;
if (pannable) {
_fader->set_control (pannable->pan_azimuth_control);
}
} else {
/* gain to fader, pan azi to vpot */
- _fader->set_control (_route->gain_control());
+ _fader->set_control (_route->group_gain_control());
control_by_parameter[GainAutomation] = _fader;
if (pannable) {
_vpot->set_control (pannable->pan_azimuth_control);
pannable = _route->pannable ();
if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) {
/* gain to vpot, pan width to fader */
- _vpot->set_control (_route->gain_control());
+ _vpot->set_control (_route->group_gain_control());
control_by_parameter[GainAutomation] = _vpot;
if (pannable) {
_fader->set_control (pannable->pan_width_control);
}
} else {
/* gain to fader, pan width to vpot */
- _fader->set_control (_route->gain_control());
+ _fader->set_control (_route->group_gain_control());
control_by_parameter[GainAutomation] = _fader;
if (pannable) {
_vpot->set_control (pannable->pan_width_control);
_trim_mode = TrimAutomation;
if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) {
/* gain to vpot, trim to fader */
- _vpot->set_control (_route->gain_control());
+ _vpot->set_control (_route->group_gain_control());
control_by_parameter[GainAutomation] = _vpot;
if (_route->trim() && route()->trim()->active()) {
_fader->set_control (_route->trim_control());
}
} else {
/* gain to fader, trim to vpot */
- _fader->set_control (_route->gain_control());
+ _fader->set_control (_route->group_gain_control());
control_by_parameter[GainAutomation] = _fader;
if (_route->trim() && route()->trim()->active()) {
_vpot->set_control (_route->trim_control());
_trim_mode = PhaseAutomation;
if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) {
/* gain to vpot, phase to fader */
- _vpot->set_control (_route->gain_control());
+ _vpot->set_control (_route->group_gain_control());
control_by_parameter[GainAutomation] = _vpot;
if (_route->phase_invert().size()) {
_fader->set_control (_route->phase_control());
}
} else {
/* gain to fader, phase to vpot */
- _fader->set_control (_route->gain_control());
+ _fader->set_control (_route->group_gain_control());
control_by_parameter[GainAutomation] = _fader;
if (_route->phase_invert().size()) {
_vpot->set_control (_route->phase_control());
case SendAutomation:
if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) {
// gain to vpot, send to fader
- _vpot->set_control (_route->gain_control());
+ _vpot->set_control (_route->group_gain_control());
control_by_parameter[GainAutomation] = _vpot;
// test for send to control
boost::shared_ptr<Processor> p = _route->nth_send (_current_send);
}
} else {
// gain to fader, send to vpot
- _fader->set_control (_route->gain_control());
+ _fader->set_control (_route->group_gain_control());
control_by_parameter[GainAutomation] = _fader;
boost::shared_ptr<Processor> p = _route->nth_send (_current_send);
if (p && p->name() != "Monitor 1") {