Audaspace  1.3.0
A high level audio library.
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 
26 #include "util/ILockable.h"
27 
28 #include <mutex>
29 #include <memory>
30 
32 
33 class ISound;
34 
39 {
40  friend class SequenceHandle;
41 private:
43  int m_status;
44 
46  int m_pos_status;
47 
49  int m_sound_status;
50 
52  int m_id;
53 
55  std::shared_ptr<ISound> m_sound;
56 
58  float m_begin;
59 
61  float m_end;
62 
64  float m_skip;
65 
67  bool m_muted;
68 
70  bool m_relative;
71 
73  float m_volume_max;
74 
76  float m_volume_min;
77 
79  float m_distance_max;
80 
82  float m_distance_reference;
83 
85  float m_attenuation;
86 
88  float m_cone_angle_outer;
89 
91  float m_cone_angle_inner;
92 
94  float m_cone_volume_outer;
95 
97  std::recursive_mutex m_mutex;
98 
100  AnimateableProperty m_volume;
101 
103  AnimateableProperty m_panning;
104 
106  AnimateableProperty m_pitch;
107 
109  AnimateableProperty m_location;
110 
112  AnimateableProperty m_orientation;
113 
114  // delete copy constructor and operator=
115  SequenceEntry(const SequenceEntry&) = delete;
116  SequenceEntry& operator=(const SequenceEntry&) = delete;
117 
118 public:
127  SequenceEntry(std::shared_ptr<ISound> sound, float begin, float end, float skip, int id);
128  virtual ~SequenceEntry();
129 
133  virtual void lock();
134 
138  virtual void unlock();
139 
144  std::shared_ptr<ISound> getSound();
145 
150  void setSound(std::shared_ptr<ISound> sound);
151 
158  void move(float begin, float end, float skip);
159 
164  bool isMuted();
165 
170  void mute(bool mute);
171 
176  int getID() const;
177 
184  AnimateableProperty* getAnimProperty(AnimateablePropertyType type);
185 
191  bool isRelative();
192 
199  void setRelative(bool relative);
200 
205  float getVolumeMaximum();
206 
212  void setVolumeMaximum(float volume);
213 
218  float getVolumeMinimum();
219 
225  void setVolumeMinimum(float volume);
226 
233  float getDistanceMaximum();
234 
242  void setDistanceMaximum(float distance);
243 
248  float getDistanceReference();
249 
255  void setDistanceReference(float distance);
256 
261  float getAttenuation();
262 
269  void setAttenuation(float factor);
270 
275  float getConeAngleOuter();
276 
282  void setConeAngleOuter(float angle);
283 
288  float getConeAngleInner();
289 
295  void setConeAngleInner(float angle);
296 
303  float getConeVolumeOuter();
304 
312  void setConeVolumeOuter(float volume);
313 };
314 
#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
This class saves animation data for float properties.
Definition: AnimateableProperty.h:46
This class represents a type of sound source and saves the necessary values for it.
Definition: ISound.h:39
Defines the AnimateableProperty class as well as existing property types.
The ILockable interface.
#define AUD_NAMESPACE_END
Closes the audaspace namespace aud.
Definition: Audaspace.h:119
This class provides an interface for lockable objects.
Definition: ILockable.h:33
virtual void unlock()=0
Unlocks the previously locked object.
AnimateablePropertyType
Possible animatable properties for Sequencer Factories and Entries.
Definition: AnimateableProperty.h:34
This class represents a sequenced entry in a sequencer sound.
Definition: SequenceEntry.h:38
virtual void lock()=0
Locks the object.