13
0

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
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
3 changed files with 22 additions and 0 deletions

View File

@ -76,6 +76,9 @@ public:
const std::string get_default_windows_vst_path() const { return windows_vst_path; }
const std::string get_default_lxvst_path() const { return lxvst_path; }
static uint32_t cache_version ();
bool cache_valid () const;
/* always return LXVST for any VST subtype */
static PluginType to_generic_vst (const PluginType);

View File

@ -234,6 +234,7 @@ CONFIG_VARIABLE (bool, discover_audio_units, "discover-audio-units", false)
CONFIG_VARIABLE (bool, ask_replace_instrument, "ask-replace-instrument", true)
CONFIG_VARIABLE (bool, ask_setup_instrument, "ask-setup-instrument", true)
CONFIG_VARIABLE (uint32_t, limit_n_automatables, "limit-n-automatables", 512)
CONFIG_VARIABLE (uint32_t, plugin_cache_version, "plugin-cache-version", 0)
/* custom user plugin paths */
CONFIG_VARIABLE (std::string, plugin_path_vst, "plugin-path-vst", "@default@")

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"));