29#ifndef NOMLIB_AUDIO_AL_DEVICE_CAPS_HPP
30#define NOMLIB_AUDIO_AL_DEVICE_CAPS_HPP
32#include "nomlib/config.hpp"
33#include "nomlib/math/Point3.hpp"
34#include "nomlib/audio/IOAudioEngine.hpp"
37#include "nomlib/audio/AL/SoundSource.hpp"
40struct ALCdevice_struct;
41struct ALCcontext_struct;
53void free_buffer(uint32 buffer_id);
54void free_source(uint32 buffer_id);
65uint32 next_buffer_id();
75uint32* next_buffer_id(uint32 num_buffers);
83uint32 next_source_id();
93uint32* next_source_id(uint32 num_sources);
96class ALAudioEngine:
public IOAudioEngine
100 virtual ~ALAudioEngine();
103 virtual void init(
void* driver)
override;
105 virtual bool valid()
const override;
107 virtual uint32 caps()
const override;
108 virtual void set_cap(uint32 format)
override;
110 virtual bool connected()
const override;
116 virtual bool valid_buffer(
SoundBuffer* target)
override;
117 virtual bool valid_source(
SoundBuffer* target)
override;
119 virtual uint32 state(
SoundBuffer* target)
override;
120 virtual real32 pitch(
SoundBuffer* target)
override;
122 virtual real32 volume()
const override;
123 virtual Point3f position()
const override;
125 virtual real32 volume(
SoundBuffer* target)
const override;
126 virtual real32 min_volume(
SoundBuffer* target)
override;
127 virtual real32 max_volume(
SoundBuffer* target)
override;
129 virtual Point3f velocity(
SoundBuffer* target)
override;
130 virtual Point3f position(
SoundBuffer* target)
override;
131 virtual real32 playback_position(
SoundBuffer* target)
override;
132 virtual real32 playback_samples(
SoundBuffer* target)
override;
136 virtual void set_volume(real32 gain)
override;
137 virtual void set_position(
const Point3f& p)
override;
139 virtual void set_min_volume(
SoundBuffer* target, real32 gain)
override;
140 virtual void set_max_volume(
SoundBuffer* target, real32 gain)
override;
141 virtual void set_volume(
SoundBuffer* target, real32 gain)
override;
143 virtual void set_velocity(
SoundBuffer* target,
const Point3f& v)
override;
144 virtual void set_position(
SoundBuffer* target,
const Point3f& p)
override;
145 virtual void set_pitch(
SoundBuffer* target, real32 pitch)
override;
146 virtual void set_playback_position(
SoundBuffer* target, real32 offset_seconds)
override;
152 virtual bool push_buffer(
SoundBuffer* target)
override;
153 virtual bool queue_buffer(
SoundBuffer* target)
override;
158 virtual void suspend()
override;
159 virtual void resume()
override;
160 virtual void close()
override;
162 virtual void free_buffer(
SoundBuffer* target)
override;
167 virtual void close_context();
168 virtual void close_device();
virtual uint32 channel_format(uint32 num_channels, uint32 channel_format) override
Find a suitable data format for OpenAL.