virtual const MidiByteArray & sysex_hdr() const;
virtual int strips() const;
+
};
}
}
_surface->init();
-
- // Connect events. Must be after route table otherwise there will be trouble
-
- for (MackiePorts::iterator it = _ports.begin(); it != _ports.end(); ++it) {
- (*it)->control_event.connect_same_thread (port_connections, boost::bind (&MackieControlProtocol::handle_control_event, this, _1, _2, _3));
- }
}
void
{
// find the route for the control, if there is one
boost::shared_ptr<Route> route;
+
if (control.group().is_strip()) {
if (control.group().is_master()) {
+ DEBUG_TRACE (DEBUG::MackieControl, "master strip control event\n");
route = master_route();
} else {
uint32_t index = control.ordinal() - 1 + (port.number() * port.strips());
- if (index < route_table.size())
+ DEBUG_TRACE (DEBUG::MackieControl, string_compose ("strip control event, index = %1, rt size = %2\n",
+ index, route_table.size()));
+ if (index < route_table.size()) {
route = route_table[index];
- else
+ if (route) {
+ DEBUG_TRACE (DEBUG::MackieControl, string_compose ("modifying %1\n", route->name()));
+ } else {
+ DEBUG_TRACE (DEBUG::MackieControl, "no route found!\n");
+ }
+ } else {
cerr << "Warning: index is " << index << " which is not in the route table, size: " << route_table.size() << endl;
+ DEBUG_TRACE (DEBUG::MackieControl, "illegal route index found!\n");
+ }
}
}
// at which point the fader should just reset itself
if (route != 0)
{
+ DEBUG_TRACE (DEBUG::MackieControl, string_compose ("fader to %1\n", state.pos));
+
route->gain_control()->set_value (slider_position_to_gain (state.pos));
if (ARDOUR::Config->get_mackie_emulation() == "bcf") {
case Control::type_button:
if (control.group().is_strip()) {
// strips
+ DEBUG_TRACE (DEBUG::MackieControl, string_compose ("strip button %1\n", control.id()));
if (route != 0) {
handle_strip_button (port, control, state.button_state, route);
} else {
}
} else if (control.group().is_master()) {
// master fader touch
+ DEBUG_TRACE (DEBUG::MackieControl, string_compose ("master strip button %1\n", control.id()));
if (route != 0) {
handle_strip_button (port, control, state.button_state, route);
}
} else {
// handle all non-strip buttons
+ DEBUG_TRACE (DEBUG::MackieControl, string_compose ("global button %1\n", control.id()));
surface().handle_button (*this, state.button_state, dynamic_cast<Button&> (control));
}
break;
// pot (jog wheel, external control)
case Control::type_pot:
if (control.group().is_strip()) {
+ DEBUG_TRACE (DEBUG::MackieControl, string_compose ("strip pot %1\n", control.id()));
if (route) {
boost::shared_ptr<Panner> panner = route->panner_shell()->panner();
// pan for mono input routes, or stereo linked panners
// it's a pot for an umnapped route, so turn all the lights off
port.write (builder.build_led_ring (dynamic_cast<Pot &> (control), off));
}
- }
- else
- {
+ } else {
if (control.is_jog()) {
+ DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Jog wheel moved %1\n", state.ticks));
_jog_wheel.jog_event (port, control, state);
} else {
+ DEBUG_TRACE (DEBUG::MackieControl, string_compose ("External controller moved %1\n", state.ticks));
cout << "external controller" << state.ticks * state.sign << endl;
}
}
void tear_down_gui ();
// control events
- void handle_control_event(Mackie::SurfacePort & port, Mackie::Control & control, const Mackie::ControlState & state);
+ void handle_control_event (Mackie::SurfacePort & port, Mackie::Control & control, const Mackie::ControlState & state);
// strip/route related stuff
public:
- /// Signal handler for Route::solo
- void notify_solo_changed(Mackie::RouteSignal *);
- /// Signal handler for Route::mute
- void notify_mute_changed(Mackie::RouteSignal *);
- /// Signal handler for Route::record_enable_changed
- void notify_record_enable_changed(Mackie::RouteSignal *);
- /// Signal handler for Route::gain_changed (from IO)
- void notify_gain_changed(Mackie::RouteSignal *, bool force_update = true);
- /// Signal handler for Route::name_change
- void notify_property_changed(const PBD::PropertyChange&, Mackie::RouteSignal *);
- /// Signal handler from Panner::Change
- void notify_panner_changed(Mackie::RouteSignal *, bool force_update = true);
- /// Signal handler for new routes added
- void notify_route_added(ARDOUR::RouteList &);
- /// Signal handler for Route::active_changed
- void notify_active_changed(Mackie::RouteSignal *);
+ void notify_solo_changed (Mackie::RouteSignal *);
+ void notify_mute_changed (Mackie::RouteSignal *);
+ void notify_record_enable_changed (Mackie::RouteSignal *);
+ void notify_gain_changed (Mackie::RouteSignal *, bool force_update = true);
+ void notify_property_changed (const PBD::PropertyChange&, Mackie::RouteSignal *);
+ void notify_panner_changed (Mackie::RouteSignal *, bool force_update = true);
+ void notify_route_added (ARDOUR::RouteList &);
+ void notify_active_changed (Mackie::RouteSignal *);
void notify_remote_id_changed();
/// remote id changed.
void refresh_current_bank();
- // global buttons (ie button not part of strips)
-
public:
// button-related signals
void notify_record_state_changed();
// in_use is set by the MackieControlProtocol::handle_strip_button
// relies on implicit ControlState constructor
- control_event (*this, *control, float (midi_pos) / float(0x3ff));
+ _mcp.handle_control_event (*this, *control, float (midi_pos) / float(0x3ff));
}
}
control->set_in_use (true);
add_in_use_timeout (*control, control);
- // emit the control event
control_event (*this, *control, state);
}
break;
}
}
+void
+MackiePort::control_event (SurfacePort& sp, Control& c, const ControlState& cs)
+{
+ _mcp.handle_control_event (sp, c, cs);
+}
*/
void probe_emulation( const MidiByteArray & bytes );
+ void control_event (SurfacePort &, Control &, const ControlState &);
+
private:
MackieControlProtocol & _mcp;
port_type_t _port_type;
MIDI::Port & output_port() { return *_output_port; }
const MIDI::Port & output_port() const { return *_output_port; }
- // all control notofications are sent from here
- PBD::Signal3<void,SurfacePort &, Control &, const ControlState &> control_event;
-
// emitted just before the port goes into initialisation
// where it tries to establish that its device is connected
PBD::Signal0<void> init_event;
protected:
/// Only for use by DummyPort
SurfacePort();
+
+ virtual void control_event (SurfacePort &, Control &, const ControlState &) {}
private:
bool control_in_use_timeout (Control *, Control *);