本文整理汇总了C++中CSettingInt::GetControlType方法的典型用法代码示例。如果您正苦于以下问题:C++ CSettingInt::GetControlType方法的具体用法?C++ CSettingInt::GetControlType怎么用?C++ CSettingInt::GetControlType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSettingInt
的用法示例。
在下文中一共展示了CSettingInt::GetControlType方法的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 SETTINGS_TYPE_BOOL:
{
CSettingBool *boolSetting = (CSettingBool *) setting;
if (boolSetting)
{
m_boolSettings.insert(make_pair(CStdString(boolSetting->GetSetting()), boolSetting->GetData()));
AddBool(boolSetting->GetOrder(), boolSetting->GetLabel(), &m_boolSettings[boolSetting->GetSetting()], true);
}
}
break;
case SETTINGS_TYPE_INT:
{
CSettingInt *intSetting = (CSettingInt *) setting;
if (intSetting)
{
if (intSetting->GetControlType() == SPIN_CONTROL_INT)
{
m_intSettings.insert(make_pair(CStdString(intSetting->GetSetting()), (float) intSetting->GetData()));
AddSlider(intSetting->GetOrder(), intSetting->GetLabel(), &m_intSettings[intSetting->GetSetting()], (float)intSetting->m_iMin, (float)intSetting->m_iStep, (float)intSetting->m_iMax, CGUIDialogVideoSettings::FormatInteger, false);
}
else if (intSetting->GetControlType() == SPIN_CONTROL_TEXT)
{
m_intTextSettings.insert(make_pair(CStdString(intSetting->GetSetting()), intSetting->GetData()));
vector<pair<int, int> > entries;
map<int, int>::iterator entriesItr = intSetting->m_entries.begin();
while (entriesItr != intSetting->m_entries.end())
{
entries.push_back(make_pair(entriesItr->first, entriesItr->second));
++entriesItr;
}
AddSpin(intSetting->GetOrder(), intSetting->GetLabel(), &m_intTextSettings[intSetting->GetSetting()], entries);
}
}
}
break;
case SETTINGS_TYPE_FLOAT:
{
CSettingFloat *floatSetting = (CSettingFloat *) setting;
if (floatSetting)
{
m_floatSettings.insert(make_pair(CStdString(floatSetting->GetSetting()), floatSetting->GetData()));
AddSlider(floatSetting->GetOrder(), floatSetting->GetLabel(), &m_floatSettings[floatSetting->GetSetting()], floatSetting->m_fMin, floatSetting->m_fStep, floatSetting->m_fMax, CGUIDialogVideoSettings::FormatFloat, false);
}
}
break;
case SETTINGS_TYPE_STRING:
{
CSettingString *stringSetting = (CSettingString *) setting;
if (stringSetting)
{
m_stringSettings.insert(make_pair(CStdString(stringSetting->GetSetting()), stringSetting->GetData()));
AddString(stringSetting->GetOrder(), stringSetting->GetLabel(), &m_stringSettings[stringSetting->GetSetting()]);
}
}
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;
}