本文整理汇总了C++中Profile::SetValue方法的典型用法代码示例。如果您正苦于以下问题:C++ Profile::SetValue方法的具体用法?C++ Profile::SetValue怎么用?C++ Profile::SetValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Profile
的用法示例。
在下文中一共展示了Profile::SetValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HideProcess
void ProcessModel::HideProcess(int puid)
{
// Modify the Model
int index = GetProcessIndex(puid);
Lock();
if (index != -1)
{
_processes[index].hidden = true;
}
Unlock();
if (index != -1)
{
// Update View
if (!ProcessView::IsHidden())
{
ProcessView::Update(false, true);
}
else
{
ProcessView::Update(true);
}
// Update Profile
std::vector<int> hiddenProcesses;
ExportHiddenProcesses(hiddenProcesses);
g_profile.SetValue(TEXT("HiddenProcess"), new ProfileIntListItem(hiddenProcesses));
}
}
示例2: GetDefaultProfile
// Returns a profile with all system default values
Profile* ProfileManager::GetDefaultProfile(HmdTypeEnum device)
{
// In the absence of any data, set some reasonable profile defaults.
// However, this is not future proof and developers should still
// provide reasonable default values for queried fields.
// Biometric data
Profile* profile = CreateProfile();
profile->SetValue(OVR_KEY_USER, "default");
profile->SetValue(OVR_KEY_NAME, "Default");
profile->SetValue(OVR_KEY_GENDER, OVR_DEFAULT_GENDER);
profile->SetFloatValue(OVR_KEY_PLAYER_HEIGHT, OVR_DEFAULT_PLAYER_HEIGHT);
profile->SetFloatValue(OVR_KEY_EYE_HEIGHT, OVR_DEFAULT_EYE_HEIGHT);
profile->SetFloatValue(OVR_KEY_IPD, OVR_DEFAULT_IPD);
float half_ipd[2] = { OVR_DEFAULT_IPD / 2, OVR_DEFAULT_IPD / 2 };
profile->SetFloatValues(OVR_KEY_EYE_TO_NOSE_DISTANCE, half_ipd, 2);
float dist[2] = {OVR_DEFAULT_NECK_TO_EYE_HORIZONTAL, OVR_DEFAULT_NECK_TO_EYE_VERTICAL};
profile->SetFloatValues(OVR_KEY_NECK_TO_EYE_DISTANCE, dist, 2);
// Device specific data
if (device != HmdType_None)
{
if (device == HmdType_CrystalCoveProto || device == HmdType_DK2)
{
profile->SetValue("EyeCup", "A");
profile->SetIntValue(OVR_KEY_EYE_RELIEF_DIAL, OVR_DEFAULT_EYE_RELIEF_DIAL);
// TODO: These defaults are a little bogus and designed for continuity with 0.3
// eye-relief values. We need better measurement-based numbers in future releases
float max_eye_plate[2] = { 0.01965f + 0.017f, 0.01965f + 0.017f };
profile->SetFloatValues(OVR_KEY_MAX_EYE_TO_PLATE_DISTANCE, max_eye_plate, 2);
}
else
{ // DK1 and DKHD variants
profile->SetValue("EyeCup", "A");
profile->SetIntValue(OVR_KEY_EYE_RELIEF_DIAL, OVR_DEFAULT_EYE_RELIEF_DIAL);
// TODO: These defaults are a little bogus and designed for continuity with 0.3
// DK1 distortion. We need better measurement-based numbers in future releases
float max_eye_plate[2] = { 0.02357f + 0.017f, 0.02357f + 0.017f };
profile->SetFloatValues(OVR_KEY_MAX_EYE_TO_PLATE_DISTANCE, max_eye_plate, 2);
}
}
return profile;
}
示例3: GetTaggedProfile
//-----------------------------------------------------------------------------
Profile* ProfileManager::GetTaggedProfile(const char** tag_names, const char** tags, int num_tags)
{
Lock::Locker lockScope(&ProfileLock);
if (ProfileCache == NULL)
{ // Load the cache
LoadCache(false);
if (ProfileCache == NULL)
return NULL;
}
JSON* tagged_data = ProfileCache->GetItemByName("TaggedData");
OVR_ASSERT(tagged_data);
if (tagged_data == NULL)
return NULL;
Profile* profile = new Profile(BasePath);
JSON* vals = FindTaggedData(tagged_data, tag_names, tags, num_tags);
if (vals)
{
JSON* item = vals->GetFirstItem();
while (item)
{
//printf("Add %s, %s\n", item->Name.ToCStr(), item->Value.ToCStr());
//profile->Settings.Set(item->Name, item->Value);
profile->SetValue(item);
item = vals->GetNextItem(item);
}
return profile;
}
else
{
profile->Release();
return NULL;
}
}