Audaspace 1.5.0
A high level audio library.
Loading...
Searching...
No Matches
SequenceEntry.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright 2009-2016 Jörg Müller
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 ******************************************************************************/
16
17#pragma once
18
27#include "util/ILockable.h"
28
29#include <mutex>
30#include <memory>
31
33
34class ISound;
35
40{
41 friend class SequenceHandle;
42private:
44 int m_status;
45
47 int m_pos_status;
48
50 int m_sound_status;
51
53 int m_id;
54
56 std::shared_ptr<ISound> m_sound;
57
59 double m_begin;
60
62 double m_end;
63
65 double m_skip;
66
68 std::shared_ptr<SequenceData> m_sequence_data;
69
71 bool m_muted;
72
74 bool m_relative;
75
77 float m_volume_max;
78
80 float m_volume_min;
81
83 float m_distance_max;
84
86 float m_distance_reference;
87
89 float m_attenuation;
90
92 float m_cone_angle_outer;
93
95 float m_cone_angle_inner;
96
98 float m_cone_volume_outer;
99
101 std::recursive_mutex m_mutex;
102
104 AnimateableProperty m_volume;
105
107 AnimateableProperty m_panning;
108
110 AnimateableProperty m_pitch;
111
113 AnimateableProperty m_location;
114
116 AnimateableProperty m_orientation;
117
118 // delete copy constructor and operator=
119 SequenceEntry(const SequenceEntry&) = delete;
120 SequenceEntry& operator=(const SequenceEntry&) = delete;
121
122public:
132 SequenceEntry(std::shared_ptr<ISound> sound, double begin, double end, double skip, std::shared_ptr<SequenceData> sequence_data, int id);
133 virtual ~SequenceEntry();
134
138 virtual void lock();
139
143 virtual void unlock();
144
149 std::shared_ptr<ISound> getSound();
150
155 void setSound(std::shared_ptr<ISound> sound);
156
163 void move(double begin, double end, double skip);
164
169 bool isMuted();
170
175 void mute(bool mute);
176
181 int getID() const;
182
190
197
204 void setRelative(bool relative);
205
211
217 void setVolumeMaximum(float volume);
218
224
230 void setVolumeMinimum(float volume);
231
239
247 void setDistanceMaximum(float distance);
248
254
260 void setDistanceReference(float distance);
261
267
274 void setAttenuation(float factor);
275
281
287 void setConeAngleOuter(float angle);
288
294
300 void setConeAngleInner(float angle);
301
309
317 void setConeVolumeOuter(float volume);
318};
319
Defines the AnimateableProperty class as well as existing property types.
AnimateablePropertyType
Possible animatable properties for Sequencer Factories and Entries.
Definition AnimateableProperty.h:35
#define AUD_NAMESPACE_END
Closes the audaspace namespace aud.
Definition Audaspace.h:119
#define AUD_NAMESPACE_BEGIN
Opens the audaspace namespace aud.
Definition Audaspace.h:116
#define AUD_API
Used for exporting symbols in the shared library.
Definition Audaspace.h:93
The ILockable interface.
The SequenceData class.
This class saves animation data for float properties.
Definition AnimateableProperty.h:47
This class provides an interface for lockable objects.
Definition ILockable.h:34
This class represents a type of sound source and saves the necessary values for it.
Definition ISound.h:40
This class represents a sequenced entry in a sequencer sound.
Definition SequenceEntry.h:40
float getDistanceMaximum()
Retrieves the maximum distance of a source.
std::shared_ptr< ISound > getSound()
Retrieves the sound of the entry.
void move(double begin, double end, double skip)
Moves the entry.
SequenceEntry(std::shared_ptr< ISound > sound, double begin, double end, double skip, std::shared_ptr< SequenceData > sequence_data, int id)
Creates a new sequenced entry.
int getID() const
Retrieves the ID of the entry.
float getVolumeMaximum()
Retrieves the maximum volume of a source.
void setVolumeMinimum(float volume)
Sets the minimum volume of a source.
void setDistanceReference(float distance)
Sets the reference distance of a source.
float getConeAngleInner()
Retrieves the inner angle of the cone of a source.
float getConeVolumeOuter()
Retrieves the outer volume of the cone of a source.
bool isRelative()
Checks whether the source location, velocity and orientation are relative to the listener.
float getVolumeMinimum()
Retrieves the minimum volume of a source.
float getDistanceReference()
Retrieves the reference distance of a source.
void setSound(std::shared_ptr< ISound > sound)
Sets the sound of the entry.
virtual void lock()
Locks the entry.
float getConeAngleOuter()
Retrieves the outer angle of the cone of a source.
void setAttenuation(float factor)
Sets the attenuation of a source.
void setVolumeMaximum(float volume)
Sets the maximum volume of a source.
void setConeVolumeOuter(float volume)
Sets the outer volume of the cone of a source.
void setConeAngleInner(float angle)
Sets the inner angle of the cone of a source.
AnimateableProperty * getAnimProperty(AnimateablePropertyType type)
Retrieves one of the animated properties of the entry.
void mute(bool mute)
Sets the muting state of the entry.
float getAttenuation()
Retrieves the attenuation of a source.
bool isMuted()
Retrieves the muting state of the entry.
void setRelative(bool relative)
Sets whether the source location, velocity and orientation are relative to the listener.
void setDistanceMaximum(float distance)
Sets the maximum distance of a source.
void setConeAngleOuter(float angle)
Sets the outer angle of the cone of a source.
virtual void unlock()
Unlocks the previously locked entry.