Esempio n. 1
0
static void remember_dynamic_CC_change(void *instp, int chn, int param, int fnid, midiccflags_t flags) {
    struct b_instance * inst = (struct b_instance *) instp;
    struct b_midicfg * m = (struct b_midicfg *) inst->midicfg;
    char rckey[32];
    ConfigContext cfg;
    cfg.fname  = "---dynamic config---";
    cfg.linenr = 0;
    sprintf(rckey, "midi.controller.%s.%d",
            chn == m->rcvChA ? "upper" : (chn == m->rcvChB ? "lower" : "pedals"), param);
    cfg.name = rckey;
    char value[64];
    if (fnid < 0) {
        strcpy(value, "unmap");
    }
    else {
        assert(strlen(ccFuncNames[fnid]) < 63);
        strcpy(value, ccFuncNames[fnid]);
        if (flags & MFLAG_INV) {
            strcat(value, "-");
        }
    }

    cfg.value = value;
    rc_add_cfg(inst->state, &cfg);
}
Esempio n. 2
0
static void remember_dynamic_CC_change(void *instp, int chn, int param, int fnid) {
  struct b_instance * inst = (struct b_instance *) instp;
  struct b_midicfg * m = (struct b_midicfg *) inst->midicfg;
  char rckey[32];
  ConfigContext cfg;
  cfg.fname  = "---dynamic config---";
  cfg.linenr = 0;
  sprintf(rckey, "midi.controller.%s.%d",
      chn == m->rcvChA ? "upper" : (chn == m->rcvChB ? "lower" : "pedals"), param);
  cfg.name = rckey;
  if (fnid < 0)
    cfg.value = "unmap";
  else
    cfg.value = ccFuncNames[fnid];
  rc_add_cfg(inst->state, &cfg);
}
Esempio n. 3
0
/*
 * Each configurable module implements this function. The implementation
 * is idempotent. The most recent call defines the parameter's value.
 */
static int distributeParameter (b_instance* inst, ConfigContext * cfg) {

  int n = 0;

#ifdef CFG_MAIN

  printf ("%s:%d:[%s]=[%s]\n",
	  cfg->fname,
	  cfg->linenr,
	  cfg->name,
 	  cfg->value);

#else

  n += mainConfig (cfg);
  n += midiConfig (inst->midicfg, cfg);
  n += pgmConfig (inst->progs, cfg);
  n += oscConfig (inst->synth, cfg);
  n += scannerConfig (inst->synth, cfg);
  n += ampConfig (inst->preamp, cfg);
  n += whirlConfig (inst->whirl, cfg);
  n += reverbConfig (inst->reverb, cfg);
#ifdef HAVE_ZITACONVOLVE
  n += convolutionConfig(cfg);
#endif

  if (n == 0) {
    fprintf (stderr, "%s:%d:%s=%s:Not claimed by any module.\n",
	    cfg->fname,
	    cfg->linenr,
	    cfg->name,
	    cfg->value);
  } else {
    rc_add_cfg(inst->state, cfg);
  }

#endif /* CFG_MAIN */

  return n;
}