From f28ea675eebc5ee0b31bdacb2d4d2d3646e2af0d Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 18 Jun 2021 16:51:24 +0200 Subject: [PATCH] VST3: update scanner API, distinguish new and updated plugins --- libs/ardour/ardour/vst3_scan.h | 2 +- libs/ardour/vst3_scan.cc | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libs/ardour/ardour/vst3_scan.h b/libs/ardour/ardour/vst3_scan.h index 5f690578e0..1be928f8d4 100644 --- a/libs/ardour/ardour/vst3_scan.h +++ b/libs/ardour/ardour/vst3_scan.h @@ -72,7 +72,7 @@ LIBARDOUR_API extern std::string vst3_cache_file (std::string const& module_path); LIBARDOUR_API extern std::string -vst3_valid_cache_file (std::string const& module_path, bool verbose = false); +vst3_valid_cache_file (std::string const& module_path, bool verbose = false, bool* is_new = NULL); LIBARDOUR_API extern bool vst3_scan_and_cache (std::string const& module_path, std::string const& bundle_path, boost::function cb, bool verbose = false); diff --git a/libs/ardour/vst3_scan.cc b/libs/ardour/vst3_scan.cc index 7c67abeeed..0f91b9c221 100644 --- a/libs/ardour/vst3_scan.cc +++ b/libs/ardour/vst3_scan.cc @@ -373,13 +373,20 @@ ARDOUR::vst3_cache_file (std::string const& module_path) } string -ARDOUR::vst3_valid_cache_file (std::string const& module_path, bool verbose) +ARDOUR::vst3_valid_cache_file (std::string const& module_path, bool verbose, bool* is_new) { string const cache_file = ARDOUR::vst3_cache_file (module_path); if (!Glib::file_test (cache_file, Glib::FileTest (Glib::FILE_TEST_EXISTS | Glib::FILE_TEST_IS_REGULAR))) { + if (is_new) { + *is_new = true; + } return ""; } + if (is_new) { + *is_new = false; + } + if (verbose) { PBD::info << "Found cache file: '" << cache_file <<"'" << endmsg; }