ControlProtocol::Undo.connect (*this, invalidator (*this), boost::bind (&Editor::undo, this, true), gui_context());
ControlProtocol::Redo.connect (*this, invalidator (*this), boost::bind (&Editor::redo, this, true), gui_context());
ControlProtocol::ScrollTimeline.connect (*this, invalidator (*this), boost::bind (&Editor::control_scroll, this, _1), gui_context());
+ ControlProtocol::StepTracksUp.connect (*this, invalidator (*this), boost::bind (&Editor::control_step_tracks_up, this), gui_context());
+ ControlProtocol::StepTracksDown.connect (*this, invalidator (*this), boost::bind (&Editor::control_step_tracks_down, this), gui_context());
ControlProtocol::GotoView.connect (*this, invalidator (*this), boost::bind (&Editor::control_view, this, _1), gui_context());
ControlProtocol::CloseDialog.connect (*this, invalidator (*this), Keyboard::close_current_dialog, gui_context());
ControlProtocol::VerticalZoomInAll.connect (*this, invalidator (*this), boost::bind (&Editor::control_vertical_zoom_in_all, this), gui_context());
}
}
+void
+Editor::control_step_tracks_up ()
+{
+ scroll_tracks_up_line ();
+}
+
+void
+Editor::control_step_tracks_down ()
+{
+ scroll_tracks_down_line ();
+}
+
void
Editor::control_scroll (float fraction)
{
void control_vertical_zoom_out_all ();
void control_vertical_zoom_in_selected ();
void control_vertical_zoom_out_selected ();
+ void control_step_tracks_up ();
+ void control_step_tracks_down ();
void control_view (uint32_t);
void control_scroll (float);
void control_select (uint32_t rid, Selection::Operation);
PBD::Signal1<void,uint32_t> ControlProtocol::SetRouteSelection;
PBD::Signal1<void,uint32_t> ControlProtocol::RemoveRouteFromSelection;
PBD::Signal0<void> ControlProtocol::ClearRouteSelection;
+PBD::Signal0<void> ControlProtocol::StepTracksDown;
+PBD::Signal0<void> ControlProtocol::StepTracksUp;
ControlProtocol::ControlProtocol (Session& s, string str)
: BasicUI (s)
static PBD::Signal0<void> VerticalZoomOutAll;
static PBD::Signal0<void> VerticalZoomInSelected;
static PBD::Signal0<void> VerticalZoomOutSelected;
+ static PBD::Signal0<void> StepTracksDown;
+ static PBD::Signal0<void> StepTracksUp;
static PBD::Signal1<void,uint32_t> AddRouteToSelection;
static PBD::Signal1<void,uint32_t> SetRouteSelection;
MackieControlProtocol::notify_transport_state_changed()
{
// switch various play and stop buttons on / off
+ update_global_button (Button::Loop, session->get_play_loop());
update_global_button (Button::Play, session->transport_speed() == 1.0);
update_global_button (Button::Stop, !session->transport_rolling());
update_global_button (Button::Rewind, session->transport_speed() < 0.0);
} else {
VerticalZoomInAll (); /* EMIT SIGNAL */
}
+ } else {
+ StepTracksUp (); /* EMIT SIGNAL */
}
return off;
}
} else {
VerticalZoomOutAll (); /* EMIT SIGNAL */
}
+ } else {
+ StepTracksDown (); /* EMIT SIGNAL */
}
return off;
}
{
// TODO do an exact calc for 0.50? To allow manually re-centering the port.
- // center on or off
- MIDI::byte msg = (val > 0.45 && val < 0.55 ? 1 : 0) << 6;
+ // center on if val is "very close" to 0.50
+ MIDI::byte msg = (val > 0.48 && val < 0.58 ? 1 : 0) << 6;
- // mode
+ // Pot/LED mode
msg |= (mode << 4);
// val, but only if off hasn't explicitly been set
-
- if (onoff) {
+ if (onoff) {
if (mode == spread) {
- msg += (lrintf (val * 6) + 1) & 0x0f; // 0b00001111
+ msg |= (lrintf (val * 6) + 1) & 0x0f; // 0b00001111
} else {
- msg += (lrintf (val * 10.0) + 1) & 0x0f; // 0b00001111
+ msg |= (lrintf (val * 10.0) + 1) & 0x0f; // 0b00001111
}
}
boost::shared_ptr<Pannable> pannable = _route->pannable();
- if (pannable) {
+ if (pannable && pannable->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());
}
build_input_list (_route->input()->n_ports());
build_output_list (_route->output()->n_ports());
- current_pot_modes.clear();
+ possible_pot_parameters.clear();
if (pannable) {
boost::shared_ptr<Panner> panner = pannable->panner();
set<Evoral::Parameter>::iterator a;
if ((a = automatable.find (PanAzimuthAutomation)) != automatable.end()) {
- current_pot_modes.push_back (PanAzimuthAutomation);
+ possible_pot_parameters.push_back (PanAzimuthAutomation);
}
if ((a = automatable.find (PanWidthAutomation)) != automatable.end()) {
- current_pot_modes.push_back (PanWidthAutomation);
+ possible_pot_parameters.push_back (PanWidthAutomation);
}
} else {
std::cerr << "connected to route without a panner\n";
boost::shared_ptr<Pannable> pannable = _route->pannable();
- if (!pannable) {
+ if (!pannable || !pannable->panner()) {
_surface->write (_vpot->zero());
return;
}
boost::shared_ptr<Pannable> pannable = _route->pannable();
- if (!pannable) {
+ if (!pannable || !pannable->panner()) {
_surface->write (_vpot->zero());
return;
}
{
if (bs == press) {
-
int ms = _surface->mcp().modifier_state();
if (ms & MackieControlProtocol::MODIFIER_SHIFT) {
return;
}
+
boost::shared_ptr<AutomationControl> ac = _vpot->control();
if (!ac) {
return;
}
- for (i = current_pot_modes.begin(); i != current_pot_modes.end(); ++i) {
+ if (possible_pot_parameters.empty() || (possible_pot_parameters.size() == 1 && possible_pot_parameters.front() == ac->parameter())) {
+ return;
+ }
+
+ for (i = possible_pot_parameters.begin(); i != possible_pot_parameters.end(); ++i) {
if ((*i) == ac->parameter()) {
break;
}
also happen if the current mode is not in the current pot mode list)
*/
- if (i != current_pot_modes.end()) {
+ if (i != possible_pot_parameters.end()) {
++i;
}
- if (i == current_pot_modes.end()) {
- i = current_pot_modes.begin();
+ if (i == possible_pot_parameters.end()) {
+ i = possible_pot_parameters.begin();
}
set_vpot_parameter (*i);
void vselect_event (Button&, ButtonState);
void fader_touch_event (Button&, ButtonState);
- std::vector<Evoral::Parameter> current_pot_modes;
+ std::vector<Evoral::Parameter> possible_pot_parameters;
void next_pot_mode ();
void set_vpot_parameter (Evoral::Parameter);
Pot* pot = pots[ev->controller_number];
+ // bit 6 gives the sign
+ float sign = (ev->value & 0x40) == 0 ? 1.0 : -1.0;
+ // bits 0..5 give the velocity. we interpret this as "ticks
+ // moved before this message was sent"
+ float ticks = (ev->value & 0x3f);
+ if (ticks == 0) {
+ /* euphonix and perhaps other devices send zero
+ when they mean 1, we think.
+ */
+ ticks = 1;
+ }
+ float delta = sign * (ticks / (float) 0x3f);
+
if (!pot) {
if (ev->controller_number == Jog::ID && _jog_wheel) {
- // bit 6 gives the sign
- float sign = (ev->value & 0x40) == 0 ? 1.0 : -1.0;
- // bits 0..5 give the velocity. we interpret this as "ticks
- // moved before this message was sent"
- float ticks = (ev->value & 0x3f);
- if (ticks == 0) {
- /* euphonix and perhaps other devices send zero
- when they mean 1, we think.
- */
- ticks = 1;
- }
- float delta = sign * (ticks / (float) 0x3f);
-
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Jog wheel moved %1\n", ticks));
_jog_wheel->jog_event (delta);
return;
}
- }
-
- if (pot) {
- // bit 6 gives the sign
- float sign = (ev->value & 0x40) == 0 ? 1.0 : -1.0;
- // bits 0..5 give the velocity. we interpret this as "ticks
- // moved before this message was sent"
- float ticks = (ev->value & 0x3f);
- if (ticks == 0) {
- /* euphonix and perhaps other devices send zero
- when they mean 1, we think.
- */
- ticks = 1;
- }
- float delta = sign * (ticks / (float) 0x3f);
- Strip* strip = dynamic_cast<Strip*> (&pot->group());
-
- if (strip) {
- strip->handle_pot (*pot, delta);
- }
- } else {
- DEBUG_TRACE (DEBUG::MackieControl, "pot not found\n");
+ return;
}
+
+ Strip* strip = dynamic_cast<Strip*> (&pot->group());
+ if (strip) {
+ strip->handle_pot (*pot, delta);
+ }
}
void
Surface::update_view_mode_display ()
{
string text;
- Button* button = 0;
+ int id = -1;
if (!_active) {
return;
switch (_mcp.view_mode()) {
case MackieControlProtocol::Mixer:
show_two_char_display ("Mx");
- button = buttons[Button::Pan];
+ id = Button::Pan;
break;
case MackieControlProtocol::Dynamics:
show_two_char_display ("Dy");
- button = buttons[Button::Dyn];
+ id = Button::Dyn;
break;
case MackieControlProtocol::EQ:
show_two_char_display ("EQ");
- button = buttons[Button::Eq];
+ id = Button::Eq;
break;
case MackieControlProtocol::Loop:
show_two_char_display ("LP");
- button = buttons[Button::Loop];
+ id = Button::Loop;
break;
case MackieControlProtocol::AudioTracks:
show_two_char_display ("AT");
break;
case MackieControlProtocol::Sends:
show_two_char_display ("Sn");
- button = buttons[Button::Sends];
+ id = Button::Sends;
break;
case MackieControlProtocol::Plugins:
show_two_char_display ("Pl");
- button = buttons[Button::Plugin];
+ id = Button::Plugin;
break;
default:
break;
}
- if (button) {
- _port->write (button->set_state (on));
+ if (id >= 0) {
+
+ /* we are attempting to turn a global button/LED on */
+
+ map<int,Control*>::iterator x = controls_by_device_independent_id.find (id);
+
+ if (x != controls_by_device_independent_id.end()) {
+ Button* button = dynamic_cast<Button*> (x->second);
+ if (button) {
+ _port->write (button->set_state (on));
+ }
+ }
}
if (!text.empty()) {