Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

First public version in GITHUB repository

  • Loading branch information...
commit 5748b024e248299f8eca5a0592f52d2ac9c15c4d 0 parents
Sergio Costas authored
Showing with 32,087 additions and 0 deletions.
  1. +18 −0 changes.txt
  2. +4 −0 devede-debug
  3. +20 −0 devede.desktop
  4. +332 −0 devede.py
  5. +273 −0 devede.svg
  6. +101 −0 devede_bincue.py
  7. +527 −0 devede_convert.py
  8. +4 −0 devede_debug
  9. +223 −0 devede_delete.py
  10. +157 −0 devede_dialogs.py
  11. +113 −0 devede_disctype.py
  12. +80 −0 devede_dvd.py
  13. +388 −0 devede_dvdmenu.py
  14. +421 −0 devede_executor.py
  15. +89 −0 devede_fonts.py
  16. +60 −0 devede_help.py
  17. +331 −0 devede_loadsave.py
  18. +1,078 −0 devede_main.py
  19. +1,750 −0 devede_newfiles.py
  20. +689 −0 devede_other.py
  21. +212 −0 devede_subtitles.py
  22. +94 −0 devede_title_properties.py
  23. +567 −0 devede_video_convert.py
  24. +937 −0 devede_xml_menu.py
  25. BIN  devedesans.ttf
  26. +415 −0 docs/changelog.Debian
  27. +22 −0 docs/copyright
  28. +62 −0 docs/html/basic.html
  29. BIN  docs/html/choose.jpg
  30. +21 −0 docs/html/contact.html
  31. BIN  docs/html/create.jpg
  32. +32 −0 docs/html/disk.html
  33. +258 −0 docs/html/faq.html
  34. +208 −0 docs/html/file.html
  35. +694 −0 docs/html/gpl.html
  36. +33 −0 docs/html/index.html
  37. +33 −0 docs/html/index.html~
  38. +51 −0 docs/html/install.html
  39. +108 −0 docs/html/main.html
  40. BIN  docs/html/main.jpg
  41. BIN  docs/html/main2.jpg
  42. BIN  docs/html/main3.jpg
  43. +78 −0 docs/html/menu.html
  44. BIN  docs/html/menu.jpg
  45. BIN  docs/html/menu2.jpg
  46. BIN  docs/html/menu_bad.jpg
  47. BIN  docs/html/menu_example.jpg
  48. BIN  docs/html/menu_opts.jpg
  49. BIN  docs/html/menu_opts2.jpg
  50. BIN  docs/html/menu_trans.jpg
  51. BIN  docs/html/movie1.jpg
  52. BIN  docs/html/movie2.jpg
  53. BIN  docs/html/movie3.jpg
  54. BIN  docs/html/movie3b.jpg
  55. BIN  docs/html/movie4.jpg
  56. BIN  docs/html/movie5.jpg
  57. BIN  docs/html/movie6.jpg
  58. BIN  docs/html/movie7.jpg
  59. +281 −0 docs/html/psf.html
  60. +48 −0 docs/html/select.html
  61. BIN  docs/html/subs.jpg
  62. +33 −0 docs/html/title.html
  63. BIN  docs/html/title_prop.jpg
  64. BIN  docs/html/ubuntu_9_10.png
  65. +571 −0 docs/html/versions.html
  66. +571 −0 docs/html/versions.html~
  67. +159 −0 install.sh
  68. +75 −0 interface/aboutdialog1.ui
  69. +230 −0 interface/add_subtitle.ui
  70. +216 −0 interface/add_subtitle2.ui
  71. +65 −0 interface/codepages.lst
  72. +136 −0 interface/languages.lst
  73. +82 −0 interface/waborted_dialog.ui
  74. +103 −0 interface/wcancel_dialog.ui
  75. +98 −0 interface/wcancel_job_dialog.ui
  76. +127 −0 interface/wdel_chapter_dialog.ui
  77. +94 −0 interface/wdel_subtitle.ui
  78. +124 −0 interface/wdel_title_dialog.ui
  79. +232 −0 interface/wdisk_type.ui
  80. +96 −0 interface/wempty_titles_dialog.ui
  81. +88 −0 interface/wend_dialog.ui
  82. +104 −0 interface/werase_dialog.ui
  83. +82 −0 interface/werror_dialog.ui
  84. +2,468 −0 interface/wfile.ui
  85. +118 −0 interface/wfolder_dialog.ui
  86. +74 −0 interface/wfolder_exists.ui
  87. +68 −0 interface/wloadconfig.ui
  88. +99 −0 interface/wloosecurrent.ui
  89. +1,260 −0 interface/wmain.ui
  90. +81 −0 interface/wmenu_preview_ntsc.ui
  91. +81 −0 interface/wmenu_preview_pal.ui
  92. +802 −0 interface/wmenu_properties.ui
  93. +39 −0 interface/wnofonts.ui
  94. +182 −0 interface/wpreview_dialog.ui
  95. +100 −0 interface/wpreviewagain_dialog.ui
  96. +114 −0 interface/wprograms.ui
  97. +93 −0 interface/wprogress.ui
  98. +73 −0 interface/wsaveconfig.ui
  99. +237 −0 interface/wtitle_properties_dialog.ui
  100. +81 −0 interface/wwarning_dialog.ui
  101. BIN  pixmaps/background.png
  102. BIN  pixmaps/backgrounds/biglens.png
  103. BIN  pixmaps/backgrounds/default_bg.png
  104. BIN  pixmaps/backgrounds/dvdfilm.png
  105. BIN  pixmaps/barras.png
  106. BIN  pixmaps/base_ntsc.mpg
  107. BIN  pixmaps/base_ntsc_wide.mpg
  108. BIN  pixmaps/base_pal.mpg
  109. BIN  pixmaps/base_pal_wide.mpg
  110. BIN  pixmaps/estira.png
  111. BIN  pixmaps/icon_cvd.png
  112. BIN  pixmaps/icon_divx.png
  113. BIN  pixmaps/icon_dvd.png
  114. BIN  pixmaps/icon_svcd.png
  115. BIN  pixmaps/icon_vcd.png
  116. BIN  pixmaps/silence.ogg
  117. +50 −0 po/POTFILES.in
  118. BIN  po/ca.mo
  119. +1,295 −0 po/ca.po
  120. BIN  po/cs_CZ.mo
  121. +1,472 −0 po/cs_CZ.po
  122. BIN  po/da.mo
  123. +1,299 −0 po/da.po
  124. BIN  po/de_DE.mo
  125. +1,233 −0 po/de_DE.po
  126. BIN  po/el.mo
  127. +1,402 −0 po/el.po
  128. BIN  po/es.mo
  129. +1,296 −0 po/es.po
  130. BIN  po/fr.mo
  131. +1,457 −0 po/fr.po
  132. BIN  po/gl.mo
  133. +1,295 −0 po/gl.po
  134. BIN  po/hu_HU.mo
  135. +1,220 −0 po/hu_HU.po
  136. BIN  po/it_IT.mo
Sorry, we could not display the entire diff because it was too big.
18 changes.txt
@@ -0,0 +1,18 @@
+
+--------- TODO --------------
+
+Allow to continue a previously failed conversion
+check maximum files allowed (69)
+Allow to select subtitles in MKV files
+Render MKV subtitles in the Right Way(tm)
+Remove v4mv
+Widescreen menus
+Allow to run a command after finishing a DVD
+Check menu size and abort if it's zero
+Use asynchronous reading in the processing of the output in Mencoder, DVDAuthor and so on
+Support for a plugable menu system
+Multithread support for parallel encoding
+Allow to extract VOB files from DVDs
+Select times for chapters
+Allow for global changes to files
+Create slideshows
4 devede-debug
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+devede > devede.debug 2>&1
+
20 devede.desktop
@@ -0,0 +1,20 @@
+[Desktop Entry]
+X-MultipleArgs=false
+Type=Application
+Name=DeVeDe
+GenericName=DVD/CD Video Creator
+X-GNOME-FullName=DeVeDe DVD/CD Video Creator
+X-GNOME-FullName[ca]=DeVeDe creador de CD/DVDs de vídeo
+X-GNOME-FullName[es]=DeVeDe creador de CD/DVDs de vídeo
+X-GNOME-FullName[gl]=DeVeDe creador de CD/DVDs de vídeo
+X-GNOME-FullName[pl]=DeVeDe tworzenie wideo na CD/DVD
+X-GNOME-FullName[it]=DeVeDe creatore di video CD/DVD
+Comment=Allows to create video CDs and DVDs, suitable to be reproduced in home DVD players
+Comment[ca]=Permet crear CDs i DVDs de vídeo, que poden reproduir-se en reproductors domèstics
+Comment[es]=Permite crear video CDs y DVDs, que pueden reproducirse en reproductores domésticos
+Comment[gl]=Permite crear video CDs e DVDs, que poden reproducirse en reproductores domésticos
+Comment[pl]=Pozwala stworzyć wideo na płytach CD lub DVD, do otwarzania w domowych odtwarzaczach DVD
+TryExec=devede
+Exec=devede
+Categories=AudioVideo;
+Icon=devede
332 devede.py
@@ -0,0 +1,332 @@
+#!/usr/bin/env python
+# -*- coding: UTF-8 -*-
+
+# Copyright 2006-2009 (C) Raster Software Vigo (Sergio Costas)
+# Copyright 2006-2009 (C) Peter Gill - win32 parts
+
+# This file is part of DeVeDe
+#
+# DeVeDe is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# DeVeDe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+import sys
+import os
+import pygtk # for testing GTK version number
+pygtk.require ('2.0')
+import gtk
+import gobject
+import subprocess
+import locale
+import gettext
+import stat
+import shutil
+import pickle
+import cairo
+
+print "DeVeDe 3.16.9"
+if (sys.platform!="win32") and (sys.platform!="win64"):
+ try:
+ print "Locale: "+str(os.environ["LANG"])
+ except:
+ print "Locale not defined"
+
+# append the directories where we install the devede's own modules
+tipo=-1
+try:
+ fichero=open("/usr/share/devede/wmain.ui","r")
+ fichero.close()
+ tipo=0
+ found=True
+except:
+ found=False
+
+if found==False:
+ try:
+ fichero=open("/usr/local/share/devede/wmain.ui","r")
+ fichero.close()
+ tipo=1
+ found=True
+ except:
+ found=False
+
+if found==False:
+ try:
+ fichero=open("./interface/wmain.ui","r")
+ fichero.close()
+ tipo=2
+ found=True
+ except:
+ found=False
+
+if tipo==0:
+ #gettext.bindtextdomain('devede', '/usr/share/locale')
+ #Note also before python 2.3 you need the following if
+ #you need translations from non python code (glibc,libglade etc.)
+ #there are other access points to this function
+ #gtk.glade.bindtextdomain("devede","/usr/share/locale")
+ #arbol=gtk.Builder("/usr/share/devede/devede.glade",domain="devede")
+ # append the directories where we install the devede's own modules
+
+ share_locale="/usr/share/locale"
+ glade="/usr/share/devede"
+ sys.path.append("/usr/lib/devede")
+ font_path="/usr/share/devede"
+ pic_path="/usr/share/devede"
+ other_path="/usr/share/devede"
+ help_path="/usr/share/doc/devede"
+ print "Using package-installed files"
+
+elif tipo==1:
+ # if the files aren't at /usr, try with /usr/local
+ #gettext.bindtextdomain('devede', '/usr/share/locale')
+ #Note also before python 2.3 you need the following if
+ #you need translations from non python code (glibc,libglade etc.)
+ #there are other access points to this function
+ #gtk.glade.bindtextdomain("devede","/usr/share/locale")
+ #arbol=gtk.Builder("/usr/local/share/devede/devede.glade",domain="devede")
+
+ share_locale="/usr/share/locale" # Are you sure?
+ # if the files aren't at /usr, try with /usr/local
+ glade="/usr/local/share/devede"
+ sys.path.append("/usr/local/lib/devede")
+ font_path="/usr/local/share/devede"
+ pic_path="/usr/local/share/devede"
+ other_path="/usr/local/share/devede"
+ help_path="/usr/local/share/doc/devede"
+ print "Using local-installed files"
+
+elif tipo==2:
+ # if the files aren't at /usr/local, try with ./
+ #gettext.bindtextdomain('devede', './po/')
+ #Note also before python 2.3 you need the following if
+ #you need translations from non python code (glibc,libglade etc.)
+ #there are other access points to this function
+ #gtk.glade.bindtextdomain("devede","/usr/share/locale")
+ #arbol=gtk.Builder("./devede.glade",domain="devede")
+
+ # if the files aren't at /usr/local, try with ./
+ share_locale="./po/"
+ glade="./interface"
+ sys.path.append(os.getcwd())#("./")
+ font_path=os.getcwd()#"./"
+ pic_path=os.path.join(font_path, "pixmaps") #pic_path=font_path
+ other_path=os.path.join(font_path,"pixmaps")
+ help_path=os.path.join(font_path,"doc")
+ print "Using direct files"
+
+else:
+ print "Can't locate extra files. Aborting."
+ sys.exit(1)
+
+
+#####################
+# GetText Stuff #
+#####################
+
+gettext.bindtextdomain('devede',share_locale)
+locale.setlocale(locale.LC_ALL,"")
+gettext.textdomain('devede')
+gettext.install("devede",localedir=share_locale) # None is sys default locale
+# Note also before python 2.3 you need the following if
+# you need translations from non python code (glibc,libglade etc.)
+# there are other access points to this function
+#gtk.glade.bindtextdomain("devede",share_locale)
+
+arbol=gtk.Builder()
+arbol.set_translation_domain("devede")
+
+# To actually call the gettext translation functions
+# just replace your strings "string" with gettext("string")
+# The following shortcut are usually used:
+_ = gettext.gettext
+
+try:
+ import devede_other
+except:
+ print "Failed to load modules DEVEDE_OTHER. Exiting"
+ sys.exit(1)
+try:
+ import devede_convert
+except:
+ print "Failed to load modules DEVEDE_CONVERT. Exiting"
+ sys.exit(1)
+try:
+ import devede_newfiles
+except:
+ print "Failed to load module DEVEDE_NEWFILES. Exiting"
+ sys.exit(1)
+try:
+ import devede_xml_menu
+except:
+ print "Failed to load module DEVEDE_XML_MENU"
+ sys.exit(1)
+
+try:
+ import devede_disctype
+except:
+ print "Failed to load module DEVEDE_DISCTYPE"
+ sys.exit(1)
+
+try:
+ import devede_fonts
+except:
+ print "Failed to load module DEVEDE_FONTS"
+ sys.exit(1)
+
+
+home=devede_other.get_home_directory()
+
+#locale.setlocale(locale.LC_ALL,"")
+#gettext.textdomain('devede')
+#_ = gettext.gettext
+
+# global variables used (they are stored in a single dictionary to
+# avoid true global variables):
+# there are these two that aren't stored in the dictionary because they are very widely used:
+# arbol
+# structure
+
+global_vars={}
+
+if pic_path[-1]!=os.sep:
+ pic_path+=os.sep
+
+global_vars["PAL"]=True
+global_vars["disctocreate"]=""
+global_vars["path"]=pic_path
+global_vars["install_path"]=other_path
+global_vars["menu_widescreen"]=False
+global_vars["gladefile"]=glade
+global_vars["erase_temporary_files"]=True
+global_vars["number_actions"]=1
+global_vars["expand_advanced"]=False
+global_vars["erase_files"]=True
+global_vars["action_todo"]=2
+global_vars["filmpath"]=""
+global_vars["help_path"]=help_path
+global_vars["finalfolder"]=""
+global_vars["sub_codepage"]="ISO-8859-1"
+global_vars["sub_language"]="EN (ENGLISH)"
+global_vars["with_menu"]=True
+#global_vars[""]=""
+
+if font_path[-1]!=os.sep:
+ font_path+=os.sep
+font_path+="devedesans.ttf"
+global_vars["font_path"]=font_path
+
+print "Entro en fonts"
+fonts_found=devede_fonts.prepare_devede_font(home,font_path)
+print "Salgo de fonts"
+
+devede_other.load_config(global_vars) # load configuration
+
+errors="" # check for installed programs
+if (sys.platform=="win32") or (sys.platform=="win64"):
+ try:
+ devede_other.check_program(["mplayer.exe", "-v"])
+ except:
+ errors+="mplayer\n"
+ try:
+ devede_other.check_program(["mencoder.exe", "-msglevel", "help"])
+ except:
+ errors+="mencoder\n"
+ try:
+ devede_other.check_program(["dvdauthor.exe", "--help"])
+ except:
+ errors+="dvdauthor\n"
+ try:
+ devede_other.check_program(["vcdimager.exe", "--help"])
+ except:
+ errors+="vcdimager\n"
+ try:
+ devede_other.check_program(["iconv.exe", "--help"])
+ except:
+ errors+="iconv\n"
+
+ try:
+ devede_other.check_program(["mkisofs.exe"])
+ mkisofs=True
+ global_vars["iso_creator"]="mkisofs.exe"
+ except:
+ mkisofs=False
+
+ if mkisofs==False:
+ try:
+ devede_other.check_program(["genisoimage.exe"])
+ global_vars["iso_creator"]="genisoimage.exe"
+ except:
+ errors+="genisoimage/mkisofs\n"
+
+ try:
+ devede_other.check_program(["spumux.exe", "--help"])
+ except:
+ errors+="spumux\n"
+
+else:
+
+ if 127==devede_other.check_program("mplayer -v"):
+ errors+="mplayer\n"
+ if 127==devede_other.check_program("mencoder -msglevel help"):
+ errors+="mencoder\n"
+ if 127==devede_other.check_program("dvdauthor --help"):
+ errors+="dvdauthor\n"
+ if 127==devede_other.check_program("vcdimager --help"):
+ errors+="vcdimager\n"
+ if 127==devede_other.check_program("iconv --help"):
+ errors+="iconv\n"
+ if 127==devede_other.check_program("mkisofs -help"):
+ if 127==devede_other.check_program("genisoimage -help"):
+ errors+="genisoimage/mkisofs\n"
+ else:
+ global_vars["iso_creator"]="genisoimage"
+ else:
+ global_vars["iso_creator"]="mkisofs"
+
+ if 127==devede_other.check_program("spumux --help"):
+ errors+="spumux\n"
+
+
+def program_exit(widget):
+
+ gtk.main_quit()
+
+
+
+if errors!="":
+ arbol.add_from_file(os.path.join(glade,"wprograms.ui"))
+ w=arbol.get_object("programs_label")
+ w.set_text(errors)
+ wprograms=arbol.get_object("wprograms")
+ wprograms.show()
+ w=arbol.get_object("program_exit")
+ w.connect("clicked",program_exit)
+ wprograms.connect("destroy",program_exit)
+elif fonts_found==False:
+ arbol.add_from_file(os.path.join(glade,"wnofonts.ui"))
+ wprograms=arbol.get_object("wnofonts")
+ wprograms.show()
+ w=arbol.get_object("fonts_program_exit")
+ w.connect("clicked",program_exit)
+ wprograms.connect("destroy",program_exit)
+else:
+ new_file=devede_disctype.disctype(global_vars)
+
+gtk.main()
+print "Saving configuration"
+devede_other.save_config(global_vars)
+print "Exiting"
+print "Have a nice day"
+sys.stdout.flush()
+sys.stderr.flush()
273 devede.svg
@@ -0,0 +1,273 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ id="Layer_1"
+ width="128"
+ height="128"
+ viewBox="0 0 128 128"
+ overflow="visible"
+ enable-background="new 0 0 128 128"
+ xml:space="preserve"
+ sodipodi:version="0.32"
+ inkscape:version="0.45"
+ sodipodi:docname="devede.svg"
+ sodipodi:docbase="/home/raster/Projects/devede-3.1"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape"
+ sodipodi:modified="true"><metadata
+ id="metadata4003"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
+ id="defs4001" /><sodipodi:namedview
+ inkscape:window-height="757"
+ inkscape:window-width="1032"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ inkscape:zoom="3.1796875"
+ inkscape:cx="64"
+ inkscape:cy="64"
+ inkscape:window-x="6"
+ inkscape:window-y="56"
+ inkscape:current-layer="Layer_1" />
+<path
+ opacity="0.2"
+ fill="#3D3D3D"
+ d="M64.105,2c-33.636,0-61,27.364-61,61c0,33.638,27.364,61.002,61,61.002s61-27.364,61-61.002 C125.105,29.364,97.741,2,64.105,2z M64.105,71.476c-4.672,0-8.474-3.801-8.474-8.476c0-4.672,3.801-8.474,8.474-8.474 c4.672,0,8.474,3.801,8.474,8.474C72.579,67.675,68.777,71.476,64.105,71.476z"
+ id="path3915" />
+<path
+ opacity="0.2"
+ fill="#3D3D3D"
+ d="M64.105,1c-33.636,0-61,27.364-61,61c0,33.638,27.364,61.002,61,61.002s61-27.364,61-61.002 C125.105,28.364,97.741,1,64.105,1z M64.105,70.476c-4.672,0-8.474-3.801-8.474-8.476c0-4.672,3.801-8.474,8.474-8.474 c4.672,0,8.474,3.801,8.474,8.474C72.579,66.675,68.777,70.476,64.105,70.476z"
+ id="path3917" />
+<path
+ opacity="0.6"
+ fill="#3D3D3D"
+ d="M64,0C30.364,0,3,27.364,3,61s27.364,61,61,61s61-27.364,61-61S97.636,0,64,0z M64,69 c-4.411,0-8-3.588-8-8c0-4.411,3.589-8,8-8s8,3.589,8,8C72,65.412,68.411,69,64,69z"
+ id="path3919" />
+<linearGradient
+ id="XMLID_8_"
+ gradientUnits="userSpaceOnUse"
+ x1="11.998"
+ y1="72.9668"
+ x2="89.7672"
+ y2="99.2332">
+ <stop
+ offset="0"
+ style="stop-color:#CED1E3"
+ id="stop3922" />
+ <stop
+ offset="0.1854"
+ style="stop-color:#E7E6F0"
+ id="stop3924" />
+ <stop
+ offset="0.618"
+ style="stop-color:#E7E6F0"
+ id="stop3926" />
+ <stop
+ offset="0.8933"
+ style="stop-color:#DBC0C4"
+ id="stop3928" />
+ <stop
+ offset="1"
+ style="stop-color:#D8BDB6"
+ id="stop3930" />
+</linearGradient>
+<path
+ fill="url(#XMLID_8_)"
+ d="M72.727,64.692c-1.438,3.397-4.804,5.781-8.727,5.781c-5.233,0-9.474-4.241-9.474-9.474 c0-0.199,0.018-0.394,0.03-0.59L5.247,48.789C4.431,52.731,4,56.815,4,61c0,33.137,26.864,60,60,60 c27.844,0,51.252-18.971,58.021-44.689L72.727,64.692z"
+ id="path3932" />
+<linearGradient
+ id="XMLID_9_"
+ gradientUnits="userSpaceOnUse"
+ x1="18.7383"
+ y1="20.0117"
+ x2="119.072"
+ y2="45.0119">
+ <stop
+ offset="0"
+ style="stop-color:#BBDBD8"
+ id="stop3935" />
+ <stop
+ offset="0.3708"
+ style="stop-color:#DFECDB"
+ id="stop3937" />
+ <stop
+ offset="0.6798"
+ style="stop-color:#DFECDB"
+ id="stop3939" />
+ <stop
+ offset="1"
+ style="stop-color:#E2E3C9"
+ id="stop3941" />
+</linearGradient>
+<path
+ fill="url(#XMLID_9_)"
+ d="M64,1C35.048,1,10.888,21.508,5.247,48.789l49.31,11.621c0.306-4.956,4.41-8.883,9.444-8.883 c5.233,0,9.474,4.242,9.474,9.474c0,1.31-0.266,2.558-0.747,3.692l49.295,11.618C123.308,71.422,124,66.292,124,61 C124,27.864,97.136,1,64,1z"
+ id="path3943" />
+<path
+ fill="#DCE8EB"
+ d="M7.46,40.904l48.369,15.317c0.301-0.514,0.647-0.995,1.036-1.441L16.429,24.453 C12.632,29.388,9.585,34.926,7.46,40.904z"
+ id="path3945" />
+<path
+ fill="#E6E9F0"
+ d="M54.526,61c0-0.629,0.064-1.243,0.182-1.838l-50.09-6.72C4.218,55.239,4,58.093,4,61 c0,3.127,0.241,6.197,0.702,9.194l49.833-9.033C54.534,61.107,54.526,61.055,54.526,61z"
+ id="path3947" />
+<path
+ fill="#BACBD8"
+ d="M4.618,52.442l50.09,6.72c0.208-1.055,0.595-2.043,1.121-2.94L7.46,40.904 C6.147,44.598,5.187,48.456,4.618,52.442z"
+ id="path3949" />
+<path
+ fill="#EBDFDA"
+ d="M120.116,82.246l-47.865-16.6c-0.323,0.572-0.706,1.105-1.137,1.596l39.591,31.406 C114.654,93.755,117.849,88.23,120.116,82.246z"
+ id="path3951" />
+<path
+ fill="#D7C8B4"
+ d="M123.227,70.598l-49.79-8.855c-0.11,1.412-0.525,2.734-1.186,3.904l47.865,16.6 C121.525,78.525,122.578,74.63,123.227,70.598z"
+ id="path3953" />
+<path
+ fill="#F0EEE3"
+ d="M73.474,61c0,0.251-0.019,0.497-0.037,0.743l49.79,8.855C123.729,67.472,124,64.268,124,61 c0-2.267-0.137-4.501-0.382-6.702l-50.226,5.524C73.44,60.208,73.474,60.6,73.474,61z"
+ id="path3955" />
+<radialGradient
+ id="XMLID_10_"
+ cx="84.2275"
+ cy="3.6353"
+ r="29.1799"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ offset="0.4101"
+ style="stop-color:#FFFFFF"
+ id="stop3958" />
+ <stop
+ offset="1"
+ style="stop-color:#DFECDB"
+ id="stop3960" />
+</radialGradient>
+<path
+ fill="url(#XMLID_10_)"
+ d="M64,1c-3.648,0-7.215,0.344-10.684,0.968c0.304,12.491,8.896,24.8,22.578,30.428 c13.635,5.609,28.345,2.946,37.358-5.644C102.412,11.191,84.4,1,64,1z"
+ id="path3962" />
+<radialGradient
+ id="XMLID_11_"
+ cx="28.3237"
+ cy="111.8779"
+ r="21.9056"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ offset="0"
+ style="stop-color:#FFFFFF"
+ id="stop3965" />
+ <stop
+ offset="1"
+ style="stop-color:#E7E6F0"
+ id="stop3967" />
+</radialGradient>
+<path
+ fill="url(#XMLID_11_)"
+ d="M50.941,119.558c2.623-10.845-3.113-22.344-13.922-26.788c-7.688-3.163-16.059-1.98-22.329,2.4 C23.146,107.349,35.992,116.238,50.941,119.558z"
+ id="path3969" />
+<linearGradient
+ id="XMLID_12_"
+ gradientUnits="userSpaceOnUse"
+ x1="47.1772"
+ y1="40.708"
+ x2="81.2175"
+ y2="81.7672">
+ <stop
+ offset="0"
+ style="stop-color:#879B95"
+ id="stop3972" />
+ <stop
+ offset="0.5056"
+ style="stop-color:#8E8E9C"
+ id="stop3974" />
+ <stop
+ offset="1"
+ style="stop-color:#9B8A91"
+ id="stop3976" />
+</linearGradient>
+<path
+ opacity="0.2"
+ fill="url(#XMLID_12_)"
+ d="M64,34.403C49.312,34.403,37.403,46.31,37.403,61 c0,14.688,11.908,26.597,26.597,26.597c14.688,0,26.597-11.908,26.597-26.597C90.597,46.31,78.688,34.403,64,34.403z M64,70.974 c-5.51,0-9.974-4.465-9.974-9.974c0-5.508,4.464-9.974,9.974-9.974s9.974,4.465,9.974,9.974C73.974,66.509,69.51,70.974,64,70.974z"
+ id="path3978" />
+<linearGradient
+ id="XMLID_13_"
+ gradientUnits="userSpaceOnUse"
+ x1="48.02"
+ y1="41.7246"
+ x2="80.3542"
+ y2="80.726">
+ <stop
+ offset="0"
+ style="stop-color:#879B95"
+ id="stop3981" />
+ <stop
+ offset="0.5056"
+ style="stop-color:#8E8E9C"
+ id="stop3983" />
+ <stop
+ offset="1"
+ style="stop-color:#9B8A91"
+ id="stop3985" />
+</linearGradient>
+<path
+ fill="url(#XMLID_13_)"
+ d="M64,35.737c-13.951,0-25.263,11.31-25.263,25.263c0,13.952,11.312,25.263,25.263,25.263 S89.263,74.952,89.263,61C89.263,47.047,77.951,35.737,64,35.737z M64,70.474c-5.233,0-9.474-4.241-9.474-9.474 c0-5.232,4.24-9.474,9.474-9.474s9.474,4.242,9.474,9.474C73.474,66.232,69.233,70.474,64,70.474z"
+ id="path3987" />
+<linearGradient
+ id="XMLID_14_"
+ gradientUnits="userSpaceOnUse"
+ x1="57.5889"
+ y1="54.5889"
+ x2="70.5428"
+ y2="67.5428">
+ <stop
+ offset="0"
+ style="stop-color:#BBDBD8"
+ id="stop3990" />
+ <stop
+ offset="1"
+ style="stop-color:#D8BDB6"
+ id="stop3992" />
+</linearGradient>
+<path
+ fill="url(#XMLID_14_)"
+ d="M64,51c-5.523,0-10,4.477-10,10c0,5.522,4.477,10,10,10c5.522,0,10-4.478,10-10 C74,55.477,69.522,51,64,51z M64,70.5c-5.248,0-9.5-4.253-9.5-9.5c0-5.247,4.252-9.5,9.5-9.5s9.5,4.253,9.5,9.5 C73.5,66.247,69.248,70.5,64,70.5z"
+ id="path3994" />
+<path
+ opacity="0.08"
+ fill="#FFFFFF"
+ d="M39.045,57.061c-0.201,1.284-0.308,2.599-0.308,3.939c0,1.013,0.066,2.01,0.183,2.992 l15.615-2.831c-0.001-0.054-0.008-0.107-0.008-0.162c0-0.629,0.064-1.243,0.182-1.838L39.045,57.061z M89.092,58.095l-15.699,1.727 C73.44,60.208,73.474,60.6,73.474,61c0,0.251-0.019,0.497-0.037,0.743l15.577,2.771c0.16-1.149,0.249-2.321,0.249-3.514 C89.263,60.017,89.2,59.049,89.092,58.095z M71.114,67.242l12.383,9.822c1.538-1.864,2.813-3.953,3.771-6.21l-15.017-5.208 C71.928,66.219,71.545,66.752,71.114,67.242z M40.627,51.408l15.202,4.814c0.301-0.514,0.647-0.995,1.036-1.441l-12.646-9.485 C42.752,47.141,41.537,49.194,40.627,51.408z"
+ id="path3996" />
+<path
+ opacity="0.5"
+ fill="#FFFFFF"
+ d="M64,1C30.864,1,4,27.864,4,61c0,20.921,10.715,39.332,26.949,50.07 c-15.742-10.716-26.09-28.848-26.09-49.414c0-32.923,26.527-59.615,59.247-59.615s59.246,26.691,59.246,59.615 c0,17.349-7.37,32.961-19.124,43.855C116.369,94.533,124,78.658,124,61C124,27.864,97.136,1,64,1z"
+ id="path3998" />
+<text
+ id="text2337"
+ x="-2.2495611"
+ y="116.82815"
+ transform="scale(1.0136239,0.9865592)"
+ xml:space="preserve"
+ style="font-size:4.90302038px;font-style:normal;font-weight:normal;fill:#006764;fill-opacity:1;stroke:none;stroke-width:1.13565516;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-family:le mans"><tspan
+ id="tspan2339"
+ sodipodi:role="line"
+ style="font-size:29.41817093px;font-style:normal;font-weight:bold;fill:#006764;fill-opacity:1;stroke:none;stroke-width:1.13565516;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;font-family:Bitstream Vera Sans"
+ x="-2.2495611"
+ y="116.82815">DeVeDe</tspan></text>
+</svg>
101 devede_bincue.py
@@ -0,0 +1,101 @@
+#!/usr/bin/env python
+# -*- coding: UTF-8 -*-
+
+# Copyright 2006-2009 (C) Raster Software Vigo (Sergio Costas)
+# Copyright 2006-2007 (C) Peter Gill - win32 parts
+
+# This file is part of DeVeDe
+#
+# DeVeDe is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# DeVeDe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+import signal
+import os
+import sys
+import re
+import shutil
+
+import devede_executor
+
+class xvcd_generator(devede_executor.executor):
+
+ """ This class creates BIN/CUE images for VCD, sVCD or CVD """
+
+ def __init__(self,filename,filefolder,progresbar,proglabel,structure,disctocreate):
+
+ devede_executor.executor.__init__(self,filename,filefolder,progresbar)
+
+ proglabel.set_text(_("Creating BIN/CUE files"))
+
+ cantidad=len(structure[0])-1
+ if (sys.platform!="win32") and (sys.platform!="win64"):
+ lista=["vcdimager","-c",filefolder+filename+".cue","-b",filefolder+filename+".bin","-t"]
+ else:
+ lista=["vcdimager.exe","-c",filefolder+filename+".cue","-b",filefolder+filename+".bin","-t"]
+
+ if disctocreate=="vcd":
+ lista.append("vcd2")
+ else:
+ lista.append("svcd")
+
+ for variable in range(cantidad):
+ currentfile=self.create_filename(filefolder+filename,1,variable+1,False)
+ lista.append(currentfile)
+
+ self.print_error=_("Failed to create the BIN/CUE files\nMaybe you ran out of disk space")
+ self.launch_program(lista,output=False)
+
+
+ def end_process(self,eraser,erase_temporal_files):
+
+ print "End process bin/cue"
+ if erase_temporal_files:
+ eraser.delete_mpg()
+ eraser.delete_menu()
+ eraser.delete_xml()
+
+
+class iso_generator(devede_executor.executor):
+
+ """ This class generates the ISO image for DVDs """
+
+ def __init__(self,filename,filefolder,progresbar,proglabel,command):
+
+ devede_executor.executor.__init__(self,filename,filefolder,progresbar)
+
+ proglabel.set_text(_("Creating ISO file"))
+ progresbar.set_fraction(0.0)
+ progresbar.set_text("0%")
+
+ volume="DVDVIDEO"
+ self.print_error=_("Failed to create the ISO image\nMaybe you ran out of disk space")
+ self.launch_program([command,"-dvd-video","-V",volume,"-v","-o",filefolder+filename+".iso",filefolder+filename])
+
+
+ def set_progress_bar(self):
+
+ punto=self.cadena.find("done, estimate")
+ if (punto!=-1):
+ if ((self.cadena[punto-6].isdigit()) and ((self.cadena[punto-7].isdigit()) or (self.cadena[punto-7]==" "))):
+ percent2=float(self.cadena[punto-7:punto-2])
+ self.bar.set_fraction(percent2/100)
+ self.bar.set_text(str(int(percent2))+"%")
+ return True
+ return False
+
+
+ def end_process(self,eraser,erase_temporal_files):
+ print "intento borrar"
+ if erase_temporal_files:
+ eraser.delete_directory()
527 devede_convert.py
@@ -0,0 +1,527 @@
+#!/usr/bin/env python
+# -*- coding: UTF-8 -*-
+# Copyright 2006-2009 (C) Raster Software Vigo (Sergio Costas)
+# Copyright 2006-2009 (C) Peter Gill - win32 parts
+
+# This file is part of DeVeDe
+#
+# DeVeDe is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# DeVeDe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+#################################################################
+# This block contains all the functions to convert a video file #
+# into an MPEG2-PS DVD-compliant file #
+#################################################################
+
+import time
+import select
+import signal
+import subprocess
+import sys
+import os
+import re
+import shutil
+import glob
+import posixpath
+import gtk
+import devede_other
+import gobject
+import cairo
+if (sys.platform=="win32") or (sys.platform=="win64"):
+ import win32api
+
+import devede_other
+import devede_video_convert
+import devede_subtitles
+import devede_xml_menu
+import devede_delete
+import devede_dvd
+import devede_bincue
+import devede_executor
+import devede_dialogs
+
+import gc
+
+class create_all:
+
+ def cancel_clicked(self,widget,temp=False):
+
+ newtree=devede_other.create_tree(self,"wcancel_job_dialog",self.gladefile,False)
+ window=newtree.get_object("wcancel_job_dialog")
+ window.show()
+ value=window.run()
+ window.hide()
+ window.destroy()
+ if value!=-5: # no
+ return True
+
+ self.runner.cancel()
+ self.runner.wait_end()
+ gobject.source_remove(self.timer)
+ self.window.hide()
+ self.window.destroy()
+ newtree=devede_other.create_tree(self,"waborted_dialog",self.gladefile,False)
+ window=newtree.get_object("waborted_dialog")
+ window.show()
+ window.run()
+ window.hide()
+ window.destroy()
+ window=None
+ gc.collect()
+ (self.main_window_callback)() # show the main window
+ return True
+
+
+ def iso_changed(self,args,arbol):
+
+ iso_name=arbol.get_object("iso_filename")
+ iso_folder=arbol.get_object("final_directory")
+
+ w=arbol.get_object("button_folder_accept")
+
+ mode=True
+
+ if iso_name.get_text()=="":
+ mode=False
+
+ folder=iso_folder.get_current_folder()
+ if folder==None:
+ mode=False
+ elif folder=="":
+ mode=False
+
+ w.set_sensitive(mode)
+
+
+ def check_free_space(self,filefolder,structure,actions,erase_temporary_files,sound_duration):
+
+ """ Returns TRUE if the free space in FILEFOLDER is insuficient to generate
+ the disk STRUCTURE """
+ # TODO Windows Stuff
+ estado=''
+ freespace=''
+ if (sys.platform!="win32") and (sys.platform!="win64"):
+ print "Checking "+str(filefolder)
+ estado=os.statvfs(filefolder) # eg. f="C:\Documents and Settings\User name\Desktop"
+ freespace=95*estado.f_bsize*estado.f_bavail/100000
+ else:
+ try:
+ test_drive = os.path.splitdrive(filefolder)[0] + "\\" # So it will also work on Windows 2000
+ spc, bps, fc, tc = win32api.GetDiskFreeSpace(test_drive)
+ freespace=fc * spc * bps
+
+ except ImportError:
+ pass
+ print "Free space in "+str(filefolder)+": "+str(freespace)
+ print "estatus ", estado, "\n"
+
+ total=devede_other.calcula_tamano_total(structure,sound_duration,self.disk_type)
+
+ print "Free: "+str(freespace)
+ print "Needed: "+str(total)
+
+ if (actions!=3):
+ total*=actions # if we only create the MPEG files or the DVD structure...
+ else:
+ if erase_temporary_files: # or if we create the ISO image
+ total*=2
+ else:
+ total*=3
+ total*=1.1 # a safe margin of 10%
+
+ if (freespace<total):
+ return True,_("Insuficient free space. To create this disc\n%(total)d MBytes are needed, but only %(free)d MBytes are available.") % {'total':int(total/1000),'free':int(freespace/1000)}
+ else:
+ return False,""
+
+
+ def __init__(self,gladefile,structure,global_vars,callback):
+
+ self.gladefile=gladefile
+ self.structure=structure
+ self.global_vars=global_vars
+ self.tree=devede_other.create_tree(self,"wprogress",self.gladefile)
+
+ self.window=self.tree.get_object("wprogress")
+ self.partial=self.tree.get_object("progresspartial")
+ self.erase_temp=global_vars["erase_temporary_files"]
+ self.iso_creator=global_vars["iso_creator"]
+
+ self.queue=[]
+ self.current_action=0
+ self.actions=global_vars["number_actions"]
+ self.total=self.tree.get_object("progress_total")
+ self.label=self.tree.get_object("lcreating")
+ self.total.set_fraction(0)
+ self.partial.set_fraction(0)
+ self.partial.set_text("0%")
+ self.label.set_text("")
+ self.start_time=time.time()
+ self.disk_type=global_vars["disctocreate"]
+ self.main_window_callback=callback
+ self.tiempo=time.time()
+
+
+ def init_queue(self):
+
+ total=0
+ title=0
+ for element in self.structure:
+ chapter=0
+ for element2 in element[1:]:
+ if self.structure[title][chapter+1]["twopass"] == True:
+ self.queue.append(["C1",title,chapter])
+ self.queue.append(["C2",title,chapter])
+ else:
+ self.queue.append(["C",title,chapter])
+ stream=0
+ for element3 in element2["sub_list"]:
+ self.queue.append(["S",title,chapter,stream])
+ stream+=1
+
+ #if self.structure[title][chapter+1]["twopass"] == True:
+ # self.queue.append(["C2",title,chapter])
+ # stream=0
+ # for element3 in element2["sub_list"]:
+ # self.queue.append(["S",title,chapter,stream])
+ # stream+=1
+
+ chapter+=1
+ title+=1
+
+
+ def preview(self,filefolder):
+
+ self.init_queue()
+ newtree=devede_other.create_tree(self,"wpreview_dialog",self.gladefile,False)
+ timev=newtree.get_object("seconds_preview")
+ timev.set_value(60)
+ path=newtree.get_object("temporary_files")
+ path.set_filename(filefolder)
+ w=newtree.get_object("wpreview_dialog")
+ w.show()
+ ret=w.run()
+ w.hide()
+ self.filefolder=path.get_filename()
+ if self.filefolder[-1]!=os.sep:
+ self.filefolder+=os.sep
+ self.seconds=timev.get_value()
+ w.destroy()
+ if ret!=-6:
+ return self.filefolder
+
+ self.runner=None
+ self.queue.append(["PREVIEW"]) # Preview
+ self.total_done=0.0
+ self.filename="previewfile"
+
+ try:
+ fichero=open(self.filefolder+"write_check","w")
+ fichero.write("Testing")
+ fichero.close()
+ except:
+ self.show_error(_("Failed to write to the destination directory.\nCheck that you have privileges and free space there."))
+ self.window.destroy()
+ return self.filefolder
+
+ try:
+ os.remove(self.filefolder+"write_check")
+ except:
+ print "Failed to erase the write check file"
+
+ self.eraser=devede_delete.delete_files(self.filename,self.filefolder)
+ self.erase_temp=True
+ self.timer=gobject.timeout_add(250,self.time_callback)
+ self.window.show()
+ return self.filefolder
+
+
+ def on_iso_filename_activate(self,widg,ventana):
+
+ ventana.response(-6)
+
+
+ def create_disc(self):
+
+ self.time=0
+
+ # first, check for empty titles
+
+ empty=False
+ for element in self.structure:
+ if len(element)<2:
+ empty=True
+ break
+
+ if empty:
+ newtree=devede_other.create_tree(self,"wempty_titles_dialog",self.gladefile,False)
+ w=newtree.get_object("wempty_titles_dialog")
+ w.show()
+ value=w.run()
+ w.hide()
+ w.destroy()
+ if value!=-6:
+ return False
+
+ # ask the folder and filename
+
+ newtree=devede_other.create_tree(self,"wfolder_dialog",self.gladefile,False)
+ wdir=newtree.get_object("final_directory")
+ if self.global_vars["finalfolder"]!="":
+ wdir.set_current_folder(self.global_vars["finalfolder"])
+ wfile=newtree.get_object("iso_filename")
+ wfolder_dialog=newtree.get_object("wfolder_dialog")
+ wfile.set_text("movie")
+ wfile.connect("activate",self.on_iso_filename_activate,wfolder_dialog)
+ wfile.connect("changed",self.iso_changed,newtree)
+ wdir.connect("current-folder-changed",self.iso_changed,newtree)
+ #self.iso_changed("",newtree)
+
+ wfolder_dialog.show()
+ wfile.grab_focus()
+ value=wfolder_dialog.run()
+
+ self.filename=wfile.get_text()
+ self.filename.replace("/","_")
+ self.filename.replace("|","_")
+ self.filename.replace("\\","_")
+
+ filefolder=wdir.get_current_folder()
+
+ wfolder_dialog.hide()
+ wfolder_dialog.destroy()
+ if value!=-6:
+ return False
+
+ self.global_vars["finalfolder"]=filefolder
+
+ filefolder2=os.path.join(filefolder,self.filename)
+
+ self.filefolder=filefolder2
+
+ if self.filefolder[-1]!=os.sep:
+ self.filefolder+=os.sep
+
+ if (os.path.exists(filefolder2)):
+ newtree=devede_other.create_tree(self,"wfolder_exists",self.gladefile,False)
+ w=newtree.get_object("wfolder_exists")
+ wtext=newtree.get_object("folder_exists_label")
+ wtext.set_text(_("The file or folder\n\n%(folder)s\n\nalready exists. If you continue, it will be deleted.") % {'folder':filefolder2})
+ w.show()
+ value=w.run()
+ w.hide()
+ w.destroy()
+ if value!=2:
+ return False
+
+ try:
+ os.remove(filefolder2)
+ except:
+ pass
+
+ try:
+ os.mkdir(filefolder2)
+ except:
+ pass
+
+ self.eraser=devede_delete.delete_files(self.filename,self.filefolder)
+ hasfree,msg=self.check_free_space(self.filefolder,self.structure,self.actions,self.erase_temp,self.global_vars["menu_sound_duration"])
+ if hasfree:
+ self.window.hide()
+ self.window.destroy()
+ self.show_error(msg)
+ (self.main_window_callback)()
+ return False
+
+ # erase all conflicting files
+
+ self.eraser.delete_all()
+
+ # now, create the XML files (even with VCD, SVCD or CVD, to check if we have write permissions)
+
+ xml_files=devede_xml_menu.xml_files(self.partial,self.filename,self.filefolder,self.structure,self.global_vars,self.label)
+
+ counter=0
+ counter2=0
+ if (self.disk_type=="dvd"):
+ if xml_files.do_menus():
+ nelements=xml_files.get_elements_per_menu()
+ while (len(self.structure[counter:])!=0):
+ self.queue.append(["M1",xml_files,counter,counter2])
+ counter+=nelements
+ counter2+=1
+
+ self.init_queue()
+
+ retorno=xml_files.create_files()
+ if retorno!=None:
+ self.window.hide()
+ self.window.destroy()
+ self.show_error(retorno)
+ (self.main_window_callback)()
+ return False
+
+ self.runner=None
+ if self.actions!=1: # want to do, at least, the DVD structure, or the VCD image
+ if self.disk_type=="dvd":
+ self.queue.append(["DVD_STRUCTURE"])
+ if self.actions==3: # do DVD image too
+ self.queue.append(["DVD_IMAGE"])
+ else:
+ self.queue.append(["CD_IMAGE"])
+
+ self.queue.append(["END"])
+ self.seconds=0
+ self.total_done=0.0
+ self.timer=gobject.timeout_add(250,self.time_callback)
+ self.window.show()
+ return True
+
+
+ def time_callback(self):
+
+ """ This method launches all the conversion stages when needed, using the standard executor
+ interface to manage all of them in an easy way """
+
+ self.total.set_text(str(self.current_action)+"/"+str(len(self.queue)-1))
+ self.total.set_fraction(float(self.current_action)/(float(len(self.queue)-1)))
+ if self.runner!=None:
+ if self.runner.initerror:
+ retval=-1;
+ else:
+ retval=self.runner.refresh()
+ if retval==0: # no error, still running
+ return True
+ else:
+ self.current_action+=1
+ retval=self.runner.wait_end()
+ if (retval!=0) or (self.runner.initerror):
+ self.window.hide()
+ self.window.destroy()
+ if self.runner.print_error==None:
+ self.runner.print_error=_("Unknown error")
+ self.show_error(self.runner.print_error)
+ (self.main_window_callback)()
+ return False
+ else:
+ self.runner.end_process(self.eraser,self.erase_temp)
+ self.runner=None
+
+ action=self.queue[self.current_action]
+
+ if action[0]=="M1":
+ self.runner=action[1]
+ self.runner.create_menu1(action[2],action[3],self.global_vars["multicore"])
+ return True
+
+ if (action[0]=='C') or (action[0]=='C1') or (action[0]=='C2'):
+ title=action[1]
+ chapter=action[2]
+ if action[0]=="C":
+ encpass = 0
+ else:
+ encpass = int(action[0][1])
+ print "Segundos "+str(self.seconds)
+ self.runner=devede_video_convert.video_converter(self.global_vars,self.structure[title][chapter+1],self.filename,self.filefolder,self.partial,self.label,self.global_vars["disctocreate"],title+1,chapter+1,self.global_vars["multicore"],self.seconds, encpass)
+ return True
+
+ if action[0]=="C2":
+ title=action[1]
+ chapter=action[2]
+ self.runner=devede_video_convert.video_converter(self.structure[title][chapter+1],self.filename,self.filefolder,self.partial,self.label,self.global_vars["disctocreate"],title+1,chapter+1,self.global_vars["multicore"],self.seconds, 2)
+ return True
+
+ if action[0]=="S":
+ title=action[1]
+ chapter=action[2]
+ sub_stream=action[3]
+ self.runner=devede_subtitles.subtitles_adder(self.structure[title][chapter+1],self.filename,self.filefolder,self.partial,self.label,self.global_vars["disctocreate"],title+1,chapter+1,sub_stream)
+ return True
+
+ if action[0]=="PREVIEW":
+ self.window.hide()
+ self.window.destroy()
+ if (sys.platform=="win32") or (sys.platform=="win64"):
+ mplay="mplayer.exe"
+ else:
+ mplay="mplayer"
+ fname=self.filefolder+"previewfile_01_01."
+ if self.disk_type=="divx":
+ fname+="avi"
+ else:
+ fname+="mpg"
+ parameters=[mplay,"-sid","0",fname,"-loop","1"]
+ newtree=devede_other.create_tree(self,"wpreviewagain_dialog",self.gladefile,False)
+ w=newtree.get_object("wpreviewagain_dialog")
+ while True:
+ salida=devede_executor.executor("previewfile",self.filefolder,None)
+ salida.launch_program(parameters,output=False)
+ salida.wait_end()
+ w.show()
+ ret=w.run()
+ w.hide()
+ if ret!=-6:
+ break
+ while gtk.events_pending():
+ gtk.main_iteration()
+ w.destroy()
+ os.remove(fname)
+ return False
+
+ if action[0]=="DVD_STRUCTURE":
+ self.runner=devede_dvd.dvd_generator(self.filename,self.filefolder,self.partial,self.label)
+ return True
+
+ if action[0]=="CD_IMAGE":
+ self.runner=devede_bincue.xvcd_generator(self.filename,self.filefolder,self.partial,self.label,self.structure,self.disk_type)
+ return True
+
+ if action[0]=="DVD_IMAGE":
+ self.runner=devede_bincue.iso_generator(self.filename,self.filefolder,self.partial,self.label,self.iso_creator)
+ return True
+
+ if action[0]=="END":
+ self.show_final_time()
+ return False
+ return True
+
+
+ def show_final_time(self):
+ if (self.erase_temp):
+ self.eraser.delete_xml()
+
+ self.window.hide()
+ self.window.destroy()
+ newtree=devede_other.create_tree(self,"wend_dialog",self.gladefile,False)
+ label=newtree.get_object("elapsed")
+ tiempo2=devede_other.return_time(time.time()-self.tiempo,True)
+ label.set_text(tiempo2)
+ window=newtree.get_object("wend_dialog")
+ window.show()
+ window.run()
+ window.hide()
+ window.destroy()
+ window = None
+ newtree = None
+ gc.collect()
+ (self.main_window_callback)()
+
+
+ def show_error(self,message):
+
+ self.window.hide()
+ self.window.destroy()
+ devede_dialogs.show_error(self.gladefile,message)
+ return
+
4 devede_debug
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+devede > devede.debug 2>&1
+
223 devede_delete.py
@@ -0,0 +1,223 @@
+#!/usr/bin/env python
+# -*- coding: UTF-8 -*-
+
+# Copyright 2006-2007 (C) Raster Software Vigo (Sergio Costas)
+# Copyright 2006-2007 (C) Peter Gill - win32 parts
+
+# This file is part of DeVeDe
+#
+# DeVeDe is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# DeVeDe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+import os
+import shutil
+import glob
+
+class delete_files:
+
+ """ This class allows to delete temporary files and directories """
+
+ def __init__(self,filename,filefolder):
+
+ self.filename=filename
+ self.filefolder=filefolder
+ self.filepath=os.path.join(filefolder,filename)
+ print "Path para borrar: "+str(self.filepath)
+
+
+ def delete_all(self):
+
+ self.delete_avi()
+ self.delete_bin_cue()
+ self.delete_directory()
+ self.delete_iso()
+ self.delete_menu_temp()
+ self.delete_menu()
+ self.delete_mpg()
+ self.delete_log()
+ self.delete_sub_xml()
+ self.delete_xml()
+ self.delete_main_dir()
+
+
+ def delete_mpg(self):
+
+ print "Deleting "+self.filename+"_??_??.mpg"
+ try:
+ listfiles=glob.glob(self.filepath+"_[0-9][0-9]_[0-9][0-9]"+".mpg")
+ for afile in listfiles:
+ print "Trying to delete "+afile
+ try:
+ os.remove(afile)
+ except OSError:
+ print str(afile.strip())+" not found to remove"
+ except OSError:
+ print self.filepath+"._??_??.mpg not found"
+
+
+ def delete_log(self):
+
+ print "Deleting "+self.filename+".log"
+ try:
+ os.remove(self.filename+".log")
+ except OSError:
+ print self.filepath+".log not found"
+
+
+ def delete_avi(self):
+
+ try:
+ listfiles=glob.glob(self.filepath+"_01_[0-9][0-9]"+".avi")
+ for afile in listfiles:
+ try:
+ os.remove(afile)
+ except OSError:
+ print str(afile.strip())+" not found to remove"
+ except OSError:
+ print self.filepath+"._01_??.avi not found"
+
+
+ def delete_xml(self):
+
+ try:
+ os.remove(self.filepath+".xml")
+ listfiles=glob.glob(self.filepath+"_menu_[0-9]"+".xml")
+ for afile in listfiles:
+ try:
+ os.remove(afile)
+ except OSError:
+ print str(afile.strip())+" not found to remove"
+ except OSError:
+ print self.filepath+".xml not found"
+
+
+ def delete_menu_temp(self):
+
+ print "delete menu temp"
+ try:
+ listfiles=glob.glob(self.filepath+"_menu[0-9]"+"_bg.png")
+ for afile in listfiles:
+ try:
+ os.remove(afile)
+ except OSError:
+ print str(afile.strip())+" not found to remove"
+ except OSError:
+ print "Can't delete "+self.filepath+"_menu?_bg.png"
+
+ try:
+ listfiles=glob.glob(self.filepath+"_menu[0-9]"+"_bg_active_out.png")
+ for afile in listfiles:
+ try:
+ os.remove(afile)
+ except OSError:
+ print str(afile.strip())+" not found to remove"
+ except OSError:
+ print "Can't delete "+self.filepath+"_menu?_bg_active_out.png"
+
+ try:
+ listfiles=glob.glob(self.filepath+"_menu[0-9]"+"_bg_inactive_out.png")
+ for afile in listfiles:
+ try:
+ os.remove(afile)
+ except OSError:
+ print str(afile.strip())+" not found to remove"
+ except OSError:
+ print "Can't delete "+self.filepath+"_menu?_bg_inactive_out.png"
+
+ try:
+ listfiles=glob.glob(self.filepath+"_menu[0-9]"+"_bg_select_out.png")
+ for afile in listfiles:
+ try:
+ os.remove(afile)
+ except OSError:
+ print str(afile.strip())+" not found to remove"
+ except OSError:
+ print "Can't delete "+self.filepath+"_menu?_bg_select_out.png"
+
+ try:
+ listfiles=glob.glob(self.filepath+"_menu_[0-9]"+".mpg")
+ for afile in listfiles:
+ try:
+ os.remove(afile)
+ except OSError:
+ print str(afile.strip())+" not found to remove"
+ except OSError:
+ print "Can't delete "+self.filepath+"_menu_?.mpg"
+
+
+ def delete_menu(self):
+
+ print "delete menu"
+
+ try:
+ listfiles=glob.glob(self.filepath+"_menu2_[0-9]"+".mpg")
+ for afile in listfiles:
+ try:
+ os.remove(afile)
+ except OSError:
+ print str(afile.strip())+" not found to remove"
+ except OSError:
+ print "Can't delete "+self.filepath+"_menu2_?.mpg"
+
+
+ def delete_sub_xml(self,xtrasub=""):
+
+ try:
+ os.remove(self.filepath+"_sub.xml")
+ except OSError:
+ print self.filepath+".xml not found"
+ if xtrasub!="":
+ try:
+ os.remove(xtrasub)
+ except OSError:
+ print str(xtrasub)+" not found"
+
+
+ def delete_iso(self):
+
+ try:
+ os.remove(self.filepath+".iso")
+ except OSError:
+ print self.filepath+".iso not found"
+
+
+ def delete_bin_cue(self):
+
+ try:
+ os.remove(self.filepath+".cue")
+ except OSError:
+ print self.filepath+".cue not found"
+
+ try:
+ os.remove(self.filepath+".bin")
+ except OSError:
+ print self.filepath+".bin not found"
+
+
+ def delete_directory(self):
+
+ try:
+ shutil.rmtree(self.filepath)
+ except OSError:
+ print self.filepath+os.sep+" not found"
+
+ def delete_main_dir(self):
+
+ print "Borro principal"
+ return
+
+ try:
+ shutil.rmtree(self.filepath)
+ except OSError:
+ print self.filepath+os.sep+" not found"
157 devede_dialogs.py
@@ -0,0 +1,157 @@
+#!/usr/bin/env python
+# -*- coding: UTF-8 -*-
+
+# Copyright 2006-2007 (C) Raster Software Vigo (Sergio Costas)
+# Copyright 2006-2007 (C) Peter Gill - win32 parts
+
+# This file is part of DeVeDe
+#
+# DeVeDe is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# DeVeDe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import pygtk # for testing GTK version number
+pygtk.require ('2.0')
+import gtk
+import devede_other
+
+class show_error:
+
+ def __init__(self,gladefile,message):
+
+ """ Shows a window with an error """
+
+ self.newtree=devede_other.create_tree(self,"werror_dialog",gladefile,False)
+ label=self.newtree.get_object("label_error_dialog")
+ label.set_text(message)
+ window=self.newtree.get_object("werror_dialog")
+ window.show()
+ window.run()
+ window.hide()
+ window.destroy()
+ window=None
+
+
+class show_warning:
+
+ def __init__(self,gladefile,message):
+
+ """ Shows a window with an error """
+
+ self.newtree=devede_other.create_tree(self,"wwarning_dialog",gladefile,False)
+ label=self.newtree.get_object("wwarning_dialog_text")
+ label.set_text(message)
+ window=self.newtree.get_object("wwarning_dialog")
+ window.show()
+ window.run()
+ window.hide()
+ window.destroy()
+ window=None
+
+
+class ask_exit:
+
+ def __init__(self,gladefile):
+
+ self.newtree=devede_other.create_tree(self,"wcancel_dialog",gladefile,False)
+ self.window=self.newtree.get_object("wcancel_dialog")
+
+ def run(self):
+ self.window.show()
+ retval=self.window.run()
+ self.window.hide()
+ self.window.destroy()
+ self.window=None
+ return retval
+
+
+class ask_overwrite_onload:
+
+ def __init__(self,gladefile):
+
+ self.newtree=devede_other.create_tree(self,"wloosecurrent",gladefile,False)
+ self.window=self.newtree.get_object("wloosecurrent")
+
+ def run(self):
+ self.window.show()
+ retval=self.window.run()
+ self.window.hide()
+ self.window.destroy()
+ self.window=None
+ return retval
+
+
+class ask_delete_title:
+
+ def __init__(self,titlename,gladefile):
+
+ self.newtree=devede_other.create_tree(self,"wdel_title_dialog",gladefile,False)
+ self.window=self.newtree.get_object("wdel_title_dialog")
+ label=self.newtree.get_object("what_title")
+ label.set_text(titlename)
+
+ def run(self):
+ self.window.show()
+ retval=self.window.run()
+ self.window.hide()
+ self.window.destroy()
+ self.window=None
+ return retval
+
+
+class ask_delete_chapter:
+
+ def __init__(self,titlename,gladefile):
+
+ self.newtree=devede_other.create_tree(self,"wdel_chapter_dialog",gladefile,False)
+ self.window=self.newtree.get_object("wdel_chapter_dialog")
+ label=self.newtree.get_object("labelchapter")
+ label.set_text(titlename)
+
+ def run(self):
+ self.window.show()
+ retval=self.window.run()
+ self.window.hide()
+ self.window.destroy()
+ self.window=None
+ return retval
+
+
+class ask_erase_all:
+
+ def __init__(self,gladefile):
+
+ self.newtree=devede_other.create_tree(self,"werase_dialog",gladefile,False)
+ self.window=self.newtree.get_object("werase_dialog")
+
+ def run(self):
+ self.window.show()
+ retval=self.window.run()
+ self.window.hide()
+ self.window.destroy()
+ self.window=None
+ return retval
+
+
+class show_about:
+
+ def __init__(self,gladefile):
+
+ """ Shows the About dialog """
+
+ self.newtree=devede_other.create_tree(self,"aboutdialog1",gladefile,False)
+ window=self.newtree.get_object("aboutdialog1")
+ window.show()
+ window.run()
+ window.hide()
+ window.destroy()
+ window=None
113 devede_disctype.py
@@ -0,0 +1,113 @@
+#!/usr/bin/env python
+# -*- coding: UTF-8 -*-
+
+# Copyright 2006-2009 (C) Raster Software Vigo (Sergio Costas)
+# Copyright 2006-2009 (C) Peter Gill - win32 parts
+
+# This file is part of DeVeDe
+#
+# DeVeDe is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# DeVeDe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import pygtk # for testing GTK version number
+pygtk.require ('2.0')
+import gtk
+import devede_main
+import devede_dialogs
+import os
+import devede_other
+
+class disctype:
+
+ def __init__(self,global_vars):
+
+ self.gladefile=global_vars["gladefile"]
+ self.global_vars=global_vars
+
+ self.tree=devede_other.create_tree(self,"wdisk_type",self.gladefile)
+ self.window=self.tree.get_object("wdisk_type")
+ self.main_window=None
+ self.window.show()
+
+
+ def on_wdisk_type_delete_event(self,widget,signal):
+ """ Callback which shows the "Are you sure?" window """
+
+ return self.ask_cancel()
+
+
+ def on_wdisk_type_cancel_clicked(self,widget):
+ """ Callback which shows the "Are you sure?" window """
+
+ return self.ask_cancel()
+
+
+ def ask_cancel(self):
+
+ window=devede_dialogs.ask_exit(self.gladefile)
+ retval=window.run()
+ window=None
+ print "Retorno: ",
+ print retval
+ if retval==-5:
+ gtk.main_quit()
+ return False
+ return True
+
+
+ def on_disctype_dvd(self,widget):
+
+ self.global_vars["disctocreate"]="dvd"
+ self.set_disk_type()
+
+
+ def on_disctype_vcd(self,widget):
+
+ self.global_vars["disctocreate"]="vcd"
+ self.set_disk_type()
+
+
+ def on_disctype_svcd(self,widget):
+
+ self.global_vars["disctocreate"]="svcd"
+ self.set_disk_type()
+
+
+ def on_disctype_cvd(self,widget):
+
+ self.global_vars["disctocreate"]="cvd"
+ self.set_disk_type()
+
+
+ def on_disctype_divx(self,widget):
+
+ self.global_vars["disctocreate"]="divx"
+ self.set_disk_type()
+
+
+ def set_disk_type(self):
+
+ if self.main_window==None:
+ self.main_window=devede_main.main_window(self.global_vars,self.show_again)
+ self.main_window.set_disc_type(True)
+ self.main_window.show()
+ self.window.hide()
+
+
+ def show_again(self):
+
+ """ Callback which is called from main window when the user wants to change the
+ disk type """
+
+ self.main_window.hide()
+ self.window.show()
80 devede_dvd.py
@@ -0,0 +1,80 @@
+#!/usr/bin/env python
+# -*- coding: UTF-8 -*-
+
+# Copyright 2006-2007 (C) Raster Software Vigo (Sergio Costas)
+# Copyright 2006-2007 (C) Peter Gill - win32 parts
+
+# This file is part of DeVeDe
+#
+# DeVeDe is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# DeVeDe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+import signal
+import os
+import sys
+import re
+import shutil
+
+import devede_executor
+
+class dvd_generator(devede_executor.executor):
+
+ def __init__(self,filename,filefolder,progresbar,proglabel):
+
+ devede_executor.executor.__init__(self,filename,filefolder,progresbar)
+ proglabel.set_text(_("Creating DVD tree structure"))
+ if (sys.platform=="win32") or (sys.platform=="win64"):
+ command="dvdauthor.exe"
+ else:
+ command="dvdauthor"
+
+ self.print_error=_("Failed to create the DVD tree\nMaybe you ran out of disk space")
+ self.launch_program([command,"-x",filefolder+filename+".xml"])
+
+
+ def set_progress_bar(self):
+
+ if (sys.platform=="win32") or (sys.platform=="win64"):
+ # This seems to be about all that can be done with dvdauthor on windows
+ self.bar.pulse()
+ return True
+
+ if self.cadena.find("INFO: Video")!=-1:
+ self.bar.pulse()
+ return True
+ else:
+ position=self.cadena.find("STAT: VOBU ")
+ if position!=-1:
+ self.bar.pulse()
+ self.bar.set_text("VOBU "+self.cadena[position+11:self.cadena.find(" ",position+11)])
+ return True
+ else:
+ position=self.cadena.find("STAT: fixing VOBU at ")
+ if (position!=-1):
+ position2=self.cadena.find("%",position+21)
+ if (position2!=-1):
+ cadena=self.cadena[position2-2:position2]
+ self.bar.set_text(cadena+"%")
+ self.bar.set_fraction((float(cadena))/100.0)
+ self.read_chars=200
+ return True
+ return False
+
+
+ def end_process(self,eraser,erase_temporal_files):
+
+ if erase_temporal_files:
+ eraser.delete_mpg()
+ eraser.delete_menu()
+ eraser.delete_xml()
388 devede_dvdmenu.py
@@ -0,0 +1,388 @@
+#!/usr/bin/env python
+# -*- coding: UTF-8 -*-
+
+# Copyright 2006-2009 (C) Raster Software Vigo (Sergio Costas)
+# Copyright 2006-2009 (C) Peter Gill - win32 parts
+
+# This file is part of DeVeDe
+#
+# DeVeDe is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# DeVeDe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import pygtk # for testing GTK version number
+pygtk.require ('2.0')
+import gtk
+import cairo
+import os
+
+import devede_other
+import devede_dialogs
+import devede_xml_menu
+import devede_newfiles
+import devede_help
+
+
+class menu_options:
+
+ def __init__(self,gladefile,structure,global_vars,callback):
+
+ self.global_vars=global_vars
+ self.gladefile=gladefile
+ self.structure=structure
+ self.callback=callback
+
+ self.tree=devede_other.create_tree(self,"wmenu_properties",self.gladefile)
+ self.window=self.tree.get_object("wmenu_properties")
+
+ menu_filename=global_vars["menu_bg"]
+ if menu_filename==None:
+ menu_filename=os.path.join(global_vars["path"],"backgrounds","default_bg.png")
+ w=self.tree.get_object("menu_bg_file")
+ w.set_filename(menu_filename)
+ filter=gtk.FileFilter()
+ filter.add_mime_type("image/*")
+ filter.set_name("Pictures")
+ w.add_filter(filter)
+
+ self.preview_x=200
+ self.preview_y=200
+ self.sf_final=cairo.ImageSurface(cairo.FORMAT_ARGB32,self.preview_x,self.preview_y)
+ self.preview=gtk.DrawingArea()
+ self.preview.set_size_request(self.preview_x,self.preview_y)
+ self.preview.connect("expose-event",self.repaint_preview)
+ w.set_preview_widget(self.preview)
+
+ self.on_menu_bg_file_update_preview(w,menu_filename)
+
+ self.adding_sound=True
+ w=self.tree.get_object("menu_sound")
+ print "filtro"
+ filter2=gtk.FileFilter()
+ filter2.add_mime_type("audio/mpeg")
+ filter2.add_mime_type("audio/x-wav")
+ filter2.add_mime_type("application/ogg")
+ filter2.add_mime_type("audio/ogg")
+ filter2.set_name("Audio files")
+ w.add_filter(filter2)
+ print "filtrado"
+ w.set_filename(global_vars["menu_sound"])
+ print "Añado"
+
+ w=self.tree.get_object("menufont")
+ w.set_font_name(global_vars["fontname"])
+
+ w=self.tree.get_object("unselected_color")
+ color=global_vars["menu_font_color"]
+ c1=gtk.gdk.Color(color[0],color[1],color[2])
+ w.set_color(c1)
+ w.set_alpha(color[3])
+
+ w=self.tree.get_object("selected_color")
+ color=global_vars["menu_selc_color"]
+ c1=gtk.gdk.Color(color[0],color[1],color[2])
+ w.set_color(c1)
+
+ w=self.tree.get_object("shadow_color")
+ color=global_vars["menu_shadow_color"]
+ c1=gtk.gdk.Color(color[0],color[1],color[2])
+ w.set_color(c1)
+ w.set_alpha(color[3])
+
+ w=self.tree.get_object("bg_color")
+ color=global_vars["menu_bgcolor"]
+ c1=gtk.gdk.Color(color[0],color[1],color[2])
+ w.set_color(c1)
+ w.set_alpha(color[3])
+
+ if global_vars["menu_alignment"]==0:
+ w=self.tree.get_object("menutop")
+ elif global_vars["menu_alignment"]==1:
+ w=self.tree.get_object("menubottom")
+ else:
+ w=self.tree.get_object("menumiddle")
+ w.set_active(True)
+
+ if global_vars["menu_halignment"]==0:
+ w=self.tree.get_object("menuleft")
+ elif global_vars["menu_halignment"]==1:
+ w=self.tree.get_object("menuright")
+ else:
+ w=self.tree.get_object("menucenter")
+ w.set_active(True)
+
+ if global_vars["do_menu"]:
+ w=self.tree.get_object("domenu")
+ else:
+ w=self.tree.get_object("notmenu")
+ w.set_active(True)
+
+ w=self.tree.get_object("menu_title_text")
+ w.set_text(global_vars["menu_title_text"])
+
+ w=self.tree.get_object("menu_title_color")
+ color=global_vars["menu_title_color"]
+ c1=gtk.gdk.Color(color[0],color[1],color[2])
+ w.set_color(c1)
+ w.set_alpha(color[3])
+
+ w=self.tree.get_object("menu_title_shadow")
+ color=global_vars["menu_title_shadow"]
+ c1=gtk.gdk.Color(color[0],color[1],color[2])
+ w.set_color(c1)
+ w.set_alpha(color[3])
+
+ w=self.tree.get_object("menu_title_font")
+ w.set_font_name(global_vars["menu_title_fontname"])
+
+ self.window.show()
+
+
+ def repaint_preview(self,dwidget,evento):
+ try:
+ cr=dwidget.window.cairo_create()
+ cr.set_source_surface(self.sf_final)
+ cr.paint()
+ except:
+ return
+
+
+ def on_menu_bg_file_update_preview(self,widget,filename2=None):
+ try:
+ if filename2==None:
+ filename=widget.get_preview_filename()
+ else:
+ filename=filename2
+
+ print "Using "+str(filename)+" as menu background"
+
+ pixbuf = gtk.gdk.pixbuf_new_from_file(filename)
+ x = pixbuf.get_width()
+ y = pixbuf.get_height()
+
+ sf_base = cairo.ImageSurface(0,x,y)
+
+ ct = cairo.Context(sf_base)
+ ct2 = gtk.gdk.CairoContext(ct)
+
+ ct2.set_source_pixbuf(pixbuf,0,0)
+ ct2.paint()
+ ct2.stroke()
+
+ xbase=float(sf_base.get_width())
+ ybase=float(sf_base.get_height())
+
+ cr_final=cairo.Context(self.sf_final)
+ cr_final.set_source_rgb(1.0,1.0,1.0)
+ cr_final.paint()
+ if xbase>ybase:
+ divisor=xbase
+ else:
+ divisor=ybase
+
+ cr_final.scale(float(self.preview_x)/divisor,float(self.preview_y)/divisor)
+
+ cr_final.set_source_surface(sf_base)
+ cr_final.paint()
+ self.repaint_preview(self.preview,"")
+ widget.set_preview_widget_active(True)
+ except:
+ widget.set_preview_widget_active(False)
+
+
+ def on_menu_sound_selection_changed(self,widget):
+
+ print "Entro"
+
+ if self.adding_sound:
+ self.adding_sound=False
+ return
+
+ filename=widget.get_filename()
+ if (filename==None) or (filename==""):
+ return
+
+ test=devede_newfiles.file_get_params()
+ check,channels=test.read_file_values(filename,True)
+ if (check!=False) or (channels!=1):
+ filename=os.path.join(self.global_vars["path"],"silence.ogg")
+ widget.set_filename(filename)
+ w = devede_dialogs.show_error(self.gladefile,_("The menu soundtrack seems damaged. Using the default silent soundtrack."))
+ w = None
+ test=None
+
+
+ def on_menu_no_sound_clicked(self,widget):
+
+ w=self.tree.get_object("menu_sound")
+ w.set_filename(os.path.join(self.global_vars["path"],"silence.ogg"))
+
+ def on_menu_help_clicked(self,widget):
+
+ help_class=devede_help.show_help(self.gladefile,self.global_vars["help_path"],"menu.html")
+
+ def on_menuprop_cancel_clicked(self,widget):
+
+ self.window.hide()
+ self.window.destroy()
+ self.window=None
+
+
+ def on_menuprop_accept_clicked(self,widget):
+
+ self.set_new_bg(self.global_vars)
+ self.window.hide()
+ self.window.destroy()
+ self.window=None
+
+
+ def on_menu_preview_clicked(self,widget):
+
+ global_vars2={}
+ global_vars2["PAL"]=self.global_vars["PAL"]
+ global_vars2["with_menu"]=True
+ self.set_new_bg(global_vars2)
+ window=menu_preview(self.gladefile,self.structure,global_vars2)
+ window=None
+
+
+ def on_menu_default_bg_clicked(self,widget):
+
+ self.global_vars["menu_bg"]=os.path.join(self.global_vars["path"],"backgrounds","default_bg.png")
+ w=self.tree.get_object("menu_bg_file")
+ w.set_filename(self.global_vars["menu_bg"])
+
+
+ def set_new_bg(self,global_vars):
+
+ w=self.tree.get_object("menu_bg_file")
+ menu_filename=w.get_filename()
+ if menu_filename==None:
+ menu_filename=os.path.join(self.global_vars["path"],"backgrounds","default_bg.png")
+ global_vars["menu_bg"]=menu_filename
+
+ w=self.tree.get_object("menu_sound")
+ sound_filename=w.get_filename()
+ test=devede_newfiles.file_get_params()
+ check,channels=test.read_file_values(sound_filename,True)
+ global_vars["menu_sound"]=sound_filename
+ global_vars["menu_sound_duration"]=test.length
+ test=None
+
+ w=self.tree.get_object("menufont")
+ global_vars["fontname"]=w.get_font_name()
+
+ w=self.tree.get_object("unselected_color")
+ color=w.get_color()
+ global_vars["menu_font_color"]=[color.red,color.green,color.blue,w.get_alpha()]
+
+ w=self.tree.get_object("selected_color")
+ color=w.get_color()
+ global_vars["menu_selc_color"]=[color.red,color.green,color.blue,65535]
+
+ w=self.tree.get_object("shadow_color")
+ color=w.get_color()
+ global_vars["menu_shadow_color"]=[color.red,color.green,color.blue,w.get_alpha()]
+
+ w=self.tree.get_object("bg_color")
+ color=w.get_color()
+ global_vars["menu_bgcolor"]=[color.red,color.green,color.blue,w.get_alpha()]
+
+ align=0 # top
+ w=self.tree.get_object(