diff plugin/PluginScan.h @ 1249:d45a16c232bd piper

Align Sonic Annotator with the new Piper-ified subrepos (bearing in mind we want neither Piper nor the plugin load checker in Sonic Annotator itself)
author Chris Cannam
date Fri, 04 Nov 2016 14:16:01 +0000
parents 75aefcc9f07d
children 48e9f538e6e9
line wrap: on
line diff
--- a/plugin/PluginScan.h	Thu Nov 03 15:38:17 2016 +0000
+++ b/plugin/PluginScan.h	Fri Nov 04 14:16:01 2016 +0000
@@ -27,8 +27,21 @@
 public:
     static PluginScan *getInstance();
 
+    /**
+     * Carry out startup scan of available plugins. Do not call
+     * getCandidateLibrariesFor() unless this has been called and
+     * scanSucceeded() is returning true.
+     */
     void scan();
 
+    /**
+     * Return true if scan() completed successfully. If the scan
+     * failed, consider using the normal plugin path to load any
+     * available plugins (as if they had all been found to be
+     * loadable) rather than rejecting all of them -- i.e. consider
+     * falling back on the behaviour of code from before the scan
+     * logic was added.
+     */
     bool scanSucceeded() const;
     
     enum PluginType {
@@ -37,9 +50,19 @@
 	DSSIPlugin
     };
     struct Candidate {
-        QString libraryPath;
-        QString helperTag;
+        QString libraryPath;    // full path, not just soname
+        QString helperTag;      // identifies the helper that found it
+                                // (see HelperExecPath) 
     };
+
+    /**
+     * Return the candidate plugin libraries of the given type that
+     * were found by helpers during the startup scan.
+     *
+     * This could return an empty list for two reasons: the scan
+     * succeeded but no libraries were found; or the scan failed. Call
+     * scanSucceeded() to distinguish between them.
+     */
     QList<Candidate> getCandidateLibrariesFor(PluginType) const;
 
     QString getStartupFailureReport() const;