Audaspace  1.3.0
A high level audio library.
AnimateableProperty.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 "util/Buffer.h"
26 #include "util/ILockable.h"
27 
28 #include <mutex>
29 #include <list>
30 
32 
35 {
36  AP_VOLUME,
37  AP_PANNING,
38  AP_PITCH,
39  AP_LOCATION,
40  AP_ORIENTATION
41 };
42 
47 {
48 private:
49  struct Unknown {
50  int start;
51  int end;
52 
53  Unknown(int start, int end) :
54  start(start), end(end) {}
55  };
56 
58  const int m_count;
59 
61  bool m_isAnimated;
62 
64  std::recursive_mutex m_mutex;
65 
67  std::list<Unknown> m_unknown;
68 
69  // delete copy constructor and operator=
71  AnimateableProperty& operator=(const AnimateableProperty&) = delete;
72 
73  void AUD_LOCAL updateUnknownCache(int start, int end);
74 
75 public:
80  AnimateableProperty(int count = 1);
81 
88  AnimateableProperty(int count, float value);
89 
94 
99  int getCount() const;
100 
105  void write(const float* data);
106 
113  void write(const float* data, int position, int count);
114 
120  void read(float position, float* out);
121 
126  bool isAnimated() const;
127 };
128 
AnimateableProperty::getCount
int getCount() const
Returns the count of floats for a single property.
ILockable.h
The ILockable interface.
AnimateableProperty::write
void write(const float *data)
Writes the properties value and marks it non-animated.
AnimateableProperty::AnimateableProperty
AnimateableProperty(int count, float value)
Creates a new animateable property.
AnimateableProperty
This class saves animation data for float properties.
Definition: AnimateableProperty.h:47
AnimateableProperty::AnimateableProperty
AnimateableProperty(int count=1)
Creates a new animateable property.
AnimateableProperty::~AnimateableProperty
~AnimateableProperty()
Destroys the animateable property.
Buffer.h
The Buffer class.
AUD_LOCAL
#define AUD_LOCAL
Used for hiding symbols from export in the shared library.
Definition: Audaspace.h:80
AnimateablePropertyType
AnimateablePropertyType
Possible animatable properties for Sequencer Factories and Entries.
Definition: AnimateableProperty.h:35
Buffer
This class is a simple buffer in RAM which is 32 Byte aligned and provides resize functionality.
Definition: Buffer.h:34
AnimateableProperty::read
void read(float position, float *out)
Reads the properties value.
AnimateableProperty::isAnimated
bool isAnimated() const
Returns whether the property is animated.
AUD_NAMESPACE_END
#define AUD_NAMESPACE_END
Closes the audaspace namespace aud.
Definition: Audaspace.h:119
AnimateableProperty::write
void write(const float *data, int position, int count)
Writes the properties value and marks it animated.
AUD_NAMESPACE_BEGIN
#define AUD_NAMESPACE_BEGIN
Opens the audaspace namespace aud.
Definition: Audaspace.h:116
AUD_API
#define AUD_API
Used for exporting symbols in the shared library.
Definition: Audaspace.h:93