Browse Source

cmDspKr.h/c, cmDspBuildIn.c : Added initial framework for cmTakeSeqBldr DSP object.

master
Kevin Larke 9 years ago
parent
commit
d01fdca576
3 changed files with 94 additions and 0 deletions
  1. 1
    0
      dsp/cmDspBuiltIn.c
  2. 92
    0
      dsp/cmDspKr.c
  3. 1
    0
      dsp/cmDspKr.h

+ 1
- 0
dsp/cmDspBuiltIn.c View File

@@ -5612,6 +5612,7 @@ cmDspClassConsFunc_t _cmDspClassBuiltInArray[] =
5612 5612
   cmRecdPlayClassCons,
5613 5613
   cmGoertzelClassCons,
5614 5614
   cmSyncRecdClassCons,
5615
+  cmTakeSeqBldrClassCons,
5615 5616
   NULL,
5616 5617
 };
5617 5618
 

+ 92
- 0
dsp/cmDspKr.c View File

@@ -43,6 +43,7 @@
43 43
 #include "cmProc4.h"
44 44
 #include "cmProc5.h"
45 45
 #include "cmSyncRecd.h"
46
+#include "cmTakeSeqBldr.h"
46 47
 
47 48
 enum
48 49
 {
@@ -3232,3 +3233,94 @@ struct cmDspClass_str* cmSyncRecdClassCons( cmDspCtx_t* ctx )
3232 3233
 
3233 3234
   return &_cmSyncRecdDC;
3234 3235
 }
3236
+
3237
+
3238
+//==========================================================================================================================================
3239
+enum
3240
+{
3241
+  kFnTbsId,
3242
+};
3243
+
3244
+cmDspClass_t _cmTakeSeqBldrDC;
3245
+
3246
+typedef struct
3247
+{
3248
+  cmDspInst_t      inst;
3249
+  cmTakeSeqBldrH_t h;
3250
+} cmDspTakeSeqBldr_t;
3251
+
3252
+
3253
+cmDspInst_t*  _cmDspTakeSeqBldrAlloc(cmDspCtx_t* ctx, cmDspClass_t* classPtr, unsigned storeSymId, unsigned instSymId, unsigned id, unsigned va_cnt, va_list vl )
3254
+{
3255
+  cmDspTakeSeqBldr_t* p = cmDspInstAllocV(cmDspTakeSeqBldr_t,ctx,classPtr,instSymId,id,storeSymId,va_cnt,vl,
3256
+    1,       "fn",  kFnScId,     0, 0, kInDsvFl  | kStrzDsvFl | kReqArgDsvFl, "Score Tracking file.",
3257
+    0 );
3258
+
3259
+  if( cmTakeSeqBldrAlloc(ctx->cmCtx, &p->h ) != kOkTsbRC )
3260
+    cmErrMsg(&p->inst.classPtr->err, kSubSysFailDspRC, "Allocate TaskSeqBldr object.");
3261
+  else
3262
+  {
3263
+    cmDspUiTakeSeqBldrCreate(ctx,&p->inst,kFnTbsId);
3264
+  }
3265
+
3266
+  return &p->inst;
3267
+}
3268
+
3269
+cmDspRC_t _cmDspTakeSeqBldrSetup( cmDspCtx_t* ctx, cmDspInst_t* inst )
3270
+{
3271
+  cmDspRC_t           rc = kOkDspRC;
3272
+  cmDspTakeSeqBldr_t* p  = (cmDspTakeSeqBldr_t*)inst;
3273
+  
3274
+  if( cmTakeSeqBldrInitialize(p->h, cmDspStrcz(inst,kFnTbsId) ) != kOkTsbRC )
3275
+    rc = cmErrMsg(&inst->classPtr->err, kSubSysFailDspRC, "Unable to initialize the internal TakeSeqBldr object with %s.",cmStringNullGuard(cmDspStrcz(inst,kFnTbsId)));
3276
+
3277
+  return rc;
3278
+}
3279
+
3280
+cmDspRC_t _cmDspTakeSeqBldrFree(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t* evt )
3281
+{
3282
+  cmDspRC_t           rc = kOkDspRC;
3283
+  cmDspTakeSeqBldr_t* p  = (cmDspTakeSeqBldr_t*)inst;
3284
+
3285
+  cmTakeSeqBldrFree(&p->h);
3286
+
3287
+  return rc;
3288
+}
3289
+
3290
+cmDspRC_t _cmDspTakeSeqBldrReset(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t* evt )
3291
+{
3292
+  //cmDspTakeSeqBldr_t* p = (cmDspTakeSeqBldr_t*)inst;
3293
+
3294
+  cmDspApplyAllDefaults(ctx,inst);
3295
+
3296
+  return _cmDspTakeSeqBldrSetup(ctx, inst );
3297
+} 
3298
+
3299
+cmDspRC_t _cmDspTakeSeqBldrExec(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t* evt )
3300
+{
3301
+  cmDspRC_t rc  = kOkDspRC;
3302
+  return rc;
3303
+}
3304
+
3305
+cmDspRC_t _cmDspTakeSeqBldrRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t* evt )
3306
+{
3307
+  //cmDspTakeSeqBldr_t*  p  = (cmDspTakeSeqBldr_t*)inst;
3308
+  return kOkDspRC;
3309
+}
3310
+
3311
+struct cmDspClass_str* cmTakeSeqBldrClassCons( cmDspCtx_t* ctx )
3312
+{
3313
+  cmDspClassSetup(&_cmTakeSeqBldrDC,ctx,"TakeSeqBldr",
3314
+    NULL,
3315
+    _cmDspTakeSeqBldrAlloc,
3316
+    _cmDspTakeSeqBldrFree,
3317
+    _cmDspTakeSeqBldrReset,
3318
+    _cmDspTakeSeqBldrExec,
3319
+    _cmDspTakeSeqBldrRecv,
3320
+    NULL,
3321
+    NULL,
3322
+    "TakeSeqBldr");
3323
+
3324
+  return &_cmTakeSeqBldrDC;
3325
+}
3326
+

+ 1
- 0
dsp/cmDspKr.h View File

@@ -19,6 +19,7 @@ extern "C" {
19 19
   struct cmDspClass_str* cmRecdPlayClassCons( cmDspCtx_t* ctx );
20 20
   struct cmDspClass_str* cmGoertzelClassCons( cmDspCtx_t* ctx );
21 21
   struct cmDspClass_str* cmSyncRecdClassCons( cmDspCtx_t* ctx );
22
+  struct cmDspClass_str* cmTakeSeqBldrClassCons( cmDspCtx_t* ctx );
22 23
 
23 24
 #ifdef __cplusplus
24 25
 }

Loading…
Cancel
Save