Version
menu_open
link
Wwise SDK 2023.1.2
AkFXParameterChangeHandler.h
Go to the documentation of this file.
1 /*******************************************************************************
2 The content of this file includes portions of the AUDIOKINETIC Wwise Technology
3 released in source code form as part of the SDK installer package.
4 
5 Commercial License Usage
6 
7 Licensees holding valid commercial licenses to the AUDIOKINETIC Wwise Technology
8 may use this file in accordance with the end user license agreement provided
9 with the software or, alternatively, in accordance with the terms contained in a
10 written agreement between you and Audiokinetic Inc.
11 
12 Apache License Usage
13 
14 Alternatively, this file may be used under the Apache License, Version 2.0 (the
15 "Apache License"); you may not use this file except in compliance with the
16 Apache License. You may obtain a copy of the Apache License at
17 http://www.apache.org/licenses/LICENSE-2.0.
18 
19 Unless required by applicable law or agreed to in writing, software distributed
20 under the Apache License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
21 OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for
22 the specific language governing permissions and limitations under the License.
23 
24  Copyright (c) 2024 Audiokinetic Inc.
25 *******************************************************************************/
26 
27 #ifndef _AKFXPARAMETERCHANGEHANDLER_H_
28 #define _AKFXPARAMETERCHANGEHANDLER_H_
29 
33 
34 /// Can be used to track individual parameter changes to avoid costly computations when they remain constant
35 /// This class is designed to use only the lower bit information of the parameter IDs
36 namespace AK
37 {
38 
39  template <AkUInt32 T_MAXNUMPARAMS>
41  {
42  public:
43 
45  {
47  }
48 
49  inline void SetParamChange( AkPluginParamID in_ID )
50  {
51  AKASSERT( in_ID <= T_MAXNUMPARAMS );
52  const AkUInt32 uByteIndex = in_ID/8;
53  const AkUInt32 uBitMask = 1<<(in_ID-uByteIndex*8);
54  m_uParamBitArray[uByteIndex] |= uBitMask;
55  }
56 
57  inline bool HasChanged( AkPluginParamID in_ID )
58  {
59  AKASSERT( in_ID <= T_MAXNUMPARAMS );
60  const AkUInt32 uByteIndex = in_ID/8;
61  const AkUInt32 uBitMask = 1<<(in_ID-uByteIndex*8);
62  return (m_uParamBitArray[uByteIndex] & uBitMask) > 0;
63  }
64 
65  inline bool HasAnyChanged()
66  {
67  AkUInt32 uByteIndex = 0;
68  do
69  {
70  if ( m_uParamBitArray[uByteIndex] > 0 )
71  return true;
72  ++uByteIndex;
73  } while (uByteIndex < (((T_MAXNUMPARAMS) + ((8)-1)) & ~((8)-1))/8 );
74  return false;
75  }
76 
77  inline void ResetParamChange( AkPluginParamID in_ID )
78  {
79  AKASSERT( in_ID <= T_MAXNUMPARAMS );
80  const AkUInt32 uByteIndex = in_ID/8;
81  const AkUInt32 uBitMask = 1<<(in_ID-uByteIndex*8);
82  m_uParamBitArray[uByteIndex] &= ~uBitMask;
83  }
84 
85  inline void ResetAllParamChanges( )
86  {
88  }
89 
90  inline void SetAllParamChanges( )
91  {
93  }
94 
95  protected:
96 
97  // Minimum storage in bits aligned to next byte boundary
98  AkUInt8 m_uParamBitArray[(((T_MAXNUMPARAMS) + ((8)-1)) & ~((8)-1))/8];
99 
100  };
101 
102 } // namespace AK
103 
104 #endif // _AKFXPARAMETERCHANGEHANDLER_H_
Audiokinetic namespace.
uint8_t AkUInt8
Unsigned 8-bit integer.
#define AkZeroMemSmall(___Dest, ___Size)
AkUInt8 m_uParamBitArray[(((T_MAXNUMPARAMS)+((8) -1)) &~((8) -1))/8]
bool HasChanged(AkPluginParamID in_ID)
#define AKASSERT(Condition)
Definition: AkAssert.h:67
AkForceInline void AkMemSet(void *pDest, AkInt32 iVal, AkUInt32 uSize)
Platform Independent Helper.
void ResetParamChange(AkPluginParamID in_ID)
uint32_t AkUInt32
Unsigned 32-bit integer.
AkInt16 AkPluginParamID
Source or effect plug-in parameter ID.
Definition: AkTypes.h:148
void SetParamChange(AkPluginParamID in_ID)

Cette page a-t-elle été utile ?

Besoin d'aide ?

Des questions ? Des problèmes ? Besoin de plus d'informations ? Contactez-nous, nous pouvons vous aider !

Visitez notre page d'Aide

Décrivez-nous de votre projet. Nous sommes là pour vous aider.

Enregistrez votre projet et nous vous aiderons à démarrer sans aucune obligation !

Partir du bon pied avec Wwise