Code to prevent unnecessary automation midi transmits was preventing updates on bank switches. This fixes it.

git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2469 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
John Anderson 2007-09-18 19:14:13 +00:00
parent 7d2f8306fc
commit 4cd658f4e5
3 changed files with 11 additions and 11 deletions

View file

@ -954,7 +954,7 @@ void MackieControlProtocol::notify_record_enable_changed( RouteSignal * route_si
}
}
void MackieControlProtocol::notify_gain_changed( RouteSignal * route_signal )
void MackieControlProtocol::notify_gain_changed( RouteSignal * route_signal, bool force_update )
{
try
{
@ -963,7 +963,7 @@ void MackieControlProtocol::notify_gain_changed( RouteSignal * route_signal )
{
float gain_value = route_signal->route().gain_control().get_value();
// check that something has actually changed
if ( gain_value != route_signal->last_gain_written() )
if ( force_update || gain_value != route_signal->last_gain_written() )
{
route_signal->port().write( builder.build_fader( fader, gain_value ) );
route_signal->last_gain_written( gain_value );
@ -1006,7 +1006,7 @@ void MackieControlProtocol::notify_name_changed( void *, RouteSignal * route_sig
}
}
void MackieControlProtocol::notify_panner_changed( RouteSignal * route_signal )
void MackieControlProtocol::notify_panner_changed( RouteSignal * route_signal, bool force_update )
{
try
{
@ -1022,7 +1022,7 @@ void MackieControlProtocol::notify_panner_changed( RouteSignal * route_signal )
// sends in spite of more work on the comparison
MidiByteArray bytes = builder.build_led_ring( pot, ControlState( on, pos ), MackieMidiBuilder::midi_pot_mode_dot );
// check that something has actually changed
if ( bytes != route_signal->last_pan_written() )
if ( force_update || bytes != route_signal->last_pan_written() )
{
route_signal->port().write( bytes );
route_signal->last_pan_written( bytes );
@ -1045,13 +1045,13 @@ void MackieControlProtocol::update_automation( RouteSignal & rs )
ARDOUR::AutoState gain_state = rs.route().gain_automation_state();
if ( gain_state == Touch || gain_state == Play )
{
notify_gain_changed( &rs );
notify_gain_changed( &rs, false );
}
ARDOUR::AutoState panner_state = rs.route().panner().automation_state();
if ( panner_state == Touch || panner_state == Play )
{
notify_panner_changed( &rs );
notify_panner_changed( &rs, false );
}
_automation_last.start();
}

View file

@ -95,11 +95,11 @@ class MackieControlProtocol
/// 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 * );
void notify_gain_changed( Mackie::RouteSignal *, bool force_update = true );
/// Signal handler for Route::name_change
void notify_name_changed( void *, Mackie::RouteSignal * );
/// Signal handler from Panner::Change
void notify_panner_changed( Mackie::RouteSignal * );
void notify_panner_changed( Mackie::RouteSignal *, bool force_update = true );
/// Signal handler for new routes added
void notify_route_added( ARDOUR::Session::RouteList & );

View file

@ -39,14 +39,14 @@ void RouteSignal::connect()
cins = _route.mute_control().Changed.connect( sigc::bind ( mem_fun ( _mcp, &MackieControlProtocol::notify_mute_changed ), this ) );
if ( _strip.has_gain() )
cins = _route.gain_control().Changed.connect( sigc::bind ( mem_fun ( _mcp, &MackieControlProtocol::notify_gain_changed ), this ) );
cins = _route.gain_control().Changed.connect( sigc::bind ( mem_fun ( _mcp, &MackieControlProtocol::notify_gain_changed ), this, true ) );
cins = _route.name_changed.connect( sigc::bind ( mem_fun ( _mcp, &MackieControlProtocol::notify_name_changed ), this ) );
cins = _route.panner().Changed.connect( sigc::bind ( mem_fun ( _mcp, &MackieControlProtocol::notify_panner_changed ), this ) );
cins = _route.panner().Changed.connect( sigc::bind ( mem_fun ( _mcp, &MackieControlProtocol::notify_panner_changed ), this, true ) );
for ( unsigned int i = 0; i < _route.panner().size(); ++i )
{
cins = _route.panner()[i]->Changed.connect( sigc::bind ( mem_fun ( _mcp, &MackieControlProtocol::notify_panner_changed ), this ) );
cins = _route.panner()[i]->Changed.connect( sigc::bind ( mem_fun ( _mcp, &MackieControlProtocol::notify_panner_changed ), this, true ) );
}
try