[pitivi: 14/41] previewer: change thumbnail period slider to combo box
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi: 14/41] previewer: change thumbnail period slider to combo box
- Date: Sat, 13 Aug 2011 12:07:24 +0000 (UTC)
commit 3f1bcbba2265a5b3c58cfab060e9ac3660554d2e
Author: Brandon Lewis <brandon_lewis alum berkeley edu>
Date: Wed Nov 3 16:18:50 2010 +0000
previewer: change thumbnail period slider to combo box
pitivi/ui/previewer.py | 22 +++++++++++++++-------
1 files changed, 15 insertions(+), 7 deletions(-)
---
diff --git a/pitivi/ui/previewer.py b/pitivi/ui/previewer.py
index 32acb24..abe79c1 100644
--- a/pitivi/ui/previewer.py
+++ b/pitivi/ui/previewer.py
@@ -49,10 +49,11 @@ GlobalSettings.addConfigOption("thumbnailSpacingHint",
key="spacing-hint",
default=2,
notify=True)
+
GlobalSettings.addConfigOption("thumbnailPeriod",
section="thumbnailing",
key="thumbnail-period",
- default=0.5,
+ default=gst.SECOND / 2,
notify=True)
PreferencesDialog.addNumericPreference("thumbnailSpacingHint",
@@ -61,12 +62,19 @@ PreferencesDialog.addNumericPreference("thumbnailSpacingHint",
lower=0,
description=_("The gap between thumbnails"))
-PreferencesDialog.addNumericPreference("thumbnailPeriod",
+PreferencesDialog.addChoicePreference("thumbnailPeriod",
section=_("Appearance"),
- label=_("Thumbnail Period (seconds)"),
- lower=0.001,
- upper=60,
- description=_("The interval, in seconds, between successive thumbnails"))
+ label=_("Thumbnail every"),
+ choices=(
+ ("1/100 second", gst.SECOND / 100),
+ ("1/10 second", gst.SECOND / 10),
+ ("1/4 second", gst.SECOND / 4),
+ ("1/2 second", gst.SECOND/ 2),
+ ("second", gst.SECOND),
+ ("5 seconds", 5 * gst.SECOND),
+ ("10 seconds", 10 * gst.SECOND),
+ ("minute", 60 * gst.SECOND)),
+ description=_("The interval, in seconds, between thumbnails"))
# this default works out to a maximum of ~ 1.78 MiB per factory, assuming:
# 4:3 aspect ratio
@@ -393,7 +401,7 @@ class RandomAccessVideoPreviewer(RandomAccessPreviewer):
def _segment_for_time(self, time):
# quantize thumbnail timestamps to maximum granularity
- return utils.quantize(time, long(gst.SECOND * self.tperiod))
+ return utils.quantize(time, self.tperiod)
def _thumbnailCb(self, unused_thsink, pixbuf, timestamp):
gobject.idle_add(self._finishThumbnail, pixbuf, timestamp)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]