Remember version that was used to scan VST plugins

This commit is contained in:
Robin Gareus
2021-02-19 21:47:42 +01:00
parent 8497298d73
commit 00d1391ed9
3 changed files with 22 additions and 0 deletions

View File

@@ -324,6 +324,19 @@ PluginManager::~PluginManager()
delete _vst3_plugin_info;
}
bool
PluginManager::cache_valid () const
{
return Config->get_plugin_cache_version () >= cache_version ();
}
uint32_t
PluginManager::cache_version ()
{
/* see ARDOUR::vst3_scan_and_cache VST3Cache version = +1 */
return 1000 * atoi (X_(PROGRAM_VERSION)) + 1;
}
struct PluginInfoPtrNameSorter {
bool operator () (PluginInfoPtr const& a, PluginInfoPtr const& b) const {
return PBD::downcase (a->name) < PBD::downcase (b->name);
@@ -520,6 +533,11 @@ PluginManager::refresh (bool cache_only)
bool conceal_vst2 = false;
#endif
if (!cache_only && !cache_valid ()) {
Config->set_plugin_cache_version (cache_version ());
Config->save_state();
}
#ifdef AUDIOUNIT_SUPPORT
if (cache_only) {
BootMessage (_("Scanning AU Plugins"));