Added manual chapters entry

This commit is contained in:
klarkc 2015-08-19 12:50:01 -03:00
parent 41ca337a70
commit 06d04c40c4
3 changed files with 56 additions and 18 deletions

View file

@ -848,23 +848,6 @@
<object class="GtkGrid" id="grid2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkCheckButton" id="divide_in_chapters">
<property name="label" translatable="yes">Split the file in chapters (for easy seeking)</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="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">2</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="chapter_size_spinbutton">
<property name="visible">True</property>
@ -896,6 +879,50 @@
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="divide_in_chapters">
<property name="label" translatable="yes">Split the file in chapters (for easy seeking)</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="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">2</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label42">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="xpad">4</property>
<property name="label" translatable="yes">Manual chapter list (split by comma in mm:ss format):</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="chapter_list_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
</child>
</object>

View file

@ -384,9 +384,18 @@ class dvdauthor_converter(devedeng.executor.executor):
xml_file.write('chapters="0')
if (element.original_length > 5):
if (element.divide_in_chapters): # add chapters
if (element.chapter_list_entry):
manual_chapter_list = element.chapter_list_entry.split(",")
toadd = element.chapter_size
seconds = toadd*60
while seconds < (element.original_length - 4):
# Check manual_chapter_list for manual entries before set next chapter
for idx, m_chapter in enumerate(manual_chapter_list):
m_chapter = m_chapter.split(":")
m_chapter = int(m_chapter[0])*60+int(m_chapter[1]) # Change from mm:ss to seconds
if (m_chapter < seconds):
seconds = m_chapter
del manual_chapter_list[idx]
thetime = self.return_time(seconds,False)
xml_file.write(","+thetime)
seconds += (toadd*60)

View file

@ -56,6 +56,8 @@ class file_movie(devedeng.interface_manager.interface_manager):
else:
self.original_aspect_ratio = 1.777 # dummy value
self.add_text("chapter_list_entry", None);
self.add_dualtoggle("format_pal","format_ntsc",self.config.PAL)
self.add_toggle("video_rate_automatic", True)
self.add_toggle("audio_rate_automatic", True)
@ -107,7 +109,7 @@ class file_movie(devedeng.interface_manager.interface_manager):
self.add_show_hide("format_pal", ["size_pal"], ["size_ntsc"])
self.add_enable_disable("divide_in_chapters", ["chapter_size_spinbutton"], [])
self.add_enable_disable("divide_in_chapters", ["chapter_size_spinbutton", "chapter_list_entry"], [])
self.add_enable_disable("video_rate_automatic", [], ["video_spinbutton"])
self.add_enable_disable("audio_rate_automatic", [], ["audio_spinbutton"])
self.add_enable_disable("sound5_1", ["copy_sound"], [])