diff --git a/devede_loadsave.py b/devede_loadsave.py index 685d6d1..7880de9 100755 --- a/devede_loadsave.py +++ b/devede_loadsave.py @@ -134,6 +134,10 @@ def load(self,file_name): element2["turbo1stpass"]=False # for backward compatibility if False==element2.has_key("subfont_size"): element2["subfont_size"]=28 # subtitle font size + if False==element2.has_key("sub_fill_color"): + element2["sub_fill_color"]=[65535,65535,65535,65535] # subtitle fill color + if False==element2.has_key("sub_outline_color"): + element2["sub_outline_color"]=[0,0,0,65535] # subtitle outline color if False==element2.has_key("volume"): element2["volume"]=100 # default volume (in percentage) if False==element2.has_key("force_subs"): diff --git a/devede_newfiles.py b/devede_newfiles.py index f2bd6c8..06e9961 100755 --- a/devede_newfiles.py +++ b/devede_newfiles.py @@ -350,6 +350,8 @@ def create_default_video_parameters(self,filename): self.file_properties["isvob"]=False # recompress both audio and video self.file_properties["swap_fields"]=False # swap fields in interlaced videos self.file_properties["subfont_size"]=28 # subtitle font size + self.file_properties["sub_fill_color"]=[65535,65535,65535,65535] # subtitle outline color + self.file_properties["sub_outline_color"]=[0,0,0,65535] # subtitle outline color self.file_properties["sound51"]=False # don't use 5.1 sound self.file_properties["gop12"]=True # GOP of 12 by default to increase compatibility self.file_properties["filesize"]=os.stat(filename)[stat.ST_SIZE] # file size @@ -732,7 +734,15 @@ def get_widgets(self): w=self.tree.get_object("subfont_size") self.file_properties["subfont_size"]=int(w.get_value()) - + + w=self.tree.get_object("sub_fill_color") + color=w.get_color() + self.file_properties["sub_fill_color"]=[color.red,color.green,color.blue,w.get_alpha()] + + w=self.tree.get_object("sub_outline_color") + color=w.get_color() + self.file_properties["sub_outline_color"]=[color.red,color.green,color.blue,w.get_alpha()] + w=self.tree.get_object("audiodelay") self.file_properties["adelay"]=float(w.get_value()) @@ -1217,6 +1227,18 @@ def set_widgets(self): w=self.tree.get_object("subfont_size") w.set_value(self.file_properties["subfont_size"]) + w=self.tree.get_object("sub_fill_color") + color=self.file_properties["sub_fill_color"] + gdk_color=gtk.gdk.Color(color[0],color[1],color[2]) + w.set_color(gdk_color) + w.set_alpha(color[3]) + + w=self.tree.get_object("sub_outline_color") + color=self.file_properties["sub_outline_color"] + gdk_color=gtk.gdk.Color(color[0],color[1],color[2]) + w.set_color(gdk_color) + w.set_alpha(color[3]) + w=self.tree.get_object("swap_fields") w.set_active(self.file_properties["swap_fields"]) diff --git a/devede_subtitles.py b/devede_subtitles.py index 5701477..f4f21fa 100755 --- a/devede_subtitles.py +++ b/devede_subtitles.py @@ -136,6 +136,16 @@ def __init__(self,videofile,filename,filefolder,progresbar,proglabel,disctype,ti fichero.write('\n\t\tfontsize="'+str(tamanofont)+'.0"') + fill_color = 'rgba(%.0f%%, %.0f%%, %.0f%%, %.0f%%)' % tuple( + float(item)/655.35 for item in videofile["sub_fill_color"] + ) + fichero.write('\n\t\tfill-color="%s"' % fill_color) + + outline_color = 'rgba(%.0f%%, %.0f%%, %.0f%%, %.0f%%)' % tuple( + float(item)/655.35 for item in videofile["sub_outline_color"] + ) + fichero.write('\n\t\toutline-color="%s"' % outline_color) + if (videofile["fps"]==30): if (videofile["ofps"]==24) and ((disctype=="dvd") or (disctype=="divx")): fps_out="24000/1001" diff --git a/interface/wfile.ui b/interface/wfile.ui index d4ea460..ece3076 100644 --- a/interface/wfile.ui +++ b/interface/wfile.ui @@ -885,6 +885,77 @@ 0 + + + True + False + 2 + 2 + + + False + True + True + True + True + #ffffffffffff + + + 1 + 2 + GTK_FILL + GTK_FILL + + + + + True + False + 1 + Fill color: + + + GTK_FILL + + + + + False + True + True + True + True + #000000000000 + + + 1 + 2 + 1 + 2 + GTK_FILL + GTK_FILL + + + + + True + False + 1 + Outline color: + right + + + 1 + 2 + + + + + False + True + 1 + + True