Audaspace  1.3.0
A high level audio library.
SequenceData.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 
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 
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 
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 
183 
189 
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 
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
Defines the I3DDevice interface as well as the different distance models.
DistanceModel
Possible distance models for the 3D device.
Definition: I3DDevice.h:35
The ILockable interface.
Defines all important macros and basic data structures for stream format descriptions.
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 sequenced entries to play a sound scene.
Definition: SequenceData.h:43
virtual void lock()
Locks the sequence.
float getFPS() const
Retrieves the scene's FPS.
std::shared_ptr< SequenceEntry > add(std::shared_ptr< ISound > sound, float begin, float end, float skip)
Adds a new entry to the scene.
void setFPS(float fps)
Sets the scene's FPS.
void setSpecs(Specs specs)
Sets the audio output specification.
bool isMuted() const
Retrieves the muting state of the scene.
void setDistanceModel(DistanceModel model)
Sets the distance model.
void setDopplerFactor(float factor)
Sets the doppler factor.
Specs getSpecs()
Retrieves the audio output specification.
DistanceModel getDistanceModel() const
Retrieves the distance model.
SequenceData(Specs specs, float fps, bool muted)
Creates a new sound scene.
float getSpeedOfSound() const
Retrieves the speed of sound.
float getDopplerFactor() const
Retrieves the doppler factor.
virtual void unlock()
Unlocks the previously locked sequence.
void mute(bool muted)
Sets the muting state of the scene.
void setSpeedOfSound(float speed)
Sets the speed of sound.
void remove(std::shared_ptr< SequenceEntry > entry)
Removes an entry from the scene.
AnimateableProperty * getAnimProperty(AnimateablePropertyType type)
Retrieves one of the animated properties of the sequence.
This class represents a sequenced entry in a sequencer sound.
Definition: SequenceEntry.h:39
This reader plays back sequenced entries.
Definition: SequenceReader.h:37
Specification of a sound source.
Definition: Specification.h:110