本文整理汇总了C++中CSettingInt::GetId方法的典型用法代码示例。如果您正苦于以下问题:C++ CSettingInt::GetId方法的具体用法?C++ CSettingInt::GetId怎么用?C++ CSettingInt::GetId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSettingInt
的用法示例。
在下文中一共展示了CSettingInt::GetId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateSettings
void CGUIDialogPeripheralSettings::CreateSettings()
{
m_bIsInitialising = true;
m_usePopupSliders = g_SkinInfo->HasSkinFile("DialogSlider.xml");
if (m_item)
{
CPeripheral *peripheral = g_peripherals.GetByPath(m_item->GetPath());
if (peripheral)
{
vector<CSetting *> settings = peripheral->GetSettings();
for (size_t iPtr = 0; iPtr < settings.size(); iPtr++)
{
CSetting *setting = settings[iPtr];
if (!setting->IsVisible())
{
CLog::Log(LOGDEBUG, "%s - invisible", __FUNCTION__);
continue;
}
switch(setting->GetType())
{
case SettingTypeBool:
{
CSettingBool *boolSetting = (CSettingBool *) setting;
if (boolSetting)
{
m_boolSettings.insert(make_pair(CStdString(boolSetting->GetId()), boolSetting->GetValue()));
AddBool(m_settingId++, boolSetting->GetLabel(), &m_boolSettings[boolSetting->GetId()], true);
}
}
break;
case SettingTypeInteger:
{
CSettingInt *intSetting = (CSettingInt *) setting;
if (intSetting)
{
if (intSetting->GetControl()->GetFormat() == "integer")
{
m_intSettings.insert(make_pair(CStdString(intSetting->GetId()), (float) intSetting->GetValue()));
AddSlider(m_settingId++, intSetting->GetLabel(), &m_intSettings[intSetting->GetId()], (float)intSetting->GetMinimum(), (float)intSetting->GetStep(), (float)intSetting->GetMaximum(), CGUIDialogVideoSettings::FormatInteger, false);
}
else if (intSetting->GetControl()->GetFormat() == "string")
{
m_intTextSettings.insert(make_pair(CStdString(intSetting->GetId()), intSetting->GetValue()));
vector<pair<int, int> > entries;
StaticIntegerSettingOptions::const_iterator entriesItr = intSetting->GetOptions().begin();
while (entriesItr != intSetting->GetOptions().end())
{
entries.push_back(make_pair(entriesItr->first, entriesItr->second));
++entriesItr;
}
AddSpin(m_settingId++, intSetting->GetLabel(), &m_intTextSettings[intSetting->GetId()], entries);
}
}
}
break;
case SettingTypeNumber:
{
CSettingNumber *floatSetting = (CSettingNumber *) setting;
if (floatSetting)
{
m_floatSettings.insert(make_pair(CStdString(floatSetting->GetId()), (float)floatSetting->GetValue()));
AddSlider(m_settingId++, floatSetting->GetLabel(), &m_floatSettings[floatSetting->GetId()], (float)floatSetting->GetMinimum(), (float)floatSetting->GetStep(), (float)floatSetting->GetMaximum(), CGUIDialogVideoSettings::FormatFloat, false);
}
}
break;
case SettingTypeString:
{
CSettingString *stringSetting = (CSettingString *) setting;
if (stringSetting)
{
m_stringSettings.insert(make_pair(CStdString(stringSetting->GetId()), stringSetting->GetValue()));
AddString(m_settingId++, stringSetting->GetLabel(), &m_stringSettings[stringSetting->GetId()]);
}
}
break;
default:
//TODO add more types if needed
CLog::Log(LOGDEBUG, "%s - unknown type", __FUNCTION__);
break;
}
}
}
else
{
CLog::Log(LOGDEBUG, "%s - no peripheral", __FUNCTION__);
}
}
m_bIsInitialising = false;
}