changeset 485:9eb7ef610d7f

* Add more informative text to Find a Transform (particularly when none available)
author Chris Cannam
date Thu, 20 Nov 2008 12:09:55 +0000
parents 45ded09e4710
children 4c000e196bf1
files base/RingBuffer.h transform/TransformFactory.cpp transform/TransformFactory.h
diffstat 3 files changed, 30 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/base/RingBuffer.h	Wed Nov 19 21:36:33 2008 +0000
+++ b/base/RingBuffer.h	Thu Nov 20 12:09:55 2008 +0000
@@ -26,6 +26,8 @@
 #include "system/System.h"
 #include "Scavenger.h"
 
+#include <cstring> // memcpy, memset &c
+
 //#define DEBUG_RINGBUFFER 1
 
 #ifdef DEBUG_RINGBUFFER
--- a/transform/TransformFactory.cpp	Wed Nov 19 21:36:33 2008 +0000
+++ b/transform/TransformFactory.cpp	Thu Nov 20 12:09:55 2008 +0000
@@ -118,6 +118,13 @@
     return m_transforms[id];
 }
 
+bool
+TransformFactory::haveInstalledTransforms()
+{
+    populateTransforms();
+    return !m_transforms.empty();
+}
+
 TransformList
 TransformFactory::getUninstalledTransformDescriptions()
 {
@@ -154,6 +161,25 @@
     return m_uninstalledTransforms[id];
 }
 
+bool
+TransformFactory::haveUninstalledTransforms(bool waitForCheckToComplete)
+{
+    if (waitForCheckToComplete) {
+        populateUninstalledTransforms();
+    } else {
+        if (!m_uninstalledTransformsMutex.tryLock()) {
+            return false;
+        }
+        if (!m_uninstalledTransformsPopulated) {
+            m_uninstalledTransformsMutex.unlock();
+            return false;
+        }
+        m_uninstalledTransformsMutex.unlock();
+    }
+
+    return !m_uninstalledTransforms.empty();
+}
+
 TransformFactory::TransformInstallStatus
 TransformFactory::getTransformInstallStatus(TransformId id)
 {
--- a/transform/TransformFactory.h	Wed Nov 19 21:36:33 2008 +0000
+++ b/transform/TransformFactory.h	Thu Nov 20 12:09:55 2008 +0000
@@ -54,9 +54,11 @@
 
     TransformList getAllTransformDescriptions();
     TransformDescription getTransformDescription(TransformId id);
+    bool haveInstalledTransforms();
 
     TransformList getUninstalledTransformDescriptions();
     TransformDescription getUninstalledTransformDescription(TransformId id);
+    bool haveUninstalledTransforms(bool waitForCheckToComplete = false);
     
     typedef enum {
         TransformUnknown,