[pitivi] Fix the encoding dialog a bit more. The code needs major love though.
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Subject: [pitivi] Fix the encoding dialog a bit more. The code needs major love though.
- Date: Mon, 29 Jun 2009 10:31:56 +0000 (UTC)
commit f77dad185a5b1df8347040f4d8af9c39ca9b4878
Author: Alessandro Decina <alessandro d gmail com>
Date: Fri Jun 26 14:17:44 2009 +0200
Fix the encoding dialog a bit more. The code needs major love though.
pitivi/formatters/etree.py | 4 ++--
pitivi/settings.py | 17 ++++++++++++-----
pitivi/ui/encodingdialog.py | 7 ++-----
3 files changed, 16 insertions(+), 12 deletions(-)
---
diff --git a/pitivi/formatters/etree.py b/pitivi/formatters/etree.py
index 167cd07..702186b 100644
--- a/pitivi/formatters/etree.py
+++ b/pitivi/formatters/etree.py
@@ -296,8 +296,8 @@ class ElementTreeFormatter(Formatter):
settings.audiochannels = int(element.attrib["audiochannels"])
settings.audiorate = int(element.attrib["audiorate"])
settings.audiodepth = int(element.attrib["audiodepth"])
- settings.aencoder = element.attrib["aencoder"]
- settings.vencoder = element.attrib["vencoder"]
+ settings.aencoder = element.attrib["aencoder"] or None
+ settings.vencoder = element.attrib["vencoder"] or None
settings.muxer = element.attrib["muxer"]
sett = element.find("container-settings")
diff --git a/pitivi/settings.py b/pitivi/settings.py
index 13c2336..8c44e21 100644
--- a/pitivi/settings.py
+++ b/pitivi/settings.py
@@ -495,14 +495,21 @@ class ExportSettings(Signallable, Loggable):
def getVideoDescription(self):
""" Returns a human-readable markup-ed string describing the video properties """
- res = "%d x %d <i>pixels</i> at %.2f <i>fps</i> <i>(%s)</i>"
- return res % (self.videowidth, self.videoheight,
- float(self.videorate), self.vencoder)
+ res = "%d x %d <i>pixels</i> at %.2f <i>fps</i>" % (self.videowidth,
+ self.videoheight, float(self.videorate))
+ if self.vencoder is not None:
+ res += " <i>(%s)</i>" % self.vencoder
+
+ return res
def getAudioDescription(self):
""" Returns a human-readable markup-ed string describing the audio properties """
- res = "%d channels at %d <i>Hz</i> (%d <i>bits</i>) <i>(%s)</i>"
- return res % (self.audiochannels, self.audiorate, self.audiodepth, self.aencoder or "raw")
+ res = "%d channels at %d <i>Hz</i> (%d <i>bits</i>)" % \
+ (self.audiochannels, self.audiorate, self.audiodepth)
+ if self.aencoder is not None:
+ res += " <i>(%s)</i>" % self.aencoder
+
+ return res
def getAudioCaps(self):
""" Returns the GstCaps corresponding to the audio settings """
diff --git a/pitivi/ui/encodingdialog.py b/pitivi/ui/encodingdialog.py
index ee007f1..54f9d4c 100644
--- a/pitivi/ui/encodingdialog.py
+++ b/pitivi/ui/encodingdialog.py
@@ -83,11 +83,8 @@ class EncodingDialog(GladeWindow, Loggable):
self.destroy()
def _displaySettings(self):
- if self.settings.vencoder is not None:
- self.vinfo.set_markup(self.settings.getVideoDescription())
-
- if self.settings.aencoder is not None:
- self.ainfo.set_markup(self.settings.getAudioDescription())
+ self.vinfo.set_markup(self.settings.getVideoDescription())
+ self.ainfo.set_markup(self.settings.getAudioDescription())
def _fileButtonClickedCb(self, button):
dialog = gtk.FileChooserDialog(title=_("Choose file to render to"),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]