cwMidiDeviceTest.cpp,cwMidiFileDev.cpp,cwMidiParser.cpp : Updates to account for change of MIDI callback signature in cwMidiDecls.h.
This commit is contained in:
parent
3526b2c807
commit
374d3ad8a8
@ -86,7 +86,7 @@ namespace cw
|
||||
return kOkRC;
|
||||
}
|
||||
|
||||
void _test_callback( const packet_t* pktArray, unsigned pktCnt )
|
||||
void _test_callback( void* cbArg, const packet_t* pktArray, unsigned pktCnt )
|
||||
{
|
||||
unsigned i,j;
|
||||
time::spec_t cur_time = time::current_time();
|
||||
@ -95,7 +95,7 @@ namespace cw
|
||||
{
|
||||
const packet_t* p = pktArray + i;
|
||||
|
||||
test_t* t = (test_t*)p->cbArg;
|
||||
test_t* t = (test_t*)cbArg;
|
||||
|
||||
for(j=0; j<p->msgCnt; ++j)
|
||||
if( p->msgArray != NULL )
|
||||
|
@ -428,13 +428,12 @@ namespace cw
|
||||
if( p->cbFunc != nullptr )
|
||||
{
|
||||
packet_t pkt = {};
|
||||
pkt.cbArg = p->cbArg;
|
||||
pkt.devIdx = p->base_dev_idx;
|
||||
pkt.portIdx = file_idx;
|
||||
pkt.msgArray = msgA;
|
||||
pkt.msgCnt = msgN;
|
||||
|
||||
p->cbFunc( &pkt, 1 );
|
||||
p->cbFunc( p->cbArg, &pkt, 1 );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -58,8 +58,8 @@ namespace cw
|
||||
cbRecd_t* c = p->cbChain;
|
||||
for(; c!=NULL; c=c->linkPtr)
|
||||
{
|
||||
pkt->cbArg = c->cbDataPtr;
|
||||
c->cbFunc( pkt, pktCnt );
|
||||
//pkt->cbArg = c->cbDataPtr;
|
||||
c->cbFunc( c->cbDataPtr, pkt, pktCnt );
|
||||
}
|
||||
}
|
||||
|
||||
@ -102,10 +102,19 @@ namespace cw
|
||||
// get a pointer to the next msg in the buffer
|
||||
msg_t* msgPtr = (msg_t*)(p->buf + p->bufIdx);
|
||||
|
||||
if( midi::isChStatus(p->status) )
|
||||
{
|
||||
msgPtr->status = p->status & 0xf0;
|
||||
msgPtr->ch = p->status & 0x0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
msgPtr->status = p->status;
|
||||
msgPtr->ch = 0;
|
||||
}
|
||||
|
||||
// fill the buffer msg
|
||||
msgPtr->timeStamp = *timeStamp;
|
||||
msgPtr->status = p->status & 0xf0;
|
||||
msgPtr->ch = p->status & 0x0f;
|
||||
msgPtr->uid = kInvalidId;
|
||||
|
||||
switch( p->dataCnt )
|
||||
|
Loading…
Reference in New Issue
Block a user