Quellcode durchsuchen

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

master
kevin vor 11 Jahren
Ursprung
Commit
bdfc4f6c8d
2 geänderte Dateien mit 13 neuen und 15 gelöschten Zeilen
  1. 12
    14
      cmRtSys.c
  2. 1
    1
      cmRtSys.h

+ 12
- 14
cmRtSys.c Datei anzeigen

41
   cmThreadH_t      threadH;     // audio system thread
41
   cmThreadH_t      threadH;     // audio system thread
42
   cmTsMp1cH_t      htdQueueH;   // host-to-dsp thread safe msg queue
42
   cmTsMp1cH_t      htdQueueH;   // host-to-dsp thread safe msg queue
43
   cmThreadMutexH_t engMutexH;   // thread mutex and condition variable
43
   cmThreadMutexH_t engMutexH;   // thread mutex and condition variable
44
-  cmUdpNetH_t      netH;
44
+  cmUdpH_t         udpH;
45
   bool             runFl;       // false during finalization otherwise true
45
   bool             runFl;       // false during finalization otherwise true
46
   bool             statusFl;    // true if regular status notifications should be sent
46
   bool             statusFl;    // true if regular status notifications should be sent
47
   bool             syncInputFl;
47
   bool             syncInputFl;
296
     if( cp->statusFl )
296
     if( cp->statusFl )
297
       _cmRtSendStateStatusToHost(cp);
297
       _cmRtSendStateStatusToHost(cp);
298
   }
298
   }
299
-
299
+  
300
 }
300
 }
301
 
301
 
302
 // Returns true if audio buffer is has waiting incoming samples and
302
 // Returns true if audio buffer is has waiting incoming samples and
377
     }
377
     }
378
 
378
 
379
     // be sure we are still enabled and the buffer is still ready
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
         // _cmRtDeliverMsgWithLock() below.
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
         if( cp->cbEnableFl )
392
         if( cp->cbEnableFl )
394
           if( cmTsMp1cMsgWaiting(cp->htdQueueH) )
393
           if( cmTsMp1cMsgWaiting(cp->htdQueueH) )
395
             _cmRtDeliverMsgsWithLock(cp); 
394
             _cmRtDeliverMsgsWithLock(cp); 
396
 
395
 
397
         // make the cmRtSys callback
396
         // make the cmRtSys callback
398
         _cmRtDspExecCallback( cp ); 
397
         _cmRtDspExecCallback( cp ); 
399
-
398
+        
400
         // update the signal time
399
         // update the signal time
401
         cp->ctx.begSmpIdx += cp->ss.args.dspFramesPerCycle;
400
         cp->ctx.begSmpIdx += cp->ss.args.dspFramesPerCycle;
402
-      }
403
     }
401
     }
404
    
402
    
405
   } 
403
   } 
852
     cp->status.oMeterCnt = cp->ctx.oChCnt;
850
     cp->status.oMeterCnt = cp->ctx.oChCnt;
853
     cp->iMeterArray      = cmMemAllocZ( double, cp->status.iMeterCnt );
851
     cp->iMeterArray      = cmMemAllocZ( double, cp->status.iMeterCnt );
854
     cp->oMeterArray      = cmMemAllocZ( double, cp->status.oMeterCnt );
852
     cp->oMeterArray      = cmMemAllocZ( double, cp->status.oMeterCnt );
855
-    cp->netH             = cfg->netH;
853
+    cp->udpH             = cfg->udpH;
856
 
854
 
857
     // create the audio System thread
855
     // create the audio System thread
858
     if((rc = cmThreadCreate( &cp->threadH, _cmRtThreadCallback, cp, ss->args.rpt )) != kOkThRC )
856
     if((rc = cmThreadCreate( &cp->threadH, _cmRtThreadCallback, cp, ss->args.rpt )) != kOkThRC )

+ 1
- 1
cmRtSys.h Datei anzeigen

197
     void*                 clientCbData; // User arg. for clientCbFunc().
197
     void*                 clientCbData; // User arg. for clientCbFunc().
198
     cmTsQueueCb_t         clientCbFunc; // Called by  cmRtSysReceiveMsg() to deliver internally generated msg's to the host. 
198
     cmTsQueueCb_t         clientCbFunc; // Called by  cmRtSysReceiveMsg() to deliver internally generated msg's to the host. 
199
                                         //  Set to NULL if msg's will be directly returned by buffers passed to cmRtSysReceiveMsg().
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
   } cmRtSysCfg_t;
201
   } cmRtSysCfg_t;
202
 
202
 
203
   extern cmRtSysH_t cmRtSysNullHandle;
203
   extern cmRtSysH_t cmRtSysNullHandle;

Laden…
Abbrechen
Speichern