Audaspace  1.6.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 "sequence/SequenceData.h"
27 #include "util/ILockable.h"
28 
29 #include <mutex>
30 #include <memory>
31 
33 
34 class ISound;
35 
40 {
41  friend class SequenceHandle;
42 private:
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 
122 public:
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 
189  AnimateableProperty* getAnimProperty(AnimateablePropertyType type);
190 
196  bool isRelative();
197 
204  void setRelative(bool relative);
205 
210  float getVolumeMaximum();
211 
217  void setVolumeMaximum(float volume);
218 
223  float getVolumeMinimum();
224 
230  void setVolumeMinimum(float volume);
231 
238  float getDistanceMaximum();
239 
247  void setDistanceMaximum(float distance);
248 
253  float getDistanceReference();
254 
260  void setDistanceReference(float distance);
261 
266  float getAttenuation();
267 
274  void setAttenuation(float factor);
275 
280  float getConeAngleOuter();
281 
287  void setConeAngleOuter(float angle);
288 
293  float getConeAngleInner();
294 
300  void setConeAngleInner(float angle);
301 
308  float getConeVolumeOuter();
309 
317  void setConeVolumeOuter(float volume);
318 };
319 
#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 SequenceData class.
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:39
virtual void lock()=0
Locks the object.