34 #ifndef _AK_COMMON_DEFS_H_
35 #define _AK_COMMON_DEFS_H_
37 #include <AK/SoundEngine/Common/AkSpeakerConfig.h>
38 #include <AK/SoundEngine/Common/AkSpeakerVolumes.h>
47 const AkDataTypeID AK_INT = 0;
48 const AkDataTypeID AK_FLOAT = 1;
50 const AkDataInterleaveID AK_INTERLEAVED = 0;
51 const AkDataInterleaveID AK_NONINTERLEAVED = 1;
54 const AkUInt32 AK_LE_NATIVE_BITSPERSAMPLE = 32;
55 const AkUInt32 AK_LE_NATIVE_SAMPLETYPE = AK_FLOAT;
56 const AkUInt32 AK_LE_NATIVE_INTERLEAVE = AK_NONINTERLEAVED;
124 AkUInt32 in_uSampleRate,
126 AkUInt32 in_uBitsPerSample,
127 AkUInt32 in_uBlockAlign,
129 AkUInt32 in_uInterleaveID
168 enum AkSourceChannelOrdering
170 SourceChannelOrdering_Standard = 0,
173 SourceChannelOrdering_Film,
174 SourceChannelOrdering_FuMa
177 #define AK_MAKE_CHANNELCONFIGOVERRIDE(_config,_order) ((AkInt64)_config.Serialize()|((AkInt64)_order<<32))
178 #define AK_GET_CHANNELCONFIGOVERRIDE_CONFIG(_over) (_over&UINT_MAX)
179 #define AK_GET_CHANNELCONFIGOVERRIDE_ORDERING(_over) ((AkSourceChannelOrdering)(_over>>32))
192 #define AKMAKECLASSID( in_pluginType, in_companyID, in_pluginID ) \
193 ( (in_pluginType) + ( (in_companyID) << 4 ) + ( (in_pluginID) << ( 4 + 12 ) ) )
195 #define AKGETPLUGINTYPEFROMCLASSID( in_classID ) ( (in_classID) & AkPluginTypeMask )
196 #define AKGETCOMPANYIDFROMCLASSID( in_classID ) ( ( (in_classID) & 0x0000FFF0 ) >> 4 )
197 #define AKGETPLUGINIDFROMCLASSID( in_classID ) ( ( (in_classID) & 0xFFFF0000 ) >> ( 4 + 12 ) )
199 #define CODECID_FROM_PLUGINID AKGETPLUGINIDFROMCLASSID
248 typedef AkReal32 AkSampleType;
325 return ( NULL !=
pData );
335 , AkUInt32 in_uChannelIdx
339 if ( in_channelConfig.HasLFE() )
341 AKASSERT( in_channelConfig.eConfigType == AK_ChannelConfigType_Standard );
343 AkUInt32 uIdxLFE =
AK::GetNumNonZeroBits( ( AK_SPEAKER_LOW_FREQUENCY - 1 ) & in_channelConfig.uChannelMask );
344 if ( in_uChannelIdx == uIdxLFE )
345 return in_channelConfig.uNumChannels - 1;
346 else if ( in_uChannelIdx > uIdxLFE )
347 return in_uChannelIdx - 1;
350 return in_uChannelIdx;
367 return (AkSampleType*)((AkUInt8*)(
pData) + ( in_uIndex *
sizeof(AkSampleType) *
MaxFrames() ));
379 return (AkSampleType*)0;
389 if ( uNumZeroFrames )
391 for ( AkUInt32 i = 0; i < uNumChannels; ++i )
410 void * pDataOld =
pData;
421 AkUIntPtr uMemoryOffset = (AkUIntPtr)in_pNewMedia - (AkUIntPtr)in_pOldMedia;
422 pData = (
void*) (((AkUIntPtr)
pData) + uMemoryOffset);
443 #endif // _AK_COMMON_DEFS_H_
AkForceInline bool HasLFE() const
Returns true if there is an LFE channel present.
AkForceInline bool IsChannelConfigSupported() const
AkSampleType * GetChannel(AkUInt32 in_uIndex)
Interface to retrieve metering information about a buffer.
AkForceInline bool HasData() const
Check if buffer has samples attached to it.
AkForceInline bool HasCenter() const
AkForceInline AkChannelConfig GetChannelConfig() const
AkAudioBuffer()
Constructor.
AkUInt32 uNumChannels
Number of channels.
virtual AkReal32 GetKWeightedPower()=0
AkForceInline void * DetachContiguousDeinterleavedData()
Detach deinterleaved data where channels are contiguous in memory. The address of the buffer is retur...
AkForceInline AkUInt32 NumChannels() const
Get the number of channels.
AkForceInline void Clear()
Clear members.
AkUInt32 uChannelMask
Channel mask (configuration).
static AkUInt32 StandardToPipelineIndex(AkChannelConfig in_channelConfig, AkUInt32 in_uChannelIdx)
void RelocateMedia(AkUInt8 *in_pNewMedia, AkUInt8 *in_pOldMedia)
AKRESULT eState
Execution status
AkUInt16 uValidFrames
Number of valid sample frames in the audio buffer
void * pData
Start of the audio buffer.
AkChannelConfig channelConfig
Channel config.
virtual AK::SpeakerVolumes::ConstVectorPtr GetTruePeak()=0
AkUInt16 uMaxFrames
Number of sample frames the buffer can hold. Access through AkAudioBuffer::MaxFrames().
AkForceInline void Clear()
Clear the channel config. Becomes "invalid" (IsValid() returns false).
AkForceInline void AkMemSet(void *pDest, AkInt32 iVal, AkUInt32 uSize)
Platform Independent Helper
AkForceInline AkUInt32 GetNumNonZeroBits(AkUInt32 in_uWord)
void ZeroPadToMaxFrames()
AkForceInline void AttachContiguousDeinterleavedData(void *in_pData, AkUInt16 in_uMaxFrames, AkUInt16 in_uValidFrames, AkChannelConfig in_channelConfig)
Attach deinterleaved data where channels are contiguous in memory. Allocation is performed outside.
AkForceInline bool HasLFE() const
AkForceInline void * GetInterleavedData()
virtual AK::SpeakerVolumes::ConstVectorPtr GetPeak()=0
virtual ~IAkMetering()
Virtual destructor on interface to avoid warnings.
AkForceInline void ClearData()
Clear data pointer.
const AkReal32 * ConstVectorPtr
Constant volume vector. Access each element with the standard bracket [] operator.
virtual AK::SpeakerVolumes::ConstVectorPtr GetRMS()=0
void AttachInterleavedData(void *in_pData, AkUInt16 in_uMaxFrames, AkUInt16 in_uValidFrames, AkChannelConfig in_channelConfig)
Attach interleaved data. Allocation is performed outside.
AkForceInline AkUInt16 MaxFrames() const
あなたのプロジェクトについて教えてください。ご不明な点はありませんか。
プロジェクトを登録していただくことで、ご利用開始のサポートをいたします。
Wwiseからはじめよう