Procházet zdrojové kódy

cmDspPgm.c : Added _cmDspSysPgm_ReflectCalc().

master
kevin před 8 roky
rodič
revize
a23c26f46b
1 změnil soubory, kde provedl 42 přidání a 3 odebrání
  1. 42
    3
      dsp/cmDspPgm.c

+ 42
- 3
dsp/cmDspPgm.c Zobrazit soubor

@@ -26,6 +26,44 @@
26 26
 #include "cmDspPgmPP.h"
27 27
 #include "cmDspPgmKr.h"
28 28
 
29
+
30
+cmDspRC_t _cmDspSysPgm_ReflectCalc( cmDspSysH_t h, void** userPtrPtr )
31
+{
32
+
33
+  // audio inputs
34
+  cmDspInst_t* ai0  = cmDspSysAllocInst(h,"AudioIn", NULL,   1, 0 );
35
+  cmDspInst_t* ai1  = cmDspSysAllocInst(h,"AudioIn", NULL,   1, 1 );
36
+
37
+  // audio outputs
38
+  cmDspInst_t* ao0 = cmDspSysAllocInst(h,"AudioOut",NULL,   1, 0 );
39
+  cmDspInst_t* ao1 = cmDspSysAllocInst(h,"AudioOut",NULL,   1, 1 );
40
+
41
+  // input meters
42
+  cmDspInst_t* im0 = cmDspSysAllocInst(h,"AMeter","In 0",  0);
43
+  cmDspInst_t* im1 = cmDspSysAllocInst(h,"AMeter","In 1",  0);
44
+
45
+  // output meters
46
+  //cmDspInst_t* om0 = cmDspSysAllocInst(h,"AMeter","Out 0", 0);
47
+  //cmDspInst_t* om1 = cmDspSysAllocInst(h,"AMeter","Out 1",0);
48
+
49
+    // gain controls
50
+  cmDspInst_t* igain = cmDspSysAllocInst( h,"Scalar", "In Gain",  5, kNumberDuiId, 0.0,  4.0, 0.01,  1.0);
51
+  cmDspInst_t* ogain = cmDspSysAllocInst( h,"Scalar", "Out Gain", 5, kNumberDuiId, 0.0,  4.0, 0.01,  1.0);
52
+
53
+  cmDspSysConnectAudio(h, ai0, "out", im0, "in");           // ain0 -> imtr0
54
+  cmDspSysConnectAudio(h, ai1, "out", im1, "in");           // ain1 -> imtr1
55
+  
56
+  cmDspSysInstallCb(   h, igain,"val", ai0, "gain", NULL);  // igain -> ain0
57
+  cmDspSysInstallCb(   h, igain,"val", ai1, "gain", NULL);  // igain -> ain0
58
+  
59
+  cmDspSysInstallCb(   h, ogain,"val", ao0, "gain", NULL);  // igain -> ain0
60
+  cmDspSysInstallCb(   h, ogain,"val", ao1, "gain", NULL);  // igain -> ain0
61
+  
62
+  cmDspSysConnectAudio(h, ai0,"out", ao0, "in" );           // ain0  -> aout0 
63
+  cmDspSysConnectAudio(h, ai1,"out", ao1, "in" );           // ain1  -> aout1 
64
+  return kOkDspRC;
65
+}
66
+
29 67
 cmDspRC_t _cmDspSysPgm_SyncRecd(  cmDspSysH_t h, void** userPtrPtr )
30 68
 {
31 69
   cmDspRC_t rc = kOkDspRC;
@@ -2834,7 +2872,7 @@ cmDspRC_t _cmDspSysPgm_BinEnc( cmDspSysH_t h, void** userPtrPtr )
2834 2872
   double maxDurMs = 60000.0;
2835 2873
   double azimBeg  =     0.0;
2836 2874
   double azimEnd  =   360.0;
2837
-  const char* fn1 = "media/audio/sourcetone/Jazz/Ella & Louis - Under A Blanket Of Blue";
2875
+  //const char* fn1 = "media/audio/sourcetone/Jazz/Ella & Louis - Under A Blanket Of Blue";
2838 2876
   const char* fn0 = "temp/comhear/drw/monty.wav";
2839 2877
   
2840 2878
   cmDspInst_t* twod = cmDspSysAllocInst( h, "twod",       NULL, 0);
@@ -2901,8 +2939,7 @@ cmDspRC_t _cmDspSysPgm_BinEnc( cmDspSysH_t h, void** userPtrPtr )
2901 2939
 
2902 2940
 _cmDspSysPgm_t _cmDspSysPgmArray[] = 
2903 2941
 {
2904
-  { "two-d",         _cmDspSysPgm_TwoD,         NULL, NULL },
2905
-  { "bin-enc",       _cmDspSysPgm_BinEnc,       NULL, NULL },
2942
+  { "reflect",       _cmDspSysPgm_ReflectCalc,  NULL, NULL },
2906 2943
   { "tksb",          _cmDspSysPgm_Tksb,         NULL, NULL },
2907 2944
   { "time_line",     _cmDspSysPgm_TimeLine,     NULL, NULL },
2908 2945
   { "seq-bldr",      _cmDspSysPgm_TakeSeqBldr,  NULL, NULL },
@@ -2951,6 +2988,8 @@ _cmDspSysPgm_t _cmDspSysPgmArray[] =
2951 2988
   { "scalar op",   _cmDspSysPgm_ScalarOp,       NULL, NULL },
2952 2989
   { "seg_line",    _cmDspSysPgm_SegLine,        NULL, NULL },
2953 2990
   { "avail_ch",    _cmDspSysPgm_AvailCh,        NULL, NULL },
2991
+  { "two-d",         _cmDspSysPgm_TwoD,         NULL, NULL },
2992
+  { "bin-enc",       _cmDspSysPgm_BinEnc,       NULL, NULL },
2954 2993
   { NULL , NULL, NULL, NULL }
2955 2994
 };
2956 2995
 

Načítá se…
Zrušit
Uložit