Bläddra i källkod

cmDspPgm.c : Added gain control to 'sine' test pgm.

master
kevin 9 år sedan
förälder
incheckning
cead889078
1 ändrade filer med 4 tillägg och 0 borttagningar
  1. 4
    0
      dsp/cmDspPgm.c

+ 4
- 0
dsp/cmDspPgm.c Visa fil

@@ -334,6 +334,7 @@ cmDspRC_t _cmDspSysPgm_PlaySine( cmDspSysH_t h, void** userPtrPtr )
334 334
   cmDspInst_t* ao1p = cmDspSysAllocInst(h,"AudioOut",  NULL,   1, useBuiltInFl ? 1 : 3 );
335 335
   cmDspInst_t* om0p = cmDspSysAllocInst(h,"AMeter","Out", 0);
336 336
   
337
+  cmDspInst_t* gain= cmDspSysAllocInst( h,"Scalar", "Gain",     5, kNumberDuiId, 0.0,  10.0,  0.01,  0.0);
337 338
 
338 339
   cmDspSysConnectAudio(h, php, "out", wtp,  "phs" );  // phasor -> wave table
339 340
   cmDspSysConnectAudio(h, wtp, "out", ao0p, "in" );   // wave table -> audio out
@@ -341,6 +342,9 @@ cmDspRC_t _cmDspSysPgm_PlaySine( cmDspSysH_t h, void** userPtrPtr )
341 342
   cmDspSysConnectAudio(h, wtp, "out", om0p, "in" );
342 343
 
343 344
   cmDspSysInstallCb( h, chp, "val", ao0p, "ch", NULL);
345
+  cmDspSysInstallCb( h, gain, "val", ao0p, "gain", NULL);
346
+  cmDspSysInstallCb( h, gain, "val", ao1p, "gain", NULL);
347
+  
344 348
   return kOkDspRC;
345 349
 }
346 350
 

Laddar…
Avbryt
Spara