Audaspace  1.1
A high level audio library.
SequenceData.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright 2009-2015 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 
25 #include "respec/Specification.h"
27 #include "devices/I3DDevice.h"
28 #include "util/ILockable.h"
29 
30 #include <list>
31 #include <memory>
32 #include <mutex>
33 
34 AUD_NAMESPACE_BEGIN
35 
36 class SequenceEntry;
37 class ISound;
38 
43 {
44  friend class SequenceReader;
45 private:
47  Specs m_specs;
48 
50  int m_status;
51 
53  int m_entry_status;
54 
56  int m_id;
57 
59  std::list<std::shared_ptr<SequenceEntry> > m_entries;
60 
62  bool m_muted;
63 
65  float m_fps;
66 
68  float m_speed_of_sound;
69 
71  float m_doppler_factor;
72 
74  DistanceModel m_distance_model;
75 
77  AnimateableProperty m_volume;
78 
80  AnimateableProperty m_location;
81 
83  AnimateableProperty m_orientation;
84 
86  std::recursive_mutex m_mutex;
87 
88  // delete copy constructor and operator=
89  SequenceData(const SequenceData&) = delete;
90  SequenceData& operator=(const SequenceData&) = delete;
91 
92 public:
99  SequenceData(Specs specs, float fps, bool muted);
100  virtual ~SequenceData();
101 
105  virtual void lock();
106 
110  virtual void unlock();
111 
116  Specs getSpecs();
117 
122  void setSpecs(Specs specs);
123 
128  float getFPS() const;
129 
134  void setFPS(float fps);
135 
140  void mute(bool muted);
141 
146  bool isMuted() const;
147 
153  float getSpeedOfSound() const;
154 
160  void setSpeedOfSound(float speed);
161 
168  float getDopplerFactor() const;
169 
176  void setDopplerFactor(float factor);
177 
182  DistanceModel getDistanceModel() const;
183 
188  void setDistanceModel(DistanceModel model);
189 
196  AnimateableProperty* getAnimProperty(AnimateablePropertyType type);
197 
206  std::shared_ptr<SequenceEntry> add(std::shared_ptr<ISound> sound, float begin, float end, float skip);
207 
212  void remove(std::shared_ptr<SequenceEntry> entry);
213 };
214 
215 AUD_NAMESPACE_END
This reader plays back sequenced entries.
Definition: SequenceReader.h:36
virtual Specs getSpecs() const
Returns the specification of the reader.
#define AUD_API
Used for exporting symbols in the shared library.
Definition: Audaspace.h:93
Defines all important macros and basic data structures for stream format descriptions.
Specification of a sound source.
Definition: Specification.h:109
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.
Defines the I3DDevice interface as well as the different distance models.
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
DistanceModel
Possible distance models for the 3D device.
Definition: I3DDevice.h:34
This class represents sequenced entries to play a sound scene.
Definition: SequenceData.h:42
This class represents a sequenced entry in a sequencer sound.
Definition: SequenceEntry.h:38
virtual void lock()=0
Locks the object.