namespace Msp {
namespace AL {
+SoundScape::SoundScape():
+ gain(1)
+{ }
+
SoundScape::~SoundScape()
{
for(list<Source *>::iterator i=sources.begin(); i!=sources.end(); ++i)
delete *i;
}
+void SoundScape::set_gain(float g)
+{
+ gain = g;
+ for(list<Source *>::iterator i=sources.begin(); i!=sources.end(); ++i)
+ (*i)->set_gain(gain);
+}
+
void SoundScape::add_source(Source &src)
{
sources.push_back(&src);
add_source(*src);
src->set_buffer(buf);
src->set_position(x, y, z);
+ src->set_gain(gain);
src->play();
return *src;
}
class SoundScape
{
private:
+ float gain;
std::list<Source *> sources;
public:
+ SoundScape();
~SoundScape();
+ void set_gain(float);
void add_source(Source &);
Source &play(const Buffer &, float, float, float);
void tick();