Now shows a default value for preview duration
Fixed progress bar for subtitle creation Allows to choose the subtitle colors
This commit is contained in:
parent
832644c2b7
commit
7f24e891ec
6 changed files with 142 additions and 11 deletions
|
|
@ -98,6 +98,9 @@ class configuration(GObject.GObject):
|
|||
self.sub_codepage = None
|
||||
self.burner = None
|
||||
self.mkiso = None
|
||||
self.subt_fill_color = (1,1,1,1)
|
||||
self.subt_outline_color = (0,0,0,1)
|
||||
self.subt_outline_thickness = 0.0
|
||||
|
||||
config_path = os.path.join(os.environ.get("HOME"),".devede")
|
||||
try:
|
||||
|
|
@ -150,6 +153,14 @@ class configuration(GObject.GObject):
|
|||
if linea[:19]=="subtitle_font_size:":
|
||||
self.subtitles_font_size = int(linea[19:].strip())
|
||||
continue
|
||||
if linea[:20] == "subtitle_fill_color:":
|
||||
c = linea[20:].strip().split(",")
|
||||
self.subt_fill_color = (float(c[0]), float(c[1]), float(c[2]), 1.0)
|
||||
if linea[:23] == "subtitle_outline_color:":
|
||||
c = linea[23:].strip().split(",")
|
||||
self.subt_outline_color = (float(c[0]), float(c[1]), float(c[2]), 1.0)
|
||||
if linea[:27] == "subtitle_outilne_thickness:":
|
||||
self.subt_outline_thickness = float(linea[27:].strip())
|
||||
config_data.close()
|
||||
except:
|
||||
pass
|
||||
|
|
@ -199,6 +210,10 @@ class configuration(GObject.GObject):
|
|||
if (self.sub_language != None):
|
||||
config_data.write("sub_language:"+str(self.sub_language)+"\n")
|
||||
config_data.write("subtitle_font_size:"+str(self.subtitles_font_size)+"\n")
|
||||
config_data.write("subtitle_fill_color:"+str(self.subt_fill_color[0])+","+str(self.subt_fill_color[1])+","+str(self.subt_fill_color[2])+"\n")
|
||||
config_data.write("subtitle_outline_color:"+str(self.subt_outline_color[0])+","+str(self.subt_outline_color[1])+","+str(self.subt_outline_color[2])+"\n")
|
||||
config_data.write("subtitle_outilne_thickness:"+str(self.subt_outline_thickness))
|
||||
|
||||
config_data.close()
|
||||
except:
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -94,6 +94,10 @@ class file_movie(devede.interface_manager.interface_manager):
|
|||
self.add_float_adjustment("audio_delay", 0.0)
|
||||
self.add_integer_adjustment("chapter_size", 5)
|
||||
|
||||
self.add_colorbutton("subt_fill_color", self.config.subt_fill_color)
|
||||
self.add_colorbutton("subt_outline_color", self.config.subt_outline_color)
|
||||
self.add_float_adjustment("subt_thickness", self.config.subt_outline_thickness)
|
||||
|
||||
if list_files == None:
|
||||
self.add_list("subtitles_list")
|
||||
else:
|
||||
|
|
@ -558,11 +562,16 @@ class file_movie(devede.interface_manager.interface_manager):
|
|||
def on_button_accept_clicked(self,b):
|
||||
|
||||
self.store_ui(self.builder)
|
||||
self.config.subt_fill_color = self.subt_fill_color
|
||||
self.config.subt_outline_color = self.subt_outline_color
|
||||
self.config.subt_outline_thickness = self.subt_thickness
|
||||
if self.list_files == None:
|
||||
# editing file properties
|
||||
self.set_final_rates()
|
||||
self.set_final_size_aspect()
|
||||
self.emit('title_changed',self.title_name)
|
||||
else:
|
||||
# editing properties for a group of files
|
||||
data = self.store_file()
|
||||
sel = self.wtreeview_multiproperties.get_selection()
|
||||
model, pathlist = sel.get_selected_rows()
|
||||
|
|
@ -635,10 +644,11 @@ class file_movie(devede.interface_manager.interface_manager):
|
|||
|
||||
if len(self.subtitles_list) != 0:
|
||||
last_process = converter
|
||||
if duration == 0:
|
||||
duration2 = self.original_length
|
||||
else:
|
||||
duration2 = duration
|
||||
#if duration == 0:
|
||||
# it seems that SPUMUX always fills the entire subtitles
|
||||
duration2 = self.original_length
|
||||
#else:
|
||||
# duration2 = duration
|
||||
stream_id = 0
|
||||
for subt in self.subtitles_list:
|
||||
subt_file = subt[0]
|
||||
|
|
@ -652,7 +662,8 @@ class file_movie(devede.interface_manager.interface_manager):
|
|||
subt_mux = devede.subtitles_mux.subtitles_mux()
|
||||
subt_mux.multiplex_subtitles( output_path, subt_file, subt_codepage, subt_lang, subt_upper,
|
||||
self.subt_font_size,self.format_pal,self.force_subtitles,
|
||||
final_aspect, duration2, stream_id)
|
||||
final_aspect, duration2, stream_id,
|
||||
self.subt_fill_color, self.subt_outline_color, self.subt_thickness)
|
||||
subt_mux.add_dependency(last_process)
|
||||
converter.add_child_process(subt_mux)
|
||||
last_process = subt_mux
|
||||
|
|
|
|||
|
|
@ -30,8 +30,13 @@ class subtitles_mux(devede.executor.executor):
|
|||
devede.executor.executor.__init__(self)
|
||||
self.config = devede.configuration_data.configuration.get_config()
|
||||
|
||||
def multiplex_subtitles(self, file_path, subtitles_path,subt_codepage, subt_lang,
|
||||
subt_upper,font_size, pal, force_subtitles, aspect, duration, stream_id):
|
||||
def multiplex_subtitles(self, file_path, subtitles_path, subt_codepage, subt_lang,
|
||||
subt_upper, font_size, pal, force_subtitles, aspect, duration, stream_id, fill_color, outline_color, outline_thick):
|
||||
|
||||
if len(fill_color) == 4:
|
||||
fill_color = fill_color[:3]
|
||||
if len(outline_color) == 4:
|
||||
outline_color = outline_color[:3]
|
||||
|
||||
self.subt_path = file_path
|
||||
self.duration = duration
|
||||
|
|
@ -53,7 +58,10 @@ class subtitles_mux(devede.executor.executor):
|
|||
out_xml.write(str(font_size))
|
||||
if subt_upper:
|
||||
out_xml.write('" bottom-margin="50')
|
||||
out_xml.write('" font="arial" horizontal-alignment="center" vertical-alignment="bottom" aspect="')
|
||||
out_xml.write('" fill-color="#%02X%02X%02X"' % fill_color)
|
||||
out_xml.write(' outline-color="#%02X%02X%02X"' % outline_color)
|
||||
out_xml.write(' outline-thickness="%d"' % outline_thick)
|
||||
out_xml.write(' font="arial" horizontal-alignment="center" vertical-alignment="bottom" aspect="')
|
||||
out_xml.write(str(aspect))
|
||||
out_xml.write('" force="')
|
||||
if force_subtitles:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue