, _fader_touch (0)
, _vpot (0)
, _fader (0)
+ , _meter (0)
, _index (index)
, _surface (&s)
, _controls_locked (false)
+ , _transport_is_rolling (false)
+ , _metering_active (true)
, _reset_display_at (0)
, _last_gain_position_written (-1.0)
, _last_pan_azi_position_written (-1.0)
{
_fader = dynamic_cast<Fader*> (Fader::factory (*_surface, index, "fader", *this));
_vpot = dynamic_cast<Pot*> (Pot::factory (*_surface, Pot::ID + index, "vpot", *this));
- _meter = dynamic_cast<Meter*> (Meter::factory (*_surface, index, "meter", *this));
+
+ if (s.mcp().device_info().has_meters()) {
+ _meter = dynamic_cast<Meter*> (Meter::factory (*_surface, index, "meter", *this));
+ }
for (map<Button::ID,StripButtonInfo>::const_iterator b = strip_buttons.begin(); b != strip_buttons.end(); ++b) {
Button* bb = dynamic_cast<Button*> (Button::factory (*_surface, b->first, b->second.base_id + index, b->second.name, *this));
break;
case Button::FaderTouch:
_fader_touch = button;
+ break;
default:
break;
}
set_vpot_parameter (PanAzimuthAutomation);
- _route->solo_control()->Changed.connect(route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_solo_changed, this), ui_context());
+ _route->solo_changed.connect (route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_solo_changed, this), ui_context());
+ _route->listen_changed.connect (route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_solo_changed, this), ui_context());
+
_route->mute_control()->Changed.connect(route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_mute_changed, this), ui_context());
boost::shared_ptr<Pannable> pannable = _route->pannable();
- if (pannable && pannable->panner()) {
+ if (pannable && _route->panner()) {
pannable->pan_azimuth_control->Changed.connect(route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_panner_azi_changed, this, false), ui_context());
pannable->pan_width_control->Changed.connect(route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_panner_width_changed, this, false), ui_context());
}
possible_pot_parameters.clear();
if (pannable) {
- boost::shared_ptr<Panner> panner = pannable->panner();
+ boost::shared_ptr<Panner> panner = _route->panner();
if (panner) {
set<Evoral::Parameter> automatable = panner->what_can_be_automated ();
set<Evoral::Parameter>::iterator a;
Strip::notify_solo_changed ()
{
if (_route && _solo) {
- _surface->write (_solo->set_state (_route->soloed() ? on : off));
+ _surface->write (_solo->set_state ((_route->soloed() || _route->listening_via_monitor()) ? on : off));
}
}
Control* control;
- if (_surface->mcp().flip_mode()) {
+ if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) {
control = _vpot;
} else {
control = _fader;
}
-
boost::shared_ptr<AutomationControl> ac = _route->gain_control();
float gain_coefficient = ac->get_value();
float normalized_position = ac->internal_to_interface (gain_coefficient);
-
+
if (force_update || normalized_position != _last_gain_position_written) {
- if (_surface->mcp().flip_mode()) {
+ if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) {
if (!control->in_use()) {
_surface->write (_vpot->set (normalized_position, true, Pot::wrap));
}
boost::shared_ptr<Pannable> pannable = _route->pannable();
- if (!pannable || !pannable->panner()) {
+ if (!pannable || !_route->panner()) {
_surface->write (_vpot->zero());
return;
}
boost::shared_ptr<Pannable> pannable = _route->pannable();
- if (!pannable || !pannable->panner()) {
+ if (!pannable || !_route->panner()) {
_surface->write (_vpot->zero());
return;
}
if (force_update || pos != _last_pan_azi_position_written) {
- if (_surface->mcp().flip_mode()) {
+ if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) {
if (control == _fader) {
if (!control->in_use()) {
case PanAzimuthAutomation:
if (_route) {
boost::shared_ptr<Pannable> p = _route->pannable();
- if (p && p->panner()) {
- string str = p->panner()->value_as_string (p->pan_azimuth_control);
+ if (p && _route->panner()) {
+ string str =_route->panner()->value_as_string (p->pan_azimuth_control);
_surface->write (display (1, str));
}
}
void
Strip::update_meter ()
{
- if (_meter) {
+ if (_meter && _transport_is_rolling && _metering_active) {
float dB = const_cast<PeakMeter&> (_route->peak_meter()).peak_power (0);
- _surface->write (_meter->update_message (dB));
+ _meter->send_update (*_surface, dB);
}
}
{
vector<Evoral::Parameter>::iterator i;
- if (_surface->mcp().flip_mode()) {
+ if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) {
/* do not change vpot mode while in flipped mode */
DEBUG_TRACE (DEBUG::MackieControl, "not stepping pot mode - in flip mode\n");
_surface->write (display (1, "Flip"));
case PanAzimuthAutomation:
pannable = _route->pannable ();
if (pannable) {
- if (_surface->mcp().flip_mode()) {
+ if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) {
/* gain to vpot, pan azi to fader */
_vpot->set_control (_route->gain_control());
control_by_parameter[GainAutomation] = _vpot;
case PanWidthAutomation:
pannable = _route->pannable ();
if (pannable) {
- if (_surface->mcp().flip_mode()) {
+ if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) {
/* gain to vpot, pan width to fader */
_vpot->set_control (_route->gain_control());
control_by_parameter[GainAutomation] = _vpot;
_last_gain_position_written = -1.0;
}
+
+void
+Strip::notify_metering_state_changed()
+{
+ if (!_route || !_meter) {
+ return;
+ }
+
+ bool transport_is_rolling = (_surface->mcp().get_transport_speed () != 0.0f);
+ bool metering_active = _surface->mcp().metering_active ();
+
+ if ((_transport_is_rolling == transport_is_rolling) && (_metering_active == metering_active)) {
+ return;
+ }
+
+ _meter->notify_metering_state_changed (*_surface, transport_is_rolling, metering_active);
+
+ if (!transport_is_rolling || !metering_active) {
+ notify_property_changed (PBD::PropertyChange (ARDOUR::Properties::name));
+ notify_panner_azi_changed (true);
+ }
+
+ _transport_is_rolling = transport_is_rolling;
+ _metering_active = metering_active;
+}