示例#1
0
文件: main.c 项目: pmyadlowsky/qmx
static int mixmaster(jack_nframes_t nframes, void *arg) {
	sample_t *outs[QMX_CHANNELS], *ch;
	size_t n, i;
	if (use_jack && need_init_guile) {
		scm_init_guile();
		need_init_guile = 0;
		}
	for (n = 0; n < QMX_CHANNELS; n++) {
		// zero the mix buffers
		if (use_jack)
			ch = outs[n] = jack_port_get_buffer(jack_cauldron[n], nframes);
		else ch = outs[n] = fixed_cauldron + n * nframes;
		for (i = 0; i < nframes; i++) ch[i] = 0.0;
		}
	// mix from sources
	alsa_mix(nframes, outs);
	audio_files_mix(nframes, outs);
	feeds_mix(nframes, outs);
	if (use_jack) jack_ports_mix(nframes, outs);
	unit_gens_mix(nframes, outs);
	// process mix; e.g. fade
	run_filter(fader, nframes, outs, outs, 0);
	// deliver mix
	buffer_out(nframes, outs);
	record(nframes, outs);
	return 0;
	}
示例#2
0
   int
   mlpipebuf::sync()
   {
#ifdef DEBUG
      char *fname = "mlpipebuf::sync()";
      Tracebuf T(fname);
#endif

      return buffer_out();
   }
示例#3
0
   mlpipebuf::int_type
   mlpipebuf::overflow(int_type c)
   {
#ifdef DEBUG
      char *fname = "mlpipebuf::overflow(int_type c)";
      Tracebuf T(fname);
#endif

      if(buffer_out() < 0)
         return EOF;

      else {
         if(c != EOF)
            return sputc(c);
         else
            return c;
      }
   }