open_common();
}
+void Sound::open_common()
+{
+ delete data;
+ data = 0;
+
+ vorbis_info *info = ov_info(&ovfile, -1);
+ freq = info->rate;
+ switch(info->channels)
+ {
+ case 1: format = MONO16; break;
+ case 2: format = STEREO16; break;
+ default: throw runtime_error("Unsupported number of channels");
+ }
+}
+
void Sound::load_data()
{
if(data)
return data;
}
-void Sound::open_common()
-{
- delete data;
- data = 0;
-
- vorbis_info *info = ov_info(&ovfile, -1);
- freq = info->rate;
- switch(info->channels)
- {
- case 1: format = MONO16; break;
- case 2: format = STEREO16; break;
- default: throw runtime_error("Unsupported number of channels");
- }
-}
-
} // namespace AL
} // namespace Msp
void open_file(const std::string &);
void open_memory(const void *, unsigned);
+private:
+ void open_common();
+public:
void load_data();
void load_file(const std::string &);
void load_memory(const void *, unsigned);
unsigned get_frequency() const { return freq; }
unsigned get_size() const { return size; }
const char *get_data() const;
-private:
- void open_common();
};
} // namespace AL
void set_position(float, float, float);
void set_velocity(float, float, float);
void set_gain(float);
-
void set_rolloff_factor(float);
+
void set_buffer(const Buffer &);
void queue_buffers(const std::vector<const Buffer *> &);
void queue_buffer(const Buffer &);
{
private:
Source &src;
- Sound *snd;
+ Sound *snd;
std::list<Buffer *> buffers;
public: