mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 07:14:56 +01:00
clear waveform cache when shape changes - fixes #6525
This commit is contained in:
parent
aa3eb11fb3
commit
63e3f326e9
2 changed files with 18 additions and 1 deletions
|
|
@ -126,6 +126,7 @@ class LIBCANVAS_API WaveViewCache
|
||||||
|
|
||||||
uint64_t image_cache_threshold () const { return _image_cache_threshold; }
|
uint64_t image_cache_threshold () const { return _image_cache_threshold; }
|
||||||
void set_image_cache_threshold (uint64_t);
|
void set_image_cache_threshold (uint64_t);
|
||||||
|
void clear_cache ();
|
||||||
|
|
||||||
void add (boost::shared_ptr<ARDOUR::AudioSource>, boost::shared_ptr<Entry>);
|
void add (boost::shared_ptr<ARDOUR::AudioSource>, boost::shared_ptr<Entry>);
|
||||||
void use (boost::shared_ptr<ARDOUR::AudioSource>, boost::shared_ptr<Entry>);
|
void use (boost::shared_ptr<ARDOUR::AudioSource>, boost::shared_ptr<Entry>);
|
||||||
|
|
|
||||||
|
|
@ -1351,6 +1351,9 @@ WaveView::set_global_shape (Shape s)
|
||||||
{
|
{
|
||||||
if (_global_shape != s) {
|
if (_global_shape != s) {
|
||||||
_global_shape = s;
|
_global_shape = s;
|
||||||
|
if (images) {
|
||||||
|
images->clear_cache ();
|
||||||
|
}
|
||||||
VisualPropertiesChanged (); /* EMIT SIGNAL */
|
VisualPropertiesChanged (); /* EMIT SIGNAL */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1360,6 +1363,9 @@ WaveView::set_global_logscaled (bool yn)
|
||||||
{
|
{
|
||||||
if (_global_logscaled != yn) {
|
if (_global_logscaled != yn) {
|
||||||
_global_logscaled = yn;
|
_global_logscaled = yn;
|
||||||
|
if (images) {
|
||||||
|
images->clear_cache ();
|
||||||
|
}
|
||||||
VisualPropertiesChanged (); /* EMIT SIGNAL */
|
VisualPropertiesChanged (); /* EMIT SIGNAL */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1827,10 +1833,20 @@ WaveViewCache::cache_flush ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
WaveViewCache::clear_cache ()
|
||||||
|
{
|
||||||
|
DEBUG_TRACE (DEBUG::WaveView, "clear cache\n");
|
||||||
|
const uint64_t image_cache_threshold = _image_cache_threshold;
|
||||||
|
_image_cache_threshold = 0;
|
||||||
|
cache_flush ();
|
||||||
|
_image_cache_threshold = image_cache_threshold;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
WaveViewCache::set_image_cache_threshold (uint64_t sz)
|
WaveViewCache::set_image_cache_threshold (uint64_t sz)
|
||||||
{
|
{
|
||||||
DEBUG_TRACE (DEBUG::WaveView, string_compose ("new image cache size \n", sz));
|
DEBUG_TRACE (DEBUG::WaveView, string_compose ("new image cache size %1\n", sz));
|
||||||
_image_cache_threshold = sz;
|
_image_cache_threshold = sz;
|
||||||
cache_flush ();
|
cache_flush ();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue