cmRtSys.h/c: Replaced use of cmNetH_t with cmUdpH_t.

This commit is contained in:
kevin 2013-04-10 00:34:34 -07:00
parent 7e6c7965fd
commit bdfc4f6c8d
2 changed files with 13 additions and 15 deletions

View File

@ -41,7 +41,7 @@ typedef struct
cmThreadH_t threadH; // audio system thread cmThreadH_t threadH; // audio system thread
cmTsMp1cH_t htdQueueH; // host-to-dsp thread safe msg queue cmTsMp1cH_t htdQueueH; // host-to-dsp thread safe msg queue
cmThreadMutexH_t engMutexH; // thread mutex and condition variable cmThreadMutexH_t engMutexH; // thread mutex and condition variable
cmUdpNetH_t netH; cmUdpH_t udpH;
bool runFl; // false during finalization otherwise true bool runFl; // false during finalization otherwise true
bool statusFl; // true if regular status notifications should be sent bool statusFl; // true if regular status notifications should be sent
bool syncInputFl; bool syncInputFl;
@ -377,17 +377,16 @@ bool _cmRtThreadCallback(void* arg)
} }
// be sure we are still enabled and the buffer is still ready // be sure we are still enabled and the buffer is still ready
if( 1 /*cp->runFl*/ )
{
while( cp->runFl && _cmRtBufIsReady(cp) ) while( cp->runFl && _cmRtBufIsReady(cp) )
{ {
++cp->status.audioCbCnt; ++cp->status.audioCbCnt;
// calling this function results in callbacks to cmAudDsp.c:_cmAdUdpNetCallback() // calling this function results in callbacks to _gtNetRecv()
// which in turn calls cmRtSysDeliverMsg() which queues any incoming messages // which in turn calls cmRtSysDeliverMsg() which queues any incoming messages
// which are then transferred to the DSP processes by the the call to // which are then transferred to the DSP processes by the the call to
// _cmRtDeliverMsgWithLock() below. // _cmRtDeliverMsgWithLock() below.
cmUdpNetReceive(cp->netH,NULL); if( cp->cbEnableFl )
cmUdpGetAvailData(cp->udpH,NULL,NULL,NULL);
// if there are msgs waiting to be sent to the DSP process send them. // if there are msgs waiting to be sent to the DSP process send them.
if( cp->cbEnableFl ) if( cp->cbEnableFl )
@ -400,7 +399,6 @@ bool _cmRtThreadCallback(void* arg)
// update the signal time // update the signal time
cp->ctx.begSmpIdx += cp->ss.args.dspFramesPerCycle; cp->ctx.begSmpIdx += cp->ss.args.dspFramesPerCycle;
} }
}
} }
@ -852,7 +850,7 @@ cmRtRC_t cmRtSysInitialize( cmRtSysH_t h, const cmRtSysCfg_t* cfg )
cp->status.oMeterCnt = cp->ctx.oChCnt; cp->status.oMeterCnt = cp->ctx.oChCnt;
cp->iMeterArray = cmMemAllocZ( double, cp->status.iMeterCnt ); cp->iMeterArray = cmMemAllocZ( double, cp->status.iMeterCnt );
cp->oMeterArray = cmMemAllocZ( double, cp->status.oMeterCnt ); cp->oMeterArray = cmMemAllocZ( double, cp->status.oMeterCnt );
cp->netH = cfg->netH; cp->udpH = cfg->udpH;
// create the audio System thread // create the audio System thread
if((rc = cmThreadCreate( &cp->threadH, _cmRtThreadCallback, cp, ss->args.rpt )) != kOkThRC ) if((rc = cmThreadCreate( &cp->threadH, _cmRtThreadCallback, cp, ss->args.rpt )) != kOkThRC )

View File

@ -197,7 +197,7 @@ extern "C" {
void* clientCbData; // User arg. for clientCbFunc(). void* clientCbData; // User arg. for clientCbFunc().
cmTsQueueCb_t clientCbFunc; // Called by cmRtSysReceiveMsg() to deliver internally generated msg's to the host. cmTsQueueCb_t clientCbFunc; // Called by cmRtSysReceiveMsg() to deliver internally generated msg's to the host.
// Set to NULL if msg's will be directly returned by buffers passed to cmRtSysReceiveMsg(). // Set to NULL if msg's will be directly returned by buffers passed to cmRtSysReceiveMsg().
cmUdpNetH_t netH; cmUdpH_t udpH;
} cmRtSysCfg_t; } cmRtSysCfg_t;
extern cmRtSysH_t cmRtSysNullHandle; extern cmRtSysH_t cmRtSysNullHandle;