本文整理汇总了C++中SparseSet::contains方法的典型用法代码示例。如果您正苦于以下问题:C++ SparseSet::contains方法的具体用法?C++ SparseSet::contains怎么用?C++ SparseSet::contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SparseSet
的用法示例。
在下文中一共展示了SparseSet::contains方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeSelectedPlugins
void PluginListComponent::removeSelectedPlugins()
{
const SparseSet<int> selected (table.getSelectedRows());
for (int i = table.getNumRows(); --i >= 0;)
if (selected.contains (i))
removePluginItem (i);
}
示例2: removeSelected
void PluginListComponent::removeSelected()
{
const SparseSet <int> selected (listBox.getSelectedRows());
for (int i = list.getNumTypes(); --i >= 0;)
if (selected.contains (i))
removePluginItem (list, i);
}
示例3: optionsMenuCallback
void PluginListComponent::optionsMenuCallback (int result)
{
switch (result)
{
case 1: list.clear(); break;
case 2: list.sort (KnownPluginList::sortAlphabetically); break;
case 3: list.sort (KnownPluginList::sortByCategory); break;
case 4: list.sort (KnownPluginList::sortByManufacturer); break;
case 5:
{
const SparseSet <int> selected (listBox.getSelectedRows());
for (int i = list.getNumTypes(); --i >= 0;)
if (selected.contains (i))
list.removeType (i);
break;
}
case 6:
{
const PluginDescription* const desc = list.getType (listBox.getSelectedRow());
if (desc != nullptr && File (desc->fileOrIdentifier).existsAsFile())
File (desc->fileOrIdentifier).getParentDirectory().startAsProcess();
break;
}
case 7:
for (int i = list.getNumTypes(); --i >= 0;)
if (! AudioPluginFormatManager::getInstance()->doesPluginStillExist (*list.getType (i)))
list.removeType (i);
break;
default:
if (result != 0)
{
typeToScan = result - 10;
startTimer (1);
}
break;
}
}
示例4: selectedRowsChanged
//==============================================================================
void selectedRowsChanged (int) override
{
SparseSet<int> newSelectedItems = getSelectedRows();
if (newSelectedItems != lastSelectedItems)
{
for (int i = 0; i < lastSelectedItems.size(); ++i)
{
if (! newSelectedItems.contains (lastSelectedItems[i]))
parent.closeDevice (isInput, lastSelectedItems[i]);
}
for (int i = 0; i < newSelectedItems.size(); ++i)
{
if (! lastSelectedItems.contains (newSelectedItems[i]))
parent.openDevice (isInput, newSelectedItems[i]);
}
lastSelectedItems = newSelectedItems;
}
}
示例5: buttonClicked
void PluginListComponent::buttonClicked (Button* b)
{
if (optionsButton == b)
{
PopupMenu menu;
menu.addItem (1, TRANS("Clear list"));
menu.addItem (5, TRANS("Remove selected plugin from list"), listBox->getNumSelectedRows() > 0);
menu.addItem (6, TRANS("Show folder containing selected plugin"), listBox->getNumSelectedRows() > 0);
menu.addItem (7, TRANS("Remove any plugins whose files no longer exist"));
menu.addSeparator();
menu.addItem (2, TRANS("Sort alphabetically"));
menu.addItem (3, TRANS("Sort by category"));
menu.addItem (4, TRANS("Sort by manufacturer"));
menu.addSeparator();
for (int i = 0; i < AudioPluginFormatManager::getInstance()->getNumFormats(); ++i)
{
AudioPluginFormat* const format = AudioPluginFormatManager::getInstance()->getFormat (i);
if (format->getDefaultLocationsToSearch().getNumPaths() > 0)
menu.addItem (10 + i, "Scan for new or updated " + format->getName() + " plugins...");
}
const int r = menu.showAt (optionsButton);
if (r == 1)
{
list.clear();
}
else if (r == 2)
{
list.sort (KnownPluginList::sortAlphabetically);
}
else if (r == 3)
{
list.sort (KnownPluginList::sortByCategory);
}
else if (r == 4)
{
list.sort (KnownPluginList::sortByManufacturer);
}
else if (r == 5)
{
const SparseSet <int> selected (listBox->getSelectedRows());
for (int i = list.getNumTypes(); --i >= 0;)
if (selected.contains (i))
list.removeType (i);
}
else if (r == 6)
{
const PluginDescription* const desc = list.getType (listBox->getSelectedRow());
if (desc != 0)
{
if (File (desc->fileOrIdentifier).existsAsFile())
File (desc->fileOrIdentifier).getParentDirectory().startAsProcess();
}
}
else if (r == 7)
{
for (int i = list.getNumTypes(); --i >= 0;)
{
if (! AudioPluginFormatManager::getInstance()->doesPluginStillExist (*list.getType (i)))
{
list.removeType (i);
}
}
}
else if (r != 0)
{
typeToScan = r - 10;
startTimer (1);
}
}
}