这篇教程C++ GetPropertyData函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetPropertyData函数的典型用法代码示例。如果您正苦于以下问题:C++ GetPropertyData函数的具体用法?C++ GetPropertyData怎么用?C++ GetPropertyData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetPropertyData函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: theAddressvoid CAHALAudioDevice::GetStereoPanControlChannels(AudioObjectPropertyScope inScope, UInt32 inChannel, UInt32& outLeftChannel, UInt32& outRightChannel) const{ CAPropertyAddress theAddress(kAudioDevicePropertyStereoPanChannels, inScope, inChannel); UInt32 theValue[2] = { 0, 0 }; UInt32 theSize = 2 * sizeof(UInt32); GetPropertyData(theAddress, 0, NULL, theSize, theValue); outLeftChannel = theValue[0]; outRightChannel = theValue[1];}
开发者ID:11020156,项目名称:SampleCode,代码行数:9,
示例2: theAddressCFStringRef CAHALAudioDevice::CopyDataDestinationNameForID(AudioObjectPropertyScope inScope, UInt32 inChannel, UInt32 inID) const{ CAPropertyAddress theAddress(kAudioDevicePropertyPlayThruDestinationNameForIDCFString, inScope, inChannel); CFStringRef theAnswer = NULL; AudioValueTranslation theTranslation = { &inID, sizeof(UInt32), &theAnswer, sizeof(CFStringRef) }; UInt32 theSize = sizeof(AudioValueTranslation); GetPropertyData(theAddress, 0, NULL, theSize, &theTranslation); return theAnswer;}
开发者ID:Michael-Lfx,项目名称:iOS,代码行数:9,
示例3: sizeofAudioObjectID CAHALAudioSystemObject::GetAudioPlugInForBundleID(CFStringRef inUID) const{ AudioObjectID theAnswer = kAudioObjectUnknown; AudioValueTranslation theValue = { &inUID, sizeof(CFStringRef), &theAnswer, sizeof(AudioObjectID) }; CAPropertyAddress theAddress(kAudioHardwarePropertyPlugInForBundleID); UInt32 theSize = sizeof(AudioValueTranslation); GetPropertyData(theAddress, 0, NULL, theSize, &theValue); return theAnswer;}
开发者ID:11020156,项目名称:SampleCode,代码行数:9,
示例4: sizeofvoid CAAudioHardwareStream::GetAvailableDataSources(UInt32& ioNumberSources, UInt32* outSources) const{ UInt32 theNumberSources = std::min(GetNumberAvailableDataSources(), ioNumberSources); UInt32 theSize = theNumberSources * sizeof(UInt32); GetPropertyData(0, kAudioDevicePropertyDataSources, theSize, outSources); ioNumberSources = theSize / sizeof(UInt32); UInt32* theFirstItem = &(outSources[0]); UInt32* theLastItem = theFirstItem + ioNumberSources; std::sort(theFirstItem, theLastItem);}
开发者ID:NikolaiUgelvik,项目名称:sooperlooper,代码行数:10,
示例5: CA4CCToCString void Control::Show() const { // Make a string for the class ID char classID[] = CA4CCToCString(mClassID); // Get the object's name PropertyAddress address(kCMIOObjectPropertyName, kCMIOObjectPropertyScopeGlobal, kCMIOObjectPropertyElementMaster); CFStringRef cfname = NULL; UInt32 dataUsed = 0; try { GetPropertyData(address, 0, NULL, sizeof(CFStringRef), dataUsed, &cfname); } catch(...) { cfname = NULL; } // Make a C string out of the name char name[256]; name[0] = 0; if (cfname != NULL) { CFIndex length = 0; CFRange range = { 0, CFStringGetLength(cfname) }; CFStringGetBytes(cfname, range, kCFStringEncodingUTF8, 0, false, (UInt8*)name, 255, &length); name[length] = 0; CFRelease(cfname); } // Get a string for the scope const char* scope = NULL; switch (GetPropertyScope()) { case kCMIODevicePropertyScopeInput: scope = "Input"; break; case kCMIODevicePropertyScopeOutput: scope = "Output"; break; case kCMIODevicePropertyScopePlayThrough: scope = "Play Through"; break; case kCMIOObjectPropertyScopeGlobal: default: scope = "Global"; break; }; // Print the information to the standard output printf("CMIOObjectID:/t/t0x%lX/n/tCMIOClassID:/t'%s'/n/tName:/t/t/t%s/n/tScope:/t/t/t%s/n/tChannel:/t/t%lu/n", (long unsigned int)mObjectID, classID, name, scope, (long unsigned int)GetPropertyElement()); }
开发者ID:AdamDiment,项目名称:CocoaSampleCode,代码行数:55,
示例6: sizeof void Device::GetStreams(CMIOObjectPropertyScope scope, UInt32& ioNumberStreams, CMIOStreamID* streamList) const { ioNumberStreams = std::min(GetNumberStreams(scope), ioNumberStreams); UInt32 size = ioNumberStreams * sizeof(CMIOStreamID); UInt32 dataUsed = 0; GetPropertyData(PropertyAddress(kCMIODevicePropertyStreams, scope), 0, NULL, size, dataUsed, streamList); ioNumberStreams = size / sizeof(CMIOStreamID); CMIOStreamID* firstItem = &(streamList[0]); CMIOStreamID* lastItem = firstItem + ioNumberStreams; std::sort(firstItem, lastItem); }
开发者ID:AdamDiment,项目名称:CocoaSampleCode,代码行数:11,
示例7: HasProperty bool Device::IsAlive() const { bool answer = HasProperty(PropertyAddress(kCMIODevicePropertyDeviceIsAlive)); if (answer) { UInt32 isAlive = 0; UInt32 dataUsed = 0; GetPropertyData(PropertyAddress(kCMIODevicePropertyDeviceIsAlive), 0, NULL, sizeof(UInt32), dataUsed, &isAlive); answer = isAlive != 0; } return answer; }
开发者ID:AdamDiment,项目名称:CocoaSampleCode,代码行数:12,
示例8: GetNumberDevicesAudioDeviceID CAAudioHardwareSystem::GetDeviceAtIndex(UInt32 inIndex){ AudioDeviceID theAnswer = 0; UInt32 theNumberDevices = GetNumberDevices(); if((theNumberDevices > 0) && (inIndex < theNumberDevices)) { CAAutoArrayDelete<AudioDeviceID> theDeviceList(theNumberDevices); UInt32 theSize = theNumberDevices * sizeof(AudioDeviceID); GetPropertyData(kAudioHardwarePropertyDevices, theSize, theDeviceList); theAnswer = theDeviceList[inIndex]; } return theAnswer;}
开发者ID:BitMax,项目名称:openitg,代码行数:13,
示例9: GetNumberItems UInt32 SelectorControl::GetItemIDForIndex(UInt32 inItemIndex) const { UInt32 answer = 0xFFFFFFFF; // Default to the featuring being on UInt32 numberOfItems = GetNumberItems(); if (numberOfItems > 0) { ThrowIf(inItemIndex >= numberOfItems, CAException(kCMIOHardwareIllegalOperationError), "SelectorControl::GetItemIDForIndex: index out of range"); CAAutoArrayDelete<UInt32> itemList(numberOfItems); UInt32 size = numberOfItems * sizeof(CMIODeviceID); UInt32 dataUsed = 0; GetPropertyData(PropertyAddress(kCMIOSelectorControlPropertyAvailableItems),0, NULL, size, dataUsed, itemList); answer = itemList[inItemIndex]; } return answer; }
开发者ID:AdamDiment,项目名称:CocoaSampleCode,代码行数:15,
示例10: address UInt32 Device::GetTotalNumberChannels(CMIOObjectPropertyScope scope) const { UInt32 answer = 0; #warning Device::GetTotalNumberChannels() needs to be implemented PropertyAddress address(kCMIODevicePropertyStreamConfiguration, scope); UInt32 size = GetPropertyDataSize(address, 0, NULL); CAAutoFree<CMIODeviceStreamConfiguration> streamConfiguration(size); UInt32 dataUsed = 0; GetPropertyData(address, 0, NULL, size, dataUsed, streamConfiguration); for(UInt32 index = 0; index < streamConfiguration->mNumberStreams; ++index) { answer += streamConfiguration->mNumberChannels[index]; } return answer; }
开发者ID:AdamDiment,项目名称:CocoaSampleCode,代码行数:16,
示例11: theAddressAudioClassID CAHALAudioObject::GetClassID() const{ // set up the return value AudioClassID theAnswer = 0; // set up the property address CAPropertyAddress theAddress(kAudioObjectPropertyClass); // make sure the property exists if(HasProperty(theAddress)) { UInt32 theSize = sizeof(AudioClassID); GetPropertyData(theAddress, 0, NULL, theSize, &theAnswer); } return theAnswer;}
开发者ID:NikolaiUgelvik,项目名称:sooperlooper,代码行数:17,
示例12: GetPropertyDataOSStatusPA_Stream::GetProperty(UInt32 inChannel, AudioDevicePropertyID inPropertyID, UInt32 *ioPropertyDataSize, void *outPropertyData){ AudioObjectPropertyAddress addr; addr.mSelector = inPropertyID; addr.mElement = inChannel; addr.mScope = 0; if (!HasProperty(&addr)) return kAudioHardwareUnknownPropertyError; return GetPropertyData(&addr, 0, NULL, ioPropertyDataSize, outPropertyData);}
开发者ID:artisdom,项目名称:PulseAudioOSX,代码行数:17,
示例13: GetClassID //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- // Control::GetVariant() //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- UInt32 Control::GetVariant() const { // Setup the answer CMIOObjectPropertyElement answer = GetClassID(); // Setup the property address PropertyAddress address(kCMIOControlPropertyVariant); // Make sure the property exists if (HasProperty(address)) { // Get the property data UInt32 dataUsed = 0; GetPropertyData(address, 0, NULL, sizeof(UInt32), dataUsed, &answer); } return answer; }
开发者ID:AdamDiment,项目名称:CocoaSampleCode,代码行数:21,
示例14: address //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- // Control::GetPropertyScope() // Get the CMIOObjectPropertyScope IN THE OWNING CMIOObject that contains the control. (Controls themselves only have kCMIOObjectPropertyScopeGlobal) //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- CMIOObjectPropertyScope Control::GetPropertyScope() const { // Setup the answer CMIOObjectPropertyScope answer = kCMIOObjectPropertyScopeGlobal; // Setup the property address PropertyAddress address(kCMIOControlPropertyScope); // Make sure the property exists if (HasProperty(address)) { // Get the property data UInt32 dataUsed = 0; GetPropertyData(address, 0, NULL, sizeof(CMIOObjectPropertyScope), dataUsed, &answer); } return answer; }
开发者ID:AdamDiment,项目名称:CocoaSampleCode,代码行数:22,
示例15: ifAudioDeviceID CAAudioHardwareSystem::GetDefaultDevice(bool inIsInput, bool inIsSystem){ AudioDeviceID theAnswer = 0; AudioHardwarePropertyID thePropertyID = 0; if(inIsInput) { thePropertyID = kAudioHardwarePropertyDefaultInputDevice; } else if(inIsSystem) { thePropertyID = kAudioHardwarePropertyDefaultSystemOutputDevice; } else { thePropertyID = kAudioHardwarePropertyDefaultOutputDevice; } UInt32 theSize = sizeof(AudioDeviceID); GetPropertyData(thePropertyID, theSize, &theAnswer); return theAnswer;}
开发者ID:BitMax,项目名称:openitg,代码行数:20,
注:本文中的GetPropertyData函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetProtocol函数代码示例 C++ GetProperty函数代码示例 |