Browse Source

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

master
kevin 11 years ago
parent
commit
bdfc4f6c8d
2 changed files with 13 additions and 15 deletions
  1. 12
    14
      cmRtSys.c
  2. 1
    1
      cmRtSys.h

+ 12
- 14
cmRtSys.c View File

@@ -41,7 +41,7 @@ typedef struct
41 41
   cmThreadH_t      threadH;     // audio system thread
42 42
   cmTsMp1cH_t      htdQueueH;   // host-to-dsp thread safe msg queue
43 43
   cmThreadMutexH_t engMutexH;   // thread mutex and condition variable
44
-  cmUdpNetH_t      netH;
44
+  cmUdpH_t         udpH;
45 45
   bool             runFl;       // false during finalization otherwise true
46 46
   bool             statusFl;    // true if regular status notifications should be sent
47 47
   bool             syncInputFl;
@@ -296,7 +296,7 @@ void _cmRtDspExecCallback( _cmRtCfg_t* cp )
296 296
     if( cp->statusFl )
297 297
       _cmRtSendStateStatusToHost(cp);
298 298
   }
299
-
299
+  
300 300
 }
301 301
 
302 302
 // Returns true if audio buffer is has waiting incoming samples and
@@ -377,29 +377,27 @@ bool _cmRtThreadCallback(void* arg)
377 377
     }
378 378
 
379 379
     // be sure we are still enabled and the buffer is still ready
380
-    if( 1 /*cp->runFl*/ )
380
+    while( cp->runFl && _cmRtBufIsReady(cp) )
381 381
     {
382
-      while( cp->runFl && _cmRtBufIsReady(cp) )
383
-      {
384
-        ++cp->status.audioCbCnt;
382
+      ++cp->status.audioCbCnt;
385 383
         
386
-        // calling this function results in callbacks to cmAudDsp.c:_cmAdUdpNetCallback()
387
-        // which in turn calls cmRtSysDeliverMsg() which queues any incoming messages
388
-        // which are then transferred to the DSP processes by the the call to 
384
+      // calling this function results in callbacks to _gtNetRecv()
385
+      // which in turn calls cmRtSysDeliverMsg() which queues any incoming messages
386
+      // which are then transferred to the DSP processes by the the call to 
389 387
         // _cmRtDeliverMsgWithLock() below.
390
-        cmUdpNetReceive(cp->netH,NULL);
388
+      if( cp->cbEnableFl )
389
+        cmUdpGetAvailData(cp->udpH,NULL,NULL,NULL);
391 390
     
392
-        // if there are msgs waiting to be sent to the DSP process send them. 
391
+      // if there are msgs waiting to be sent to the DSP process send them. 
393 392
         if( cp->cbEnableFl )
394 393
           if( cmTsMp1cMsgWaiting(cp->htdQueueH) )
395 394
             _cmRtDeliverMsgsWithLock(cp); 
396 395
 
397 396
         // make the cmRtSys callback
398 397
         _cmRtDspExecCallback( cp ); 
399
-
398
+        
400 399
         // update the signal time
401 400
         cp->ctx.begSmpIdx += cp->ss.args.dspFramesPerCycle;
402
-      }
403 401
     }
404 402
    
405 403
   } 
@@ -852,7 +850,7 @@ cmRtRC_t cmRtSysInitialize( cmRtSysH_t h, const cmRtSysCfg_t* cfg )
852 850
     cp->status.oMeterCnt = cp->ctx.oChCnt;
853 851
     cp->iMeterArray      = cmMemAllocZ( double, cp->status.iMeterCnt );
854 852
     cp->oMeterArray      = cmMemAllocZ( double, cp->status.oMeterCnt );
855
-    cp->netH             = cfg->netH;
853
+    cp->udpH             = cfg->udpH;
856 854
 
857 855
     // create the audio System thread
858 856
     if((rc = cmThreadCreate( &cp->threadH, _cmRtThreadCallback, cp, ss->args.rpt )) != kOkThRC )

+ 1
- 1
cmRtSys.h View File

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

Loading…
Cancel
Save