Missed one consideration when handling MI/II EFX presets

This commit is contained in:
hirsch 2016-09-05 13:07:16 -04:00
parent a9e2cd8e5e
commit 74408f8715

View file

@ -107,6 +107,10 @@ Mustang::handleInput( void ) {
if ( 0==memcmp(read_buf,state_prefix,2) ) { if ( 0==memcmp(read_buf,state_prefix,2) ) {
// Only care about amp state messages, and not even all of them... // Only care about amp state messages, and not even all of them...
int dsp_category = read_buf[2]; int dsp_category = read_buf[2];
// 0 = AMP preset / DSP state, 1 = MI/II Mod preset, 2 = MI/II Delay/Reverb preset
int preset_category = read_buf[3];
switch( dsp_category ) { switch( dsp_category ) {
// Response for DSP data and/or patch-change // Response for DSP data and/or patch-change
// //
@ -122,9 +126,6 @@ Mustang::handleInput( void ) {
case 0x04: case 0x04:
{ {
// PRESET NAME // PRESET NAME
// 0 = Amp preset, 1 = Mod preset, 2 = Delay/Reverb preset
int preset_category = read_buf[3];
// Rank within preset category // Rank within preset category
int idx = read_buf[4]; int idx = read_buf[4];
@ -152,67 +153,82 @@ Mustang::handleInput( void ) {
case 0x05: case 0x05:
{ {
// AMP // AMP
// DSP parms (make 0x05..0x0a normal to zero) if ( 0==preset_category ) {
int idx = dsp_category - 5; // (Don't want MI/II preset data here)
pthread_mutex_lock( &dsp_sync[idx].lock );
memcpy( dsp_parms[idx], (const char *)read_buf, 64 ); // DSP parms (make 0x05..0x0a normal to zero)
updateAmpObj( read_buf ); int idx = dsp_category - 5;
pthread_mutex_lock( &dsp_sync[idx].lock );
pthread_mutex_unlock( &dsp_sync[idx].lock );
memcpy( dsp_parms[idx], (const char *)read_buf, 64 );
updateAmpObj( read_buf );
pthread_mutex_unlock( &dsp_sync[idx].lock );
}
break; break;
} }
case 0x06: case 0x06:
{ {
// STOMP // STOMP
int idx = dsp_category - 5; if ( 0==preset_category ) {
pthread_mutex_lock( &dsp_sync[idx].lock ); int idx = dsp_category - 5;
pthread_mutex_lock( &dsp_sync[idx].lock );
memcpy( dsp_parms[idx], (const char *)read_buf, 64 );
updateStompObj( read_buf ); memcpy( dsp_parms[idx], (const char *)read_buf, 64 );
updateStompObj( read_buf );
pthread_mutex_unlock( &dsp_sync[idx].lock );
pthread_mutex_unlock( &dsp_sync[idx].lock );
}
break; break;
} }
case 0x07: case 0x07:
{ {
// MOD // MOD
int idx = dsp_category - 5; if ( 0==preset_category ) {
pthread_mutex_lock( &dsp_sync[idx].lock ); int idx = dsp_category - 5;
pthread_mutex_lock( &dsp_sync[idx].lock );
memcpy( dsp_parms[idx], (const char *)read_buf, 64 ); memcpy( dsp_parms[idx], (const char *)read_buf, 64 );
updateModObj( read_buf ); updateModObj( read_buf );
pthread_mutex_unlock( &dsp_sync[idx].lock ); pthread_mutex_unlock( &dsp_sync[idx].lock );
}
break; break;
} }
case 0x08: case 0x08:
{ {
// DELAY // DELAY
int idx = dsp_category - 5; if ( 0==preset_category ) {
pthread_mutex_lock( &dsp_sync[idx].lock ); int idx = dsp_category - 5;
pthread_mutex_lock( &dsp_sync[idx].lock );
memcpy( dsp_parms[idx], (const char *)read_buf, 64 ); memcpy( dsp_parms[idx], (const char *)read_buf, 64 );
updateDelayObj( read_buf ); updateDelayObj( read_buf );
pthread_mutex_unlock( &dsp_sync[idx].lock ); pthread_mutex_unlock( &dsp_sync[idx].lock );
}
break; break;
} }
case 0x09: case 0x09:
{ {
// REVERB // REVERB
int idx = dsp_category - 5; if ( 0==preset_category ) {
pthread_mutex_lock( &dsp_sync[idx].lock ); int idx = dsp_category - 5;
pthread_mutex_lock( &dsp_sync[idx].lock );
memcpy( dsp_parms[idx], (const char *)read_buf, 64 );
updateReverbObj( read_buf ); memcpy( dsp_parms[idx], (const char *)read_buf, 64 );
updateReverbObj( read_buf );
pthread_mutex_unlock( &dsp_sync[idx].lock );
pthread_mutex_unlock( &dsp_sync[idx].lock );
}
break; break;
} }
case 0x0a: case 0x0a:
{ {
// EXP PEDAL // EXP PEDAL
// (No need to guard for MI/II EFX preset here, since they
// do not support pedals)
//
int idx = dsp_category - 5; int idx = dsp_category - 5;
pthread_mutex_lock( &dsp_sync[idx].lock ); pthread_mutex_lock( &dsp_sync[idx].lock );