当前位置: 首页>>代码示例>>C++>>正文


C++ SizeOf32函数代码示例

本文整理汇总了C++中SizeOf32函数的典型用法代码示例。如果您正苦于以下问题:C++ SizeOf32函数的具体用法?C++ SizeOf32怎么用?C++ SizeOf32使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SizeOf32函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: theAddress

void	CAHALAudioDevice::GetStreams(bool inIsInput, UInt32& ioNumberStreams, AudioObjectID* outStreamList) const
{
	CAPropertyAddress theAddress(kAudioDevicePropertyStreams, inIsInput ? kAudioDevicePropertyScopeInput : kAudioDevicePropertyScopeOutput);
	UInt32 theSize = ioNumberStreams * SizeOf32(AudioObjectID);
	GetPropertyData(theAddress, 0, NULL, theSize, outStreamList);
	ioNumberStreams = theSize / SizeOf32(AudioObjectID);
}
开发者ID:Michael-Lfx,项目名称:iOS,代码行数:7,代码来源:CAHALAudioDevice.cpp

示例2: theAddress

void	CAHALAudioStream::GetAvailablePhysicalFormats(UInt32& ioNumberFormats, AudioStreamRangedDescription* outFormats) const
{
	CAPropertyAddress theAddress(kAudioStreamPropertyAvailablePhysicalFormats);
	UInt32 theSize = ioNumberFormats * SizeOf32(AudioStreamRangedDescription);
	GetPropertyData(theAddress, 0, NULL, theSize, outFormats);
	ioNumberFormats = theSize / SizeOf32(AudioStreamRangedDescription);
}
开发者ID:Halfnhav4,项目名称:methcla,代码行数:7,代码来源:CAHALAudioStream.cpp

示例3: switch

void	ACAppleIMA4Encoder::GetPropertyInfo(AudioCodecPropertyID inPropertyID, UInt32& outPropertyDataSize, Boolean& outWritable)
{
	switch(inPropertyID)
	{
		case kAudioCodecPropertyAvailableNumberChannels:
			outPropertyDataSize = SizeOf32(UInt32) * kMaxIMA4Channels;
			outWritable = false;
			break;

		case kAudioCodecPropertyAvailableInputSampleRates:
			outPropertyDataSize = SizeOf32(AudioValueRange);
			outWritable = false;
			break;
			
		case kAudioCodecPropertyAvailableOutputSampleRates:
			outPropertyDataSize = SizeOf32(AudioValueRange);
			outWritable = false;
			break;
			
		case kAudioCodecPropertyZeroFramesPadded:
			outPropertyDataSize = SizeOf32(UInt32);
			outWritable = false;
			break;
			
 		case kAudioCodecPropertyPrimeInfo:
			outPropertyDataSize = SizeOf32(AudioCodecPrimeInfo);
			outWritable = false;
			break;
            		            		
		default:
			ACAppleIMA4Codec::GetPropertyInfo(inPropertyID, outPropertyDataSize, outWritable);
			break;
			
	};
}
开发者ID:AdamDiment,项目名称:CocoaSampleCode,代码行数:35,代码来源:ACAppleIMA4Encoder.cpp

示例4: theAddress

void	CAHALAudioSystemObject::GetAudioDevices(UInt32& ioNumberAudioDevices, AudioObjectID* outAudioDevices) const
{
	CAPropertyAddress theAddress(kAudioHardwarePropertyDevices);
	UInt32 theSize = ioNumberAudioDevices * SizeOf32(AudioObjectID);
	GetPropertyData(theAddress, 0, NULL, theSize, outAudioDevices);
	ioNumberAudioDevices = theSize / SizeOf32(AudioObjectID);
}
开发者ID:Michael-Lfx,项目名称:iOS,代码行数:7,代码来源:CAHALAudioSystemObject.cpp

示例5: theAddress

UInt32	CAHALAudioObject::GetNumberOwnedObjects(AudioClassID inClass) const
{
    //	set up the return value
    UInt32 theAnswer = 0;

    //	set up the property address
    CAPropertyAddress theAddress(kAudioObjectPropertyOwnedObjects);

    //	figure out the qualifier
    UInt32 theQualifierSize = 0;
    void* theQualifierData = NULL;
    if(inClass != 0)
    {
        theQualifierSize = sizeof(AudioObjectID);
        theQualifierData = &inClass;
    }

    //	get the property data size
    theAnswer = GetPropertyDataSize(theAddress, theQualifierSize, theQualifierData);

    //	calculate the number of object IDs
    theAnswer /= SizeOf32(AudioObjectID);

    return theAnswer;
}
开发者ID:kuolei,项目名称:CocoaSampleCode,代码行数:25,代码来源:CAHALAudioObject.cpp

示例6: SizeOf32

bool	HP_SystemInfo::IsCurrentProcessInitingOrExiting()
{
	UInt32 isInitingOrExiting = 0;
	UInt32 theSize = SizeOf32(UInt32);
	AudioObjectPropertyAddress theAddress = { kAudioHardwarePropertyIsInitingOrExiting, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster };
	AudioObjectGetPropertyData(kAudioObjectSystemObject, &theAddress, 0, NULL, &theSize, &isInitingOrExiting);
	return isInitingOrExiting != 0;
}
开发者ID:abscura,项目名称:audiounitjs,代码行数:8,代码来源:HP_SystemInfo.cpp

示例7: switch

OSStatus	HP_SystemInfo::SystemListener(AudioObjectID inObjectID, UInt32 inNumberAddresses, const AudioObjectPropertyAddress inAddresses[], void* /*inClientData*/)
{
	if(inObjectID == kAudioObjectSystemObject)
	{
		for(UInt32 theAddressIndex = 0; theAddressIndex < inNumberAddresses; ++theAddressIndex)
		{
			switch(inAddresses[theAddressIndex].mSelector)
			{
				case 'user':	//	kAudioHardwarePropertyUserSessionIsActiveOrHeadless
					{
						CAPropertyAddress theAddress('user');	//	kAudioHardwarePropertyUserSessionIsActiveOrHeadless
						UInt32 theUserSessionIsActiveOrHeadless = 1;
						UInt32 theSize = SizeOf32(UInt32);
						AudioObjectGetPropertyData(kAudioObjectSystemObject, &theAddress, 0, NULL, &theSize, &theUserSessionIsActiveOrHeadless);
						sCurrentUserSessionIsActiveOrHeadless = theUserSessionIsActiveOrHeadless != 0;
					}
					break;
				
				case 'pmut':	//	kAudioHardwarePropertyProcessIsAudible
					{
						CAPropertyAddress theAddress('pmut');	//	kAudioHardwarePropertyProcessIsAudible
						UInt32 theProcessIsAudible = 1;
						UInt32 theSize = SizeOf32(UInt32);
						AudioObjectGetPropertyData(kAudioObjectSystemObject, &theAddress, 0, NULL, &theSize, &theProcessIsAudible);
						sCurrentProcessIsAudible = theProcessIsAudible != 0;
					}
					break;
				
				case 'stmo':	//	kAudioHardwarePropertyMixStereoToMono
					{
						CAPropertyAddress theAddress('stmo');	//	kAudioHardwarePropertyMixStereoToMono
						UInt32 theIsMixingStereoToMono = 1;
						UInt32 theSize = SizeOf32(UInt32);
						OSStatus theError = AudioObjectGetPropertyData(kAudioObjectSystemObject, &theAddress, 0, NULL, &theSize, &theIsMixingStereoToMono);
						if(theError == 0)
						{
							sIsMixingStereoToMono = theIsMixingStereoToMono != 0;
						}
					}
					break;
			};
		}
	}

	return 0;
}
开发者ID:abscura,项目名称:audiounitjs,代码行数:46,代码来源:HP_SystemInfo.cpp

示例8: GetNumberStreams

void	CAHALAudioDevice::SetIOProcStreamUsage(AudioDeviceIOProcID inIOProcID, bool inIsInput, const bool* inStreamUsage)
{
	//	make an AudioHardwareIOProcStreamUsage the right size
	UInt32 theNumberStreams = GetNumberStreams(inIsInput);
	UInt32 theSize = SizeOf32(void*) + SizeOf32(UInt32) + (theNumberStreams * SizeOf32(UInt32));
	CAAutoFree<AudioHardwareIOProcStreamUsage> theStreamUsage(theSize);
	
	//	set it up
	theStreamUsage->mIOProc = reinterpret_cast<void*>(inIOProcID);
	theStreamUsage->mNumberStreams = theNumberStreams;
	for(UInt32 theIndex = 0; theIndex < theNumberStreams; ++theIndex)
	{
		theStreamUsage->mStreamIsOn[theIndex] = (inStreamUsage[theIndex] ? 1 : 0);
	}
	
	//	set the property
	CAPropertyAddress theAddress(kAudioDevicePropertyIOProcStreamUsage, inIsInput ? kAudioDevicePropertyScopeInput : kAudioDevicePropertyScopeOutput);
	SetPropertyData(theAddress, 0, NULL, theSize, theStreamUsage);
}
开发者ID:Michael-Lfx,项目名称:iOS,代码行数:19,代码来源:CAHALAudioDevice.cpp

示例9: switch

void	ACSimpleCodec::GetPropertyInfo(AudioCodecPropertyID inPropertyID, UInt32& outPropertyDataSize, Boolean& outWritable)
{
	switch(inPropertyID)
	{
		case kAudioCodecPropertyInputBufferSize:
			outPropertyDataSize = SizeOf32(UInt32);
			outWritable = true;
			break;
		default:
			ACBaseCodec::GetPropertyInfo(inPropertyID, outPropertyDataSize, outWritable);
			break;
	}

}
开发者ID:0xJoker,项目名称:apple-ios-samples,代码行数:14,代码来源:ACSimpleCodec.cpp

示例10: SizeOf32

bool	CAAudioBufferList::HasData(AudioBufferList& inBufferList)
{
	bool hasData = false;
	for(UInt32 theBufferIndex = 0; !hasData && (theBufferIndex < inBufferList.mNumberBuffers); ++theBufferIndex)
	{
		if(inBufferList.mBuffers[theBufferIndex].mData != NULL)
		{
			UInt32* theBuffer = (UInt32*)inBufferList.mBuffers[theBufferIndex].mData;
			UInt32 theNumberSamples = inBufferList.mBuffers[theBufferIndex].mDataByteSize / SizeOf32(UInt32);
			for(UInt32 theSampleIndex = 0; !hasData && (theSampleIndex < theNumberSamples); ++theSampleIndex)
			{
				hasData = theBuffer[theSampleIndex] != 0;
			}
		}
	}
	return hasData;
}
开发者ID:AdamDiment,项目名称:CocoaSampleCode,代码行数:17,代码来源:CAAudioBufferList.cpp

示例11: switch

UInt32	HP_PreferredChannels::GetPropertyDataSize(const AudioObjectPropertyAddress& inAddress, UInt32 /*inQualifierDataSize*/, const void* /*inQualifierData*/) const
{
	UInt32 theAnswer = 0;
	
	switch(inAddress.mSelector)
	{
		case kAudioDevicePropertyPreferredChannelsForStereo:
			theAnswer = 2 * SizeOf32(UInt32);
			break;
			
		case kAudioDevicePropertyPreferredChannelLayout:
			theAnswer = CAAudioChannelLayout::CalculateByteSize(mDevice->GetTotalNumberChannels(inAddress.mScope == kAudioDevicePropertyScopeInput));
			break;
			
		case 'srdd':
			theAnswer = CAAudioChannelLayout::CalculateByteSize(mDevice->GetTotalNumberChannels(inAddress.mScope == kAudioDevicePropertyScopeInput));
			break;
	};
	
	return theAnswer;
}
开发者ID:abscura,项目名称:audiounitjs,代码行数:21,代码来源:HP_PreferredChannels.cpp

示例12: ACAppleIMA4Codec

ACAppleIMA4Encoder::ACAppleIMA4Encoder(AudioComponentInstance inInstance)
:
	ACAppleIMA4Codec(kInputBufferPackets * kIMAFramesPerPacket * SizeOf32(SInt16), inInstance), 
	mEndOfInput(false), mZeroPaddedOnce(false), mZeroesPadded(0)
{
	//	This encoder only accepts 16 bit native endian signed integer as it's input,
	//	but can handle any sample rate and any number of channels
	CAStreamBasicDescription theInputFormat(kAudioStreamAnyRate, kAudioFormatLinearPCM, 0, 1, 0, 0, 16, kAudioFormatFlagsNativeEndian | kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked);
	AddInputFormat(theInputFormat);
	
	//	set our intial input format to mono 16 bit native endian signed integer at a 44100 sample rate
	mInputFormat.mSampleRate = 44100;
	mInputFormat.mFormatID = kAudioFormatLinearPCM;
	mInputFormat.mFormatFlags = kAudioFormatFlagsNativeEndian | kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked;
	mInputFormat.mBytesPerPacket = 2;
	mInputFormat.mFramesPerPacket = 1;
	mInputFormat.mBytesPerFrame = 2;
	mInputFormat.mChannelsPerFrame = 1;
	mInputFormat.mBitsPerChannel = 16;
	
	//	This encoder only puts out an Acme IMA4 stream
	CAStreamBasicDescription theOutputFormat(kAudioStreamAnyRate, 'DEMO', 0, kIMAFramesPerPacket, 0, 0, 0, 0);
	AddOutputFormat(theOutputFormat);

	//	set our intial output format to mono Apple IMA4 at a 44100 sample rate
	mOutputFormat.mSampleRate = 44100;
	mOutputFormat.mFormatID = 'DEMO';
	mOutputFormat.mFormatFlags = 0;
	mOutputFormat.mBytesPerPacket = kIMA4PacketBytes;
	mOutputFormat.mFramesPerPacket = kIMAFramesPerPacket;
	mOutputFormat.mBytesPerFrame = 0;
	mOutputFormat.mChannelsPerFrame = 1;
	mOutputFormat.mBitsPerChannel = 0;
	
	mSupportedChannelTotals[0] = 1;
	mSupportedChannelTotals[1] = 2;

	//	initialize our channel state
	InitializeChannelStateList();
}
开发者ID:AdamDiment,项目名称:CocoaSampleCode,代码行数:40,代码来源:ACAppleIMA4Encoder.cpp

示例13: switch

void	ACBaseCodec::GetPropertyInfo(AudioCodecPropertyID inPropertyID, UInt32& outPropertyDataSize, Boolean& outWritable)
{
	switch(inPropertyID)
	{
		case kAudioCodecPropertyNameCFString:
			outPropertyDataSize = SizeOf32(CFStringRef);
			outWritable = false;
			break;
			
		case kAudioCodecPropertyManufacturerCFString:
			outPropertyDataSize = SizeOf32(CFStringRef);
			outWritable = false;
			break;
			
		case kAudioCodecPropertyFormatCFString:
			outPropertyDataSize = SizeOf32(CFStringRef);
			outWritable = false;
			break;
		case kAudioCodecPropertyRequiresPacketDescription:
			outPropertyDataSize = SizeOf32(UInt32);
			outWritable = false;
			break;
			
		case kAudioCodecPropertyMinimumNumberInputPackets :
			outPropertyDataSize = SizeOf32(UInt32);
			outWritable = false;
			break;
			
		case kAudioCodecPropertyMinimumNumberOutputPackets :
			outPropertyDataSize = SizeOf32(UInt32);
			outWritable = false;
			break;

		case kAudioCodecPropertyCurrentInputFormat:
			outPropertyDataSize = SizeOf32(AudioStreamBasicDescription);
			outWritable = true;
			break;
			
		case kAudioCodecPropertySupportedInputFormats:
		case kAudioCodecPropertyInputFormatsForOutputFormat:
			outPropertyDataSize = GetNumberSupportedInputFormats() * SizeOf32(AudioStreamBasicDescription);
			outWritable = false;
			break;
			
		case kAudioCodecPropertyCurrentOutputFormat:
			outPropertyDataSize = SizeOf32(AudioStreamBasicDescription);
			outWritable = true;
			break;
			
		case kAudioCodecPropertySupportedOutputFormats:
		case kAudioCodecPropertyOutputFormatsForInputFormat:
			outPropertyDataSize = GetNumberSupportedOutputFormats() * SizeOf32(AudioStreamBasicDescription);
			outWritable = false;
			break;
			
		case kAudioCodecPropertyMagicCookie:
			outPropertyDataSize = GetMagicCookieByteSize();
			outWritable = true;
			break;
			
		case kAudioCodecPropertyInputBufferSize:
			outPropertyDataSize = SizeOf32(UInt32);
			outWritable = false;
			break;
			
		case kAudioCodecPropertyUsedInputBufferSize:
			outPropertyDataSize = SizeOf32(UInt32);
			outWritable = false;
			break;
		
		case kAudioCodecPropertyIsInitialized:
			outPropertyDataSize = SizeOf32(UInt32);
			outWritable = false;
			break;

		case kAudioCodecPropertyAvailableNumberChannels:
			outPropertyDataSize = SizeOf32(UInt32) * 2; // Mono, stereo
			outWritable = false;
			break;
			
 		case kAudioCodecPropertyPrimeMethod:
			outPropertyDataSize = SizeOf32(UInt32);
			outWritable = false;
			break;

 		case kAudioCodecPropertyPrimeInfo:
			outPropertyDataSize = SizeOf32(AudioCodecPrimeInfo);
			outWritable = false;
			break;

 		case kAudioCodecPropertyDoesSampleRateConversion:
			outPropertyDataSize = SizeOf32(UInt32);
			outWritable = false;
			break;

		default:
			CODEC_THROW(kAudioCodecUnknownPropertyError);
			break;
			
	};
//.........这里部分代码省略.........
开发者ID:abscura,项目名称:audiounitjs,代码行数:101,代码来源:ACBaseCodec.cpp


注:本文中的SizeOf32函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。