[pitivi/ges: 103/287] ui: Properly handle Subtitles discovery in media files
- From: Jean-FranÃois Fortin Tam <jfft src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi/ges: 103/287] ui: Properly handle Subtitles discovery in media files
- Date: Thu, 15 Mar 2012 16:34:29 +0000 (UTC)
commit 8cd3fc6adb55d78ddb85dc05288942b84008dea2
Author: Thibault Saunier <thibault saunier collabora com>
Date: Sat Dec 24 10:47:25 2011 +0100
ui: Properly handle Subtitles discovery in media files
Listen to the discoverer when it finds subtitles in media files, and show it up
in the UI.
pitivi/ui/common.py | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/pitivi/ui/common.py b/pitivi/ui/common.py
index 838d587..2e5c024 100644
--- a/pitivi/ui/common.py
+++ b/pitivi/ui/common.py
@@ -93,7 +93,11 @@ def unpack_cairo_gradient(value):
def beautify_info(info):
- ranks = {gst.pbutils.DiscovererVideoInfo: 0, gst.pbutils.DiscovererAudioInfo: 1, gst.pbutils.DiscovererStreamInfo: 2}
+ ranks = {
+ gst.pbutils.DiscovererVideoInfo: 0,
+ gst.pbutils.DiscovererAudioInfo: 1,
+ gst.pbutils.DiscovererStreamInfo: 2
+ }
def stream_sort_key(stream):
return ranks[type(stream)]
@@ -126,10 +130,9 @@ def beautify_stream(stream):
templ = _(u"<b>Image:</b> %dÃ%d <i>pixels</i>")
templ = templ % (par * stream.get_height(), stream.get_height())
return templ
- #FIXME : lol I have absolutely no clue what I'm doing !
- elif type(stream) == gst.pbutils.DiscovererStreamInfo:
- print stream.get_caps()
- return "And we have subtitles :)"
+ elif type(stream) == gst.pbutils.DiscovererStreamInfo and\
+ "text" in stream.get_caps():
+ return _("Subtitles")
raise NotImplementedError
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]