This commit is contained in:
Sergio Costas 2015-06-30 01:09:34 +02:00
commit 1dcaa6f6c0
4 changed files with 156 additions and 48 deletions

View file

@ -39,7 +39,6 @@
<property name="modal">True</property> <property name="modal">True</property>
<property name="window_position">center</property> <property name="window_position">center</property>
<property name="deletable">False</property> <property name="deletable">False</property>
<property name="has_resize_grip">False</property>
<child> <child>
<object class="GtkBox" id="box1"> <object class="GtkBox" id="box1">
<property name="visible">True</property> <property name="visible">True</property>
@ -75,8 +74,8 @@
<object class="GtkLabel" id="label7"> <object class="GtkLabel" id="label7">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Text:</property> <property name="label" translatable="yes">Text:</property>
<property name="xalign">1</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
@ -87,8 +86,8 @@
<object class="GtkLabel" id="label8"> <object class="GtkLabel" id="label8">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Font:</property> <property name="label" translatable="yes">Font:</property>
<property name="xalign">1</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
@ -99,8 +98,8 @@
<object class="GtkLabel" id="label9"> <object class="GtkLabel" id="label9">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Text color:</property> <property name="label" translatable="yes">Text color:</property>
<property name="xalign">1</property>
</object> </object>
<packing> <packing>
<property name="left_attach">2</property> <property name="left_attach">2</property>
@ -111,8 +110,8 @@
<object class="GtkLabel" id="label10"> <object class="GtkLabel" id="label10">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Shadow color:</property> <property name="label" translatable="yes">Shadow color:</property>
<property name="xalign">1</property>
</object> </object>
<packing> <packing>
<property name="left_attach">2</property> <property name="left_attach">2</property>
@ -170,8 +169,8 @@
<object class="GtkLabel" id="label28"> <object class="GtkLabel" id="label28">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Vertical position (percent):</property> <property name="label" translatable="yes">Vertical position (percent):</property>
<property name="xalign">1</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
@ -196,8 +195,8 @@
<object class="GtkLabel" id="label11"> <object class="GtkLabel" id="label11">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Horizontal position (percent):</property> <property name="label" translatable="yes">Horizontal position (percent):</property>
<property name="xalign">1</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
@ -610,8 +609,8 @@
<object class="GtkLabel" id="label21"> <object class="GtkLabel" id="label21">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Font:</property> <property name="label" translatable="yes">Font:</property>
<property name="xalign">1</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -648,8 +647,8 @@
<object class="GtkLabel" id="label22"> <object class="GtkLabel" id="label22">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Unselected titles:</property> <property name="label" translatable="yes">Unselected titles:</property>
<property name="xalign">1</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
@ -660,8 +659,8 @@
<object class="GtkLabel" id="label23"> <object class="GtkLabel" id="label23">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Shadows:</property> <property name="label" translatable="yes">Shadows:</property>
<property name="xalign">1</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
@ -672,8 +671,8 @@
<object class="GtkLabel" id="label24"> <object class="GtkLabel" id="label24">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Selected title:</property> <property name="label" translatable="yes">Selected title:</property>
<property name="xalign">1</property>
</object> </object>
<packing> <packing>
<property name="left_attach">2</property> <property name="left_attach">2</property>
@ -684,8 +683,8 @@
<object class="GtkLabel" id="label25"> <object class="GtkLabel" id="label25">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Background color:</property> <property name="label" translatable="yes">Background color:</property>
<property name="xalign">1</property>
</object> </object>
<packing> <packing>
<property name="left_attach">2</property> <property name="left_attach">2</property>
@ -832,6 +831,73 @@
<property name="position">5</property> <property name="position">5</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkFrame" id="frame7">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment9">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
<object class="GtkBox" id="box12">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkRadioButton" id="menu_play_all">
<property name="label" translatable="yes">Provide "Play All" option</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="menu_no_play_all">
<property name="label" translatable="yes">Don't provide "Play All" option</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="group">menu_play_all</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label15">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Play all option&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">6</property>
</packing>
</child>
<child> <child>
<object class="GtkFrame" id="frame_preview_controls"> <object class="GtkFrame" id="frame_preview_controls">
<property name="visible">True</property> <property name="visible">True</property>
@ -920,7 +986,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">6</property> <property name="position">7</property>
</packing> </packing>
</child> </child>
</object> </object>

View file

@ -47,6 +47,7 @@ class dvd_menu(devedeng.interface_manager.interface_manager):
self.add_group("position_horizontal", ["left", "center", "right"], "center", self.update_preview) self.add_group("position_horizontal", ["left", "center", "right"], "center", self.update_preview)
self.add_group("at_startup", ["menu_show_at_startup", "play_first_title_at_startup"], "menu_show_at_startup") self.add_group("at_startup", ["menu_show_at_startup", "play_first_title_at_startup"], "menu_show_at_startup")
self.add_group("play_all", ["menu_play_all", "menu_no_play_all"], "menu_no_play_all", self.update_preview)
self.add_integer_adjustment("sound_length", 30) self.add_integer_adjustment("sound_length", 30)
@ -373,6 +374,8 @@ class dvd_menu(devedeng.interface_manager.interface_manager):
entry_height = self.cached_menu_size + self.entry_vertical_margin * 2.0 + self.entry_separation entry_height = self.cached_menu_size + self.entry_vertical_margin * 2.0 + self.entry_separation
entries_per_page = int((self.y - top_margin_p - bottom_margin_p) / entry_height) entries_per_page = int((self.y - top_margin_p - bottom_margin_p) / entry_height)
if (self.play_all == "menu_play_all"):
entries_per_page -= 1
n_entries = len(self.title_list) n_entries = len(self.title_list)
if (n_entries > entries_per_page): if (n_entries > entries_per_page):
paint_arrows = True paint_arrows = True
@ -392,6 +395,18 @@ class dvd_menu(devedeng.interface_manager.interface_manager):
xr = 720.0 - right_margin_p xr = 720.0 - right_margin_p
y = top_margin_p + entry_height/2.0 y = top_margin_p + entry_height/2.0
height = (self.cached_menu_size + self.entry_vertical_margin) / 2.0 height = (self.cached_menu_size + self.entry_vertical_margin) / 2.0
if (self.play_all == "menu_play_all"):
coordinates.append([xl, y-height, xr, y+height, "play_all"])
if paint_background:
self.paint_base(xl, xr, y, 0)
self.write_text("Play All", "menu_entry", xl, xr, y, self.position_horizontal)
if paint_selected:
self.write_text("Play All", "menu_entry_selected", xl, xr, y, self.position_horizontal)
if paint_activated:
self.write_text("Play All", "menu_entry_activated", xl, xr, y, self.position_horizontal)
y += entry_height
for entry in self.title_list[page_number*entries_per_page:(page_number+1)*entries_per_page]: for entry in self.title_list[page_number*entries_per_page:(page_number+1)*entries_per_page]:
coordinates.append([xl, y-height, xr, y+height, "entry"]) coordinates.append([xl, y-height, xr, y+height, "entry"])
text = entry[0].title_name text = entry[0].title_name

View file

@ -29,7 +29,7 @@ class dvdauthor_converter(devedeng.executor.executor):
self.config = devedeng.configuration_data.configuration.get_config() self.config = devedeng.configuration_data.configuration.get_config()
def create_dvd_project (self, path, name, file_movies, menu_entries, start_with_menu): def create_dvd_project (self, path, name, file_movies, menu_entries, start_with_menu, play_all_opt):
movie_path = os.path.join(path,"dvd_tree") movie_path = os.path.join(path,"dvd_tree")
try: try:
@ -37,7 +37,7 @@ class dvdauthor_converter(devedeng.executor.executor):
except: except:
pass pass
xml_file = self.create_dvdauthor_xml(path, file_movies, menu_entries, start_with_menu) xml_file = self.create_dvdauthor_xml(path, file_movies, menu_entries, start_with_menu, play_all_opt)
self.command_var=[] self.command_var=[]
self.command_var.append("dvdauthor") self.command_var.append("dvdauthor")
@ -59,7 +59,7 @@ class dvdauthor_converter(devedeng.executor.executor):
return return
def create_dvdauthor_xml(self,movie_folder, file_movies, menu_entries, start_with_menu): def create_dvdauthor_xml(self,movie_folder, file_movies, menu_entries, start_with_menu, play_all_opt):
xmlpath = os.path.join(movie_folder,"xml_data") xmlpath = os.path.join(movie_folder,"xml_data")
xml_file_path = os.path.join(xmlpath,"dvdauthor.xml") xml_file_path = os.path.join(xmlpath,"dvdauthor.xml")
@ -94,11 +94,17 @@ class dvdauthor_converter(devedeng.executor.executor):
xml_file.write('\t\t<fpc>\n') xml_file.write('\t\t<fpc>\n')
xml_file.write('\t\t\tg0=100;\n') xml_file.write('\t\t\tg0=100;\n')
xml_file.write('\t\t\tg1=') #goto variable
if (menu_entries != None) and (start_with_menu): if (menu_entries != None) and (start_with_menu):
xml_file.write('\t\t\tg1=0;\n') xml_file.write('0;\n') #show menu
else: else:
xml_file.write('\t\t\tg1=100;\n') xml_file.write('100;\n') #auto play
xml_file.write('\t\t\tg2=1024;\n') xml_file.write('\t\t\tg2=1024;\n') #highlight?
xml_file.write('\t\t\tg3=') #play all variable
if play_all_opt and (menu_entries != None) and (start_with_menu):
xml_file.write('1;\n') #auto play all
else:
xml_file.write('0;\n') #do not play all
xml_file.write('\t\t\tjump menu 1;\n') xml_file.write('\t\t\tjump menu 1;\n')
xml_file.write('\t\t</fpc>\n') xml_file.write('\t\t</fpc>\n')
@ -173,8 +179,8 @@ class dvdauthor_converter(devedeng.executor.executor):
for menu_page in menu_entries: for menu_page in menu_entries:
xml_file.write('\t\t\t<pgc>\n') xml_file.write('\t\t\t<pgc>\n')
xml_file.write('\t\t\t\t<pre>\n') xml_file.write('\t\t\t\t<pre>\n')
# first we recover the currently selected button xml_file.write('\t\t\t\t\ts8=g2;\n') # first we recover the currently selected button
xml_file.write('\t\t\t\t\ts8=g2;\n') xml_file.write('\t\t\t\t\tg3=0;\n') #turnoff play all
if first_entry: # here we add some code to jump to each menu if first_entry: # here we add some code to jump to each menu
for menu2 in range(nmenues-1): for menu2 in range(nmenues-1):
@ -195,8 +201,15 @@ class dvdauthor_converter(devedeng.executor.executor):
xml_file.write('"></vob>\n') xml_file.write('"></vob>\n')
for nbutton in menu_page["chapters"]: for nbutton in menu_page["chapters"]:
xml_file.write('\t\t\t\t<button name="'+nbutton+'"> g0='+str(title_list[button_counter])+'; jump vmgm menu; </button>\n') #xml_file.write('\t\t\t\t<button name="'+nbutton+'"> g0='+str(title_list[button_counter])+'; jump vmgm menu; </button>\n')
button_counter+=1 xml_file.write('\t\t\t\t<button name="'+nbutton+'">\n')
xml_file.write('\t\t\t\t\tg0='+str(title_list[button_counter])+';\n')
if play_all_opt and nbutton == "boton0x0":
xml_file.write('\t\t\t\t\tg3=1;\n')
xml_file.write('\t\t\t\t\tjump vmgm menu;\n')
xml_file.write('\t\t\t\t</button>\n')
if not play_all_opt:
button_counter+=1
if (menu_page["left"] != None): if (menu_page["left"] != None):
xml_file.write('\t\t\t\t<button name="'+menu_page["left"]+'"> g1=') xml_file.write('\t\t\t\t<button name="'+menu_page["left"]+'"> g1=')
@ -384,32 +397,42 @@ class dvdauthor_converter(devedeng.executor.executor):
xml_file.write('\t\t\t\t<post>\n') xml_file.write('\t\t\t\t<post>\n')
files+=1 files+=1
xml_file.write('\t\t\t\t\tg1='+str(int(titles/elements_per_menu))+';\n') xml_file.write('\t\t\t\t\tg1='+str(int(titles/elements_per_menu))+';\n')
if (action=="action_stop"):
xml_file.write('\t\t\t\t\tg0=100;\n')
xml_file.write('\t\t\t\t\tcall vmgm menu entry title;\n')
else:
xml_file.write('\t\t\t\t\tg0=')
if action=="action_play_previous":
if titles == 0:
prev_t = total_t - 1
else:
prev_t = titles - 1
xml_file.write(str(prev_t + 1))
elif action=="action_play_again":
xml_file.write(str(titles + 1))
elif action=="action_play_next":
if titles==total_t-1:
next_t=0
else:
next_t=titles + 1
xml_file.write(str(next_t + 1))
elif action=="action_play_last":
xml_file.write(str(total_t))
else:
xml_file.write('1') # first
xml_file.write(';\n') #play all
xml_file.write('\t\t\t\t\tcall vmgm menu entry title;\n') xml_file.write('\t\t\t\t\tif (g3 eq 1) {\n') #if play all:
if titles==total_t-1: #return to menu if last title
xml_file.write('\t\t\t\t\t\tg0=100;\n')
else: #play next title
xml_file.write('\t\t\t\t\t\tg0='+str(titles + 2)+';\n')
xml_file.write('\t\t\t\t\t} else {\n')
#end of play opt
xml_file.write('\t\t\t\t\t\tg0=')
if action=="action_stop":
xml_file.write('100')
elif action=="action_play_previous":
if titles == 0:
prev_t = total_t - 1
else:
prev_t = titles - 1
xml_file.write(str(prev_t + 1))
elif action=="action_play_again":
xml_file.write(str(titles + 1))
elif action=="action_play_next":
if titles==total_t-1:
next_t=0
else:
next_t=titles + 1
xml_file.write(str(next_t + 1))
elif action=="action_play_last":
xml_file.write(str(total_t))
else:
xml_file.write('1') # first
xml_file.write(';\n')
xml_file.write('\t\t\t\t\t}\n')
xml_file.write('\t\t\t\t\tcall vmgm menu entry title;\n') #preform action
xml_file.write('\t\t\t\t</post>\n') xml_file.write('\t\t\t\t</post>\n')
xml_file.write("\t\t\t</pgc>\n") xml_file.write("\t\t\t</pgc>\n")
xml_file.write("\t\t</titles>\n") xml_file.write("\t\t</titles>\n")

View file

@ -525,8 +525,12 @@ class devede_project:
start_with_menu = True start_with_menu = True
else: else:
start_with_menu = False start_with_menu = False
if (self.menu.play_all == "menu_play_all"):
play_all_opt = True
else:
play_all_opt = False
dvdauthor = devedeng.dvdauthor_converter.dvdauthor_converter() dvdauthor = devedeng.dvdauthor_converter.dvdauthor_converter()
dvdauthor.create_dvd_project(data.path, data.name, file_movies, menu_entries, start_with_menu) dvdauthor.create_dvd_project(data.path, data.name, file_movies, menu_entries, start_with_menu, play_all_opt)
# dvdauthor must wait until all the files have been converted # dvdauthor must wait until all the files have been converted
for element in final_dependencies: for element in final_dependencies:
dvdauthor.add_dependency(element) dvdauthor.add_dependency(element)