artsmixer.cpp

/* [<][>]
[^][v][top][bottom][index][help] */

FUNCTIONS

This source file includes following functions.
  1. Createmixer
  2. open
  3. Mix
  4. close

#include "artsmixer.h"

// -- factory method

mymixer* mymixer_factory::Createmixer()
/* [<][>][^][v][top][bottom][index][help] */
{
  return new artsmixer();
}

int artsmixer::open(int rate)
/* [<][>][^][v][top][bottom][index][help] */
{
  if(arts_init() < 0) return -1;
  stream = arts_play_stream(rate, 16, 2, "artsmixer");
}

void artsmixer::Mix(short* buf, int samples)
/* [<][>][^][v][top][bottom][index][help] */
{
  arts_write(stream, buf, samples * sizeof(short));
}

void artsmixer::close()
/* [<][>][^][v][top][bottom][index][help] */
{
  arts_close_stream(stream);
  arts_free();
}


/* [<][>][^][v][top][bottom][index][help] */