cwIoMidiRecordPlay.cpp : Added 'quiet_flag' to turn off logging of out of range pedal velocites.

This commit is contained in:
kevin 2022-10-01 18:51:30 -04:00
parent c0ab1ba53f
commit 4f96ac3131

View File

@ -281,7 +281,7 @@ namespace cw
rc_t _event_callback( midi_record_play_t* p, unsigned id, const time::spec_t timestamp, unsigned loc, uint8_t ch, uint8_t status, uint8_t d0, uint8_t d1, bool log_fl=true ) rc_t _event_callback( midi_record_play_t* p, unsigned id, const time::spec_t timestamp, unsigned loc, uint8_t ch, uint8_t status, uint8_t d0, uint8_t d1, bool log_fl=true )
{ {
rc_t rc = kOkRC; rc_t rc = kOkRC;
bool quiet_flag = true;
// if we have arrived at the stop time // if we have arrived at the stop time
bool after_stop_time_fl = !time::isZero(p->end_play_event_timestamp) && time::isGT(timestamp,p->end_play_event_timestamp); bool after_stop_time_fl = !time::isZero(p->end_play_event_timestamp) && time::isGT(timestamp,p->end_play_event_timestamp);
bool after_all_off_fl = after_stop_time_fl && time::isGT(timestamp,p->all_off_timestamp); bool after_all_off_fl = after_stop_time_fl && time::isGT(timestamp,p->all_off_timestamp);
@ -332,9 +332,12 @@ namespace cw
if( d1 == p->midiDevA[i].pedalDownHalfVelId ) if( d1 == p->midiDevA[i].pedalDownHalfVelId )
out_d1 = p->midiDevA[i].pedalDownHalfVel; out_d1 = p->midiDevA[i].pedalDownHalfVel;
else else
{
if(!quiet_flag)
cwLogError(kInvalidIdRC,"Unexpected pedal down velocity (%i) during pedal velocity mapping.",d1); cwLogError(kInvalidIdRC,"Unexpected pedal down velocity (%i) during pedal velocity mapping.",d1);
} }
} }
}
if( !supress_fl ) if( !supress_fl )
io::midiDeviceSend( p->ioH, p->midiDevA[i].midiOutDevIdx, p->midiDevA[i].midiOutPortIdx, status + ch, d0, out_d1 ); io::midiDeviceSend( p->ioH, p->midiDevA[i].midiOutDevIdx, p->midiDevA[i].midiOutPortIdx, status + ch, d0, out_d1 );