Browse Source

cmDspKr.c : Added 'post' output to cmDspScMod object.

master
kevin 11 years ago
parent
commit
de58bb5232
1 changed files with 10 additions and 3 deletions
  1. 10
    3
      dsp/cmDspKr.c

+ 10
- 3
dsp/cmDspKr.c View File

1158
 {
1158
 {
1159
   kScLocIdxMdId,
1159
   kScLocIdxMdId,
1160
   kResetIdxMdId,
1160
   kResetIdxMdId,
1161
-  kCmdMdId
1161
+  kCmdMdId,
1162
+  kPostMdId
1162
 };
1163
 };
1163
 
1164
 
1164
 cmDspClass_t _cmModulatorDC;
1165
 cmDspClass_t _cmModulatorDC;
1172
   cmChar_t*      modLabel;
1173
   cmChar_t*      modLabel;
1173
   unsigned       onSymId;
1174
   unsigned       onSymId;
1174
   unsigned       offSymId;
1175
   unsigned       offSymId;
1176
+  unsigned       postSymId;
1175
 } cmDspScMod_t;
1177
 } cmDspScMod_t;
1176
 
1178
 
1177
-void _cmDspScModCb( void* arg, unsigned varSymId, double value )
1179
+void _cmDspScModCb( void* arg, unsigned varSymId, double value, bool postFl )
1178
 {
1180
 {
1179
   cmDspScMod_t* p = (cmDspScMod_t*)arg;
1181
   cmDspScMod_t* p = (cmDspScMod_t*)arg;
1180
 
1182
 
1183
     return;
1185
     return;
1184
 
1186
 
1185
   cmDspSetDouble(p->tmp_ctx,&p->inst,varPtr->constId,value);
1187
   cmDspSetDouble(p->tmp_ctx,&p->inst,varPtr->constId,value);
1188
+
1189
+  if( postFl )
1190
+    cmDspSetSymbol(p->tmp_ctx,&p->inst,kPostMdId,p->postSymId);
1186
   
1191
   
1187
 }
1192
 }
1188
 
1193
 
1196
     { "index",   kScLocIdxMdId, 0,0, kInDsvFl  | kUIntDsvFl,  "Score follower index input."},
1201
     { "index",   kScLocIdxMdId, 0,0, kInDsvFl  | kUIntDsvFl,  "Score follower index input."},
1197
     { "reset",   kResetIdxMdId, 0,0, kInDsvFl  | kUIntDsvFl | kOptArgDsvFl, "Reset the modulator and go to the score index."},
1202
     { "reset",   kResetIdxMdId, 0,0, kInDsvFl  | kUIntDsvFl | kOptArgDsvFl, "Reset the modulator and go to the score index."},
1198
     { "cmd",     kCmdMdId,      0,0, kInDsvFl  | kSymDsvFl  | kOptArgDsvFl, "on | off."},
1203
     { "cmd",     kCmdMdId,      0,0, kInDsvFl  | kSymDsvFl  | kOptArgDsvFl, "on | off."},
1204
+    { "post",    kPostMdId,     0,0, kOutDsvFl | kSymDsvFl, "Sends 'post' symbol after a message transmission if the 'post' flag is set in scMod."},
1199
     { NULL, 0, 0, 0, 0 }
1205
     { NULL, 0, 0, 0, 0 }
1200
   };
1206
   };
1201
 
1207
 
1253
   p->mp       = mp;
1259
   p->mp       = mp;
1254
   p->onSymId  = cmSymTblId(ctx->stH,"on");
1260
   p->onSymId  = cmSymTblId(ctx->stH,"on");
1255
   p->offSymId = cmSymTblId(ctx->stH,"off");
1261
   p->offSymId = cmSymTblId(ctx->stH,"off");
1262
+  p->postSymId = cmSymTblRegisterStaticSymbol(ctx->stH,"post");
1256
 
1263
 
1257
   mp->cbArg = p;  // set the modulator callback arg
1264
   mp->cbArg = p;  // set the modulator callback arg
1258
 
1265
 
1819
 
1826
 
1820
           // transmit the records value and cost
1827
           // transmit the records value and cost
1821
           cmDspSetDouble(ctx,inst,varId,r->value);
1828
           cmDspSetDouble(ctx,inst,varId,r->value);
1822
-          cmDspSetDouble(ctx,inst,kCostAmId,r->value);
1829
+          cmDspSetDouble(ctx,inst,kCostAmId,r->cost);
1823
 
1830
 
1824
           prvLoc = r->loc;
1831
           prvLoc = r->loc;
1825
         } 
1832
         } 

Loading…
Cancel
Save