diff base/Layer.h @ 29:8460b3bf8f04

* Implement play mute, level and pan controls and a layer visibility control * Handle swapping the buffers in AudioCallbackPlaySource more gracefully, so that in many cases it can be done inaudibly. Still gets it wrong when playing in a noncontiguous selection. * Fix to SV file save for non-2d sparse models * Fixes to LED button drawing and AudioDial mouse functionality * Add progress bar for Ogg file import * Reshuffle PropertyContainer and its subclasses so it can be a QObject * Add layer dormancy (invisible layer permitted to free its cache space) * Optimisations to SpectrogramLayer, removing locks when reading/writing individual pixels in the cache (should be unnecessary there) -- there's still an issue here as we need a lock when reading from the model in case the model is replaced, and we don't currently have one * Several munlock() calls to make it harder to exhaust real memory if running in an RT mode with mlockall() active
author Chris Cannam
date Fri, 17 Feb 2006 18:04:26 +0000
parents 4b16526b011b
children 5e28cbb431d0
line wrap: on
line diff
--- a/base/Layer.h	Wed Feb 15 17:58:35 2006 +0000
+++ b/base/Layer.h	Fri Feb 17 18:04:26 2006 +0000
@@ -30,8 +30,7 @@
  * View, and may also be editable.
  */
 
-class Layer : public QObject,
-	      public PropertyContainer,
+class Layer : public PropertyContainer,
 	      public XmlExportable
 {
     Q_OBJECT
@@ -199,11 +198,21 @@
      * expected to become visible in the near future (for example
      * because the user has explicitly removed or hidden it).  The
      * layer may respond by (for example) freeing any cache memory it
-     * is using, until next time its paint method is called.
+     * is using, until next time its paint method is called.  It does
+     * not need to remember not to draw itself; the view will handle
+     * that.
      */
-    virtual void setLayerDormant() { }
+    virtual void setLayerDormant(bool dormant) { m_dormant = dormant; }
 
-    virtual PlayParameters *getPlayParameters() const;
+    /**
+     * Return whether the layer is dormant (i.e. hidden).
+     */
+    virtual bool isLayerDormant() const { return m_dormant; }
+
+    virtual PlayParameters *getPlayParameters();
+
+public slots:
+    void showLayer(bool show);
 
 signals:
     void modelChanged();
@@ -216,6 +225,7 @@
 
 protected:
     View *m_view;
+    bool m_dormant;
 };
 
 #endif