From d01fdca576f0f63b4dee37d7abde65a66ff17d2a Mon Sep 17 00:00:00 2001 From: Kevin Larke Date: Wed, 25 Feb 2015 10:38:27 -0800 Subject: [PATCH] cmDspKr.h/c, cmDspBuildIn.c : Added initial framework for cmTakeSeqBldr DSP object. --- dsp/cmDspBuiltIn.c | 1 + dsp/cmDspKr.c | 92 ++++++++++++++++++++++++++++++++++++++++++++++ dsp/cmDspKr.h | 1 + 3 files changed, 94 insertions(+) diff --git a/dsp/cmDspBuiltIn.c b/dsp/cmDspBuiltIn.c index f1128ae..d1c375a 100644 --- a/dsp/cmDspBuiltIn.c +++ b/dsp/cmDspBuiltIn.c @@ -5612,6 +5612,7 @@ cmDspClassConsFunc_t _cmDspClassBuiltInArray[] = cmRecdPlayClassCons, cmGoertzelClassCons, cmSyncRecdClassCons, + cmTakeSeqBldrClassCons, NULL, }; diff --git a/dsp/cmDspKr.c b/dsp/cmDspKr.c index 3c3d9de..887de27 100644 --- a/dsp/cmDspKr.c +++ b/dsp/cmDspKr.c @@ -43,6 +43,7 @@ #include "cmProc4.h" #include "cmProc5.h" #include "cmSyncRecd.h" +#include "cmTakeSeqBldr.h" enum { @@ -3232,3 +3233,94 @@ struct cmDspClass_str* cmSyncRecdClassCons( cmDspCtx_t* ctx ) return &_cmSyncRecdDC; } + + +//========================================================================================================================================== +enum +{ + kFnTbsId, +}; + +cmDspClass_t _cmTakeSeqBldrDC; + +typedef struct +{ + cmDspInst_t inst; + cmTakeSeqBldrH_t h; +} cmDspTakeSeqBldr_t; + + +cmDspInst_t* _cmDspTakeSeqBldrAlloc(cmDspCtx_t* ctx, cmDspClass_t* classPtr, unsigned storeSymId, unsigned instSymId, unsigned id, unsigned va_cnt, va_list vl ) +{ + cmDspTakeSeqBldr_t* p = cmDspInstAllocV(cmDspTakeSeqBldr_t,ctx,classPtr,instSymId,id,storeSymId,va_cnt,vl, + 1, "fn", kFnScId, 0, 0, kInDsvFl | kStrzDsvFl | kReqArgDsvFl, "Score Tracking file.", + 0 ); + + if( cmTakeSeqBldrAlloc(ctx->cmCtx, &p->h ) != kOkTsbRC ) + cmErrMsg(&p->inst.classPtr->err, kSubSysFailDspRC, "Allocate TaskSeqBldr object."); + else + { + cmDspUiTakeSeqBldrCreate(ctx,&p->inst,kFnTbsId); + } + + return &p->inst; +} + +cmDspRC_t _cmDspTakeSeqBldrSetup( cmDspCtx_t* ctx, cmDspInst_t* inst ) +{ + cmDspRC_t rc = kOkDspRC; + cmDspTakeSeqBldr_t* p = (cmDspTakeSeqBldr_t*)inst; + + if( cmTakeSeqBldrInitialize(p->h, cmDspStrcz(inst,kFnTbsId) ) != kOkTsbRC ) + rc = cmErrMsg(&inst->classPtr->err, kSubSysFailDspRC, "Unable to initialize the internal TakeSeqBldr object with %s.",cmStringNullGuard(cmDspStrcz(inst,kFnTbsId))); + + return rc; +} + +cmDspRC_t _cmDspTakeSeqBldrFree(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t* evt ) +{ + cmDspRC_t rc = kOkDspRC; + cmDspTakeSeqBldr_t* p = (cmDspTakeSeqBldr_t*)inst; + + cmTakeSeqBldrFree(&p->h); + + return rc; +} + +cmDspRC_t _cmDspTakeSeqBldrReset(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t* evt ) +{ + //cmDspTakeSeqBldr_t* p = (cmDspTakeSeqBldr_t*)inst; + + cmDspApplyAllDefaults(ctx,inst); + + return _cmDspTakeSeqBldrSetup(ctx, inst ); +} + +cmDspRC_t _cmDspTakeSeqBldrExec(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t* evt ) +{ + cmDspRC_t rc = kOkDspRC; + return rc; +} + +cmDspRC_t _cmDspTakeSeqBldrRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t* evt ) +{ + //cmDspTakeSeqBldr_t* p = (cmDspTakeSeqBldr_t*)inst; + return kOkDspRC; +} + +struct cmDspClass_str* cmTakeSeqBldrClassCons( cmDspCtx_t* ctx ) +{ + cmDspClassSetup(&_cmTakeSeqBldrDC,ctx,"TakeSeqBldr", + NULL, + _cmDspTakeSeqBldrAlloc, + _cmDspTakeSeqBldrFree, + _cmDspTakeSeqBldrReset, + _cmDspTakeSeqBldrExec, + _cmDspTakeSeqBldrRecv, + NULL, + NULL, + "TakeSeqBldr"); + + return &_cmTakeSeqBldrDC; +} + diff --git a/dsp/cmDspKr.h b/dsp/cmDspKr.h index 247ee28..ffe7569 100644 --- a/dsp/cmDspKr.h +++ b/dsp/cmDspKr.h @@ -19,6 +19,7 @@ extern "C" { struct cmDspClass_str* cmRecdPlayClassCons( cmDspCtx_t* ctx ); struct cmDspClass_str* cmGoertzelClassCons( cmDspCtx_t* ctx ); struct cmDspClass_str* cmSyncRecdClassCons( cmDspCtx_t* ctx ); + struct cmDspClass_str* cmTakeSeqBldrClassCons( cmDspCtx_t* ctx ); #ifdef __cplusplus }