diff layer/ImageLayer.h @ 1608:6616e1899daa

Make ImageLayer able to report whether an image format can be opened
author Chris Cannam
date Mon, 11 May 2020 17:28:12 +0100
parents e6362cf5ff1d
children
line wrap: on
line diff
--- a/layer/ImageLayer.h	Wed May 06 11:44:38 2020 +0100
+++ b/layer/ImageLayer.h	Mon May 11 17:28:12 2020 +0100
@@ -98,6 +98,8 @@
 
     void setProperties(const QXmlAttributes &attributes) override;
 
+    static bool isImageFileSupported(QString url); // based on extension alone
+    
     virtual bool addImage(sv_frame_t frame, QString url); // using a command
 
 protected slots:
@@ -120,12 +122,14 @@
     typedef std::map<QString, FileSource *> FileSourceMap;
 
     static ImageMap m_images;
-    static QMutex m_imageMapMutex;
+    static FileSourceMap m_fileSources;
+    static QMutex m_staticMutex;
+
     mutable ViewImageMap m_scaled;
-    mutable FileSourceMap m_fileSources;
 
-    QString getLocalFilename(QString img) const;
-    void checkAddSource(QString img) const;
+    static QString getLocalFilename(QString img);
+    static void checkAddSource(QString img, bool synchronise);
+    void checkAddSourceAndConnect(QString img);
 
     ModelId m_model; // an ImageModel
     bool m_editing;