Mercurial > hg > svgui
diff layer/SpectrogramLayer.cpp @ 47:2e2ad8510e52
* Fix a crash in PortAudio output for mono data
* Don't construct a chromagram in TonalChangeDetect plugin ctor
* Update layer show/hide/dormancy for multi-view-capable layers -- the
dormancy concept doesn't really work with these constraints any more
author | Chris Cannam |
---|---|
date | Fri, 03 Mar 2006 17:52:21 +0000 |
parents | 25a2915d351d |
children | 97b0643bd799 |
line wrap: on
line diff
--- a/layer/SpectrogramLayer.cpp Fri Mar 03 17:23:27 2006 +0000 +++ b/layer/SpectrogramLayer.cpp Fri Mar 03 17:52:21 2006 +0000 @@ -798,14 +798,15 @@ } void -SpectrogramLayer::setLayerDormant(const bool dormant) +SpectrogramLayer::setLayerDormant(const View *v, bool dormant) { - if (dormant == m_dormant) return; + QMutexLocker locker(&m_mutex); + + if (dormant == m_dormancy[v]) return; if (dormant) { - m_mutex.lock(); - m_dormant = true; + m_dormancy[v] = true; // delete m_cache; // m_cache = 0; @@ -815,12 +816,9 @@ delete m_pixmapCache; m_pixmapCache = 0; - m_mutex.unlock(); - } else { - m_dormant = false; - fillCache(); + m_dormancy[v] = false; } } @@ -1272,8 +1270,13 @@ // std::cerr << "SpectrogramLayer::CacheFillThread::run in loop" << std::endl; - if (m_layer.m_dormant) { - +/*!!! Need a way of finding out whether this layer is dormant in + all the views that are currently visible... or not + + if (m_layer.m_dormancy[) { +*/ + if (0) { //!!! + if (m_layer.m_cacheInvalid) { delete m_layer.m_cache; m_layer.m_cache = 0; @@ -1695,7 +1698,7 @@ return; } - if (m_dormant) { + if (isLayerDormant(v)) { std::cerr << "SpectrogramLayer::paint(): Layer is dormant" << std::endl; return; }