Audaspace
1.3.0
A high level audio library.
|
Go to the documentation of this file.
20 #define AUD_BUILD_PLUGIN
57 static const int CYCLE_BUFFERS = 3;
63 std::shared_ptr<IReader> m_reader;
75 ALuint m_buffers[CYCLE_BUFFERS];
104 OpenALHandle(
const OpenALHandle&) =
delete;
105 OpenALHandle& operator=(
const OpenALHandle&) =
delete;
116 OpenALHandle(
OpenALDevice* device, ALenum format, std::shared_ptr<IReader> reader,
bool keep);
118 virtual ~OpenALHandle() {}
119 virtual bool pause();
120 virtual bool resume();
122 virtual bool getKeep();
123 virtual bool setKeep(
bool keep);
124 virtual bool seek(
float position);
125 virtual float getPosition();
126 virtual Status getStatus();
129 virtual float getPitch();
130 virtual bool setPitch(
float pitch);
131 virtual int getLoopCount();
132 virtual bool setLoopCount(
int count);
133 virtual bool setStopCallback(
stopCallback callback = 0,
void* data = 0);
136 virtual bool setLocation(
const Vector3& location);
138 virtual bool setVelocity(
const Vector3& velocity);
140 virtual bool setOrientation(
const Quaternion& orientation);
141 virtual bool isRelative();
142 virtual bool setRelative(
bool relative);
143 virtual float getVolumeMaximum();
144 virtual bool setVolumeMaximum(
float volume);
145 virtual float getVolumeMinimum();
146 virtual bool setVolumeMinimum(
float volume);
147 virtual float getDistanceMaximum();
148 virtual bool setDistanceMaximum(
float distance);
149 virtual float getDistanceReference();
150 virtual bool setDistanceReference(
float distance);
151 virtual float getAttenuation();
152 virtual bool setAttenuation(
float factor);
153 virtual float getConeAngleOuter();
154 virtual bool setConeAngleOuter(
float angle);
155 virtual float getConeAngleInner();
156 virtual bool setConeAngleInner(
float angle);
157 virtual float getConeVolumeOuter();
158 virtual bool setConeVolumeOuter(
float volume);
169 ALCcontext* m_context;
184 std::list<std::shared_ptr<OpenALHandle> > m_playingSounds;
189 std::list<std::shared_ptr<OpenALHandle> > m_pausedSounds;
194 std::recursive_mutex m_mutex;
199 std::thread m_thread;
262 virtual std::shared_ptr<IHandle>
play(std::shared_ptr<IReader> reader,
bool keep =
false);
263 virtual std::shared_ptr<IHandle>
play(std::shared_ptr<ISound> sound,
bool keep =
false);
virtual float getVolume() const
Retrieves the overall device volume.
Specification of a sound source.
Definition: Specification.h:110
virtual void setVolume(float volume)
Sets the overall device volume.
virtual void setListenerVelocity(const Vector3 &velocity)
Sets the listener velocity.
static std::list< std::string > getDeviceNames()
Retrieves a list of available hardware devices to open with OpenAL.
virtual Vector3 getListenerVelocity() const
Retrieves the listener velocity.
virtual Vector3 getListenerLocation() const
Retrieves the listener location.
Defines the I3DDevice interface as well as the different distance models.
virtual void lock()
Locks the device.
This device plays through OpenAL.
Definition: OpenALDevice.h:49
virtual void unlock()
Unlocks the previously locked device.
virtual void stopAll()
Stops all playing sounds.
virtual std::shared_ptr< IHandle > play(std::shared_ptr< IReader > reader, bool keep=false)
Plays a sound source.
virtual DistanceModel getDistanceModel() const
Retrieves the distance model.
void(* stopCallback)(void *)
The stopCallback is called when a handle reaches the end of the stream and thus gets stopped.
Definition: IHandle.h:42
Specification of a sound device.
Definition: Specification.h:120
static void registerPlugin()
Registers this plugin.
DistanceModel
Possible distance models for the 3D device.
Definition: I3DDevice.h:35
#define AUD_DEFAULT_BUFFER_SIZE
The default playback buffer size of a device.
Definition: Audaspace.h:103
virtual void setListenerOrientation(const Quaternion &orientation)
Sets the listener orientation.
This class enables global synchronization of several audio applications if supported.
Definition: ISynchronizer.h:39
This class is a default ISynchronizer implementation that actually does no synchronization and is int...
Definition: DefaultSynchronizer.h:34
The DefaultSynchronizer class.
virtual void setListenerLocation(const Vector3 &location)
Sets the listener location.
virtual Quaternion getListenerOrientation() const
Retrieves the listener orientation.
virtual void setDopplerFactor(float factor)
Sets the doppler factor.
The I3DHandle interface represents a playback handle for 3D sources.
Definition: I3DHandle.h:39
virtual ISynchronizer * getSynchronizer()
Retrieves the synchronizer for this device, which enables accurate synchronization between audio play...
This class represents a 3 dimensional vector.
Definition: Math3D.h:36
virtual float getDopplerFactor() const
Retrieves the doppler factor.
#define AUD_PLUGIN_API
Used for exporting symbols in the shared library.
Definition: Audaspace.h:94
virtual void setSpeedOfSound(float speed)
Sets the speed of sound.
virtual std::shared_ptr< IHandle > play(std::shared_ptr< ISound > sound, bool keep=false)
Plays a sound source.
#define AUD_LOCAL
Used for hiding symbols from export in the shared library.
Definition: Audaspace.h:80
This class represents a quaternion used for 3D rotations.
Definition: Math3D.h:206
This class is a simple buffer in RAM which is 32 Byte aligned and provides resize functionality.
Definition: Buffer.h:34
The IDevice interface represents an output device for sound sources.
Definition: IDevice.h:47
The I3DDevice interface represents an output device for 3D sound.
Definition: I3DDevice.h:53
OpenALDevice(DeviceSpecs specs, int buffersize=AUD_DEFAULT_BUFFER_SIZE, std::string name="")
Opens the OpenAL audio device for playback.
#define AUD_NAMESPACE_END
Closes the audaspace namespace aud.
Definition: Audaspace.h:119
The IHandle interface represents a playback handles of a specific device.
Definition: IHandle.h:49
virtual float getSpeedOfSound() const
Retrieves the speed of sound.
#define AUD_NAMESPACE_BEGIN
Opens the audaspace namespace aud.
Definition: Audaspace.h:116
Defines the IHandle interface as well as possible states of the handle.
virtual DeviceSpecs getSpecs() const
Returns the specification of the device.
virtual void setDistanceModel(DistanceModel model)
Sets the distance model.
Status
Status of a playback handle.
Definition: IHandle.h:31