From ee9338612793568f0fe31383b1d4e88a7c5b82be Mon Sep 17 00:00:00 2001 From: iovar Date: Fri, 17 Nov 2006 01:55:54 +0000 Subject: better rounding of video and audio quality git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@182 f606c939-3180-4ac9-a4b8-4b8779d57d0a --- gtk-recordmydesktop/src/rmdSimple.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gtk-recordmydesktop/src/rmdSimple.py b/gtk-recordmydesktop/src/rmdSimple.py index b5789a3..e885dea 100644 --- a/gtk-recordmydesktop/src/rmdSimple.py +++ b/gtk-recordmydesktop/src/rmdSimple.py @@ -99,12 +99,12 @@ class simpleWidget(object): self.NWBox.pack_start(self.image,False,False) #quality - self.v_adj=gtk.Adjustment(value=(self.values[10]*100)/63, lower=0, upper=100, step_incr=1, page_incr=10, page_size=0) + self.v_adj=gtk.Adjustment(value=int(round((float(self.values[10])*100.0)/63.0)), lower=0, upper=100, step_incr=1, page_incr=10, page_size=0) self.v_quality=gtk.HScale(self.v_adj) self.v_quality.set_value_pos(gtk.POS_LEFT) self.v_quality.set_digits(0) self.s_button= gtk.CheckButton(label=None) - self.s_adj=gtk.Adjustment(value=(self.values[11]*10), lower=0, upper=100, step_incr=1, page_incr=10, page_size=0) + self.s_adj=gtk.Adjustment(value=int(round(float(self.values[11])*10.0)), lower=0, upper=100, step_incr=1, page_incr=10, page_size=0) #print (self.values[11]*10) self.s_quality=gtk.HScale(self.s_adj) self.s_quality.set_value_pos(gtk.POS_LEFT) @@ -254,8 +254,12 @@ class simpleWidget(object): self.values[2]=widget.get_active() def update(self) : - self.values[10]=int((self.v_quality.get_value()*63)/100) - self.values[11]=int(self.s_quality.get_value()/10) + self.values[10]=int(round((float(self.v_quality.get_value())*63.0)/100.0)) + self.values[11]=int(round(float(self.s_quality.get_value())/10.0)) + if self.values[10]>63: + self.values[10]=63 + if self.values[11]>10: + self.values[11]=10 def load_prefs(self): path=os.path.join(os.getenv("HOME"),".gtk-recordmydesktop") try: -- cgit v1.2.3