[pitivi: 5/6] previewer: add cache size configuration option, se
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Subject: [pitivi: 5/6] previewer: add cache size configuration option, se
- Date: Sun, 8 Mar 2009 08:02:32 -0400 (EDT)
commit 491d35b75d3e56da98413ab11e06ed75e8ef1a55
Author: Brandon Lewis <brandon_lewis berkeley edu>
Date: Fri Mar 6 18:48:41 2009 -0800
previewer: add cache size configuration option, set a reasonable default
---
pitivi/previewer.py | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/pitivi/previewer.py b/pitivi/previewer.py
index d48d8b5..f4c4e5c 100644
--- a/pitivi/previewer.py
+++ b/pitivi/previewer.py
@@ -47,6 +47,14 @@ GlobalSettings.addConfigOption("thumbnailSpacingHint",
section="thumbnailing",
key="spacing-hint",
default=2.0)
+# this default works out to a maximum of ~ 1.78 MiB per factory, assuming:
+# 4:3 aspect ratio
+# 4 bytes per pixel
+# 50 pixel height
+GlobalSettings.addConfigOption("thumbnailCacheSize",
+ section="thumbnailing",
+ key="cache-size",
+ default=250)
# Previewer -- abstract base class with public interface for UI
# |_DefaultPreviewer -- draws a default thumbnail for UI
@@ -126,7 +134,8 @@ class RandomAccessPreviewer(Previewer):
def __init__(self, factory, stream_):
Previewer.__init__(self, factory, stream_)
self._queue = []
- self._cache = ThumbnailCache(size=100)
+ self._cache = ThumbnailCache(size=
+ instance.PiTiVi.settings.thumbnailCacheSize)
# FIXME:
# why doesn't this work?
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]