Ver código fonte

cmDspPgm.c Added _cmDspSysPgm_AvailCh() testing function.

master
kevin 12 anos atrás
pai
commit
6122fff8c9
1 arquivos alterados com 36 adições e 0 exclusões
  1. 36
    0
      dsp/cmDspPgm.c

+ 36
- 0
dsp/cmDspPgm.c Ver arquivo

@@ -2311,6 +2311,41 @@ cmDspRC_t _cmDspSysPgm_SegLine( cmDspSysH_t h, void** userPtrPtr )
2311 2311
  errLabel:
2312 2312
   return rc;
2313 2313
 }
2314
+
2315
+cmDspRC_t _cmDspSysPgm_AvailCh( cmDspSysH_t h, void** userPtrPtr )
2316
+{
2317
+  double   frqHz       = 440.0;
2318
+  unsigned xfadeChCnt  = 2;
2319
+  double   xfadeMs     = 250.0;
2320
+  bool     xfadeInitFl = false;
2321
+
2322
+  const char*  fn    = "/home/kevin/media/audio/20110723-Kriesberg/Audio Files/Piano 3_01.wav";
2323
+  
2324
+  cmDspInst_t* chk   = cmDspSysAllocInst(h,"Button", "Next",  2, kCheckDuiId, 0.0 );
2325
+
2326
+  
2327
+  cmDspInst_t* sphp  =  cmDspSysAllocInst( h, "Phasor",    NULL,   2, cmDspSysSampleRate(h), frqHz );
2328
+  cmDspInst_t* swtp  =  cmDspSysAllocInst( h, "WaveTable", NULL,   2, ((int)cmDspSysSampleRate(h)), 4);
2329
+  cmDspInst_t* fphp  =  cmDspSysAllocInst( h, "Phasor",    NULL,   1, cmDspSysSampleRate(h) );
2330
+  cmDspInst_t* fwtp  =  cmDspSysAllocInst( h, "WaveTable", NULL,   5, ((int)cmDspSysSampleRate(h)), 1, fn, -1, 7000000 );
2331
+  cmDspInst_t* fad0  =  cmDspSysAllocInst( h, "Xfader",    NULL,   3, xfadeChCnt,  xfadeMs, xfadeInitFl ); 
2332
+  cmDspInst_t* fad1  =  cmDspSysAllocInst( h, "Xfader",    NULL,   3, xfadeChCnt,  xfadeMs, xfadeInitFl );
2333
+
2334
+  cmDspInst_t* ao0p = cmDspSysAllocInst(h,"AudioOut",  NULL,   1, 0 );
2335
+  cmDspInst_t* ao1p = cmDspSysAllocInst(h,"AudioOut",  NULL,   1, 1 );
2336
+    
2337
+
2338
+  cmDspSysConnectAudio(h, sphp, "out", swtp, "phs" );
2339
+  cmDspSysConnectAudio(h, swtp, "out", fad0, "in" ); 
2340
+  cmDspSysConnectAudio(h, fad0, "out", ao0p, "in" );
2341
+  cmDspSysConnectAudio(h, fphp, "out", fwtp, "phs" );
2342
+  cmDspSysConnectAudio(h, fwtp, "out", fad1, "in" ); 
2343
+  cmDspSysConnectAudio(h, fad1, "out", ao1p, "in" ); 
2344
+
2345
+  return kOkDspRC;
2346
+
2347
+}
2348
+
2314 2349
 _cmDspSysPgm_t _cmDspSysPgmArray[] = 
2315 2350
 {
2316 2351
   { "time_line",     _cmDspSysPgm_TimeLine,     NULL, NULL },
@@ -2351,6 +2386,7 @@ _cmDspSysPgm_t _cmDspSysPgmArray[] =
2351 2386
   { "comb filt",   _cmDspSysPgm_CombFilt,       NULL, NULL },
2352 2387
   { "scalar op",   _cmDspSysPgm_ScalarOp,       NULL, NULL },
2353 2388
   { "seg_line",    _cmDspSysPgm_SegLine,        NULL, NULL },
2389
+  { "avail_ch",    _cmDspSysPgm_AvailCh,        NULL, NULL },
2354 2390
   { NULL , NULL, NULL, NULL }
2355 2391
 };
2356 2392
 

Carregando…
Cancelar
Salvar