154 bool pause(
bool keep);
166 SoftwareHandle(
SoftwareDevice* device, std::shared_ptr<IReader> reader, std::shared_ptr<PitchReader> pitch, std::shared_ptr<ResampleReader> resampler, std::shared_ptr<ChannelMapperReader> mapper,
bool keep);
177 void setSpecs(
Specs specs);
180 virtual bool pause();
184 virtual bool setKeep(
bool keep);
185 virtual bool seek(
double position);
252 void mix(
data_t* buffer,
int length);
259 virtual void playing(
bool playing)=0;
265 void setSpecs(
Specs specs);
288 std::list<std::shared_ptr<SoftwareHandle> > m_playingSounds;
293 std::list<std::shared_ptr<SoftwareHandle> > m_pausedSounds;
303 std::recursive_mutex m_mutex;
320 float m_speed_of_sound;
323 float m_doppler_factor;
332 uint64_t m_synchronizerPosition{0};
333 int m_synchronizerState{0};
346 static void setPanning(
IHandle* handle,
float pan);
355 virtual std::shared_ptr<IHandle> play(std::shared_ptr<IReader> reader,
bool keep =
false);
356 virtual std::shared_ptr<IHandle> play(std::shared_ptr<ISound> sound,
bool keep =
false);
357 virtual void stopAll();
359 virtual void unlock();
363 virtual Vector3 getListenerLocation()
const;
364 virtual void setListenerLocation(
const Vector3& location);
365 virtual Vector3 getListenerVelocity()
const;
366 virtual void setListenerVelocity(
const Vector3& velocity);
367 virtual Quaternion getListenerOrientation()
const;
368 virtual void setListenerOrientation(
const Quaternion& orientation);
369 virtual float getSpeedOfSound()
const;
370 virtual void setSpeedOfSound(
float speed);
371 virtual float getDopplerFactor()
const;
372 virtual void setDopplerFactor(
float factor);
376 virtual void seekSynchronizer(
double time);
377 virtual double getSynchronizerPosition();
378 virtual void playSynchronizer();
379 virtual void stopSynchronizer();
380 virtual void setSyncCallback(syncFunction
function,
void* data);
381 virtual int isSynchronizerPlaying();
This class represents a quaternion used for 3D rotations.
Definition: Math3D.h:205
bool m_keep
Whether to keep the source if end of it is reached.
Definition: SoftwareDevice.h:78
#define AUD_NAMESPACE_BEGIN
Opens the audaspace namespace aud.
Definition: Audaspace.h:116
This abstract class is able to mix audiosignals with same channel count and sample rate and convert i...
Definition: Mixer.h:39
std::shared_ptr< Mixer > m_mixer
The mixer.
Definition: SoftwareDevice.h:230
virtual bool stop()=0
Stops a played back or paused sound.
virtual bool setKeep(bool keep)=0
Sets the behaviour of the device for a played back sound when the sound doesn't return any more sampl...
virtual bool seek(double position)=0
Seeks in a played back sound.
virtual float getPitch()=0
Retrieves the pitch of a playing sound.
void * m_stop_data
Stop callback data.
Definition: SoftwareDevice.h:141
float m_volume_min
Minimum volume.
Definition: SoftwareDevice.h:114
float m_old_volume
The previous calculated final volume of the source.
Definition: SoftwareDevice.h:93
virtual float getConeVolumeOuter()=0
Retrieves the outer volume of the cone of a source.
virtual float getVolumeMaximum()=0
Retrieves the maximum volume of a source.
ResampleQuality m_quality
Resampling quality.
Definition: SoftwareDevice.h:235
Saves the data for playback.
Definition: SoftwareDevice.h:54
virtual bool setStopCallback(stopCallback callback=0, void *data=0)=0
Sets the callback function that's called when the end of a playing sound is reached.
float m_distance_reference
Reference distance;.
Definition: SoftwareDevice.h:120
#define AUD_API
Used for exporting symbols in the shared library.
Definition: Audaspace.h:93
float m_cone_angle_outer
Cone outer angle.
Definition: SoftwareDevice.h:126
Vector3 m_velocity
Velocity in 3D Space.
Definition: SoftwareDevice.h:102
virtual Status getStatus()=0
Returns the status of a played back sound.
This class maps a sound source's channels to a specific output channel count.
Definition: ChannelMapperReader.h:34
unsigned char data_t
Sample data type (format samples)
Definition: Audaspace.h:129
Specification of a sound source.
Definition: Specification.h:118
float m_cone_angle_inner
Cone inner angle.
Definition: SoftwareDevice.h:129
virtual bool setPitch(float pitch)=0
Sets the pitch of a playing sound.
bool m_relative
Whether the position to the listener is relative or absolute.
Definition: SoftwareDevice.h:108
The I3DHandle interface represents a playback handle for 3D sources.
Definition: I3DHandle.h:38
int m_flags
Rendering flags.
Definition: SoftwareDevice.h:135
std::shared_ptr< ResampleReader > m_resampler
The resample reader in between.
Definition: SoftwareDevice.h:69
virtual float getDistanceReference()=0
Retrieves the reference distance of a source.
DeviceSpecs m_specs
The specification of the device.
Definition: SoftwareDevice.h:225
virtual bool getKeep()=0
Gets the behaviour of the device for a played back sound when the sound doesn't return any more sampl...
float m_attenuation
Attenuation.
Definition: SoftwareDevice.h:123
virtual bool setOrientation(const Quaternion &orientation)=0
Sets the orientation of the source.
virtual bool setDistanceReference(float distance)=0
Sets the reference distance of a source.
virtual int getLoopCount()=0
Retrieves the loop count of a playing sound.
void(* stopCallback)(void *)
The stopCallback is called when a handle reaches the end of the stream and thus gets stopped...
Definition: IHandle.h:42
virtual bool setDistanceMaximum(float distance)=0
Sets the maximum distance of a source.
float m_volume
The calculated final volume of the source.
Definition: SoftwareDevice.h:90
float m_user_pitch
The user set pitch of the source.
Definition: SoftwareDevice.h:81
This class is a simple buffer in RAM which is 32 Byte aligned and provides resize functionality...
Definition: Buffer.h:33
std::shared_ptr< IReader > m_reader
The reader source.
Definition: SoftwareDevice.h:63
Status m_status
Current status of the handle.
Definition: SoftwareDevice.h:144
virtual bool setVolumeMinimum(float volume)=0
Sets the minimum volume of a source.
Specification of a sound device.
Definition: Specification.h:128
float m_user_volume
The user set volume of the source.
Definition: SoftwareDevice.h:84
virtual float getConeAngleInner()=0
Retrieves the inner opening angle of the cone of a source.
Quaternion m_orientation
Orientation in 3D Space.
Definition: SoftwareDevice.h:105
virtual Vector3 getVelocity()=0
Retrieves the velocity of the source.
virtual float getDistanceMaximum()=0
Retrieves the maximum distance of a source.
float m_cone_volume_outer
Cone outer volume.
Definition: SoftwareDevice.h:132
bool m_first_reading
Whether the source is being read for the first time.
Definition: SoftwareDevice.h:75
virtual float getConeAngleOuter()=0
Retrieves the outer opening angle of the cone of a source.
virtual float getAttenuation()=0
Retrieves the attenuation of a source.
float m_volume_max
Maximum volume.
Definition: SoftwareDevice.h:111
The I3DDevice interface represents an output device for 3D sound.
Definition: I3DDevice.h:52
virtual bool isRelative()=0
Checks whether the source location, velocity and orientation are relative to the listener.
Defines the IHandle interface as well as possible states of the handle.
SoftwareDevice * m_device
Own device.
Definition: SoftwareDevice.h:147
float m_distance_max
Maximum distance.
Definition: SoftwareDevice.h:117
virtual bool setRelative(bool relative)=0
Sets whether the source location, velocity and orientation are relative to the listener.
virtual bool setVolumeMaximum(float volume)=0
Sets the maximum volume of a source.
virtual bool setConeAngleInner(float angle)=0
Sets the inner opening angle of the cone of a source.
virtual Vector3 getLocation()=0
Retrieves the location of the source.
ResampleQuality
Resampling algorithm and quality.
Definition: Specification.h:87
float m_user_pan
The user set panning for non-3D sources.
Definition: SoftwareDevice.h:87
virtual float getVolume()=0
Retrieves the volume of a playing sound.
virtual bool pause()=0
Pauses a played back sound.
This is the base class for all resampling readers.
Definition: ResampleReader.h:32
#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:48
virtual bool setLoopCount(int count)=0
Sets the loop count of a playing sound.
Defines the I3DDevice interface as well as the different distance models.
std::shared_ptr< PitchReader > m_pitch
The pitch reader in between.
Definition: SoftwareDevice.h:66
The IDevice interface represents an output device for sound sources.
Definition: IDevice.h:45
virtual bool setVolume(float volume)=0
Sets the volume of a playing sound.
The software device is a generic device with software mixing.
Definition: SoftwareDevice.h:50
This class represents a 3 dimensional vector.
Definition: Math3D.h:35
virtual float getVolumeMinimum()=0
Retrieves the minimum volume of a source.
virtual double getPosition()=0
Retrieves the current playback position of a sound.
virtual bool setConeVolumeOuter(float volume)=0
Sets the outer volume of the cone of a source.
int m_loopcount
The loop count of the source.
Definition: SoftwareDevice.h:96
This class reads another reader and changes it's pitch.
Definition: PitchReader.h:32
virtual bool setAttenuation(float factor)=0
Sets the attenuation of a source.
virtual Quaternion getOrientation()=0
Retrieves the orientation of the source.
Status
Status of a playback handle.
Definition: IHandle.h:30
DistanceModel
Possible distance models for the 3D device.
Definition: I3DDevice.h:34
Vector3 m_location
Location in 3D Space.
Definition: SoftwareDevice.h:99
std::shared_ptr< ChannelMapperReader > m_mapper
The channel mapper reader in between.
Definition: SoftwareDevice.h:72
virtual bool setVelocity(const Vector3 &velocity)=0
Sets the velocity of the source.
stopCallback m_stop
The stop callback.
Definition: SoftwareDevice.h:138
virtual bool setConeAngleOuter(float angle)=0
Sets the outer opening angle of the cone of a source.
virtual bool setLocation(const Vector3 &location)=0
Sets the location of the source.
virtual bool resume()=0
Resumes a paused sound.