Audaspace 1.5.0
A high level audio library.
Loading...
Searching...
No Matches
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{
48private:
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
75public:
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
121 void writeConstantRange(const float* data, int position_start, int position_end);
122
128 void read(float position, float* out);
129
134 bool isAnimated() const;
135};
136
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_LOCAL
Used for hiding symbols from export in the shared library.
Definition Audaspace.h:80
#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
The Buffer class.
The ILockable interface.
This class saves animation data for float properties.
Definition AnimateableProperty.h:47
AnimateableProperty(int count=1)
Creates a new animateable property.
void write(const float *data)
Writes the properties value and marks it non-animated.
void read(float position, float *out)
Reads the properties value.
~AnimateableProperty()
Destroys the animateable property.
void writeConstantRange(const float *data, int position_start, int position_end)
Fills the properties frame range with constant value and marks it animated.
bool isAnimated() const
Returns whether the property is animated.
void write(const float *data, int position, int count)
Writes the properties value and marks it animated.
AnimateableProperty(int count, float value)
Creates a new animateable property.
int getCount() const
Returns the count of floats for a single property.
This class is a simple buffer in RAM which is 32 Byte aligned and provides resize functionality.
Definition Buffer.h:34