void clear_vst_cache ();
void clear_vst_blacklist ();
+ bool cancelled () { return cancel_scan; }
+
int add_windows_vst_directory (std::string dirpath);
int add_lxvst_directory (std::string dirpath);
{
DEBUG_TRACE (DEBUG::PluginManager, "PluginManager::refresh\n");
BootMessage (_("Discovering Plugins"));
+ cancel_scan = false;
ladspa_refresh ();
#ifdef LV2_SUPPORT
PluginListChanged (); /* EMIT SIGNAL */
PluginScanMessage(X_("closeme"), "");
+ cancel_scan = false;
}
void
PluginManager::cancel_plugin_scan ()
{
- // TODO
+ cancel_scan = true;
}
void
if (plugin_objects) {
for (x = plugin_objects->begin(); x != plugin_objects->end (); ++x) {
+ if (cancelled()) break;
ARDOUR::PluginScanMessage(_("VST"), **x);
windows_vst_discover (**x, cache_only);
}
if (plugin_objects) {
for (x = plugin_objects->begin(); x != plugin_objects->end (); ++x) {
+ if (cancelled()) break;
ARDOUR::PluginScanMessage(_("LXVST"), **x);
lxvst_discover (**x, cache_only);
}
#include "ardour/vst_info_file.h"
#define MAX_STRING_LEN 256
+#define PLUGIN_SCAN_TIMEOUT (600) // in deciseconds
using namespace std;
PBD::error << "Cannot launch VST scanner app '" << scanner_bin_path << "': "<< strerror(errno) << endmsg;
return infos;
} else {
- // TODO idle loop (emit signal to GUI to call gtk_main_iteration()) check cancel.
- scanner.wait();
+ int timeout = PLUGIN_SCAN_TIMEOUT;
+ while (scanner.is_running() && --timeout) {
+ ARDOUR::GUIIdle();
+ Glib::usleep (100000);
+ if (ARDOUR::PluginManager::instance().cancelled()) break;
+ }
+ scanner.terminate();
}
/* re-read index */
vstfx_clear_info_list(infos);