MCPcopy Create free account
hub / github.com/audacity/audacity / StoreSettings

Method StoreSettings

libraries/lib-vst/VSTWrapper.cpp:1764–1811  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1762}
1763
1764bool VSTWrapper::StoreSettings(const VSTSettings& vstSettings) const
1765{
1766 // First, make sure settings are compatibile with the plugin
1767 if ((vstSettings.mUniqueID != mAEffect->uniqueID) ||
1768// (vstSettings.mVersion != mAEffect->version) ||
1769 (vstSettings.mNumParams != mAEffect->numParams) )
1770 {
1771 return false;
1772 }
1773
1774
1775 // Try using the chunk first (if available)
1776 auto &chunk = vstSettings.mChunk;
1777 if (!chunk.empty())
1778 {
1779 VstPatchChunkInfo info = { 1, mAEffect->uniqueID, mAEffect->version, mAEffect->numParams, "" };
1780 callSetChunk(true, chunk.size(), const_cast<char *>(chunk.data()), &info);
1781 }
1782
1783
1784 // Settings (like the message) may store both a chunk, and also accumulated
1785 // slider movements to reapply after the chunk change. Or it might be
1786 // no chunk and id-value pairs only
1787
1788 constCallDispatcher(effBeginSetProgram, 0, 0, NULL, 0.0);
1789
1790 ForEachParameter
1791 (
1792 [&](const ParameterInfo& pi)
1793 {
1794 const auto itr = vstSettings.mParamsMap.find(pi.mName);
1795 if (itr != vstSettings.mParamsMap.end())
1796 {
1797 const float& value = *(itr->second);
1798
1799 if (value >= -1.0 && value <= 1.0)
1800 {
1801 callSetParameter(pi.mID, value);
1802 }
1803 }
1804 return true;
1805 }
1806 );
1807
1808 constCallDispatcher(effEndSetProgram, 0, 0, NULL, 0.0);
1809
1810 return true;
1811}
1812
1813ComponentInterfaceSymbol VSTWrapper::GetSymbol() const
1814{

Callers 5

OnIdleMethod · 0.45
ValidateUIMethod · 0.45
OnCloseMethod · 0.45

Calls 5

emptyMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected