本文整理汇总了C++中GetPropertyData函数的典型用法代码示例。如果您正苦于以下问题:C++ GetPropertyData函数的具体用法?C++ GetPropertyData怎么用?C++ GetPropertyData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetPropertyData函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: theAddress
void 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];
}
示例2: theAddress
CFStringRef 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;
}
示例3: sizeof
AudioObjectID 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;
}
示例4: sizeof
void 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);
}
示例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());
}
示例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);
}
示例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;
}
示例8: GetNumberDevices
AudioDeviceID 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;
}
示例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;
}
示例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;
}
示例11: theAddress
AudioClassID 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;
}
示例12: GetPropertyData
OSStatus
PA_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);
}
示例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;
}
示例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;
}
示例15: if
AudioDeviceID 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;
}