[VST] scan timeout display and per plugin timeout override.
authorRobin Gareus <robin@gareus.org>
Sun, 9 Mar 2014 18:34:53 +0000 (19:34 +0100)
committerRobin Gareus <robin@gareus.org>
Sun, 9 Mar 2014 19:32:52 +0000 (20:32 +0100)
gtk2_ardour/ardour_ui.cc
gtk2_ardour/ardour_ui.h
libs/ardour/ardour/ardour.h
libs/ardour/ardour/plugin_manager.h
libs/ardour/globals.cc
libs/ardour/plugin_manager.cc
libs/ardour/vst_info_file.cc

index d33cdf58042c9b2a526e683b191f75a14802487d..ecd8872ea3621d7b0a4cabfa493f6c3cd42b3a6d 100644 (file)
@@ -3866,7 +3866,7 @@ ARDOUR_UI::plugin_scan_dialog (std::string type, std::string plugin, bool can_ca
                timeout_button->show();
 
                scan_pbar = manage(new ProgressBar());
-               //scan_pbar->set_size_request(300,-1);
+               scan_pbar->set_orientation(Gtk::PROGRESS_RIGHT_TO_LEFT);
                scan_pbar->set_text(_("Scan Timeout"));
                scan_pbar->show();
 
index 69ff876dc854bf40891284f55f7fa393caa5a9b9..5aa08797fb710694832642aa5be1fdb21bb57884 100644 (file)
@@ -669,7 +669,9 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
        void gui_idle_handler ();
 
        void cancel_plugin_scan ();
+       void cancel_plugin_timeout ();
        void plugin_scan_dialog (std::string type, std::string plugin, bool);
+       void plugin_scan_timeout (int);
 
         void session_format_mismatch (std::string, std::string);
 
index 003f05ca5d1e1f6f23e86fec0b4938e44238bab4..465de04127a1b013add7fe8d5e538f532bb77b08 100644 (file)
@@ -51,6 +51,7 @@ namespace ARDOUR {
 
        extern LIBARDOUR_API PBD::Signal1<void,std::string> BootMessage;
        extern LIBARDOUR_API PBD::Signal3<void,std::string,std::string,bool> PluginScanMessage;
+       extern LIBARDOUR_API PBD::Signal1<void,int> PluginScanTimeout;
        extern LIBARDOUR_API PBD::Signal0<void> GUIIdle;
 
        /**
index 17400ea4d8002020b987ea7ffcb3683da293b0ab..6239bd7cb0abf2377c4c39c989dade3a99fa9982 100644 (file)
@@ -53,13 +53,15 @@ class LIBARDOUR_API PluginManager : public boost::noncopyable {
 
        void refresh (bool cache_only = false);
        void cancel_plugin_scan();
+       void cancel_plugin_timeout();
        void clear_vst_cache ();
        void clear_vst_blacklist ();
 
        const std::string get_default_windows_vst_path() const { return windows_vst_path; }
        const std::string get_default_lxvst_path() const { return lxvst_path; }
 
-       bool cancelled () { return cancel_scan; }
+       bool cancelled () { return _cancel_scan; }
+       bool no_timeout () { return _cancel_timeout; }
 
        enum PluginStatusType {
                Normal = 0,
@@ -112,7 +114,8 @@ class LIBARDOUR_API PluginManager : public boost::noncopyable {
        std::string windows_vst_path;
        std::string lxvst_path;
 
-       bool cancel_scan;
+       bool _cancel_scan;
+       bool _cancel_timeout;
 
        void ladspa_refresh ();
        void windows_vst_refresh (bool cache_only = false);
index 359f960f30a1187a7384228cabbb5b3e51827806..8bee4ec9023cc0f8c4d4c098283ab8cc8a26ca6c 100644 (file)
@@ -126,6 +126,7 @@ mix_buffers_no_gain_t   ARDOUR::mix_buffers_no_gain = 0;
 
 PBD::Signal1<void,std::string> ARDOUR::BootMessage;
 PBD::Signal3<void,std::string,std::string,bool> ARDOUR::PluginScanMessage;
+PBD::Signal1<void,int> ARDOUR::PluginScanTimeout;
 PBD::Signal0<void> ARDOUR::GUIIdle;
 
 namespace ARDOUR {
index 72df671928f3fccdf481c9f49b1781c84a2db2e3..a07651bc6a947efbf8496c1b7e832808432d7398 100644 (file)
@@ -111,7 +111,8 @@ PluginManager::PluginManager ()
        , _ladspa_plugin_info(0)
        , _lv2_plugin_info(0)
        , _au_plugin_info(0)
-       , cancel_scan(false)
+       , _cancel_scan(false)
+       , _cancel_timeout(false)
 {
        char* s;
        string lrdf_path;
@@ -192,7 +193,7 @@ void
 PluginManager::refresh (bool cache_only)
 {
        DEBUG_TRACE (DEBUG::PluginManager, "PluginManager::refresh\n");
-       cancel_scan = false;
+       _cancel_scan = false;
 
        BootMessage (_("Scanning LADSPA Plugins"));
        ladspa_refresh ();
@@ -222,13 +223,19 @@ PluginManager::refresh (bool cache_only)
        BootMessage (_("Plugin Scan Complete..."));
        PluginListChanged (); /* EMIT SIGNAL */
        PluginScanMessage(X_("closeme"), "", false);
-       cancel_scan = false;
+       _cancel_scan = false;
 }
 
 void
 PluginManager::cancel_plugin_scan ()
 {
-       cancel_scan = true;
+       _cancel_scan = true;
+}
+
+void
+PluginManager::cancel_plugin_timeout ()
+{
+       _cancel_timeout = true;
 }
 
 void
@@ -674,6 +681,7 @@ PluginManager::windows_vst_discover (string path, bool cache_only)
 {
        DEBUG_TRACE (DEBUG::PluginManager, string_compose ("windows_vst_discover '%1'\n", path));
 
+       _cancel_timeout = false;
        vector<VSTInfo*> * finfos = vstfx_get_info_fst (const_cast<char *> (path.c_str()),
                        cache_only ? VST_SCAN_CACHE_ONLY : VST_SCAN_USE_APP);
 
@@ -797,6 +805,7 @@ PluginManager::lxvst_discover (string path, bool cache_only)
 {
        DEBUG_TRACE (DEBUG::PluginManager, string_compose ("checking apparent LXVST plugin at %1\n", path));
 
+       _cancel_timeout = false;
        vector<VSTInfo*> * finfos = vstfx_get_info_lx (const_cast<char *> (path.c_str()),
                        cache_only ? VST_SCAN_CACHE_ONLY : VST_SCAN_USE_APP);
 
index 1db9afbbc46f024e722a59d2a9e053a55b7dc764..fe434909f33f4b9030cb7a70191b32aa83e71b0d 100644 (file)
@@ -916,7 +916,15 @@ vstfx_get_info (const char* dllpath, enum ARDOUR::PluginType type, enum VSTScanM
                        return infos;
                } else {
                        int timeout = PLUGIN_SCAN_TIMEOUT;
-                       while (scanner.is_running() && --timeout) {
+                       bool no_timeout = (timeout <= 0);
+                       ARDOUR::PluginScanTimeout(timeout);
+                       while (scanner.is_running() && (no_timeout || timeout > 0)) {
+                               if (!no_timeout && !ARDOUR::PluginManager::instance().no_timeout()) {
+                                       if (timeout%5 == 0) {
+                                               ARDOUR::PluginScanTimeout(timeout);
+                                       }
+                                       --timeout;
+                               }
                                ARDOUR::GUIIdle();
                                Glib::usleep (100000);