cwIoMidiRecordPlay.h/cpp :Added send_midi_msg().

This commit is contained in:
kevin 2022-10-26 08:47:54 -04:00
parent 4b65621c68
commit d8e4109baf
2 changed files with 16 additions and 0 deletions

View File

@ -382,6 +382,7 @@ namespace cw
return rc;
}
rc_t _transmit_msg( midi_record_play_t* p, const am_midi_msg_t* am, bool log_fl=true )
{
return _event_callback( p, am->id, am->timestamp, am->loc, am->ch, am->status, am->d0, am->d1, log_fl );
@ -1408,6 +1409,20 @@ void cw::midi_record_play::enable_device( handle_t h, unsigned devIdx, bool enab
}
}
cw::rc_t cw::midi_record_play::send_midi_msg( handle_t h, unsigned devIdx, uint8_t ch, uint8_t status, uint8_t d0, uint8_t d1 )
{
midi_record_play_t* p = _handleToPtr(h);
if( devIdx >= p->midiDevN )
return cwLogError(kInvalidArgRC,"The MIDI record-play device index '%i' is invalid.",devIdx );
if( p->midiDevA[devIdx].enableFl )
io::midiDeviceSend( p->ioH, p->midiDevA[devIdx].midiOutDevIdx, p->midiDevA[devIdx].midiOutPortIdx, status + ch, d0, d1 );
return kOkRC;
}
void cw::midi_record_play::half_pedal_params( handle_t h, unsigned noteDelayMs, unsigned pitch, unsigned vel, unsigned pedal_vel, unsigned noteDurMs, unsigned downDelayMs )
{
midi_record_play_t* p = _handleToPtr(h);

View File

@ -63,6 +63,7 @@ namespace cw
unsigned device_count( handle_t h );
bool is_device_enabled( handle_t h, unsigned devIdx );
void enable_device( handle_t h, unsigned devIdx, bool enableFl );
rc_t send_midi_msg( handle_t h, unsigned devIdx, uint8_t ch, uint8_t status, uint8_t d0, uint8_t d1 );
void half_pedal_params( handle_t h, unsigned noteDelayMs, unsigned pitch, unsigned vel, unsigned pedal_vel, unsigned noteDurMs, unsigned downDelayMs );