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 
#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 is a simple buffer in RAM which is 32 Byte aligned and provides resize functionality...
Definition: Buffer.h:33
The ILockable interface.
#define AUD_NAMESPACE_END
Closes the audaspace namespace aud.
Definition: Audaspace.h:119
AnimateablePropertyType
Possible animatable properties for Sequencer Factories and Entries.
Definition: AnimateableProperty.h:34
#define AUD_LOCAL
Used for hiding symbols from export in the shared library.
Definition: Audaspace.h:80
The Buffer class.