当前位置: 首页>>代码示例>>C++>>正文


C++ FileSearchPath::getNumPaths方法代码示例

本文整理汇总了C++中FileSearchPath::getNumPaths方法的典型用法代码示例。如果您正苦于以下问题:C++ FileSearchPath::getNumPaths方法的具体用法?C++ FileSearchPath::getNumPaths怎么用?C++ FileSearchPath::getNumPaths使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FileSearchPath的用法示例。


在下文中一共展示了FileSearchPath::getNumPaths方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: path

    Scanner (PluginListComponent& plc,
             AudioPluginFormat& format,
             PropertiesFile* properties,
             int threads)
        : owner (plc), formatToScan (format), propertiesToUse (properties),
          pathChooserWindow (TRANS("Select folders to scan..."), String::empty, AlertWindow::NoIcon),
          progressWindow (TRANS("Scanning for plug-ins..."),
                          TRANS("Searching for all possible plug-in files..."), AlertWindow::NoIcon),
          progress (0.0), numThreads (threads), finished (false)
    {
        FileSearchPath path (formatToScan.getDefaultLocationsToSearch());

        if (path.getNumPaths() > 0) // if the path is empty, then paths aren't used for this format.
        {
            if (propertiesToUse != nullptr)
                path = getLastSearchPath (*propertiesToUse, formatToScan);

            pathList.setSize (500, 300);
            pathList.setPath (path);

            pathChooserWindow.addCustomComponent (&pathList);
            pathChooserWindow.addButton (TRANS("Scan"),   1, KeyPress (KeyPress::returnKey));
            pathChooserWindow.addButton (TRANS("Cancel"), 0, KeyPress (KeyPress::escapeKey));

            pathChooserWindow.enterModalState (true,
                ModalCallbackFunction::forComponent (startScanCallback, &pathChooserWindow, this),
                false);
        }
        else
        {
            startScan();
        }
    }
开发者ID:alexgustafson,项目名称:Mango-Chutney,代码行数:33,代码来源:juce_PluginListComponent.cpp

示例2: path

    Scanner (CabbagePluginListComponent& plc, AudioPluginFormat& format, const StringArray& filesOrIdentifiers,
             PropertiesFile* properties, bool allowPluginsWhichRequireAsynchronousInstantiation, int threads,
             const String& title, const String& text)
        : owner (plc), formatToScan (format), filesOrIdentifiersToScan (filesOrIdentifiers), propertiesToUse (properties),
          pathChooserWindow (TRANS("Select folders to scan..."), String(), AlertWindow::NoIcon),
          progressWindow (title, text, AlertWindow::NoIcon),
          progress (0.0), numThreads (threads), allowAsync (allowPluginsWhichRequireAsynchronousInstantiation),
          finished (false)
    {
		pathChooserWindow.setLookAndFeel(&owner.getLookAndFeel());
		progressWindow.setLookAndFeel(&owner.getLookAndFeel());
        FileSearchPath path (formatToScan.getDefaultLocationsToSearch());

        // You need to use at least one thread when scanning plug-ins asynchronously
        jassert (! allowAsync || (numThreads > 0));

        // If the filesOrIdentifiersToScan argumnent isn't empty, we should only scan these
        // If the path is empty, then paths aren't used for this format.
        if (filesOrIdentifiersToScan.isEmpty() && path.getNumPaths() > 0)
        {
           #if ! JUCE_IOS
            if (propertiesToUse != nullptr)
                path = getLastSearchPath (*propertiesToUse, formatToScan);
           #endif

            pathList.setSize (500, 300);
            pathList.setPath (path);

            pathChooserWindow.addCustomComponent (&pathList);
            pathChooserWindow.addButton (TRANS("Scan"),   1, KeyPress (KeyPress::returnKey));
            pathChooserWindow.addButton (TRANS("Cancel"), 0, KeyPress (KeyPress::escapeKey));

            pathChooserWindow.enterModalState (true,
                                               ModalCallbackFunction::forComponent (startScanCallback,
                                                                                    &pathChooserWindow, this),
                                               false);
        }
        else
        {
            startScan();
        }
    }
开发者ID:rorywalsh,项目名称:cabbage,代码行数:42,代码来源:CabbagePluginList.cpp

示例3: scanFor

void PluginListComponent::scanFor (AudioPluginFormat* format)
{
    if (format != nullptr)
    {
        FileSearchPath path (format->getDefaultLocationsToSearch());

        if (path.getNumPaths() > 0) // if the path is empty, then paths aren't used for this format.
        {
           #if JUCE_MODAL_LOOPS_PERMITTED
            if (propertiesToUse != nullptr)
                path = propertiesToUse->getValue ("lastPluginScanPath_" + format->getName(), path.toString());

            AlertWindow aw (TRANS("Select folders to scan..."), String::empty, AlertWindow::NoIcon);
            FileSearchPathListComponent pathList;
            pathList.setSize (500, 300);
            pathList.setPath (path);

            aw.addCustomComponent (&pathList);
            aw.addButton (TRANS("Scan"), 1, KeyPress (KeyPress::returnKey));
            aw.addButton (TRANS("Cancel"), 0, KeyPress (KeyPress::escapeKey));

            if (aw.runModalLoop() == 0)
                return;

            path = pathList.getPath();
           #else
            jassertfalse; // XXX this method needs refactoring to work without modal loops..
           #endif
        }

        if (propertiesToUse != nullptr)
        {
            propertiesToUse->setValue ("lastPluginScanPath_" + format->getName(), path.toString());
            propertiesToUse->saveIfNeeded();
        }

        currentScanner = new Scanner (*this, *format, path);
    }
}
开发者ID:Frongo,项目名称:JUCE,代码行数:39,代码来源:juce_PluginListComponent.cpp

示例4: addPath

void FileSearchPath::addPath (const FileSearchPath& other)
{
    for (int i = 0; i < other.getNumPaths(); ++i)
        addIfNotAlreadyThere (other[i]);
}
开发者ID:AlessandroGiacomini,项目名称:pyplasm,代码行数:5,代码来源:juce_FileSearchPath.cpp


注:本文中的FileSearchPath::getNumPaths方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。