artsmixer.cpp
/* [<][>][^][v][top][bottom][index][help] */
FUNCTIONS
This source file includes following functions.
- Createmixer
- open
- Mix
- 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();
}