本文整理汇总了C++中CGUIListContainer::SetEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIListContainer::SetEnabled方法的具体用法?C++ CGUIListContainer::SetEnabled怎么用?C++ CGUIListContainer::SetEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIListContainer
的用法示例。
在下文中一共展示了CGUIListContainer::SetEnabled方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnClickListActive
bool CGUIDialogAudioDSPManager::OnClickListActive(CGUIMessage &message)
{
if (!m_bMovingMode)
{
int iAction = message.GetParam1();
int iItem = m_activeViewControl.GetSelectedItem();
/* Check file item is in list range and get his pointer */
if (iItem < 0 || iItem >= (int)m_activeItems[m_iCurrentType]->Size()) return true;
/* Process actions */
if (iAction == ACTION_SELECT_ITEM || iAction == ACTION_CONTEXT_MENU || iAction == ACTION_MOUSE_LEFT_CLICK || iAction == ACTION_MOUSE_RIGHT_CLICK)
{
/* Show Contextmenu */
OnPopupMenu(iItem, LIST_ACTIVE);
return true;
}
}
else
{
CFileItemPtr pItem = m_activeItems[m_iCurrentType]->Get(m_iSelected[LIST_ACTIVE]);
if (pItem)
{
pItem->Select(false);
pItem->SetProperty("Changed", true);
m_bMovingMode = false;
m_bContainsChanges = true;
if (m_bContinousSaving)
{
SaveList();
}
CGUIListContainer *modeList = dynamic_cast<CGUIListContainer*>(GetControl(CONTROL_LIST_MODE_SELECTION));
CGUIButtonControl *applyButton = dynamic_cast<CGUIButtonControl*>(GetControl(CONTROL_BUTTON_APPLY_CHANGES));
CGUIButtonControl *clearActiveModesButton = dynamic_cast<CGUIButtonControl*>(GetControl(CONTROL_BUTTON_CLEAR_ACTIVE_MODES));
if (!modeList || !applyButton || !clearActiveModesButton)
{
helper_LogError(__FUNCTION__);
return false;
}
// reenable all buttons and mode selection list
modeList->SetEnabled(true);
clearActiveModesButton->SetEnabled(true);
if (!m_bContinousSaving)
{
applyButton->SetEnabled(true);
}
return true;
}
}
return false;
}
示例2: OnContextButton
//.........这里部分代码省略.........
{
/*!
* Activate selected processing mode
*/
if ((m_iCurrentType == AE_DSP_MODE_TYPE_INPUT_RESAMPLE || m_iCurrentType == AE_DSP_MODE_TYPE_OUTPUT_RESAMPLE) && m_activeItems[m_iCurrentType]->Size() > 0)
{ // if there is already an active resampler, now we remove it
CFileItemPtr activeResampler = m_activeItems[m_iCurrentType]->Get(0);
if (activeResampler)
{
CFileItemPtr newItem(dynamic_cast<CFileItem*>(activeResampler->Clone()));
newItem->SetProperty("ActiveMode", false);
newItem->SetProperty("Changed", true);
m_availableItems[m_iCurrentType]->Add(newItem);
// clear active list, because only one active resampling mode is supported by ActiveAEDSP
m_activeItems[m_iCurrentType]->Clear();
}
}
// remove mode from available mode list and add it to active mode list
CFileItemPtr newItem(dynamic_cast<CFileItem*>(pItem->Clone()));
newItem->SetProperty("Number", (int)m_activeItems[m_iCurrentType]->Size() +1);
newItem->SetProperty("Changed", true);
newItem->SetProperty("ActiveMode", true);
m_availableItems[m_iCurrentType]->Remove(itemNumber);
m_activeItems[m_iCurrentType]->Add(newItem);
}
m_bContainsChanges = true;
if (m_bContinousSaving)
{
SaveList();
}
// reorder available mode list, so that the mode order is always consistent
m_availableItems[m_iCurrentType]->ClearSortState();
m_availableItems[m_iCurrentType]->Sort(SortByLabel, SortOrderAscending);
// update active and available mode list
Renumber();
m_availableViewControl.SetItems(*m_availableItems[m_iCurrentType]);
m_activeViewControl.SetItems(*m_activeItems[m_iCurrentType]);
}
else if (button == CONTEXT_BUTTON_MOVE)
{
m_bMovingMode = true;
pItem->Select(true);
CGUIListContainer *modeList = dynamic_cast<CGUIListContainer*>(GetControl(CONTROL_LIST_MODE_SELECTION));
CGUIButtonControl *applyButton = dynamic_cast<CGUIButtonControl*>(GetControl(CONTROL_BUTTON_APPLY_CHANGES));
CGUIButtonControl *clearActiveModesButton = dynamic_cast<CGUIButtonControl*>(GetControl(CONTROL_BUTTON_CLEAR_ACTIVE_MODES));
if (!modeList || !applyButton || !clearActiveModesButton)
{
helper_LogError(__FUNCTION__);
return false;
}
// if we are in MovingMode all buttons and mode selection list will be disabled!
modeList->SetEnabled(false);
clearActiveModesButton->SetEnabled(false);
if (!m_bContinousSaving)
{
applyButton->SetEnabled(false);
}
}
else if (button == CONTEXT_BUTTON_SETTINGS)
{
int hookId = (int)pItem->GetProperty("SettingsDialog").asInteger();
if (hookId > 0)
{
AE_DSP_ADDON addon;
if (CServiceBroker::GetADSP().GetAudioDSPAddon((int)pItem->GetProperty("AddonId").asInteger(), addon))
{
AE_DSP_MENUHOOK hook;
AE_DSP_MENUHOOK_DATA hookData;
hook.category = AE_DSP_MENUHOOK_ALL;
hook.iHookId = hookId;
hook.iRelevantModeId = (unsigned int)pItem->GetProperty("AddonModeNumber").asInteger();
hookData.category = AE_DSP_MENUHOOK_ALL;
hookData.data.iStreamId = -1;
/*!
* @note the addon dialog becomes always opened on the back of Kodi ones for this reason a
* "<animation effect="fade" start="100" end="0" time="400" condition="Window.IsVisible(Addon)">Conditional</animation>"
* on skin is needed to hide dialog.
*/
addon->CallMenuHook(hook, hookData);
}
}
else
{
CGUIDialogOK::ShowAndGetInput(19033, 0, 15040, 0);
}
}
return true;
}
示例3: OnContextButton
bool CGUIDialogAudioDSPManager::OnContextButton(int itemNumber, CONTEXT_BUTTON button, int listType)
{
CFileItemPtr pItem;
int listSize = 0;
if (listType == LIST_ACTIVE)
{
pItem = m_activeItems[m_iCurrentType]->Get(itemNumber);
listSize = m_activeItems[m_iCurrentType]->Size();
}
else if (listType == LIST_AVAILABLE)
{
pItem = m_availableItems[m_iCurrentType]->Get(itemNumber);
listSize = m_availableItems[m_iCurrentType]->Size();
}
/* Check file item is in list range and get his pointer */
if (!pItem || itemNumber < 0 || itemNumber >= listSize)
{
return false;
}
if (button == CONTEXT_BUTTON_ACTIVATE)
{
/*!
* Deactivate selected processing mode
*/
if (pItem->GetProperty("ActiveMode").asBoolean())
{
// remove mode from active mode list and add it to available mode list
CFileItemPtr newItem(dynamic_cast<CFileItem*>(pItem->Clone()));
newItem->SetProperty("ActiveMode", false);
newItem->SetProperty("Changed", true);
m_activeItems[m_iCurrentType]->Remove(itemNumber);
m_availableItems[m_iCurrentType]->Add(newItem);
}
else
{
/*!
* Activate selected processing mode
*/
if ((m_iCurrentType == AE_DSP_MODE_TYPE_INPUT_RESAMPLE || m_iCurrentType == AE_DSP_MODE_TYPE_OUTPUT_RESAMPLE) && m_activeItems[m_iCurrentType]->Size() > 0)
{ // if there is already an active resampler, now we remove it
CFileItemPtr activeResampler = m_activeItems[m_iCurrentType]->Get(0);
if (activeResampler)
{
CFileItemPtr newItem(dynamic_cast<CFileItem*>(activeResampler->Clone()));
newItem->SetProperty("ActiveMode", false);
newItem->SetProperty("Changed", true);
m_availableItems[m_iCurrentType]->Add(newItem);
// clear active list, because only one active resampling mode is supported by ActiveAEDSP
m_activeItems[m_iCurrentType]->Clear();
}
}
// remove mode from available mode list and add it to active mode list
CFileItemPtr newItem(dynamic_cast<CFileItem*>(pItem->Clone()));
newItem->SetProperty("Number", (int)m_activeItems[m_iCurrentType]->Size() +1);
newItem->SetProperty("Changed", true);
newItem->SetProperty("ActiveMode", true);
m_availableItems[m_iCurrentType]->Remove(itemNumber);
m_activeItems[m_iCurrentType]->Add(newItem);
}
m_bContainsChanges = true;
if (m_bContinuousSaving)
{
SaveList();
}
// reorder available mode list, so that the mode order is always consistent
m_availableItems[m_iCurrentType]->ClearSortState();
m_availableItems[m_iCurrentType]->Sort(SortByLabel, SortOrderAscending);
// update active and available mode list
Renumber();
m_availableViewControl.SetItems(*m_availableItems[m_iCurrentType]);
m_activeViewControl.SetItems(*m_activeItems[m_iCurrentType]);
}
else if (button == CONTEXT_BUTTON_MOVE)
{
m_bMovingMode = true;
pItem->Select(true);
CGUIListContainer *modeList = dynamic_cast<CGUIListContainer*>(GetControl(CONTROL_LIST_MODE_SELECTION));
CGUIButtonControl *applyButton = dynamic_cast<CGUIButtonControl*>(GetControl(CONTROL_BUTTON_APPLY_CHANGES));
CGUIButtonControl *clearActiveModesButton = dynamic_cast<CGUIButtonControl*>(GetControl(CONTROL_BUTTON_CLEAR_ACTIVE_MODES));
if (!modeList || !applyButton || !clearActiveModesButton)
{
helper_LogError(__FUNCTION__);
return false;
}
// if we are in MovingMode all buttons and mode selection list will be disabled!
modeList->SetEnabled(false);
clearActiveModesButton->SetEnabled(false);
if (!m_bContinuousSaving)
{
//.........这里部分代码省略.........