버전
menu_open
link

include/AK/Plugin/PluginServices/AkFXParameterChangeHandler.h

Go to the documentation of this file.
00001 
00002 //
00003 // Copyright (c) 2006 Audiokinetic Inc. / All Rights Reserved
00004 //
00006 
00007 #ifndef _AKFXPARAMETERCHANGEHANDLER_H_
00008 #define _AKFXPARAMETERCHANGEHANDLER_H_
00009 
00010 #include <AK/SoundEngine/Common/AkTypes.h>
00011 #include <AK/Tools/Common/AkAssert.h>
00012 #include <AK/Tools/Common/AkPlatformFuncs.h>
00013 
00016 namespace AK
00017 {
00018 
00019     template <AkUInt32 T_MAXNUMPARAMS> 
00020     class AkFXParameterChangeHandler
00021     {
00022     public:
00023 
00024         inline AkFXParameterChangeHandler()
00025         {
00026             ResetAllParamChanges( );
00027         }
00028 
00029         inline void SetParamChange( AkPluginParamID in_ID )
00030         {
00031             AKASSERT( in_ID <= T_MAXNUMPARAMS );
00032             const AkUInt32 uByteIndex = in_ID/8;
00033             const AkUInt32 uBitMask = 1<<(in_ID-uByteIndex*8);
00034             m_uParamBitArray[uByteIndex] |= uBitMask;
00035         }
00036 
00037         inline bool HasChanged( AkPluginParamID in_ID )
00038         {
00039             AKASSERT( in_ID <= T_MAXNUMPARAMS );
00040             const AkUInt32 uByteIndex = in_ID/8;
00041             const AkUInt32 uBitMask = 1<<(in_ID-uByteIndex*8);
00042             return (m_uParamBitArray[uByteIndex] & uBitMask) > 0;
00043         }
00044 
00045         inline bool HasAnyChanged()
00046         {
00047             AkUInt32 uByteIndex = 0;
00048             do
00049             {
00050                 if ( m_uParamBitArray[uByteIndex] > 0 )
00051                     return true;
00052                 ++uByteIndex;
00053             } while (uByteIndex < (((T_MAXNUMPARAMS) + ((8)-1)) & ~((8)-1))/8 );
00054             return false;
00055         }
00056 
00057         inline void ResetParamChange( AkPluginParamID in_ID )
00058         {
00059             AKASSERT( in_ID <= T_MAXNUMPARAMS );
00060             const AkUInt32 uByteIndex = in_ID/8;
00061             const AkUInt32 uBitMask = 1<<(in_ID-uByteIndex*8);
00062             m_uParamBitArray[uByteIndex] &= ~uBitMask;
00063         }
00064 
00065         inline void ResetAllParamChanges( )
00066         {
00067             AkZeroMemSmall( m_uParamBitArray, sizeof(m_uParamBitArray) );
00068         }
00069 
00070         inline void SetAllParamChanges( )
00071         {
00072             AKPLATFORM::AkMemSet( m_uParamBitArray, 0xFF, sizeof(m_uParamBitArray) );
00073         }   
00074 
00075     protected:
00076 
00077         // Minimum storage in bits aligned to next byte boundary
00078         AkUInt8 m_uParamBitArray[(((T_MAXNUMPARAMS) + ((8)-1)) & ~((8)-1))/8]; 
00079 
00080     };
00081 
00082 } // namespace AK
00083 
00084 #endif // _AKFXPARAMETERCHANGEHANDLER_H_

이 페이지가 도움이 되었나요?

지원이 필요하신가요?

질문이 있으신가요? 문제를 겪고 계신가요? 더 많은 정보가 필요하신가요? 저희에게 문의해주시면 도와드리겠습니다!

지원 페이지를 방문해 주세요

작업하는 프로젝트에 대해 알려주세요. 언제든지 도와드릴 준비가 되어 있습니다.

프로젝트를 등록하세요. 아무런 조건이나 의무 사항 없이 빠른 시작을 도와드리겠습니다.

Wwise를 시작해 보세요