Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Let set subtitles color

  • Loading branch information...
commit 0d14d49affd19a28f90c834331cf768320a0fc4c 1 parent 757d20a
@nott nott authored
View
4 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"):
View
24 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"])
View
10 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"
View
71 interface/wfile.ui
@@ -886,6 +886,77 @@
</packing>
</child>
<child>
+ <object class="GtkTable" id="table8">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <child>
+ <object class="GtkColorButton" id="sub_fill_color">
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_alpha">True</property>
+ <property name="color">#ffffffffffff</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label52">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Fill color: </property>
+ </object>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkColorButton" id="sub_outline_color">
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_alpha">True</property>
+ <property name="color">#000000000000</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label102">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Outline color: </property>
+ <property name="justify">right</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkHBox" id="hbox7">
<property name="visible">True</property>
<property name="can_focus">False</property>
Please sign in to comment.
Something went wrong with that request. Please try again.