Browse Source

cmDspPgm.c : Added _cmDspSysPgm_SyncRecd to test the cmDspSyncRecd.

master
kevin 11 years ago
parent
commit
e2a2295be6
1 changed files with 46 additions and 1 deletions
  1. 46
    1
      dsp/cmDspPgm.c

+ 46
- 1
dsp/cmDspPgm.c View File

16
 #include "cmThread.h"
16
 #include "cmThread.h"
17
 #include "cmUdpPort.h"
17
 #include "cmUdpPort.h"
18
 #include "cmUdpNet.h"
18
 #include "cmUdpNet.h"
19
+#include "cmTime.h"
19
 #include "cmAudioSys.h"
20
 #include "cmAudioSys.h"
20
 #include "cmProcObj.h"
21
 #include "cmProcObj.h"
21
 #include "cmDspCtx.h"
22
 #include "cmDspCtx.h"
25
 #include "cmDspPgmPP.h"
26
 #include "cmDspPgmPP.h"
26
 #include "cmDspPgmKr.h"
27
 #include "cmDspPgmKr.h"
27
 
28
 
29
+cmDspRC_t _cmDspSysPgm_SyncRecd(  cmDspSysH_t h, void** userPtrPtr )
30
+{
31
+  cmDspRC_t rc = kOkDspRC;
32
+  unsigned audioFileBits = 24;
33
+  
34
+  cmDspInst_t* ai0p   = cmDspSysAllocInst(h,"AudioIn", NULL,   1, 0 );
35
+  cmDspInst_t* ai1p   = cmDspSysAllocInst(h,"AudioIn", NULL,   1, 1 );
36
+  cmDspInst_t* mip    = cmDspSysAllocInst(h,"MidiIn",  NULL,   0 );
37
+  cmDspInst_t* srp    = cmDspSysAllocInst(h,"SyncRecd",NULL,   3, "/home/kevin/temp/kr/sr","sr","audio",audioFileBits);
38
+  cmDspInst_t* am0p   = cmDspSysAllocInst(h,"AMeter",  "Left", 0);
39
+  cmDspInst_t* am1p   = cmDspSysAllocInst(h,"AMeter",  "Right",0);
40
+  cmDspInst_t* ao0p   = cmDspSysAllocInst(h,"AudioOut", NULL,  1, 0 );
41
+  cmDspInst_t* ao1p   = cmDspSysAllocInst(h,"AudioOut", NULL,  1, 1 );
42
+
43
+  cmDspInst_t* chk    = cmDspSysAllocInst(h,"Checkbox","recd", 5, "Recd","open","close", 1.0, 0.0);
44
+  cmDspInst_t* gain0 = cmDspSysAllocInst(h,"Scalar", "In Gain-0",    5, kNumberDuiId, 0.0,   10.0,0.01,   1.0 );  
45
+  cmDspInst_t* gain1 = cmDspSysAllocInst(h,"Scalar", "In Gain-1",    5, kNumberDuiId, 0.0,   10.0,0.01,   1.0 );  
46
+
47
+  
48
+  // check for allocation errors
49
+  if((rc = cmDspSysLastRC(h)) != kOkDspRC )
50
+    goto errLabel;
51
+
52
+  cmDspSysInstallCb(h, mip,   "status", srp, "status", NULL);
53
+  cmDspSysInstallCb(h, mip,   "d0",     srp, "d0",     NULL);
54
+  cmDspSysInstallCb(h, mip,   "d1",     srp, "d1",     NULL);
55
+  cmDspSysInstallCb(h, mip,   "sec",    srp, "sec",    NULL);
56
+  cmDspSysInstallCb(h, mip,   "nsec",   srp, "nsec",   NULL);
57
+  cmDspSysInstallCb(h, chk,   "sym",    srp, "cmd",    NULL);
58
+  cmDspSysInstallCb(h, gain0, "val",   ai0p, "gain",   NULL);
59
+  cmDspSysInstallCb(h, gain1, "val",   ai1p, "gain",   NULL);
60
+
61
+  cmDspSysConnectAudio(h, ai0p, "out", srp,  "ain-0");
62
+  cmDspSysConnectAudio(h, ai1p, "out", srp,  "ain-1");
63
+  cmDspSysConnectAudio(h, ai0p, "out", am0p, "in");
64
+  cmDspSysConnectAudio(h, ai1p, "out", am1p, "in");
65
+  cmDspSysConnectAudio(h, ai0p, "out", ao0p, "in");
66
+  cmDspSysConnectAudio(h, ai1p, "out", ao1p, "in");
67
+
68
+ errLabel:
69
+  return rc;
70
+
71
+}
72
+
28
 cmDspRC_t _cmDspSysPgm_Test_Midi( cmDspSysH_t h, void** userPtrPtr )
73
 cmDspRC_t _cmDspSysPgm_Test_Midi( cmDspSysH_t h, void** userPtrPtr )
29
 {
74
 {
30
   cmDspRC_t rc = kOkDspRC;
75
   cmDspRC_t rc = kOkDspRC;
203
   cmDspInst_t* ao1p = cmDspSysAllocInst(h,"AudioOut",  NULL,   1, useBuiltInFl ? 1 : 3 );
248
   cmDspInst_t* ao1p = cmDspSysAllocInst(h,"AudioOut",  NULL,   1, useBuiltInFl ? 1 : 3 );
204
   cmDspInst_t* om0p = cmDspSysAllocInst(h,"AMeter","Out", 0);
249
   cmDspInst_t* om0p = cmDspSysAllocInst(h,"AMeter","Out", 0);
205
   
250
   
206
-  
207
 
251
 
208
   cmDspSysConnectAudio(h, php, "out", wtp,  "phs" );  // phasor -> wave table
252
   cmDspSysConnectAudio(h, php, "out", wtp,  "phs" );  // phasor -> wave table
209
   cmDspSysConnectAudio(h, wtp, "out", ao0p, "in" );   // wave table -> audio out
253
   cmDspSysConnectAudio(h, wtp, "out", ao0p, "in" );   // wave table -> audio out
2543
   { "pickup tails", _cmDspSysPgm_NoiseTails,    NULL, NULL },
2587
   { "pickup tails", _cmDspSysPgm_NoiseTails,    NULL, NULL },
2544
   { "tails_2",      _cmDspSysPgm_NoiseTails2,   NULL, NULL },
2588
   { "tails_2",      _cmDspSysPgm_NoiseTails2,   NULL, NULL },
2545
   { "pickups",     _cmDspSysPgm_Pickups0,       NULL, NULL },
2589
   { "pickups",     _cmDspSysPgm_Pickups0,       NULL, NULL },
2590
+  { "sync_recd",   _cmDspSysPgm_SyncRecd,       NULL, NULL },
2546
   { "midi_test",   _cmDspSysPgm_Test_Midi,      NULL, NULL },
2591
   { "midi_test",   _cmDspSysPgm_Test_Midi,      NULL, NULL },
2547
   { "2_thru",      _cmDspSysPgm_Stereo_Through, NULL, NULL },
2592
   { "2_thru",      _cmDspSysPgm_Stereo_Through, NULL, NULL },
2548
   { "guitar",      _cmDspSysPgmGuitar,          NULL, NULL },
2593
   { "guitar",      _cmDspSysPgmGuitar,          NULL, NULL },

Loading…
Cancel
Save