cwIo.h/cpp : Added midiDeviceAllNotesOff().
This commit is contained in:
parent
58e545d58c
commit
fac5b2b31a
24
cwIo.cpp
24
cwIo.cpp
@ -2883,6 +2883,30 @@ cw::rc_t cw::io::midiDeviceSend( handle_t h, unsigned devIdx, unsigned portIdx,
|
|||||||
return midi::device::send( p->midiH, devIdx, portIdx, status, d0, d1 );
|
return midi::device::send( p->midiH, devIdx, portIdx, status, d0, d1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cw::rc_t cw::io::midiDeviceAllNotesOff( handle_t h, unsigned devIdx, unsigned portIdx )
|
||||||
|
{
|
||||||
|
rc_t rc = kOkRC;
|
||||||
|
unsigned devN = midiDeviceCount(h);
|
||||||
|
for(unsigned i=0; i<devN; ++i)
|
||||||
|
if( devIdx==kInvalidIdx || devIdx==i )
|
||||||
|
{
|
||||||
|
unsigned portN = midiDevicePortCount(h,i,false);
|
||||||
|
for(unsigned j=0; j<portN; ++j)
|
||||||
|
if( portIdx==kInvalidIdx || portIdx==j )
|
||||||
|
{
|
||||||
|
rc_t rc0;
|
||||||
|
if((rc0 = midiDeviceSend(h,i,j,midi::kCtlMdId,121,0)) != kOkRC) // reset all controllers
|
||||||
|
rc = cwLogError(rc0,"Send reset all controllers failed on %i:%i.",i,j);
|
||||||
|
|
||||||
|
if((rc0 = midiDeviceSend(h,i,j,midi::kCtlMdId,123,0)) != kOkRC) // all notes off
|
||||||
|
rc = cwLogError(rc0,"Send all-notes-off failed on %i:%i.",i,j);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned cw::io::midiDeviceMaxBufferMsgCount( handle_t h )
|
unsigned cw::io::midiDeviceMaxBufferMsgCount( handle_t h )
|
||||||
{
|
{
|
||||||
io_t* p = _handleToPtr(h);
|
io_t* p = _handleToPtr(h);
|
||||||
|
1
cwIo.h
1
cwIo.h
@ -235,6 +235,7 @@ namespace cw
|
|||||||
const char* midiDevicePortName( handle_t h, unsigned devIdx, bool inputFl, unsigned portIdx );
|
const char* midiDevicePortName( handle_t h, unsigned devIdx, bool inputFl, unsigned portIdx );
|
||||||
unsigned midiDevicePortIndex( handle_t h, unsigned devIdx, bool inputFl, const char* portName );
|
unsigned midiDevicePortIndex( handle_t h, unsigned devIdx, bool inputFl, const char* portName );
|
||||||
rc_t midiDeviceSend( handle_t h, unsigned devIdx, unsigned portIdx, uint8_t status, uint8_t d0, uint8_t d1 );
|
rc_t midiDeviceSend( handle_t h, unsigned devIdx, unsigned portIdx, uint8_t status, uint8_t d0, uint8_t d1 );
|
||||||
|
rc_t midiDeviceAllNotesOff( handle_t h, unsigned devIdx=kInvalidIdx, unsigned portIdx=kInvalidIdx );
|
||||||
|
|
||||||
unsigned midiDeviceMaxBufferMsgCount( handle_t h );
|
unsigned midiDeviceMaxBufferMsgCount( handle_t h );
|
||||||
const midi::ch_msg_t* midiDeviceBuffer( handle_t h, unsigned& msgCntRef );
|
const midi::ch_msg_t* midiDeviceBuffer( handle_t h, unsigned& msgCntRef );
|
||||||
|
Loading…
Reference in New Issue
Block a user