~ubuntu-branches/ubuntu/trusty/pitivi/trusty

« back to all changes in this revision

Viewing changes to pitivi/ui/previewer.py

* New upstream pre-release:
  + debian/control:
    - Update dependencies.
* debian/control:
  + Update Standards-Version to 3.8.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
import gst
29
29
import cairo
30
30
import os
 
31
from gettext import gettext as _
31
32
import pitivi.utils as utils
32
33
from pitivi.configure import get_pixmap_dir
33
34
from pitivi.elements.singledecodebin import SingleDecodeBin
52
53
    notify=True)
53
54
 
54
55
PreferencesDialog.addNumericPreference("thumbnailSpacingHint",
55
 
    section="Appearance",
56
 
    label="Thumbnail Gap (pixels)",
 
56
    section=_("Appearance"),
 
57
    label=_("Thumbnail Gap (pixels)"),
57
58
    lower=0,
58
 
    description="The gap between thumbnails")
 
59
    description=_("The gap between thumbnails"))
59
60
 
60
61
# this default works out to a maximum of ~ 1.78 MiB per factory, assuming:
61
62
# 4:3 aspect ratio
80
81
    notify = True)
81
82
 
82
83
PreferencesDialog.addTogglePreference('showThumbnails',
83
 
    section = "Appearance",
84
 
    label = "Show Thumbnails (Video)",
85
 
    description = "Show Thumbnails on Video Clips")
 
84
    section = _("Appearance"),
 
85
    label = _("Show Thumbnails (Video)"),
 
86
    description = _("Show Thumbnails on Video Clips"))
86
87
 
87
88
GlobalSettings.addConfigOption('showWaveforms',
88
89
    section = 'user-interface',
91
92
    notify = True)
92
93
 
93
94
PreferencesDialog.addTogglePreference('showWaveforms',
94
 
    section = "Appearance",
95
 
    label = "Show Waveforms (Audio)",
96
 
    description = "Show Waveforms on Audio Clips")
 
95
    section = _("Appearance"),
 
96
    label = _("Show Waveforms (Audio)"),
 
97
    description = _("Show Waveforms on Audio Clips"))
97
98
 
98
99
# Previewer                      -- abstract base class with public interface for UI
99
100
# |_DefaultPreviewer             -- draws a default thumbnail for UI
466
467
 
467
468
        # generate points
468
469
        cr.set_source_rgba(0, 0, 0, 1.0)
469
 
        points = ((x * scale, hscale - (y * hscale)) for x, y in enumerate(samples))
470
 
 
471
 
        self._plot_points(cr, 0, hscale, points)
 
470
 
 
471
        cr.move_to(0, hscale)
 
472
        for x, y in enumerate(samples):
 
473
            x = x * scale
 
474
            y = hscale - (y * hscale)
 
475
            cr.line_to(x, y)
 
476
 
472
477
        cr.stroke()
473
478
 
474
 
    def _plot_points(self, cr, x0, y0, points):
475
 
        cr.move_to(x0, y0)
476
 
        for x, y in points:
477
 
            cr.line_to(x, y)
478
 
 
479
479
    def _connectSettings(self, settings):
480
480
        RandomAccessPreviewer._connectSettings(self, settings)
481
481
        self._view = settings.showWaveforms