MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / binaryPluginSearchCallback

Method binaryPluginSearchCallback

plugins/Cardinal/src/Ildaeil.cpp:1662–1744  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1660 }
1661
1662 void binaryPluginSearchCallback(const CarlaPluginDiscoveryInfo* const info, const char* const sha1sum)
1663 {
1664 // save plugin info into cache
1665 if (sha1sum != nullptr)
1666 {
1667 const String configDir(asset::config("Ildaeil").c_str());
1668 const water::File cacheFile(configDir + CARLA_OS_SEP_STR "cache" CARLA_OS_SEP_STR + sha1sum);
1669
1670 if (cacheFile.create().ok())
1671 {
1672 water::FileOutputStream stream(cacheFile);
1673
1674 if (stream.openedOk())
1675 {
1676 if (info != nullptr)
1677 {
1678 stream.writeString(getBinaryTypeAsString(info->btype));
1679 stream.writeString(getPluginTypeAsString(info->ptype));
1680 stream.writeString(info->filename);
1681 stream.writeString(info->label);
1682 stream.writeInt64(info->uniqueId);
1683 stream.writeString(info->metadata.name);
1684 stream.writeString(info->metadata.maker);
1685 stream.writeString(getPluginCategoryAsString(info->metadata.category));
1686 stream.writeInt(info->metadata.hints);
1687 stream.writeCompressedInt(info->io.audioIns);
1688 stream.writeCompressedInt(info->io.audioOuts);
1689 stream.writeCompressedInt(info->io.cvIns);
1690 stream.writeCompressedInt(info->io.cvOuts);
1691 stream.writeCompressedInt(info->io.midiIns);
1692 stream.writeCompressedInt(info->io.midiOuts);
1693 stream.writeCompressedInt(info->io.parameterIns);
1694 stream.writeCompressedInt(info->io.parameterOuts);
1695 }
1696 }
1697 else
1698 {
1699 d_stderr("Failed to write cache file for %s", sha1sum);
1700 }
1701 }
1702 else
1703 {
1704 d_stderr("Failed to write cache file directories for %s", sha1sum);
1705 }
1706 }
1707
1708 if (info == nullptr)
1709 return;
1710
1711 if (info->io.cvIns != 0 || info->io.cvOuts != 0)
1712 return;
1713 if (info->io.midiIns != 0 && info->io.midiIns != 1)
1714 return;
1715 if (info->io.midiOuts != 0 && info->io.midiOuts != 1)
1716 return;
1717
1718 if (fPluginType == PLUGIN_INTERNAL)
1719 {

Callers 1

Calls 4

configFunction · 0.85
c_strMethod · 0.80
push_backMethod · 0.80
okMethod · 0.45

Tested by

no test coverage detected