#include "ardour/debug.h"
#include "ardour/midi_ui.h"
#include "ardour/meter.h"
+#include "ardour/monitor_control.h"
#include "ardour/plugin_insert.h"
#include "ardour/pannable.h"
#include "ardour/panner.h"
#include "ardour/panner_shell.h"
+#include "ardour/phase_control.h"
#include "ardour/rc_configuration.h"
#include "ardour/route.h"
#include "ardour/session.h"
#include "ardour/send.h"
+#include "ardour/solo_isolate_control.h"
#include "ardour/track.h"
#include "ardour/midi_track.h"
#include "ardour/user_bundle.h"
reset_saved_values ();
if (!r) {
+ DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Surface %1 Strip %2 mapped to null route\n", _surface->number(), _index));
zero ();
return;
}
_solo->set_control (_route->solo_control());
_mute->set_control (_route->mute_control());
- _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->solo_control()->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<AutomationControl> pan_control = _route->pan_azimuth_control();
Strip::notify_solo_changed ()
{
if (_route && _solo) {
- _surface->write (_solo->set_state ((_route->soloed() || _route->listening_via_monitor()) ? on : off));
+ _surface->write (_solo->set_state (_route->soloed() ? on : off));
}
}
Strip::notify_record_enable_changed ()
{
if (_route && _recenable) {
- _surface->write (_recenable->set_state (_route->record_enabled() ? on : off));
+ boost::shared_ptr<Track> trk = boost::dynamic_pointer_cast<Track> (_route);
+ if (trk) {
+ _surface->write (_recenable->set_state (trk->rec_enable_control()->get_value() ? on : off));
+ }
}
}
if (force_update || normalized_position != _last_gain_position_written) {
- if (_surface->mcp().flip_mode() != MackieControlProtocol::Normal) {
- if (!control->in_use()) {
+ if (!control->in_use()) {
+ if (control == _vpot) {
_surface->write (_vpot->set (normalized_position, true, Pot::wrap));
- }
- do_parameter_display (GainAutomation, gain_coefficient);
- } else {
- if (!control->in_use()) {
+ } else {
_surface->write (_fader->set_position (normalized_position));
}
- do_parameter_display (GainAutomation, gain_coefficient);
}
+ do_parameter_display (GainAutomation, gain_coefficient);
_last_gain_position_written = normalized_position;
}
}
string fullname = string();
if (!_route) {
- // make sure first three strips get cleared of view mode
- if (_index > 2) {
- return;
- }
+ fullname = string();
} else {
fullname = _route->name();
}
- string line1;
if (fullname.length() <= 6) {
- line1 = fullname;
+ pending_display[0] = fullname;
} else {
- line1 = PBD::short_version (fullname, 6);
+ pending_display[0] = PBD::short_version (fullname, 6);
}
-
- pending_display[0] = line1;
}
void
if (control) {
float val = control->get_value();
do_parameter_display (type, val);
- /* update pot/encoder */
- _surface->write (_vpot->set (control->internal_to_interface (val), true, Pot::wrap));
+
+ if (_vpot->control() == control) {
+ /* update pot/encoder */
+ _surface->write (_vpot->set (control->internal_to_interface (val), true, Pot::wrap));
+ }
}
}
}
boost::shared_ptr<AutomationControl> control;
-
boost::shared_ptr<Track> track = boost::dynamic_pointer_cast<Track> (r);
switch (type) {
if (control) {
float val = control->get_value();
- if (control->desc().enumeration || control->desc().integer_step) {
- do_parameter_display (type, val);
- } else {
- do_parameter_display (type, control->internal_to_interface (val));
- }
+
+ /* Note: all of the displayed controllables require the display
+ * of their *actual* ("internal") value, not the version mapped
+ * into the normalized 0..1.0 ("interface") range.
+ */
+
+ do_parameter_display (type, val);
/* update pot/encoder */
_surface->write (_vpot->set (control->internal_to_interface (val), true, Pot::wrap));
}
return;
}
- if (ms & MackieControlProtocol::MODIFIER_SHIFT) {
- /* reset to default */
- boost::shared_ptr<AutomationControl> ac = _fader->control ();
- if (ac) {
- ac->set_value (ac->normal(), Controllable::NoGroup);
- }
- return;
- }
-
DEBUG_TRACE (DEBUG::MackieControl, "add select button on press\n");
_surface->mcp().add_down_select_button (_surface->number(), _index);
_surface->mcp().select_range ();
switch (type) {
case GainAutomation:
- case BusSendLevel:
if (val == 0.0) {
pending_display[1] = " -inf ";
} else {
}
break;
+ case BusSendLevel:
+ if (Profile->get_mixbus()) { //Mixbus sends are already stored in dB
+ 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()) {
snprintf (buf, sizeof (buf), "%2.1f", val);
} else {
- double p = ac->get_value();
+ double p = ac->get_interface();
p += delta;
- p = max (ac->lower(), p);
- p = min (ac->upper(), p);
+ p = max (0.0, p);
+ p = min (1.0, p);
- ac->set_value (p, gcd);
+ ac->set_value ( ac->interface_to_internal(p), gcd);
}
}
}
if (_meter && _transport_is_rolling && _metering_active) {
- float dB = const_cast<PeakMeter&> (_route->peak_meter()).meter_level (0, MeterMCP);
+ float dB = _route->peak_meter()->meter_level (0, MeterMCP);
_meter->send_update (*_surface, dB);
return;
}
do_parameter_display (BusSendLevel, fader_control->get_value());
}
+ /* update fader */
+
+ _surface->write (_fader->set_position (pot_control->internal_to_interface (pot_control->get_value ())));
+
+ /* update pot */
+
+ _surface->write (_vpot->set (fader_control->internal_to_interface (fader_control->get_value()), true, Pot::wrap));
+
+
} else {
/* do nothing */
}
set_vpot_parameter (_pan_mode);
/* need to show strip name again */
show_route_name ();
+ if (!_route) {
+ _surface->write (_vpot->set (0, true, Pot::wrap));
+ _surface->write (_fader->set_position (0.0));
+ }
notify_metering_state_changed ();
eq_band = -1;
break;
pc->Changed.connect (subview_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_send_level_change, this, BusSendLevel, global_pos, false), ui_context());
_vpot->set_control (pc);
- pending_display[0] = r->send_name (global_pos);
+ pending_display[0] = PBD::short_version (r->send_name (global_pos), 6);
notify_send_level_change (BusSendLevel, global_pos, true);
}