* how long can UI signal callbacks take to execute? What happens if they block?
where ENSURE_CORRECT_THREAD is a macro that is modelled on ENSURE_GUI_THREAD
if the handler is not called in the "correct thread", it will use a pseudo-RT-safe-enough technique to get the correct thread to recall "handler" later on, and return.
-
+
+* automation feedback not working
* finish button mapping
* discuss button mapping for Ardour
* concurrency for bank switching? And make sure "old" events aren't sent to "new" faders
* concurrency in write( bytes ). Queueing?
* TODOs in code
-* handle remote_control_id changed signal from Route.
-* handle removal of route. Need another session signal?
+* removal of a route results in a strip that isn't dead, but doesn't have any effect on the session
+* bulk remote id changes cause too many surface updates
* use i18n. see string_compose
* MackieControlProtocol in namespace Mackie?
* Generic surface code to common location
* power-cycling of surface. fd_midiport doesn't close.
* remove couts
* jog with transport rolling doesn't work properly. My use of ScrollTimeline also doesn't work.
-* docs in manual
+* docs in manual, including button assignment diagram
Later
-----
uint32_t end_pos = min( route_table.size(), sorted.size() );
Sorted::iterator it = sorted.begin() + _current_initial_bank;
Sorted::iterator end = sorted.begin() + _current_initial_bank + end_pos;
- cout << "switch to " << _current_initial_bank << ", " << end_pos << endl;
+ //cout << "switch to " << _current_initial_bank << ", " << end_pos << endl;
// link routes to strips
uint32_t i = 0;
{
boost::shared_ptr<Route> route = *it;
Strip & strip = *surface().strips[i];
- cout << "remote id " << route->remote_control_id() << " connecting " << route->name() << " to " << strip.name() << " with port " << port_for_id(i) << endl;
+ //cout << "remote id " << route->remote_control_id() << " connecting " << route->name() << " to " << strip.name() << " with port " << port_for_id(i) << endl;
route_table[i] = route;
RouteSignal * rs = new RouteSignal( *route, *this, strip, port_for_id(i) );
route_signals.push_back( rs );
connections_back = Config->ParameterChanged.connect( ( mem_fun (*this, &MackieControlProtocol::notify_parameter_changed) ) );
// receive rude solo changed
connections_back = session->SoloActive.connect( ( mem_fun (*this, &MackieControlProtocol::notify_solo_active_changed) ) );
+
+ // make sure remote id changed signals reach here
+ // see also notify_route_added
+ Sorted sorted = get_sorted_routes();
+ for ( Sorted::iterator it = sorted.begin(); it != sorted.end(); ++it )
+ {
+ (*it)->RemoteControlIDChanged.connect( ( mem_fun (*this, &MackieControlProtocol::notify_remote_id_changed) ) );
+ }
}
void MackieControlProtocol::add_port( MIDI::Port & midi_port, int number )
refresh_current_bank();
}
// otherwise route added, but current bank needs no updating
+
+ // make sure remote id changes in the new route are handled
+ typedef ARDOUR::Session::RouteList ARS;
+ for ( ARS::iterator it = rl.begin(); it != rl.end(); ++it )
+ {
+ (*it)->RemoteControlIDChanged.connect( ( mem_fun (*this, &MackieControlProtocol::notify_remote_id_changed) ) );
+ }
}
void MackieControlProtocol::notify_solo_active_changed( bool active )
mcu_port().write( builder.build_led( *rude_solo, active ? flashing : off ) );
}
+void MackieControlProtocol::notify_remote_id_changed()
+{
+ Sorted sorted = get_sorted_routes();
+
+ // if a remote id has been moved off the end, we need to shift
+ // the current bank backwards.
+ if ( sorted.size() - _current_initial_bank < route_signals.size() )
+ {
+ // but don't shift backwards past the zeroth channel
+ switch_banks( max( (unsigned int)0, sorted.size() - route_signals.size() ) );
+ }
+ // Otherwise just refresh the current bank
+ else
+ {
+ refresh_current_bank();
+ }
+}
+
///////////////////////////////////////////
// Transport signals
///////////////////////////////////////////