cwMidiDeviceTest.cpp,cwMidiFileDev.cpp,cwMidiParser.cpp : Updates to account for change of MIDI callback signature in cwMidiDecls.h.

This commit is contained in:
kevin 2024-04-06 16:04:42 -04:00
parent 3526b2c807
commit 374d3ad8a8
3 changed files with 16 additions and 8 deletions

View File

@ -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 )

View File

@ -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 );
}
}

View File

@ -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);
// fill the buffer msg
msgPtr->timeStamp = *timeStamp;
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->uid = kInvalidId;
switch( p->dataCnt )