acidrip-0.14/0000755000076400001440000000000010125531051013335 5ustar chrisusers00000000000000acidrip-0.14/META.yml0000644000076400001440000000055510125531050014612 0ustar chrisusers00000000000000# http://module-build.sourceforge.net/META-spec.html #XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# name: acidrip version: 0.14 version_from: acidrip installdirs: site requires: Glib: 1 Gtk2: 1 distribution_type: module generated_by: ExtUtils::MakeMaker version 6.17 acidrip-0.14/test.pl0000644000076400001440000000133010017441207014651 0ustar chrisusers00000000000000use strict; print "test for lsdvd ( >= 0.9) : "; my $lsdvd = `lsdvd -V 2>&1`; if ( $lsdvd !~ /0.(\d+)\s/ ) { die "Not Found!\n\n***************\n" . "AcidRip needs my little app \"lsdvd\" in order to see what is on your dvd\'s\n" . "Download it and install it (and libdvdread) before trying to use AcidRip.\n" . "If it\'s simply not on your path then set the full path inside AcidRip.\n" . "***************\n\n" } if ( $1 < 9 ) { die "Too old!\n\n***************\n" . "AcidRip needs at least version 0.9 of lsdvd, but version 0.$1 was found\n" . "Download it and install it (and libdvdread) before trying to use AcidRip.\n" . "***************\n\n" } print "found\n"; print "Everything looks good here...\n"; acidrip-0.14/COPYING0000644000076400001440000004307610017441207014405 0ustar chrisusers00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program 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 2 of the License, or (at your option) any later version. This program 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. acidrip-0.14/acidrip.spec0000644000076400001440000000436310017441207015635 0ustar chrisusers00000000000000%define ver 0.9 %define rel 1 %define name acidrip %define rlname %{name} %define source0 http://acidrip.thirtythreeandathird.net/%{name}-%{ver}.tar.gz %define url http://acidrip.thirtythreeandathird.net %define group Application %define copy GPL or Artistic %define filelst %{name}-%{ver}-files %define confdir /etc %define prefix /usr %define arch noarch Summary: No description Name: %name Version: %ver Release: %rel Copyright: %{copy} Packager: Chris Phillips Source: %{source0} URL: %{url} Group: %{group} BuildArch: %{arch} BuildRoot: /var/tmp/%{name}-%{ver} %description AcidRip is an automated front end for MPlayer/Mencoder written in Perl, using Gtk::Perl for a graphical interface. Makes encoding a DVD just one button click! %prep %setup -n %{rlname}-%{ver} %build if [ $(perl -e 'print index($INC[0],"%{prefix}/lib/perl");') -eq 0 ];then # package is to be installed in perl root inst_method="makemaker-root" CFLAGS=$RPM_OPT_FLAGS perl Makefile.PL PREFIX=%{prefix} else # package must go somewhere else (eg. /opt), so leave off the perl # versioning to ease integration with automatic profile generation scripts # if this is really a perl-version dependant package you should not omiss # the version info... inst_method="makemaker-site" CFLAGS=$RPM_OPT_FLAGS perl Makefile.PL PREFIX=%{prefix} LIB=%{prefix}/lib/perl5 fi echo $inst_method > inst_method # get number of processors for parallel builds on SMP systems numprocs=`cat /proc/cpuinfo | grep processor | wc | cut -c7` if [ "x$numprocs" = "x" -o "x$numprocs" = "x0" ]; then numprocs=1 fi make "MAKE=make -j$numprocs" %install rm -rf $RPM_BUILD_ROOT if [ "$(cat inst_method)" = "makemaker-root" ];then make UNINST=1 PREFIX=$RPM_BUILD_ROOT%{prefix} install elif [ "$(cat inst_method)" = "makemaker-site" ];then make UNINST=1 PREFIX=$RPM_BUILD_ROOT%{prefix} LIB=$RPM_BUILD_ROOT%{prefix}/lib/perl5 install fi %__os_install_post find $RPM_BUILD_ROOT -type f -print|sed -e "s@^$RPM_BUILD_ROOT@@g" > %{filelst} %files -f %{filelst} %defattr(-, root, root) %doc Documentation/* %clean rm -rf $RPM_BUILD_ROOT %changelog * Fri Sep 27 2002 - Chris Phillips,,, wrote stuff acidrip-0.14/acidrip0000755000076400001440000002341310125312157014705 0ustar chrisusers00000000000000#!/usr/bin/perl -w require 5.005; use strict; use vars qw($VERSION); $VERSION = '0.14'; package acidrip; use AcidRip::acidrip; use Getopt::Long; sub version { print "AcidRip - Version $::VERSION \"Written\" by Chris Phillips \n"; exit 0; } @ARGV = ( '-x', @ARGV ) if ( scalar @ARGV ); my %opts = (); GetOptions( 'x|no-gui' => \$opts{'x'}, 'c|crop=i' => \$opts{'c'}, 't|track=i' => \$opts{'t'}, 'v|version' => \$opts{'v'}, 'f|filename=s' => \$opts{'f'}, 'h|help' => \$opts{'h'} ); $::settings = new acidrip_settings; $::playlist = new acidrip_playlist; $::settings->load_settings; $::messages = new acidrip_messages($::settings->{'ui_language'}); $::dvd = (); version() if $opts{'v'}; $::widgets = new acidrip; $::settings->{'verbose'} = 0; load_settings_to_interface(); $::settings->{'verbose'} = 1; get_available_codecs(); $::widgets->{'acidrip'}->show; if ( $::settings->{'autoload'} ) { $::widgets->{'read_dvd_button'}->clicked; $::widgets->{'crop_detect_button'}->clicked if $::settings->{'crop_enable'}; } message("AcidRip $::VERSION, \"Written\" by C.Phillips "); main Gtk2; exit 0; __END__ #=============================================================================== #==== Documentation #=============================================================================== =pod =head1 NAME acidrip - a Gtk2::Perl wrapper for MPlayer / Mencoder =head1 SYNOPSIS acidrip =head1 DESCRIPTION AcidRip is a Gtk2::Perl application for ripping and encoding DVD's and other media files. It neatly wraps MPlayer and MEncoder, which is pretty handy, seeing as MPlayer is by far the best video player software. As well as creating a simple interface for those scared of getting down and dirty with MEncoders command line interface, It also automates the process in a number of ways: =over =item * Parses DVD into contents tree =item * Finds longest title =item * Calculate video bitrate for given filesize =item * Finds black bands and crops them =item * Divides long films into multiple files =item * Other stuff! =back =head1 USAGE Some simple steps to ripping with AcidRip: =head2 1 - Load DVD or file =over To load a DVD, press "Load" with the disk in your drive (after checking that the device is correct. You might want to symlink it to /dev/dvd). To load a file, or a whole directory, enter the location in the "Path" box and hit Load. This loads contents and displays it as a tree of tracks (and chapters for DVD). The longest track, assumed to be the main feature, is automatically selected for you. If you wish to only encode certain chapters of a DVD title, just expand that branch and click on the first and last chapters you want, while holding shift. =back =head2 2 - Choose correct file name and desired size =over The name of the output file is defined by a number of variables: =over =item * %T - Title of the track, as in the editable box above =item * %N - Number of the selected track - useful for batch encoding =item * %L - Length of the selected track =item * %f - The first letter of the title [useful for organisation] =item * %b - bitrate of the video stream =item * %l - language of the audio track =item * %w - width of the video output =item * %h - height of the video output =back For example, "/var/film/%f/%T-%N-%wx%h" might be evaluated to "/var/film/s/simpsons-2-480x360". Also select a file size. This is used to calculate bitrates for the codecs you are going to use. If the codecs you choose do NOT support a bitrate option (e.g copy, rawrgb etc. for video) then the given size can NOT be enforced at all. A film can be split into a number of files by setting a value in the relevant box. The created files are split by chapter boundaries, so the chapters must be suitable. You can also add additional information, akin to the ID3 tag's in MP3s. Choose the field in the combo box and enter the correct value. Few players other than mplayer use this information though. =back =head2 3 - Choose audio track =over Select the language for the audio. You may also have the option to encode directors commentary etc., however the tracks will only be listed as such if the description is actually on the DVD itself, which doesn't seem to happen that often. =back =head2 4 - Choose audio output =over Use the combo box to choose how to encode the audio. normally this should be an MP3 stream. If you do not have mp3lame listed in the codecs combo box then you need to compile it into mencoder, it is nothing to do with acidrip at all. If you choose mp3lame set your options in the box below. See the mencoder manpage for a list of options (look for "lameopts"). =back =head2 5 - Choose video output =over Select the desired video output. lavc (FFMpeg's avcodec libraries) is the default choice. Despite what you might assume "vcodec=mpeg4" relates to divx4/5 encoding, trust me on this one..! Many people prefer Xvid encoding, it's up to you of course. Set any options specific to the selected output in the options box below. See the relevant entries in the mencoder manpage for the full selection. Only defaults for lavc are provided. The three main codecs can also use 2 pass encoding, select the option if you wish to encode the film twice to improve quality. You should also check the bitrate here. This value is based on the desired file size and the selected audio bitrates. You may wish to enter your own bitrate and lock the value using the check box to ensure that it is not changed. This naturally means that the file size can not be guarenteed. =back =head2 6 - Crop film =over Assuming you are using a proper encoding codec (lavc / xvid / divx) then you should want to chop off any widescreen bars and such like. These bars just soak up disk space, leaving less for the actual film. Just pressing the "Detect" button should suffice, but it's a good idea to check the results to make sure, and adjust the values accordingly. Pressing the "Detect" button uses mplayer to pick frames throughout the DVD and analyzes it for unwanted areas. Note that the values for cropping are not related at all to the output size, but instead the size of the DVD itself (720x568 for PAL, 720x480 for NTSC). =back =head2 7 - Scale film =over The final output dimensions of the film can now be set. By default the height is locked against the width setting in line with the aspect of the video (including any cropping to be applied). The scaling of the film is most likely to affect the BPP (Bits Per Pixel) values of the file. For a typical divx film you want about 0.17 - 0.20. A value higher than this just wastes space: divx just doesn't *need* it..., a lower value and the output is blocky and poor. By adjusting the width of the film you can affect the BPP value directly. Obviously file size and crop values can also affect the BPP among others. =back =head2 8 - Filters =over You can now enter any flags for processing the film, such as deinterlacing, deblocking etc. See the mencoder manpage for details. There are no set options other than a default "pp=de" as you should only use the options if you know what they are there for. rtfm! =back =head2 9 - Encode =over Everything should be set up now so press the "Start" button and make some tea. =back That is all that should be required to rip a DVD or file(s). However you should not need to perform each step every time. By saving your settings they will be automatically loaded next time, and if "Autoload media" is selected in the "Additional settings" dialog then the DVD / file / directory will be automatically loaded for you. Further more is autoload is set, and cropping in enabled then it will be cropped automatically too. After this, all you should ever need to do is that press start. One button! =head1 QUEUE =over Acidrip has the ability to build and process a queue of events. Clicking on "Queue" rather that "Start" will take the current encoding settings and create the commands as normal but then add them to an execution queue which will not be executed until the "Start" button is pressed. The queue can also be exported to a standard bash script (~/acidrip.sh) to execute outside of acidrip. =back =head1 ADDITIONAL FEATURES =over There are a number of other additional features in the "Additional settings" dialog window. These are: Mencoder / Mplayer / lsdvd entries: Change the default program names / locations. Allows you to set default parameters not handled elsewhere, or set something such as changing "mencoder" to "nice mencoder" to run the program via nice. Cache DVD / Delete Cache: Values used in caching a disc. Firstly the directory to place the cached track in, wether to cache at all and wether to automatically delete the cache after encoding. NB. you do NOT NOT NOT *need* to cache a DVD at all, you jsut might want to. Language: The default ISO639 language code or full language name to use, e.g. en, de, English... Overwrite files: Movie files will be overwritten if they aleady exist. Shutdown: Attempt to shutdown system after completion. Compact progress dialog: Hides the main window while encoding, and only shows the encoding box by itself. There is no "Stop" button etc, so as well as the smaller footprint you can't stop it by mistake. Enforce size check: The file size value set will turn red if there is apparently not enough space in the provided output directory. As the file size value is only used as an estimate and does not guarentee a fixed output size, you may well know something acidrip doesn't, so you can allow the program to encode regardless if you wish. =head1 BUGS Please report any bugs or functional inconsistencies by email or on the sourceforge.net tracker. =head1 SEE ALSO mencoder(1) lsdvd =head1 AUTHOR Chris Phillips http://acidrip.sf.net =cut acidrip-0.14/AcidRip/0000755000076400001440000000000010125531051014650 5ustar chrisusers00000000000000acidrip-0.14/AcidRip/signals.pm0000644000076400001440000007254210100732615016662 0ustar chrisusers00000000000000#!/usr/bin/perl -w package acidrip; require 5.005; use strict; use Data::Dumper; use AcidRip::acidrip; use File::Basename; sub quit_acidrip { if ( $::settings->{'mencoder_pid'} > 0 ) { my $confirm = Gtk2::MessageDialog->new( $::widgets->{'acidrip'}, [qw/modal destroy-with-parent/], 'question', 'yes-no', "Are you sure you want to stop the encoding process?" ); my $m = $::settings->{'mencoder_pid'} + 1; if ( $confirm->run eq 'yes' ) { kill 'INT', $::settings->{'mencoder_pid'}; kill 'INT', $m if `ps $m | grep mencoder` || `ps $m | grep mplayer`; Gtk2->main_quit; } $confirm->destroy; } else { Gtk2->main_quit; } } sub on_select_audio { my ( $widget, $this_audio ) = @_; $::settings->{'selected_audio'} = $this_audio; if ( $this_audio > 0 ) { my $audio = get_audio($this_audio); message("selected_audio changed to $this_audio - Channels $audio->{'channels'} frequency $audio->{'frequency'} quant. $audio->{'quantization'}"); set_bitrate(); } } sub on_mpegfile_option_changed { my $widget = shift; $::settings->{'mpegfile'} = $widget->get_history; message( "********************\nMPEG container selected. Please note that you MUST use a compatible mpeg1 video stream, " . "select lavc video output, using vcodec=mpeg1video. For a useful output you will probably want to choose a suitable encoding matrix." . "for example, create a kvcd file with vcodec=mpeg1video:keyint=25:mbd=2:vrc_minrate=300:vrc_maxrate=2400:vrc_buf_size=320:" . "intra_matrix=8,9,12,22,26,27,29,34,9,10,14,26,27,29,34,37,12,14,18,27,29,34,37,38,22," . "26,27,31,36,37,38,40,26,27,29,36,39,38,40,48,27,29,34,37,38,40,48,58,29,34,37,38,40," . "48,58,69,34,37,38,40,48,58,69,79:inter_matrix=16,18,20,22,24,26,28,30,18,20,22,24,26," . "28,30,32,20,22,24,26,28,30,32,34,22,24,26,30,32,32,34,36,24,26,28,32,34,34,36,38,26," . "28,30,32,34,36,38,40,28,30,32,34,36,38,42,42,30,32,34,36,38,40,42,44\nAnd don't forget to set VALID scale values etc...\n********************" ) if $::settings->{'mpegfile'}; message( "Filetype changed to " . ( $::settings->{'mpegfile'} ? ".mpg - READ DEBUG COMMENT! --->" : ".avi" ) ); } sub on_select_subp { my ( $widget, $this_subp ) = @_; $::settings->{'selected_subp'} = $this_subp; message("Selected_subp changed to $::settings->{'selected_subp'}"); } sub on_select_track { my ( $selection, $model ) = @_; my $x; my @newitem = $selection->get_selected_rows; my $length; return if not defined $newitem[0]; my $newitem = ( $newitem[0]->get_indices )[0] + 1; my $this_track = get_track($newitem); # count total and collapse if odd? $::settings->{'selected_chapters_start'} = 0; $::settings->{'selected_chapters_end'} = 0; foreach (@newitem) { ( $selection->get_tree_view )->collapse_all if ( $_->get_depth == 1 && defined $this_track->{'chapter'} ); if ( $_->get_depth == 2 ) { $::settings->{'selected_chapters_start'} = ( $_->get_indices )[1] + 1 if $::settings->{'selected_chapters_start'} == 0; $::settings->{'selected_chapters_end'} = ( $_->get_indices )[1] + 1; } } $::settings->{'selected_track'} = $this_track->{'ix'}; if ( $::settings->{'selected_chapters_start'} && defined $this_track->{'chapter'} ) { $::settings->{'length'} = hhmmss( get_selection_length( $::settings->{'selected_chapters_start'}, $::settings->{'selected_chapters_end'} ) ); $::widgets->{'selected_track_label'}->set_text( "Selected Track $::settings->{'selected_track'} " . "Ch $::settings->{'selected_chapters_start'}-$::settings->{'selected_chapters_end'} - " . $::settings->{'length'} ); } else { $::settings->{'length'} = hhmmss( $this_track->{'length'} ); $::widgets->{'selected_track_label'}->set_text( "Selected Track $newitem - " . $::settings->{'length'} ); } #load the correct audio entries for the menu my $audio_menu = Gtk2::Menu->new; $::widgets->{'audio_track_option'}->set_menu($audio_menu); my $default_audio = -1; my $audio_item; if ( $::dvd->{'source'} eq "dvd" ) { foreach ( reverse( @{ $this_track->{'audio'} } ) ) { if ( defined $_->{'langcode'} || defined $_->{'language'} ) { $default_audio = $_->{'ix'} if $_->{'langcode'} eq $::settings->{'language'} || $_->{'language'} eq $::settings->{'language'}; } } foreach my $this_audio ( @{ $this_track->{'audio'} } ) { my $label = $this_audio->{'ix'}; $label .= ": " . $this_audio->{'language'} if defined $this_audio->{'language'}; if ( defined $this_audio->{'content'} ) { $label = $label . ": " . $this_audio->{'content'} if $this_audio->{'content'} ne "Undefined"; } $audio_item = Gtk2::MenuItem->new($label); $audio_item->signal_connect( 'activate', \&on_select_audio, $this_audio->{'ix'} ); $audio_menu->append($audio_item); $audio_item->show; } } $audio_item = Gtk2::MenuItem->new(""); $audio_item->signal_connect( 'activate', \&on_select_audio, -2 ); $audio_menu->prepend($audio_item); $audio_item->show; $audio_item = Gtk2::MenuItem->new( " " . $::settings->{'language'} ); $audio_item->signal_connect( 'activate', \&on_select_audio, $default_audio ); $audio_menu->prepend($audio_item); $audio_item->show; $::widgets->{'audio_track_option'}->set_history(0); my $subp_menu = Gtk2::Menu->new; $::widgets->{'subp_option'}->set_menu($subp_menu); my $subp_item = Gtk2::MenuItem->new(""); $subp_item->signal_connect( 'select', \&on_select_subp, -1 ); $subp_menu->append($subp_item); $subp_item->show; $::widgets->{'subp_option'}->set_history(0); foreach my $this_subp ( @{ $this_track->{'subp'} } ) { my $subp_ix = $this_subp->{'ix'}; my $label = $subp_ix . ": " . $this_subp->{'language'}; $label .= ": " . $this_subp->{'content'} if $this_subp->{'content'} ne "Undefined"; $subp_item = new_with_label Gtk2::MenuItem($label); $subp_item->signal_connect( 'activate', \&on_select_subp, $subp_ix ); $subp_menu->append($subp_item); $subp_item->show; } set_bitrate(); split_track() if $::dvd->{'source'} eq "dvd" and $::settings->{'total_blocks'} > 1; } sub on_scale_lock_check_clicked { my $widget = shift; $::widgets->{'scale_height_spin'}->set_sensitive( !$widget->get_active ); if ( $widget->get_active ) { $::widgets->{'scale_height_spin'}->hide; $::widgets->{'scale_height_estimate_entry'}->show; $::widgets->{'scale_height_spin'}->set_value("-2"); } else { $::widgets->{'scale_height_spin'}->show; $::widgets->{'scale_height_estimate_entry'}->hide; $::widgets->{'scale_height_spin'}->set_value( $::widgets->{'scale_height_estimate_entry'}->get_text ); } } sub on_filesize_changed { my $free = 0; my $size = $::settings->{'filesize'} * $::settings->{'total_blocks'}; my $directory = dirname( substitute_filename( $::settings->{'filename'} ) ); open( DF, "df $directory |" ) if -w $directory; return if not -w $directory; while () { my @array = split /\s+/; $free = $array[3] / 1024 if $. != 1; } close DF; $free = sprintf( "%d", $free ); set_warning_text( $::widgets->{'filesize_spin'}, $free <= $size ? 1 : 0 ); my $warn_block = $::settings->{'total_blocks'} > 1 ? 1 : 0; set_warning_text( $::widgets->{'total_blocks_spin'}, $free <= $size ? $warn_block : 0 ); $::settings->{'enough_space'} = $free <= $size ? 0 : 1; set_bitrate(); } sub on_bpp_changed { my $widget = shift; my $bpp = $widget->get_text || 0; my $message = "Bits per pixel is "; my $warn; if ( $bpp < 0.10 ) { $message .= "FAR too low!!, increase file size or reduce resolution"; $warn = 1 } elsif ( $bpp < 0.15 ) { $message .= "quite low, output will probably suck, increase filesize or lower resolution"; $warn = 0.5 } elsif ( $bpp < 0.20 ) { $message .= "alright, output will be a bit blocky, but generally ok."; $warn = 0 } elsif ( $bpp < 0.25 ) { $message .= "super, output should look pretty good"; $warn = 0 } elsif ( $bpp < 0.30 ) { $message .= "quite high, not much to gain here. might want a slightly higher resolution"; $warn = 0.5 } else { $message .= "very high, you'll waste the space, try a bigger resolution"; $warn = 1 } set_warning_text( $widget, $warn ); $::widgets->{'tooltips'}->set_tip( $widget, $message ); } sub on_crop_detect_button_clicked { message("Crop detection in progress... please wait"); while ( Gtk2->events_pending() ) { Gtk2->main_iteration() } my $crop = "fail"; my $crop_output; ( $crop, $crop_output ) = find_crop( $::settings->{'selected_track'} ); $::widgets->{'mencoder_output_text'}->get_buffer->insert_with_tags_by_name( $::widgets->{'mencoder_output_text'}->get_buffer->get_end_iter, $crop_output, 'mplayer' ); if ( defined $crop && $crop =~ /crop=(\d+):(\d+):(\d+):(\d+)/ ) { set_setting( 'crop_width', $1 ); set_setting( 'crop_height', $2 ); set_setting( 'crop_horizontal', $3 ); set_setting( 'crop_vertical', $4 ); message('Crop detection completed'); } else { message( 'Crop detection failed, is the DVD loaded?', 'error' ) } } sub on_crop_preview_button_clicked { if ( defined $::dvd->{'track'} ) { $::widgets->{'stop_preview_button'}->show; $::widgets->{'preview_button'}->hide; $::widgets->{'preview_socket_frame'}->show; $::widgets->{'preview_logo'}->hide if defined $::widgets->{'preview_logo'}; #fork proofing open STDIN, '/dev/null' or message("Can't read /dev/null: $!. May fail if in background"); message("Preview command: "); message("Previewing crop window"); while ( Gtk2->events_pending() ) { Gtk2->main_iteration() } my $mplayer_output = ''; my $preview = get_command("preview"); message("Preview command: $preview"); message("Previewing crop window"); $/ = "\r"; $::settings->{'mencoder_pid'} = open( PREVIEW, "$preview 2>&1 |" ); while () { $::widgets->{'preview_socket'}->set_size_request( $1, $2 ) if /\s=>\s(\d+)x(\d+)/ && $::settings->{'embed_preview'}; $mplayer_output .= $_ if $_ !~ /crop|^A:/; while ( Gtk2->events_pending() ) { Gtk2->main_iteration() } } $/ = "\n"; close PREVIEW; message($mplayer_output); message("Preview finished"); $::widgets->{'stop_preview_button'}->hide; $::widgets->{'preview_button'}->show; $::widgets->{'preview_socket_frame'}->hide; $::widgets->{'preview_logo'}->show if defined $::widgets->{'preview_logo'}; } else { message("Preview failed, is the DVD loaded?") } } sub on_info_field_select { my ( $widget, $value ) = @_; $::widgets->{'info_name_entry'}->hide; $::widgets->{'info_artist_entry'}->hide; $::widgets->{'info_genre_entry'}->hide; $::widgets->{'info_subject_entry'}->hide; $::widgets->{'info_comment_entry'}->hide; $::widgets->{'info_copyright_entry'}->hide; $::widgets->{ 'info_' . $value . '_entry' }->show; } sub on_setting_finished { my $widget = shift; my $name = $::widgets->get_widget_name($widget); $name =~ /([\w_]+)_\w+/; my $data = $1; my $ref = ref $widget; my $value; if ( $ref eq "Gtk2::Entry" ) { $value = $widget->get_text } elsif ( $ref eq "Gtk2::SpinButton" ) { $value = $widget->get_value_as_int } elsif ( $ref eq "Gtk2::CheckButton" || $ref eq "Gtk2::ToggleButton" ) { if ( $widget->get_active ) { $value = 1 } else { $value = 0 } } message("$data has been set to $value") if $::settings->{$data} ne $value || $ref eq "Gtk2::SpinButton"; $::settings->{$data} = $value; on_setting_changed($widget); return 0; } sub enable_crop_control { my $value = shift; $::widgets->{'crop_width_spin'}->set_sensitive($value); $::widgets->{'crop_width_label'}->set_sensitive($value); $::widgets->{'crop_height_spin'}->set_sensitive($value); $::widgets->{'crop_height_label'}->set_sensitive($value); $::widgets->{'crop_vertical_spin'}->set_sensitive($value); $::widgets->{'crop_vertical_label'}->set_sensitive($value); $::widgets->{'crop_horizontal_spin'}->set_sensitive($value); $::widgets->{'crop_horizontal_label'}->set_sensitive($value); $::widgets->{'crop_detect_button'}->set_sensitive($value); $::settings->{'crop_width'} = $value ? $::widgets->{'crop_width_spin'}->get_value : 0; $::settings->{'crop_height'} = $value ? $::widgets->{'crop_height_spin'}->get_value : 0; set_bpp(); } sub enable_scale_control { my $value = shift; $::widgets->{'scale_width_spin'}->set_sensitive($value); $::widgets->{'scale_width_label'}->set_sensitive($value); $::widgets->{'scale_height_spin'}->set_sensitive($value); $::widgets->{'scale_height_label'}->set_sensitive($value); $::widgets->{'scale_height_estimate_entry'}->set_sensitive($value); $::widgets->{'scale_lock_check'}->set_sensitive($value); $::settings->{'scale_width'} = $value ? $::widgets->{'scale_width_spin'}->get_value : 0; $::settings->{'scale_height'} = $value ? $::widgets->{'scale_height_spin'}->get_value : 0; set_bpp(); } sub on_option_changed { my $widget = shift; my $value = shift; my $menu = $widget->get_parent; my $name = $::widgets->get_widget_name($menu); $name =~ /([\w_]+)_\w+/; $name = $1; $::settings->{$name} = $value; message("$1 has been set to $value"); if ( $name eq "video_codec" ) { message( $::settings->{'available_video'}{$value} ); my $enable = ( $value eq "lavc" || $value eq "xvid" || $value eq "divx4" ); $::widgets->{'video_bitrate_entry'}->set_sensitive($enable); $::widgets->{'video_bitrate_label'}->set_sensitive($enable); $::widgets->{'video_bitrate_lock_check'}->set_sensitive($enable); $::widgets->{'video_bpp_entry'}->set_sensitive($enable); $::widgets->{'video_bpp_label'}->set_sensitive($enable); $::widgets->{'video_passes_spin'}->set_sensitive($enable); $::widgets->{'video_passes_label'}->set_sensitive($enable); $::widgets->{'filesize_spin'}->set_sensitive($enable); $enable = ( $enable || $value eq "nuv" ); $::widgets->{'video_options_entry'}->set_text( $::settings->{ $value . '_options' } or "" ); $::widgets->{'video_options_entry'}->set_sensitive($enable); $::widgets->{'video_options_label'}->set_sensitive($enable); $enable = ( $value ne "copy" ); enable_crop_control($enable); enable_scale_control($enable); $::widgets->{'crop_enable_check'}->set_sensitive($enable); $::widgets->{'crop_detect_button'}->set_sensitive($enable); $::widgets->{'scale_enable_check'}->set_sensitive($enable); $::widgets->{'vf_pre_enable_check'}->set_sensitive($enable); $::widgets->{'vf_post_enable_check'}->set_sensitive($enable); $::widgets->{'vf_pre_entry'}->set_sensitive($enable); $::widgets->{'vf_post_entry'}->set_sensitive($enable); } if ( $name eq "audio_codec" ) { message( $::settings->{'available_audio'}{$value} ); my $enable = ( $value eq "mp3lame" or $value eq "lavc" ); $::widgets->{'audio_options_entry'}->set_sensitive($enable); $::widgets->{'audio_options_label'}->set_sensitive($enable); $::widgets->{'audio_gain_label'}->set_sensitive( $::settings->{"audio_codec"} ne "copy" ); $::widgets->{'audio_gain_spin'}->set_sensitive( $::settings->{"audio_codec"} ne "copy" ); $::widgets->{'audio_options_entry'}->set_text( $::settings->{ "audio_" . $value . "_options" } or "" ); } set_bpp(); } # Sets trivial data, and UI manipulation sub on_setting_changed { my $widget = shift; my $name = $::widgets->get_widget_name($widget); $name =~ /([\w_]+)_\w+/; my $data = $1; my $ref = ref $widget; my $value; my $boolean; my $encode = 1; if ( $ref eq "Gtk2::Entry" ) { $value = $widget->get_text } elsif ( $ref eq "Gtk2::SpinButton" ) { $value = $widget->get_value_as_int } elsif ( $ref eq "Gtk2::CheckButton" || $ref eq "Gtk2::ToggleButton" ) { if ( $widget->get_active ) { $value = 1 } else { $value = 0 } } $::settings->{$data} = $value; if ( $widget eq $::widgets->{'video_bitrate_spin'} ) { set_bitrate() if $::settings->{'video_bitrate_lock'}; set_bpp(); } if ( $widget eq $::widgets->{'filesize_spin'} ) { set_bitrate() if defined $::dvd->{'track'}; } if ( $widget eq $::widgets->{'total_blocks_spin'} ) { #on_filesize_changed(); split_track() if defined $::dvd->{'track'}; #set_bitrate() if defined $::dvd->{'track'}; } if ( $widget eq $::widgets->{'tooltips_check'} ) { if ( $widget->get_active ) { $::widgets->{'tooltips'}->enable; } else { $::widgets->{'tooltips'}->disable; } } if ( $widget eq $::widgets->{'crop_enable_check'} ) { enable_crop_control( $::widgets->{'crop_enable_check'}->get_active && $encode ); } if ( $widget eq $::widgets->{'scale_enable_check'} ) { enable_scale_control( $::widgets->{'scale_enable_check'}->get_active && $encode ); } if ( $widget eq $::widgets->{'vf_pre_enable_check'} ) { $boolean = $::widgets->{'vf_pre_enable_check'}->get_active && $encode; $::widgets->{'vf_pre_entry'}->set_sensitive($boolean); } if ( $widget eq $::widgets->{'vf_post_enable_check'} ) { $boolean = $::widgets->{'vf_post_enable_check'}->get_active && $encode; $::widgets->{'vf_post_entry'}->set_sensitive($boolean); } if ( $widget eq $::widgets->{'video_bitrate_lock_check'} ) { if ($value) { $::widgets->{'video_bitrate_spin'}->show; $::widgets->{'video_bitrate_entry'}->hide; $::widgets->{'filesize_spin'}->hide; $::widgets->{'filesize_entry'}->show; $::widgets->{'filesize_entry'}->set_text( $::widgets->{'filesize_spin'}->get_value_as_int ); set_bitrate(); } else { $::widgets->{'video_bitrate_spin'}->hide; $::widgets->{'video_bitrate_entry'}->show; $::widgets->{'filesize_spin'}->show; $::widgets->{'filesize_entry'}->hide; $::widgets->{'video_bitrate_entry'}->set_text( $::widgets->{'video_bitrate_spin'}->get_value_as_int ); } } if ( $widget eq $::widgets->{'video_options_entry'} ) { $::settings->{ $::settings->{'video_codec'} . "_options" } = $::widgets->{'video_options_entry'}->get_text; } if ( $widget eq $::widgets->{'audio_options_entry'} ) { $::settings->{ "audio_" . $::settings->{'audio_codec'} . "_options" } = $::widgets->{'audio_options_entry'}->get_text; set_bitrate(); } if ( $widget eq $::widgets->{'scale_width_spin'} || $widget eq $::widgets->{'scale_height_spin'} || $widget eq $::widgets->{'crop_width_spin'} || $widget eq $::widgets->{'crop_height_spin'} || $widget eq $::widgets->{'crop_horizontal_spin'} || $widget eq $::widgets->{'crop_vertical_spin'} ) { set_bpp(); } if ( $widget eq $::widgets->{'filename_entry'} ) { my $fullname = substitute_filename($value) . $::settings->{'mpegfile'}; my $directory = dirname($fullname); $::widgets->{'view_button'}->set_sensitive( -r $fullname ? 1 : 0 ); # Allow view if the file is readable. set_warning_text( $widget, -w $directory ? 0 : 1 ); message("No permission to write to output directory!") if -w $directory ? 0 : 1; on_filesize_changed(); } if ( $widget eq $::widgets->{'crop_width_spin'} ) { my $wo = get_track_param('width'); $::widgets->{'crop_horizontal_spin'}->set_adjustment( new Gtk2::Adjustment( 0, 0, $wo - $value, 1, 50, 200 ) ); set_bpp(); } if ( $widget eq $::widgets->{'crop_horizontal_spin'} ) { my $wo = get_track_param('width'); $::widgets->{'crop_width_spin'}->set_adjustment( new Gtk2::Adjustment( 0, 0, $wo - $value, 1, 50, 200 ) ); set_bpp(); } if ( $widget eq $::widgets->{'crop_height_spin'} ) { my $wo = get_track()->{'height'}; $::widgets->{'crop_vertical_spin'}->set_adjustment( new Gtk2::Adjustment( 0, 0, $wo - $value, 1, 50, 200 ) ); set_bpp(); } if ( $widget eq $::widgets->{'crop_vertical_spin'} ) { my $wo = get_track_param('height'); $::widgets->{'crop_height_spin'}->set_adjustment( new Gtk2::Adjustment( 0, 0, $wo - $value, 1, 50, 200 ) ); set_bpp(); } if ( $widget eq $::widgets->{'cache_directory_entry'} ) { set_warning_text( $widget, -w $value ? 0 : 1 ); } if ( $widget eq $::widgets->{'dvd_device_entry'} ) { set_warning_text( $widget, -r $value ? 0 : 1 ); } if ( $widget eq $::widgets->{'audio_gain_spin'} ) { } 1; } sub on_save_settings_button_clicked { message("Settings saved"); $::settings->save_settings; } sub on_restore_defaults_button_clicked { $::settings->restore_settings; load_settings_to_interface(); } sub progress_dialog_show { if ( $::widgets->{'cache_menc_vbox'}->parent == $::widgets->{'right_vbox'} ) { $::widgets->{'acidrip'}->hide; $::widgets->{'right_vbox'}->remove( $::widgets->{'cache_menc_vbox'} ); $::widgets->{'progress_vbox'}->add( $::widgets->{'cache_menc_vbox'} ); $::widgets->{'status_hbox'}->remove( $::widgets->{'status_bar'} ); $::widgets->{'progress_vbox'}->add( $::widgets->{'status_bar'} ); $::widgets->{'progress_dialog'}->show; } } sub progress_dialog_hide { if ( $::widgets->{'cache_menc_vbox'}->parent == $::widgets->{'progress_vbox'} ) { $::widgets->{'progress_dialog'}->hide; $::widgets->{'progress_vbox'}->remove( $::widgets->{'cache_menc_vbox'} ); $::widgets->{'right_vbox'}->pack_start( $::widgets->{'cache_menc_vbox'}, 0, 1, 0 ); $::widgets->{'progress_vbox'}->remove( $::widgets->{'status_bar'} ); $::widgets->{'status_hbox'}->add( $::widgets->{'status_bar'} ); $::widgets->{'acidrip'}->show; } } sub on_queue_clear_button_clicked { $::playlist->clear; rebuild_queue_text(); $::widgets->{'queue_export_button'}->set_sensitive( @{$::playlist} ? 1 : 0 ); $::widgets->{'queue_clear_button'}->set_sensitive( @{$::playlist} ? 1 : 0 ); } sub on_queue_export_button_clicked { if ( open( QUEUEFILE, '>', "$ENV{HOME}/acidrip.sh" ) ) { print QUEUEFILE "#!/bin/sh\necho \"***********************************************************\"\n" . "echo \"Automated script created by AcidRip - http://acidrip.sf.net\"\n" . "echo \"***********************************************************\"\n"; my $text = $::widgets->{'queue_text'}->get_buffer->get_text( $::widgets->{'queue_text'}->get_buffer->get_bounds, 0 ); $text =~ s/-v\s//g; print QUEUEFILE $text; close QUEUEFILE; chmod 0755, "$ENV{HOME}/acidrip.sh"; message("Queue exported to $ENV{HOME}/acidrip.sh"); } else { message("Error opening queue output file"); } } sub on_queue_button_clicked { push_playlist_queue(); rebuild_queue_text(); $::widgets->{'queue_export_button'}->set_sensitive( @{$::playlist} ? 1 : 0 ); $::widgets->{'queue_clear_button'}->set_sensitive( @{$::playlist} ? 1 : 0 ); } sub on_start_button_clicked { $::widgets->{'queue_button'}->clicked if !@{$::playlist}; my @cache_files = []; my $return = 0; $::widgets->{'cache_menc_vbox'}->show; $::widgets->{'stop_button'}->show; $::widgets->{'start_button'}->hide; $::widgets->{'preview_button'}->set_sensitive(0); $::widgets->{'progress_dialog_show_button'}->set_sensitive(1); progress_dialog_show if $::settings->{'compact'}; #Play contents of Playlist until ended or an error occurs message( "Playlist contains " . @{$::playlist} . " item(s)" ); $::settings->{'total_events'} = queued_encode_events(); while ( @{$::playlist} ) { $return = pop_playlist_queue(); last if $return; rebuild_queue_text(); } #Clear any dead items stuck on the playlist if ( @{$::playlist} ) { message( "Clearing " . @{$::playlist} . " remaining playlist items" ); $::widgets->{'queue_clear_button'}->clicked; } else { message("Playlist completed"); } progress_dialog_hide if $::settings->{'compact'}; $::widgets->{'stop_button'}->hide; $::widgets->{'start_button'}->show; $::widgets->{'preview_button'}->set_sensitive(1); $::widgets->{'progress_dialog_show_button'}->set_sensitive(0); $::widgets->{'acidrip'}->set_title(msg("acidrip")); $::widgets->{'progress_dialog'}->set_title(msg("acidrip")); message( $return ? ( ( $return >> 8 ) == 1 ? "Mencoder interrupted by user" : "Mencoder exited with an error code " . ( $return >> 8 ) ) : "Encoding finished, hope it worked..." ); $::settings->{'mencoder_pid'} = 0; $::settings->{'this_block'} = 0; set_bitrate(); } sub on_stop_button_clicked { my $confirm = Gtk2::MessageDialog->new( $::widgets->{'acidrip'}, [qw/modal destroy-with-parent/], 'question', 'yes-no', "Are you sure you want to stop the encoding process?" ); if ( $confirm->run eq 'yes' ) { kill_mplayer(); } $confirm->destroy; } sub on_stop_preview_button_clicked { kill_mplayer(); } sub on_mencoder_output_show_button_clicked { $::widgets->{'mencoder_output_frame'}->show_all; $::widgets->{'mencoder_output_show_button'}->hide; } sub on_mencoder_output_hide_button_clicked { $::widgets->{'mencoder_output_frame'}->hide; $::widgets->{'mencoder_output_show_button'}->show_all; $::widgets->{'status_hbox'}->show_all; } sub on_mencoder_output_save_button_clicked { if ( open( LOGFILE, '>', "$ENV{HOME}/acidrip.log" ) ) { print LOGFILE $::widgets->{'mencoder_output_text'}->get_buffer->get_text( $::widgets->{'mencoder_output_text'}->get_buffer->get_bounds, 0 ); close LOGFILE; message("Output log saved to $ENV{HOME}/acidrip.log"); } else { message("Error opening output file"); } } sub on_mencoder_output_saveall_button_clicked { $::widgets->{'mencoder_output_save_button'}->set_sensitive( !$::widgets->{'mencoder_output_saveall_button'}->get_active ); if ( $::widgets->{'mencoder_output_saveall_button'}->get_active ) { open( LOGFILE, '>', "$ENV{HOME}/acidrip.log" ); print LOGFILE $::widgets->{'mencoder_output_text'}->get_buffer->get_text( $::widgets->{'mencoder_output_text'}->get_buffer->get_bounds, 0 ); } else { close LOGFILE } } sub on_mencoder_output_clear_button_clicked { message("Log information cleared"); $::widgets->{'mencoder_output_text'}->get_buffer->delete( $::widgets->{'mencoder_output_text'}->get_buffer->get_bounds ); } sub on_view_button_clicked { #fork proofing open STDIN, '/dev/null' or message("Can't read /dev/null: $!. May fail if in background"); message("Playing back encoded track..."); my $mplayer_output; open( VIEW, get_command("view") . " 2>&1 |" ) || ( message("mplayer preview failed, is it installed?") ); while () { $mplayer_output .= $_; while ( Gtk2->events_pending() ) { Gtk2->main_iteration() } } message($mplayer_output); message("Playing back encoded track... Finished"); } sub on_read_dvd_button_clicked { my ( $button, $widgets ) = @_; my $model; my $dvd_tree = $::widgets->{'dvd_tree'}; message("Reading DVD / file(s)... please wait"); $model = Gtk2::TreeStore->new( 'Glib::String', 'Glib::String' ); $dvd_tree->set_model($model); my $ret; while ( Gtk2->events_pending() ) { Gtk2->main_iteration() } $ret = read_source( $::settings->{'dvd_device'} ); message( $::dvd->{'status'}, $ret ? "error" : "" ); if ( defined $::dvd->{'track'} ) { my $selection = $dvd_tree->get_selection; foreach my $this_track ( @{ $::dvd->{'track'} } ) { my $iter = $model->append(undef); my $ix = $this_track->{'ix'}; if ( $::dvd->{'source'} eq "dvd" ) { # DVD input $selection->set_mode('multiple'); $model->set( $iter, 0, $ix, 1, $ix . ": " . hhmmss( $this_track->{'length'} ) ); foreach my $this_chapter ( @{ $this_track->{'chapter'} } ) { $model->set( $model->append($iter), 0, $this_chapter->{'ix'}, 1, $this_chapter->{'ix'} . ": " . hhmmss( $this_chapter->{'length'} ) ); } } else { # File input $selection->set_mode('single'); $model->set( $iter, 0, $ix, 1, basename( $this_track->{'filename'} ) ); $model->set( $model->append($iter), 0, 0, 1, "V: " . $this_track->{'format'} . ' ' . $this_track->{'width'} . "x" . $this_track->{'height'} . ' ' . (defined $this_track->{'bitrate'} ? int( $this_track->{'bitrate'} * .001 ) : "??" ) . "kbps" . (defined $this_track->{'audio'}[0]{'format'} ? ( "\nA: " . $this_track->{'audio'}[0]{'format'} . ' ' . (defined $this_track->{'audio'}[0]{'bitrate'} ? int( $this_track->{'audio'}[0]{'bitrate'} * .001) : "??" ) . "kbps@" . (defined $this_track->{'audio'}[0]{'frequency'} ? $this_track->{'audio'}[0]{'frequency'} * .001 : "??") . "kHz " . (defined $this_track->{'audio'}[0]{'channels'} ? $this_track->{'audio'}[0]{'channels'} : "?") . "ch" ) : '')); } } my $cell = Gtk2::CellRendererText->new; my $column = Gtk2::TreeViewColumn->new_with_attributes( "content", $cell, 'text', 1 ); $dvd_tree->remove_column( $dvd_tree->get_column(0) ) if ( scalar $dvd_tree->get_columns() ); $dvd_tree->append_column($column); $selection->signal_connect( changed => \&on_select_track, $model ); my $path = Gtk2::TreePath->new_from_string( defined $::dvd->{'longest_track'} ? $::dvd->{'longest_track'} - 1 : 0 ); $selection->select_path($path); $dvd_tree->scroll_to_cell($path); $dvd_tree->show_all; $::widgets->{'total_blocks_spin'}->set_sensitive($::dvd->{'source'} eq "dvd"); $::widgets->{'total_blocks_label'}->set_sensitive($::dvd->{'source'} eq "dvd"); $::widgets->{'total_blocks_spin'}->set_value(1) if $::dvd->{'source'} ne "dvd"; if ( defined $::dvd->{'title'} ) { my $name = $::dvd->{'title'}; $name =~ tr/A-Z/a-z/; set_setting( 'title', $name ); } $::widgets->{'preview_button'}->set_sensitive(1); $::widgets->{'start_button'}->set_sensitive(1); $::widgets->{'queue_button'}->set_sensitive(1); } } 1; acidrip-0.14/AcidRip/logo.png0000644000076400001440000002147710017441207016334 0ustar chrisusers00000000000000PNG  IHDR1! pHYs  ~tIME ;'9VtEXtCommentCreated with The GIMPd%n IDATxwx\յ3uɖlIq`LC5p&@ .pg!Bù@ p  %&m\p/j3*3Gdig<ZkeO~8LAk(tޱ> 35Ȃ誟 )o 9.~ j`=|^$/5مz5l0VQh)Ro}Lv#v3Lg)70Dw\w쉾?uvCtwpv|vho;Ai$}A]#Ո=W{653廛'`< 5Wdg [ jpYjqv(  8'B1g``?p2"&:AqȟS43z~(Ʀn`j %ǁYf ̎ cj30kyo5Pi ;b5&X3mFtg>>'ݚlre ]yvp#"pJ_J[KD&݀$rʧX+B+π&=Q3僃5}@kRwi߯V\"6 \ IU_VAx .Is[`"MR|S=X'pCJ^ibeN』)Nǥ ы0PiٿibzIe87gT$}a"pBw4PmMuHР\|j3vAX iRTbMaxt#SD)P 0H4NBKl#5&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G4/%SrGdyNX< ҆UV~z9,u~:q{ORl/m#Mڦ#a;C*2i.i  5M:vŁS~\&_b3d2:;OL;Bmll񬓓Z.86fy\\, +"7ŽvmgFӽ,By-!y?~H#  n/$u.\CGѓ_ǴLl ˕䥂`(K1&`{b JŐ `[Zgw<y9l.Cn6\Ԋv7>L&K᪨[eC;0a0Їm z!cnUUU̘9Ӧ5Sgaqj,7]KyQĩ@\0 !j-*`MUkt3Jv8P罅:΀m{͈+nW(n{؇†8/7@6=lIDAT5ԉm-8@7X3Bǁ;4W_Fׂ бcj草^ >A>`st}߀mգmИ]vy^C DŽy^c쯠 GaഀmOItl[{΀m@/~kƪфgX3Do#tY Dv rգ`Oaf̀mIt;`iͿn BdDщA+It/`k @g(HS[c:lMAD[c')$׀Q 'Ex_. fb;U X ElBdNo`dTۺr f[A}99`7!#ԙ9+8E҅o044m?}9W-wSQ.{LG섵IENDB`acidrip-0.14/AcidRip/interface.pm0000644000076400001440000021025210100736420017150 0ustar chrisusers00000000000000use Gtk2; use Glib; init Gtk2; use File::Basename; sub get_widget_name ($) { my $widgets = shift; my $this_widget = shift; foreach ( keys %{$widgets} ) { return $_ if $widgets->{$_} == $this_widget; } return undef; } sub connect_signals ($$@) { my ( $widgets, $signal, $function, @data ) = @_; foreach (@data) { $widgets->{$_}->signal_connect( $signal, $function ); } } sub create_stock_buttons { my $factory = Gtk2::IconFactory->new; $factory->add_default; my $style = new Gtk2::Style; my @items = ( { stock_id => "ar_quit", label => msg("Quit"), icon => 'gtk-quit' }, { stock_id => "ar_start", label => msg("_Start"), icon => 'gtk-convert' }, { stock_id => "ar_load", label => msg("Load"), icon => 'gtk-refresh' }, { stock_id => "ar_compact", label => msg("Compact"), icon => 'gtk-goto-bottom' }, { stock_id => "ar_view", label => msg("View"), icon => 'gtk-yes' }, { stock_id => "ar_queue", label => msg("_Queue"), icon => 'gtk-add' }, { stock_id => "ar_preview", label => msg("Preview"), icon => 'gtk-zoom-in' }, { stock_id => "ar_debug", label => msg("Debug"), icon => 'gtk-go-down' }, { stock_id => "ar_clear", label => msg("Clear"), icon => 'gtk-clear' }, { stock_id => "ar_log_save", label => msg("Save"), icon => 'gtk-save' }, { stock_id => "ar_export", label => msg("Export"), icon => 'gtk-save' }, { stock_id => "ar_log_hide", label => msg("Hide"), icon => 'gtk-go-up' }, { stock_id => "ar_stop", label => msg("Stop"), icon => 'gtk-stop' } ); Gtk2::Stock->add(@items); foreach (@items) { $factory->add( $_->{'stock_id'}, $style->lookup_icon_set( $_->{'icon'} ) ); } } sub msg ($) { return $::messages->msg(shift); } sub new { my $class = shift; my $widgets; my $row_height = 4; create_stock_buttons(); # # Construct a GtkWindow 'acidrip' $widgets->{'acidrip'} = new Gtk2::Window; $widgets->{'acidrip'}->set_title(msg("acidrip")); $widgets->{'acidrip'}->set_resizable(0); $widgets->{'acidrip'}->realize; # # Construct a GtkVBox 'status_vbox' $widgets->{'status_vbox'} = new Gtk2::VBox( 0, 0 ); $widgets->{'acidrip'}->add( $widgets->{'status_vbox'} ); $widgets->{'status_vbox'}->show; $widgets->{'main_table'} = new Gtk2::Table( 10, 2, 0 ); $widgets->{'main_table'}->show; # Construct a GtkHBox 'main_hbox' $widgets->{'main_hbox'} = new Gtk2::HBox( 0, 0 ); $widgets->{'status_vbox'}->add( $widgets->{'main_hbox'} ); $widgets->{'main_hbox'}->show; # # Construct a GtkVBox 'left_vbox' $widgets->{'left_vbox'} = new Gtk2::VBox( 0, 0 ); $widgets->{'main_hbox'}->add( $widgets->{'left_vbox'} ); $widgets->{'left_vbox'}->show; # # Construct a GtkVBox 'notebook_vbox' $widgets->{'notebook_vbox'} = new Gtk2::VBox( 0, 0 ); $widgets->{'notebook_vbox'}->show; # # notebook $widgets->{'notebook'} = new Gtk2::Notebook(); $widgets->{'notebook'}->show; $widgets->{'notebook'}->set_border_width(2); $widgets->{'left_vbox'}->add( $widgets->{'notebook'} ); $widgets->{'notebook'}->append_page( $widgets->{'notebook_vbox'}, new Gtk2::Label(msg("General"))); ### GENERAL FRAME # Construct a GtkFrame 'general_frame' $widgets->{'general_frame'} = new Gtk2::Frame(msg('General')); $widgets->{'general_frame'}->set_shadow_type('etched_in'); $widgets->{'notebook_vbox'}->add( $widgets->{'general_frame'} ); $widgets->{'general_frame'}->show; $widgets->{'general_frame'}->set_border_width(2); # # Construct a GtkTable 'general_table' $widgets->{'general_table'} = new Gtk2::Table( 5, 4, 0 ); $widgets->{'general_frame'}->add( $widgets->{'general_table'} ); $widgets->{'general_table'}->set_row_spacings($row_height); $widgets->{'general_table'}->show; # # Construct a GtkLabel 'filename_label' $widgets->{'title_label'} = new Gtk2::Label(msg('Track title')); $widgets->{'general_table'}->attach( $widgets->{'title_label'}, 0, 1, 0, 1, ['fill'], [], 2, 2 ); $widgets->{'title_label'}->show; $widgets->{'title_label'}->set_alignment( 0, 0 ); # # Construct a GtkEntry 'filename' $widgets->{'title_entry'} = new Gtk2::Entry; $widgets->{'title_entry'}->show; $widgets->{'title_entry'}->set_size_request( 10, -1 ); $widgets->{'general_table'}->attach( $widgets->{'title_entry'}, 1, 5, 0, 1, ['fill'], [], 2, 2 ); # # Construct a GtkLabel 'filename_label' $widgets->{'filename_label'} = new Gtk2::Label(msg('Filename')); $widgets->{'general_table'}->attach( $widgets->{'filename_label'}, 0, 1, 1, 2, ['fill'], [], 2, 2 ); $widgets->{'filename_label'}->show; # # Construct a GtkEntry 'filename' $widgets->{'filename_entry'} = new Gtk2::Entry; $widgets->{'filename_entry'}->show; $widgets->{'filename_entry'}->set_size_request( 10, -1 ); $widgets->{'general_table'}->attach( $widgets->{'filename_entry'}, 1, 4, 1, 2, ['fill'], [], 2, 2 ); $widgets->{'mpegfile_option'} = new Gtk2::OptionMenu; $widgets->{'mpegfile_menu'} = new Gtk2::Menu; $widgets->{'mpegfile_option'}->set_menu( $widgets->{'mpegfile_menu'} ); $widgets->{'mpegfile_menu'}->append( new Gtk2::MenuItem(".avi") ); $widgets->{'mpegfile_menu'}->append( new Gtk2::MenuItem(".mpg") ); $widgets->{'mpegfile_option'}->set_history( $::settings->{'mpegfile'} ); $widgets->{'mpegfile_option'}->show_all; $widgets->{'general_table'}->attach( $widgets->{'mpegfile_option'}, 4, 5, 1, 2, ['fill'], [], 2, 2 ); # Construct a GtkLabel 'filesize_label' $widgets->{'filesize_label'} = new Gtk2::Label(msg('File size')); $widgets->{'general_table'}->attach( $widgets->{'filesize_label'}, 0, 1, 2, 3, ['fill'], [], 2, 2 ); $widgets->{'filesize_label'}->show; $widgets->{'filesize_label'}->set_alignment( 0, 0 ); # Construct a GtkCombo 'filesize_spin' $widgets->{'filesize_adjust'} = new Gtk2::Adjustment( 700, 1, 9999, 1, 50, 1 ); $widgets->{'filesize_spin'} = new Gtk2::SpinButton( $widgets->{'filesize_adjust'}, 1, 0 ); $widgets->{'filesize_spin'}->set_size_request( 50, -1 ); $widgets->{'general_table'}->attach( $widgets->{'filesize_spin'}, 1, 2, 2, 3, [ 'expand', 'fill' ], [], 2, 2 ); $widgets->{'filesize_spin'}->show; $widgets->{'filesize_entry'} = new Gtk2::Entry; $widgets->{'general_table'}->attach( $widgets->{'filesize_entry'}, 1, 2, 2, 3, [ 'expand', 'fill' ], [], 2, 2 ); $widgets->{'filesize_entry'}->set_size_request( 50, -1 ); $widgets->{'filesize_entry'}->set_editable(0); $widgets->{'total_blocks_label'} = new Gtk2::Label(msg("# Files")); $widgets->{'general_table'}->attach( $widgets->{'total_blocks_label'}, 2, 4, 2, 3, ['fill'], [], 2, 2 ); $widgets->{'total_blocks_label'}->show; $widgets->{'total_blocks_adjust'} = new Gtk2::Adjustment( 1, 1, 10, 1, 0, 1 ); $widgets->{'total_blocks_spin'} = new Gtk2::SpinButton( $widgets->{'total_blocks_adjust'}, 1, 0 ); $widgets->{'general_table'}->attach( $widgets->{'total_blocks_spin'}, 4, 5, 2, 3, ['fill'], [], 2, 2 ); $widgets->{'total_blocks_spin'}->show; $widgets->{'info_label'} = new Gtk2::Label(msg('Info')); $widgets->{'general_table'}->attach( $widgets->{'info_label'}, 0, 1, 3, 4, ['fill'], [], 2, 2 ); $widgets->{'info_label'}->set_alignment( 0, 0 ); $widgets->{'info_label'}->show; $widgets->{'info_field_option'} = new Gtk2::OptionMenu; $widgets->{'info_field_menu'} = new Gtk2::Menu; $widgets->{'info_field_option'}->set_menu( $widgets->{'info_field_menu'} ); $widgets->{'info_field_option'}->set_size_request( 40, -1 ); $widgets->{'general_table'}->attach( $widgets->{'info_field_option'}, 1, 2, 3, 4, ['fill'], [], 2, 2 ); foreach ( msg("name"), msg("artist"), msg("subject"), msg("genre"), msg("copyright") ) { my $item = new Gtk2::MenuItem($_); $item->signal_connect( "activate", \&on_info_field_select, $_ ); $widgets->{'info_field_menu'}->append($item); } $widgets->{'info_field_option'}->set_history(0); $widgets->{'info_field_option'}->show_all; $widgets->{'info_name_entry'} = new Gtk2::Entry; $widgets->{'general_table'}->attach( $widgets->{'info_name_entry'}, 2, 5, 3, 4, ['fill'], [], 2, 2 ); $widgets->{'info_name_entry'}->set_size_request( 40, -1 ); $widgets->{'info_name_entry'}->show; $widgets->{'info_artist_entry'} = new Gtk2::Entry; $widgets->{'general_table'}->attach( $widgets->{'info_artist_entry'}, 2, 5, 3, 4, ['fill'], [], 2, 2 ); $widgets->{'info_artist_entry'}->set_size_request( 40, -1 ); $widgets->{'info_subject_entry'} = new Gtk2::Entry; $widgets->{'general_table'}->attach( $widgets->{'info_subject_entry'}, 2, 5, 3, 4, ['fill'], [], 2, 2 ); $widgets->{'info_subject_entry'}->set_size_request( 40, -1 ); $widgets->{'info_genre_entry'} = new Gtk2::Entry; $widgets->{'general_table'}->attach( $widgets->{'info_genre_entry'}, 2, 5, 3, 4, ['fill'], [], 2, 2 ); $widgets->{'info_genre_entry'}->set_size_request( 40, -1 ); $widgets->{'info_copyright_entry'} = new Gtk2::Entry; $widgets->{'general_table'}->attach( $widgets->{'info_copyright_entry'}, 2, 5, 3, 4, ['fill'], [], 2, 2 ); $widgets->{'info_copyright_entry'}->set_size_request( 40, -1 ); $widgets->{'info_comment_entry'} = new Gtk2::Entry; $widgets->{'general_table'}->attach( $widgets->{'info_comment_entry'}, 2, 5, 3, 4, ['fill'], [], 2, 2 ); $widgets->{'info_comment_entry'}->set_size_request( 40, -1 ); $widgets->{'notebook_vbox'}->set_child_packing( $widgets->{'general_frame'}, 1, 1, 0, 'start' ); ### AUDIO FRAME # Construct a GtkFrame 'audio_frame' $widgets->{'audio_frame'} = new Gtk2::Frame(msg('Audio')); $widgets->{'audio_frame'}->set_shadow_type('etched_in'); $widgets->{'notebook_vbox'}->add( $widgets->{'audio_frame'} ); $widgets->{'audio_frame'}->show; $widgets->{'audio_frame'}->set_border_width(2); # # Construct a GtkTable 'audio_table' $widgets->{'audio_table'} = new Gtk2::Table( 3, 5, 0 ); $widgets->{'audio_frame'}->add( $widgets->{'audio_table'} ); $widgets->{'audio_table'}->set_row_spacings($row_height); $widgets->{'audio_table'}->show; # # Construct a GtkLabel 'language_label' $widgets->{'audio_track_label'} = new Gtk2::Label(msg('Language')); $widgets->{'audio_table'}->attach( $widgets->{'audio_track_label'}, 0, 1, 0, 1, ['fill'], [], 2, 2 ); $widgets->{'audio_track_label'}->show; $widgets->{'audio_track_label'}->set_alignment( 0, 0.5 ); # # Construct a GtkCombo 'language_combo' $widgets->{'audio_track_option'} = new Gtk2::OptionMenu; $widgets->{'audio_track_menu'} = new Gtk2::Menu; $widgets->{'audio_track_option'}->set_menu( $widgets->{'audio_track_menu'} ); $widgets->{'audio_track_menu'}->append( Gtk2::MenuItem->new(" $::settings->{'language'}") ); $widgets->{'audio_table'}->attach( $widgets->{'audio_track_option'}, 1, 5, 0, 1, [ 'expand', 'fill' ], [], 2, 2 ); $widgets->{'audio_track_option'}->show_all; $widgets->{'audio_track_option'}->set_history(0); # # Construct a GtkLabel 'audio_options_label' $widgets->{'audio_options_label'} = new Gtk2::Label(msg('Options')); $widgets->{'audio_table'}->attach( $widgets->{'audio_options_label'}, 0, 1, 2, 3, ['fill'], [], 2, 2 ); $widgets->{'audio_options_label'}->show; $widgets->{'audio_options_label'}->set_alignment( 0, 0.5 ); $widgets->{'audio_options_entry'} = new Gtk2::Entry; $widgets->{'audio_table'}->attach( $widgets->{'audio_options_entry'}, 1, 5, 2, 3, ['fill'], [], 2, 2 ); $widgets->{'audio_options_entry'}->show; $widgets->{'audio_options_entry'}->set_size_request( 50, -1 ); # Construct a GtkLabel 'audio_codec_label' $widgets->{'audio_codec_label'} = new Gtk2::Label(msg('Codec')); $widgets->{'audio_table'}->attach( $widgets->{'audio_codec_label'}, 0, 1, 1, 2, ['fill'], [], 2, 2 ); $widgets->{'audio_codec_label'}->show; $widgets->{'audio_codec_label'}->set_alignment( 0, 0.5 ); # # Construct a GtkCombo 'audio_codec_option' $widgets->{'audio_codec_option'} = new Gtk2::OptionMenu; $widgets->{'audio_codec_menu'} = new Gtk2::Menu; $widgets->{'audio_codec_option'}->set_menu( $widgets->{'audio_codec_menu'} ); $widgets->{'audio_table'}->attach( $widgets->{'audio_codec_option'}, 1, 3, 1, 2, [ 'expand', 'fill' ], [], 2, 2 ); $widgets->{'audio_codec_option'}->show_all; $widgets->{'left_vbox'}->set_child_packing( $widgets->{'audio_frame'}, 1, 1, 0, 'start' ); # Construct a GtkCombo 'audio_codec_option' $widgets->{'audio_gain_label'} = new Gtk2::Label(msg("Gain")); $widgets->{'audio_table'}->attach( $widgets->{'audio_gain_label'}, 3, 4, 1, 2, [ 'expand', 'fill' ], [], 2, 2 ); $widgets->{'audio_gain_label'}->show; $widgets->{'audio_gain_adjust'} = new Gtk2::Adjustment( 0, -200, 40, 1, 5, 1 ); $widgets->{'audio_gain_spin'} = new Gtk2::SpinButton( $widgets->{'audio_gain_adjust'}, 1, 0 ); #$widgets->{'audio_gain_spin'}->set_size_request(40, -1); $widgets->{'audio_table'}->attach( $widgets->{'audio_gain_spin'}, 4, 5, 1, 2, [ 'expand', 'fill' ], [], 2, 2 ); $widgets->{'audio_gain_spin'}->show; $widgets->{'mp3_type_label'} = new Gtk2::Label(msg("Type")); #$widgets->{'mp3_type_label'}->show; $widgets->{'audio_table'}->attach( $widgets->{'mp3_type_label'}, 3, 4, 1, 2, ['fill'], [], 2, 2 ); $widgets->{'mp3_type_label'}->set_alignment( 0, 0.5 ); $widgets->{'mp3_type_combo'} = new Gtk2::Combo; $widgets->{'audio_table'}->attach( $widgets->{'mp3_type_combo'}, 4, 5, 1, 2, ['fill'], [], 2, 2 ); $widgets->{'mp3_type_combo'}->set_popdown_strings( 'abr', 'cbr', 'vbr' ); #$widgets->{'mp3_type_combo'}->show; $widgets->{'mp3_type_combo'}->set_size_request( 50, -1 ); $widgets->{'mp3_bitrate_label'} = new Gtk2::Label(msg("Bitrate")); #$widgets->{'mp3_bitrate_label'}->show; $widgets->{'audio_table'}->attach( $widgets->{'mp3_bitrate_label'}, 3, 4, 2, 3, ['fill'], [], 2, 2 ); $widgets->{'mp3_bitrate_label'}->set_alignment( 0, 0.5 ); $widgets->{'mp3_bitrate_entry'} = new Gtk2::Entry; #$widgets->{'mp3_bitrate_entry'}->show; $widgets->{'audio_table'}->attach( $widgets->{'mp3_bitrate_entry'}, 4, 5, 2, 3, ['fill'], [], 2, 2 ); $widgets->{'mp3_bitrate_entry'}->set_size_request( 50, -1 ); $widgets->{'mp3_quality_label'} = new Gtk2::Label(msg("Quality")); #$widgets->{'mp3_quality_label'}->show; $widgets->{'audio_table'}->attach( $widgets->{'mp3_quality_label'}, 3, 4, 2, 3, ['fill'], [], 2, 2 ); $widgets->{'mp3_quality_label'}->set_alignment( 0, 0.5 ); $widgets->{'mp3_quality_entry'} = new Gtk2::Entry; #$widgets->{'mp3_quality_entry'}->show; $widgets->{'audio_table'}->attach( $widgets->{'mp3_quality_entry'}, 4, 5, 2, 3, ['fill'], [], 2, 2 ); $widgets->{'mp3_quality_entry'}->set_size_request( 50, -1 ); ### SUBTITLES $widgets->{'misc_table'} = new Gtk2::Table( 4, 2, 0 ); $widgets->{'misc_table'}->show; $widgets->{'misc_table'}->set_row_spacings($row_height); $widgets->{'misc_frame'} = new Gtk2::Frame(msg("Other stuff")); $widgets->{'misc_frame'}->add( $widgets->{'misc_table'} ); $widgets->{'notebook_vbox'}->add( $widgets->{'misc_frame'} ); $widgets->{'misc_frame'}->show; $widgets->{'misc_frame'}->set_border_width(2); $widgets->{'subp_label'} = new Gtk2::Label(msg('Subtitle')); $widgets->{'subp_label'}->show; $widgets->{'misc_table'}->attach( $widgets->{'subp_label'}, 0, 1, 0, 1, ['fill'], [], 4, 2 ); $widgets->{'subp_option'} = new Gtk2::OptionMenu; $widgets->{'subp_menu'} = new Gtk2::Menu; $widgets->{'subp_option'}->set_menu( $widgets->{'subp_menu'} ); $widgets->{'subp_menu'}->append( Gtk2::MenuItem->new(msg(""))); $widgets->{'subp_option'}->show; $widgets->{'subp_option'}->set_history(0); $widgets->{'misc_table'}->attach( $widgets->{'subp_option'}, 1, 2, 0, 1, [ 'fill', 'expand' ], [], 2, 2 ); $widgets->{'vobsubout_check'} = new Gtk2::CheckButton(msg('Sub File')); $widgets->{'vobsubout_check'}->show; $widgets->{'misc_table'}->attach( $widgets->{'vobsubout_check'}, 2, 3, 0, 1, ['fill'], [], 2, 2 ); $widgets->{'more_options_entry'} = new Gtk2::Entry; $widgets->{'more_options_entry'}->show; $widgets->{'more_options_label'} = new Gtk2::Label(msg("Misc.")); $widgets->{'more_options_label'}->set_alignment( 0, 0.5 ); $widgets->{'more_options_label'}->show; $widgets->{'misc_table'}->attach( $widgets->{'more_options_label'}, 0, 1, 1, 2, ['fill'], [], 4, 2 ); $widgets->{'misc_table'}->attach( $widgets->{'more_options_entry'}, 1, 4, 1, 2, [ 'fill', 'expand' ], [], 2, 2 ); ### VIDEO # Construct a GtkFrame 'video_frame' $widgets->{'video_frame'} = new Gtk2::Frame(msg('Video')); $widgets->{'notebook'}->append_page( $widgets->{'video_frame'}, new Gtk2::Label(msg("Video"))); $widgets->{'video_frame'}->show; $widgets->{'video_frame'}->set_border_width(2); # Construct a GtkTable 'video_table' $widgets->{'video_table'} = new Gtk2::Table( 10, 5, 0 ); $widgets->{'video_table'}->set_row_spacings($row_height); $widgets->{'video_frame'}->add( $widgets->{'video_table'} ); $widgets->{'video_table'}->show; $widgets->{'video_crop_seperator'} = new Gtk2::HSeparator; $widgets->{'video_crop_seperator'}->show; $widgets->{'video_table'}->attach( $widgets->{'video_crop_seperator'}, 0, 5, 3, 4, ['fill'], ['expand'], 2, 2 ); # Construct a GtkCheckButton 'crop_enable_check' $widgets->{'crop_enable_check'} = new Gtk2::CheckButton(msg("Crop")); $widgets->{'video_table'}->attach( $widgets->{'crop_enable_check'}, 0, 1, 4, 5, ['fill'], ['expand'], 2, 2 ); $widgets->{'crop_enable_check'}->set_active(1); $widgets->{'crop_enable_check'}->show; # Construct a GtkEntry 'crop_vertical_entry' $widgets->{'crop_vertical_adjust'} = new Gtk2::Adjustment( 0, 0, 720, 1, 50, 200 ); $widgets->{'crop_vertical_spin'} = new Gtk2::SpinButton( $widgets->{'crop_vertical_adjust'}, 1, 0 ); $widgets->{'video_table'}->attach( $widgets->{'crop_vertical_spin'}, 4, 5, 5, 6, [ 'expand', 'fill' ], ['expand'], 2, 2 ); $widgets->{'crop_vertical_spin'}->show; $widgets->{'crop_vertical_spin'}->set_size_request( 40, -1 ); # Construct a GtkEntry 'crop_horizontal_entry' $widgets->{'crop_horizontal_adjust'} = new Gtk2::Adjustment( 0, 0, 576, 1, 50, 200 ); $widgets->{'crop_horizontal_spin'} = new Gtk2::SpinButton( $widgets->{'crop_horizontal_adjust'}, 1, 0 ); $widgets->{'video_table'}->attach( $widgets->{'crop_horizontal_spin'}, 4, 5, 4, 5, [ 'expand', 'fill' ], ['expand'], 2, 2 ); $widgets->{'crop_horizontal_spin'}->show; $widgets->{'crop_horizontal_spin'}->set_size_request( 40, -1 ); # Construct a GtkEntry 'crop_width_entry' $widgets->{'crop_width_adjust'} = new Gtk2::Adjustment( 0, 0, 1000, 1, 50, 200 ); $widgets->{'crop_width_spin'} = new Gtk2::SpinButton( $widgets->{'crop_width_adjust'}, 1, 0 ); $widgets->{'video_table'}->attach( $widgets->{'crop_width_spin'}, 2, 3, 4, 5, [ 'expand', 'fill' ], ['expand'], 2, 2 ); $widgets->{'crop_width_spin'}->show; $widgets->{'crop_width_spin'}->set_size_request( 40, -1 ); # Construct a GtkEntry 'crop_height_entry' $widgets->{'crop_height_adjust'} = new Gtk2::Adjustment( 0, 0, 1000, 1, 50, 200 ); $widgets->{'crop_height_spin'} = new Gtk2::SpinButton( $widgets->{'crop_height_adjust'}, 1, 0 ); $widgets->{'video_table'}->attach( $widgets->{'crop_height_spin'}, 2, 3, 5, 6, [ 'expand', 'fill' ], ['expand'], 2, 2 ); $widgets->{'crop_height_spin'}->show; $widgets->{'crop_height_spin'}->set_size_request( 40, -1 ); # Construct a GtkLabel 'crop_vertical_label' $widgets->{'crop_vertical_label'} = new Gtk2::Label(msg('Vert')); $widgets->{'video_table'}->attach( $widgets->{'crop_vertical_label'}, 3, 4, 5, 6, ['fill'], ['expand'], 2, 2 ); $widgets->{'crop_vertical_label'}->show; # Construct a GtkLabel 'crop_horizontal_label' $widgets->{'crop_horizontal_label'} = new Gtk2::Label(msg('Horiz')); $widgets->{'video_table'}->attach( $widgets->{'crop_horizontal_label'}, 3, 4, 4, 5, ['fill'], ['expand'], 2, 2 ); $widgets->{'crop_horizontal_label'}->show; # Construct a GtkLabel 'crop_width_label' $widgets->{'crop_width_label'} = new Gtk2::Label(msg('Width')); $widgets->{'video_table'}->attach( $widgets->{'crop_width_label'}, 1, 2, 4, 5, ['fill'], ['expand'], 2, 2 ); $widgets->{'crop_width_label'}->show; # Construct a GtkLabel 'crop_height_label' $widgets->{'crop_height_label'} = new Gtk2::Label(msg('Height')); $widgets->{'video_table'}->attach( $widgets->{'crop_height_label'}, 1, 2, 5, 6, ['fill'], ['expand'], 2, 2 ); $widgets->{'crop_height_label'}->show; # Construct a GtkButton 'crop_detect_button' $widgets->{'crop_detect_button'} = new Gtk2::Button(msg('Detect')); $widgets->{'video_table'}->attach( $widgets->{'crop_detect_button'}, 0, 1, 5, 6, ['fill'], ['expand'], 2, 2 ); $widgets->{'crop_detect_button'}->show; $widgets->{'video_scale_seperator'} = new Gtk2::HSeparator; $widgets->{'video_scale_seperator'}->show; $widgets->{'video_table'}->attach( $widgets->{'video_scale_seperator'}, 0, 5, 6, 7, ['fill'], ['expand'], 2, 2 ); # Construct a GtkCheckButton 'scale_enable_check' $widgets->{'scale_enable_check'} = new Gtk2::CheckButton(msg('Scale')); $widgets->{'video_table'}->attach( $widgets->{'scale_enable_check'}, 0, 1, 7, 8, ['fill'], ['expand'], 2, 2 ); $widgets->{'scale_enable_check'}->set_active(1); $widgets->{'scale_enable_check'}->show; # Construct a GtkLabel 'scale_width_label' $widgets->{'scale_width_label'} = new Gtk2::Label(msg('Width')); $widgets->{'video_table'}->attach( $widgets->{'scale_width_label'}, 1, 2, 7, 8, ['fill'], ['expand'], 2, 2 ); $widgets->{'scale_width_label'}->show; # # Construct a GtkLabel 'scale_height_label' $widgets->{'scale_lock_check'} = new Gtk2::CheckButton(msg('Lock aspect')); $widgets->{'video_table'}->attach( $widgets->{'scale_lock_check'}, 3, 5, 7, 8, ['fill'], ['expand'], 2, 2 ); $widgets->{'scale_lock_check'}->set_relief('none'); $widgets->{'scale_lock_check'}->show; $widgets->{'scale_lock_check'}->set_active(1); $widgets->{'scale_height_label'} = new Gtk2::Label(msg('Height')); $widgets->{'video_table'}->attach( $widgets->{'scale_height_label'}, 1, 2, 8, 9, ['fill'], ['expand'], 2, 2 ); $widgets->{'scale_height_label'}->show; # # Construct a GtkEntry 'scale_width_entry' $widgets->{'scale_width_adjust'} = new Gtk2::Adjustment( 1, -2, 1000, 1, 50, 200 ); $widgets->{'scale_width_spin'} = new Gtk2::SpinButton( $widgets->{'scale_width_adjust'}, 1, 0 ); $widgets->{'video_table'}->attach( $widgets->{'scale_width_spin'}, 2, 3, 7, 8, [ 'expand', 'fill' ], ['expand'], 2, 2 ); $widgets->{'scale_width_spin'}->show; $widgets->{'scale_width_spin'}->set_size_request( 50, -1 ); # # Construct a GtkEntry 'scale_height_entry' $widgets->{'scale_height_adjust'} = new Gtk2::Adjustment( 123, -2, 1000, 1, 50, 200 ); $widgets->{'scale_height_spin'} = new Gtk2::SpinButton( $widgets->{'scale_height_adjust'}, 1, 0 ); $widgets->{'video_table'}->attach( $widgets->{'scale_height_spin'}, 2, 3, 8, 9, [ 'expand', 'fill' ], ['expand'], 2, 2 ); $widgets->{'scale_height_spin'}->hide; $widgets->{'scale_height_spin'}->set_size_request( 50, -1 ); $widgets->{'scale_height_estimate_entry'} = new Gtk2::Entry; $widgets->{'scale_height_estimate_entry'}->set_text("0"); $widgets->{'video_table'}->attach( $widgets->{'scale_height_estimate_entry'}, 2, 3, 8, 9, [ 'expand', 'fill' ], ['expand'], 2, 2 ); $widgets->{'scale_height_estimate_entry'}->set_editable(0); $widgets->{'scale_height_estimate_entry'}->show; $widgets->{'scale_height_estimate_entry'}->set_size_request( 50, -1 ); $widgets->{'video_filters_seperator'} = new Gtk2::HSeparator; $widgets->{'video_filters_seperator'}->show; $widgets->{'video_table'}->attach( $widgets->{'video_filters_seperator'}, 0, 5, 9, 10, ['fill'], ['expand'], 2, 2 ); $widgets->{'vf_pre_enable_check'} = new Gtk2::CheckButton(msg("Pre filters")); $widgets->{'video_table'}->attach( $widgets->{'vf_pre_enable_check'}, 0, 2, 10, 11, [ 'expand', 'fill' ], ['expand'], 2, 2 ); $widgets->{'vf_pre_enable_check'}->set_active(1); $widgets->{'vf_pre_enable_check'}->show; $widgets->{'vf_pre_entry'} = new Gtk2::Entry; $widgets->{'vf_pre_entry'}->set_size_request( 40, -1 ); $widgets->{'video_table'}->attach( $widgets->{'vf_pre_entry'}, 2, 5, 10, 11, [ 'expand', 'fill' ], ['expand'], 2, 2 ); $widgets->{'vf_pre_entry'}->show; $widgets->{'vf_post_enable_check'} = new Gtk2::CheckButton(msg("Post filters")); $widgets->{'video_table'}->attach( $widgets->{'vf_post_enable_check'}, 0, 2, 11, 12, [ 'expand', 'fill' ], ['expand'], 2, 2 ); $widgets->{'vf_post_enable_check'}->set_active(1); $widgets->{'vf_post_enable_check'}->show; $widgets->{'vf_post_entry'} = new Gtk2::Entry; $widgets->{'video_table'}->attach( $widgets->{'vf_post_entry'}, 2, 5, 11, 12, [ 'expand', 'fill' ], ['expand'], 2, 2 ); $widgets->{'vf_post_entry'}->show; $widgets->{'vf_post_entry'}->set_size_request( 40, -1 ); # Construct a GtkLabel 'codec_label' $widgets->{'codec_label'} = new Gtk2::Label(msg('Codec')); $widgets->{'video_table'}->attach( $widgets->{'codec_label'}, 0, 1, 0, 1, ['fill'], ['expand'], 2, 2 ); $widgets->{'codec_label'}->show; $widgets->{'codec_label'}->set_alignment( 0, 0.5 ); # # Construct a GtkCombo 'codec_combo' $widgets->{'video_codec_option'} = new Gtk2::OptionMenu; $widgets->{'video_codec_menu'} = new Gtk2::Menu; $widgets->{'video_codec_option'}->set_menu( $widgets->{'video_codec_menu'} ); $widgets->{'video_table'}->attach( $widgets->{'video_codec_option'}, 1, 3, 0, 1, [ 'expand', 'fill' ], ['expand'], 2, 2 ); $widgets->{'video_codec_option'}->show; $widgets->{'video_codec_option'}->set_size_request( 40, -1 ); # # Construct a GtkLabel 'lavc_label' $widgets->{'video_options_label'} = new Gtk2::Label(msg('Options')); $widgets->{'video_table'}->attach( $widgets->{'video_options_label'}, 0, 1, 1, 2, ['fill'], ['expand'], 2, 2 ); $widgets->{'video_options_label'}->show; $widgets->{'video_options_label'}->set_alignment( 0, 0.5 ); # # Construct a GtkEntry 'codec_options_entry' $widgets->{'video_options_entry'} = new Gtk2::Entry; $widgets->{'video_table'}->attach( $widgets->{'video_options_entry'}, 1, 5, 1, 2, [ 'expand', 'fill' ], ['expand'], 2, 2 ); $widgets->{'video_options_entry'}->show; $widgets->{'video_bitrate_label'} = new Gtk2::Label(msg('Bitrate')); $widgets->{'video_bitrate_label'}->show; $widgets->{'video_bitrate_label'}->set_alignment( 0, 0.5 ); $widgets->{'video_table'}->attach( $widgets->{'video_bitrate_label'}, 0, 1, 2, 3, ['fill'], ['expand'], 2, 2 ); $widgets->{'video_bitrate_entry'} = new Gtk2::Entry; $widgets->{'video_bitrate_entry'}->set_editable(0); $widgets->{'video_bitrate_entry'}->set_size_request( 50, -1 ); $widgets->{'video_table'}->attach( $widgets->{'video_bitrate_entry'}, 1, 2, 2, 3, ['fill'], ['expand'], 2, 2 ); $widgets->{'video_bitrate_entry'}->show; $widgets->{'video_bitrate_adjust'} = new Gtk2::Adjustment( 1, 1, 5000, 1, 50, 1 ); $widgets->{'video_bitrate_spin'} = new Gtk2::SpinButton( $widgets->{'video_bitrate_adjust'}, 1, 0 ); $widgets->{'video_table'}->attach( $widgets->{'video_bitrate_spin'}, 1, 2, 2, 3, ['fill'], ['expand'], 2, 2 ); #$widgets->{'video_bitrate_spin'}->show; $widgets->{'video_bitrate_spin'}->set_size_request( 50, -1 ); $widgets->{'video_bitrate_lock_check'} = new Gtk2::CheckButton(msg('Lock')); $widgets->{'video_bitrate_lock_check'}->show; $widgets->{'video_table'}->attach( $widgets->{'video_bitrate_lock_check'}, 2, 3, 2, 3, ['fill'], ['expand'], 2, 2 ); $widgets->{'video_passes_adjust'} = new Gtk2::Adjustment( 1, 1, 3, 1, 1, 1 ); $widgets->{'video_passes_spin'} = new Gtk2::SpinButton( $widgets->{'video_passes_adjust'}, 1, 0 ); $widgets->{'video_passes_spin'}->show; $widgets->{'video_passes_label'} = new Gtk2::Label(msg("Passes")); $widgets->{'video_passes_label'}->show; $widgets->{'video_table'}->attach( $widgets->{'video_passes_label'}, 3, 4, 0, 1, ['fill'], ['expand'], 2, 2 ); $widgets->{'video_table'}->attach( $widgets->{'video_passes_spin'}, 4, 5, 0, 1, ['fill'], ['expand'], 2, 2 ); $widgets->{'video_bpp_label'} = new Gtk2::Label(msg("Bits/Px")); $widgets->{'video_bpp_label'}->show; $widgets->{'video_bpp_entry'} = new Gtk2::Entry; $widgets->{'video_bpp_entry'}->show; $widgets->{'video_bpp_entry'}->set_editable(0); $widgets->{'video_bpp_entry'}->set_size_request( 40, -1 ); $widgets->{'video_table'}->attach( $widgets->{'video_bpp_label'}, 3, 4, 2, 3, ['fill'], ['expand'], 2, 2 ); $widgets->{'video_table'}->attach( $widgets->{'video_bpp_entry'}, 4, 5, 2, 3, ['fill'], ['expand'], 2, 2 ); # Construct a GtkVBox 'right_vbox' $widgets->{'right_vbox'} = new Gtk2::VBox( 0, 0 ); $widgets->{'main_hbox'}->add( $widgets->{'right_vbox'} ); $widgets->{'right_vbox'}->show; ### right hand notebook #$widgets->{'right_notebook'} = new Gtk2::Notebook(); #$widgets->{'right_notebook'}->show; #$widgets->{'right_notebook'}->set_border_width(2); #$widgets->{'right_vbox'}->add($widgets->{'right_notebook'}); ### DVD TREE # Construct a GtkFrame 'dvd_tree_frame' $widgets->{'dvd_tree_frame'} = new Gtk2::Frame(msg('Video source')); #$widgets->{'dvd_tree_frame'}->set_label_align(0, 0); $widgets->{'right_vbox'}->add( $widgets->{'dvd_tree_frame'} ); #$widgets->{'right_notebook'}->append_page($widgets->{'dvd_tree_frame'}, new Gtk2::Label("DVD")); $widgets->{'dvd_tree_frame'}->show; $widgets->{'dvd_tree_frame'}->set_border_width(2); # # Construct a GtkVBox 'dvd_tree_vbox' $widgets->{'dvd_tree_vbox'} = new Gtk2::VBox( 0, 0 ); $widgets->{'dvd_tree_frame'}->add( $widgets->{'dvd_tree_vbox'} ); $widgets->{'dvd_tree_vbox'}->show; # # Construct a GtkHBox 'dvd_device_hbox' $widgets->{'dvd_device_hbox'} = new Gtk2::HBox( 0, 0 ); $widgets->{'dvd_tree_vbox'}->add( $widgets->{'dvd_device_hbox'} ); $widgets->{'dvd_device_hbox'}->show; # # Construct a GtkLabel 'dvd_device' $widgets->{'dvd_device_label'} = new Gtk2::Label(msg('Path')); $widgets->{'dvd_device_hbox'}->add( $widgets->{'dvd_device_label'} ); $widgets->{'dvd_device_label'}->show; $widgets->{'dvd_device_label'}->set_alignment( 0.5, 0.5 ); $widgets->{'dvd_device_label'}->set_padding( 2, 2 ); $widgets->{'dvd_device_hbox'}->set_child_packing( $widgets->{'dvd_device_label'}, 0, 0, 0, 'start' ); # # Construct a GtkEntry 'dvd_device_entry' $widgets->{'dvd_device_entry'} = new Gtk2::Entry; $widgets->{'dvd_device_hbox'}->add( $widgets->{'dvd_device_entry'} ); $widgets->{'dvd_device_entry'}->show; $widgets->{'dvd_device_entry'}->set_size_request( 100, -1 ); $widgets->{'dvd_device_hbox'}->set_child_packing( $widgets->{'dvd_device_entry'}, 1, 1, 0, 'start' ); # # Construct a GtkButton 'read_dvd_button' $widgets->{'read_dvd_button'} = Gtk2::Button->new_from_stock('ar_load'); $widgets->{'dvd_device_hbox'}->add( $widgets->{'read_dvd_button'} ); $widgets->{'read_dvd_button'}->show; $widgets->{'read_dvd_button'}->set_border_width(2); $widgets->{'dvd_device_hbox'}->set_child_packing( $widgets->{'read_dvd_button'}, 1, 1, 0, 'start' ); $widgets->{'dvd_tree_vbox'}->set_child_packing( $widgets->{'dvd_device_hbox'}, 0, 0, 0, 'start' ); # # Construct a GtkScrolledWindow 'tree_scroll_window' $widgets->{'tree_scroll_window'} = new Gtk2::ScrolledWindow( undef, undef ); $widgets->{'tree_scroll_window'}->set_policy( 'automatic', 'always' ); $widgets->{'tree_scroll_window'}->set_border_width(2); $widgets->{'tree_scroll_window'}->set_shadow_type('in'); $widgets->{'dvd_tree_vbox'}->add( $widgets->{'tree_scroll_window'} ); $widgets->{'tree_scroll_window'}->show; # # Construct a GtkTree 'dvd_tree' $widgets->{'dvd_tree'} = new Gtk2::TreeView; $widgets->{'dvd_tree'}->set_headers_visible(0); $widgets->{'tree_scroll_window'}->add( $widgets->{'dvd_tree'} ); $widgets->{'dvd_tree'}->show; $widgets->{'dvd_tree'}->set_size_request( 200, 0 ); $widgets->{'dvd_tree_vbox'}->set_child_packing( $widgets->{'tree_scroll_window'}, 1, 1, 0, 'start' ); $widgets->{'right_vbox'}->set_child_packing( $widgets->{'dvd_tree_frame'}, 1, 1, 0, 'start' ); $widgets->{'selected_track_label'} = new Gtk2::Label(msg("No track selected")); $widgets->{'dvd_tree_vbox'}->pack_end( $widgets->{'selected_track_label'}, 0, 1, 2 ); $widgets->{'selected_track_label'}->show; $widgets->{'selected_track_label'}->set_alignment( 0, 0 ); ### CACHE VBOX $widgets->{'cache_menc_vbox'} = new Gtk2::VBox(); $widgets->{'right_vbox'}->pack_start( $widgets->{'cache_menc_vbox'}, 0, 0, 0 ); $widgets->{'cache_menc_vbox'}->show; ### CACHE FRAME # Construct a GtkFrame 'cache_frame' $widgets->{'cache_frame'} = new Gtk2::Frame(msg('Cache status')); $widgets->{'cache_menc_vbox'}->pack_start( $widgets->{'cache_frame'}, 0, 0, 2 ); $widgets->{'cache_frame'}->show; $widgets->{'cache_frame'}->set_border_width(2); # # Construct a GtkTable 'mencoder_table' $widgets->{'cache_table'} = new Gtk2::Table( 1, 4, 1 ); $widgets->{'cache_frame'}->add( $widgets->{'cache_table'} ); $widgets->{'cache_table'}->show; $widgets->{'cache_chapter_label'} = new Gtk2::Label(msg('Chapter:')); $widgets->{'cache_chapter_label'}->show; $widgets->{'cache_chapter_label'}->set_alignment( 0, 0.5 ); $widgets->{'cache_table'}->attach( $widgets->{'cache_chapter_label'}, 0, 1, 0, 1, ['fill'], [], 2, 2 ); $widgets->{'cache_chapter'} = new Gtk2::Label("0 (0/0)"); $widgets->{'cache_chapter'}->show; $widgets->{'cache_table'}->attach( $widgets->{'cache_chapter'}, 1, 2, 0, 1, [ 'fill', 'expand' ], [], 2, 2 ); $widgets->{'cache_size_label'} = new Gtk2::Label(msg("Size:")); $widgets->{'cache_size_label'}->show; $widgets->{'cache_size_label'}->set_alignment( 0, 0.5 ); $widgets->{'cache_table'}->attach( $widgets->{'cache_size_label'}, 2, 3, 0, 1, [ 'fill', 'expand' ], [], 2, 2 ); $widgets->{'cache_size'} = new Gtk2::Label("0mb"); $widgets->{'cache_size'}->show; $widgets->{'cache_table'}->attach( $widgets->{'cache_size'}, 3, 4, 0, 1, [ 'fill', 'expand' ], [], 2, 2 ); ### MENCODER FRAME # Construct a GtkFrame 'menc_frame' $widgets->{'menc_frame'} = new Gtk2::Frame(msg('Encoding status')); $widgets->{'cache_menc_vbox'}->add( $widgets->{'menc_frame'} ); #$widgets->{'main_table'}->attach($widgets->{'menc_frame'}, 1, 2, 4, 6, ['fill'], ['fill'], 2, 2); $widgets->{'menc_frame'}->show; $widgets->{'menc_frame'}->set_border_width(2); # # Construct a GtkTable 'mencoder_table' $widgets->{'mencoder_table'} = new Gtk2::Table( 6, 2, 0 ); $widgets->{'menc_frame'}->add( $widgets->{'mencoder_table'} ); $widgets->{'mencoder_table'}->show; # # Construct a GtkLabel 'menc_fps_label' $widgets->{'menc_fps_label'} = new Gtk2::Label(msg('Encoding speed:')); $widgets->{'mencoder_table'}->attach( $widgets->{'menc_fps_label'}, 0, 1, 1, 2, ['fill'], [], 2, 1 ); $widgets->{'menc_fps_label'}->show; $widgets->{'menc_fps_label'}->set_alignment( 0, 0.5 ); # # Construct a GtkLabel 'menc_time_label' $widgets->{'menc_time_label'} = new Gtk2::Label(msg('Real time left:')); $widgets->{'mencoder_table'}->attach( $widgets->{'menc_time_label'}, 0, 1, 0, 1, ['fill'], [], 2, 1 ); $widgets->{'menc_time_label'}->show; $widgets->{'menc_time_label'}->set_alignment( 0, 0.5 ); # # Construct a GtkLabel 'menc_filesize_label' $widgets->{'menc_filesize_label'} = new Gtk2::Label(msg('Estimated filesize:')); $widgets->{'mencoder_table'}->attach( $widgets->{'menc_filesize_label'}, 0, 1, 2, 3, ['fill'], [], 2, 1 ); $widgets->{'menc_filesize_label'}->show; $widgets->{'menc_filesize_label'}->set_alignment( 0, 0.5 ); # # Construct a GtkLabel 'menc_progress_label' $widgets->{'menc_progress_label'} = new Gtk2::Label(msg('Time encoded:')); $widgets->{'mencoder_table'}->attach( $widgets->{'menc_progress_label'}, 0, 1, 3, 4, ['fill'], [], 2, 1 ); $widgets->{'menc_progress_label'}->show; $widgets->{'menc_progress_label'}->set_alignment( 0, 0.5 ); # # Construct a GtkLabel 'progress_value' $widgets->{'menc_seconds'} = new Gtk2::Label('0:00:00'); $widgets->{'mencoder_table'}->attach( $widgets->{'menc_seconds'}, 1, 2, 3, 4, [ 'expand', 'fill' ], [], 2, 1 ); $widgets->{'menc_seconds'}->show; $widgets->{'menc_seconds'}->set_alignment( 0.5, 0.5 ); # # Construct a GtkLabel 'menc_progress_label' $widgets->{'menc_bitrate_label'} = new Gtk2::Label(msg('Average bitrates:')); $widgets->{'mencoder_table'}->attach( $widgets->{'menc_bitrate_label'}, 0, 1, 4, 5, ['fill'], [], 2, 1 ); $widgets->{'menc_bitrate_label'}->show; $widgets->{'menc_bitrate_label'}->set_alignment( 0, 0.5 ); $widgets->{'menc_bitrate'} = new Gtk2::Label('0:0'); $widgets->{'mencoder_table'}->attach( $widgets->{'menc_bitrate'}, 1, 2, 4, 5, [ 'expand', 'fill' ], [], 2, 1 ); $widgets->{'menc_bitrate'}->show; $widgets->{'menc_bitrate'}->set_alignment( 0.5, 0.5 ); # # Construct a GtkLabel 'filesize' $widgets->{'menc_filesize'} = new Gtk2::Label('0mb'); $widgets->{'mencoder_table'}->attach( $widgets->{'menc_filesize'}, 1, 2, 2, 3, [ 'expand', 'fill' ], [], 2, 1 ); $widgets->{'menc_filesize'}->show; $widgets->{'menc_filesize'}->set_alignment( 0.5, 0.5 ); # # Construct a GtkLabel 'fps' $widgets->{'menc_fps'} = new Gtk2::Label('0fps'); $widgets->{'mencoder_table'}->attach( $widgets->{'menc_fps'}, 1, 2, 1, 2, [ 'expand', 'fill' ], [], 2, 1 ); $widgets->{'menc_fps'}->show; $widgets->{'menc_fps'}->set_alignment( 0.5, 0.5 ); # # Construct a GtkLabel 'time' $widgets->{'menc_time'} = new Gtk2::Label('0min'); $widgets->{'mencoder_table'}->attach( $widgets->{'menc_time'}, 1, 2, 0, 1, [ 'expand', 'fill' ], [], 2, 1 ); $widgets->{'menc_time'}->show; $widgets->{'menc_time'}->set_alignment( 0.5, 0.5 ); # # Construct a GtkProgressBar 'progress' $widgets->{'menc_progress'} = new Gtk2::ProgressBar; $widgets->{'menc_progress'}->set_orientation('left_to_right'); $widgets->{'mencoder_table'}->attach( $widgets->{'menc_progress'}, 0, 2, 5, 6, ['fill'], [], 2, 2 ); $widgets->{'menc_progress'}->show; $widgets->{'right_vbox'}->set_child_packing( $widgets->{'menc_frame'}, 0, 1, 0, 'start' ); $widgets->{'control_table'} = new Gtk2::Table( 2, 2, 1 ); $widgets->{'control_table'}->show; $widgets->{'right_vbox'}->pack_end( $widgets->{'control_table'}, 0, 1, 0 ); $widgets->{'right_vbox'}->set_child_packing( $widgets->{'control_table'}, 0, 1, 0, 'start' ); ### BUTTONS # Construct a GtkHBox 'settings_hbox' $widgets->{'buttons_table'} = new Gtk2::Table( 2, 2, 1 ); $widgets->{'buttons_frame'} = new Gtk2::Frame; $widgets->{'buttons_frame'}->set_border_width(2); $widgets->{'buttons_frame'}->add( $widgets->{'buttons_table'} ); $widgets->{'left_vbox'}->add( $widgets->{'buttons_frame'} ); $widgets->{'buttons_frame'}->show_all; # # Construct a GtkButton 'quit_button' $widgets->{'quit_button'} = Gtk2::Button->new_from_stock('ar_quit'); $widgets->{'buttons_table'}->attach( $widgets->{'quit_button'}, 1, 2, 1, 2, [ 'expand', 'fill' ], [], 2, 2 ); $widgets->{'quit_button'}->show; # # Construct a GtkButton 'progress_dialog_show_button' $widgets->{'progress_dialog_show_button'} = Gtk2::Button->new_from_stock('ar_compact'); $widgets->{'buttons_table'}->attach( $widgets->{'progress_dialog_show_button'}, 0, 1, 1, 2, [ 'expand', 'fill' ], [], 2, 2 ); $widgets->{'progress_dialog_show_button'}->show; $widgets->{'progress_dialog_show_button'}->set_sensitive(0); # # Construct a GtkButton 'start_button' $widgets->{'start_button'} = Gtk2::Button->new_from_stock('ar_start'); $widgets->{'buttons_table'}->attach( $widgets->{'start_button'}, 1, 2, 0, 1, [ 'expand', 'fill' ], [], 2, 2 ); $widgets->{'start_button'}->show; $widgets->{'start_button'}->set_sensitive(0); # # Construct a GtkButton 'stop_button' $widgets->{'stop_button'} = Gtk2::Button->new_from_stock('ar_stop'); $widgets->{'buttons_table'}->attach( $widgets->{'stop_button'}, 1, 2, 0, 1, [ 'expand', 'fill' ], [], 2, 2 ); # # Construct a GtkButton 'view_button' $widgets->{'view_button'} = Gtk2::Button->new_from_stock('ar_view'); #$widgets->{'buttons_table'}->attach($widgets->{'view_button'}, 0, 1, 0, 1, ['expand', 'fill'], [], 2, 2); #$widgets->{'view_button'}->show; $widgets->{'view_button'}->set_sensitive(0); #$widgets->{'main_hbox'}->set_child_packing($widgets->{'right_vbox'}, 1, 1, 0, 'end'); # # Construct a GtkButton 'queue_button' $widgets->{'queue_button'} = Gtk2::Button->new_from_stock('ar_queue'); $widgets->{'buttons_table'}->attach( $widgets->{'queue_button'}, 0, 1, 0, 1, [ 'expand', 'fill' ], [], 2, 2 ); $widgets->{'queue_button'}->show; $widgets->{'queue_button'}->set_sensitive(0); $widgets->{'main_hbox'}->set_child_packing( $widgets->{'right_vbox'}, 1, 1, 0, 'end' ); ### PREVIEW TAB $widgets->{'preview_frame'} = new Gtk2::Frame(msg("Preview")); $widgets->{'preview_frame'}->set_border_width(2); $widgets->{'preview_table'} = new Gtk2::Table( 2, 6, 0 ); $widgets->{'preview_table'}->set_row_spacings($row_height); $widgets->{'preview_frame'}->add( $widgets->{'preview_table'} ); $widgets->{'notebook'}->append_page( $widgets->{'preview_frame'}, new Gtk2::Label(msg("Preview"))); $widgets->{'preview_socket'} = new Gtk2::Socket; $widgets->{'preview_socket_frame'} = new Gtk2::Frame; $widgets->{'preview_socket_frame'}->set_shadow_type(GTK_SHADOW_IN); $widgets->{'preview_socket_frame'}->add( $widgets->{'preview_socket'} ); $widgets->{'preview_table'}->attach( $widgets->{'preview_socket_frame'}, 0, 2, 0, 1, [ 'expand', 'fill' ], ['expand'], 2, 2 ); $widgets->{'preview_socket'}->realize; $widgets->{'preview_table'}->attach( new Gtk2::VBox, 0, 2, 1, 2, [ 'expand', 'fill' ], [ 'expand', 'fill' ], 2, 2 ); $widgets->{'preview_table'}->attach( new Gtk2::HSeparator, 0, 2, 2, 3, [ 'expand', 'fill' ], [], 2, 2 ); my $dirname = dirname( $INC{"AcidRip/interface.pm"} ); if ( -e $dirname . "/logo.png" ) { $widgets->{'preview_logo'} = new_from_file Gtk2::Image( $dirname . "/logo.png" ); $widgets->{'preview_table'}->attach( $widgets->{'preview_logo'}, 0, 2, 0, 1, [ 'expand', 'fill' ], ['expand'], 2, 2 ); } # Construct a GtkButton 'preview_button' $widgets->{'preview_button'} = Gtk2::Button->new_from_stock('ar_preview'); $widgets->{'preview_button'}->set_sensitive(0); $widgets->{'preview_table'}->attach( $widgets->{'preview_button'}, 0, 1, 4, 5, [ 'expand', 'fill' ], [], 2, 2 ); # # Construct a GtkButton 'stop_preview_button' $widgets->{'stop_preview_button'} = Gtk2::Button->new_from_stock('ar_stop'); $widgets->{'preview_table'}->attach( $widgets->{'stop_preview_button'}, 0, 1, 4, 5, [ 'expand', 'fill' ], [], 2, 2 ); # # Construct a GtkCHECK 'flickbook_preview_check' $widgets->{'flickbook_preview_check'} = new Gtk2::CheckButton(msg("Flickbook")); $widgets->{'preview_table'}->attach( $widgets->{'flickbook_preview_check'}, 1, 2, 3, 4, ['fill'], [], 2, 2 ); # $widgets->{'embed_preview_check'} = new Gtk2::CheckButton(msg("Embed")); $widgets->{'preview_table'}->attach( $widgets->{'embed_preview_check'}, 0, 1, 3, 4, ['fill'], [], 2, 2 ); $widgets->{'preview_table'}->attach( $widgets->{'view_button'}, 1, 2, 4, 5, [ 'expand', 'fill' ], [], 2, 2 ); $widgets->{'view_button'}->show; $widgets->{'preview_frame'}->show_all; $widgets->{'preview_socket_frame'}->hide; ### QUEUE TAB $widgets->{'queue_frame'} = new Gtk2::Frame(msg("Queue")); $widgets->{'queue_frame'}->set_border_width(2); $widgets->{'queue_table'} = new Gtk2::Table( 2, 1, 0 ); $widgets->{'queue_table'}->set_row_spacings($row_height); $widgets->{'queue_frame'}->add( $widgets->{'queue_table'} ); $widgets->{'notebook'}->append_page( $widgets->{'queue_frame'}, new Gtk2::Label(msg("Queue")) ); $widgets->{'queue_text'} = new Gtk2::TextView; $widgets->{'queue_text'}->set_editable(0); $widgets->{'queue_scroll'} = new Gtk2::ScrolledWindow( undef, undef ); $widgets->{'queue_scroll'}->set_policy( 'automatic', 'automatic' ); $widgets->{'queue_scroll'}->set_size_request( -1, 150 ); $widgets->{'queue_scroll'}->add( $widgets->{'queue_text'} ); $widgets->{'queue_text_frame'} = new Gtk2::Frame; $widgets->{'queue_text_frame'}->add( $widgets->{'queue_scroll'} ); $widgets->{'queue_text_frame'}->set_shadow_type(GTK_SHADOW_IN); $widgets->{'queue_table'}->attach( $widgets->{'queue_text_frame'}, 0, 2, 0, 1, [ 'expand', 'fill' ], [ 'expand', 'fill' ], 2, 2 ); # Construct a GtkButton 'clear_queue_button' $widgets->{'queue_clear_button'} = Gtk2::Button->new_from_stock('ar_clear'); $widgets->{'queue_clear_button'}->set_sensitive(0); $widgets->{'queue_table'}->attach( $widgets->{'queue_clear_button'}, 0, 1, 1, 2, [ 'expand', 'fill' ], [], 2, 2 ); # Construct a GtkButton 'export_queue_button' $widgets->{'queue_export_button'} = Gtk2::Button->new_from_stock('ar_export'); $widgets->{'queue_export_button'}->set_sensitive(0); $widgets->{'queue_table'}->attach( $widgets->{'queue_export_button'}, 1, 2, 1, 2, [ 'expand', 'fill' ], [], 2, 2 ); $widgets->{'queue_frame'}->show_all; ### ADDITIONAL SETTINGS # Construct a GtkDialog 'additional_settings_dialog' $widgets->{'additional_settings_frame'} = new Gtk2::Frame(msg("Settings")); $widgets->{'additional_settings_frame'}->show; $widgets->{'additional_settings_frame'}->set_border_width(2); $widgets->{'notebook'}->append_page( $widgets->{'additional_settings_frame'}, new Gtk2::Label(msg("Settings"))); # # Construct a GtkVBox 'additional_settings_vbox' $widgets->{'additional_settings_vbox'} = new Gtk2::VBox; #$widgets->{'additional_settings_dialog'}->vbox; $widgets->{'additional_settings_frame'}->add( $widgets->{'additional_settings_vbox'} ); $widgets->{'additional_settings_vbox'}->show; # # Construct a GtkTable 'additional_settings_table' $widgets->{'additional_settings_table'} = new Gtk2::Table( 11, 4, 0 ); $widgets->{'additional_settings_vbox'}->add( $widgets->{'additional_settings_table'} ); $widgets->{'additional_settings_table'}->show; $widgets->{'additional_settings_table'}->set_row_spacings($row_height); # # Construst a GtkCheckButton 'autoload_check' $widgets->{'tooltips_check'} = new Gtk2::CheckButton(msg('Use tooltips')); #$widgets->{'additional_settings_table'}->attach($widgets->{'tooltips_check'}, 2, 4, 6, 7, ['fill'], ['expand'], 2, 0); #$widgets->{'tooltips_check'}->show; $widgets->{'shutdown_check'} = new Gtk2::CheckButton(msg('Shutdown')); $widgets->{'additional_settings_table'}->attach( $widgets->{'shutdown_check'}, 2, 4, 6, 7, ['fill'], ['expand'], 2, 0 ); $widgets->{'shutdown_check'}->show; # # Construst a GtkCheckButton 'autoload_check' $widgets->{'autoload_check'} = new Gtk2::CheckButton(msg('Autoload media')); $widgets->{'additional_settings_table'}->attach( $widgets->{'autoload_check'}, 0, 2, 5, 6, ['fill'], ['expand'], 2, 0 ); $widgets->{'autoload_check'}->show; # # Construst a GtkCheckButton 'precache_check' $widgets->{'precache_check'} = new Gtk2::CheckButton(msg('Pre-cache video')); $widgets->{'additional_settings_table'}->attach( $widgets->{'precache_check'}, 2, 4, 5, 6, ['fill'], ['expand'], 2, 0 ); $widgets->{'precache_check'}->show; # # Construst a GtkCheckButton 'autoload_check' $widgets->{'del_cache_check'} = new Gtk2::CheckButton(msg('Delete cache')); $widgets->{'additional_settings_table'}->attach( $widgets->{'del_cache_check'}, 2, 4, 4, 5, ['fill'], ['expand'], 2, 0 ); $widgets->{'del_cache_check'}->show; # # Construst a GtkCheckButton 'autoload_check' $widgets->{'overwrite_check'} = new Gtk2::CheckButton(msg('Overwrite files')); $widgets->{'additional_settings_table'}->attach( $widgets->{'overwrite_check'}, 0, 2, 6, 7, ['fill'], ['expand'], 2, 0 ); $widgets->{'overwrite_check'}->show; # # Construct a GtkLabel 'mencoder_label' $widgets->{'mencoder_label'} = new Gtk2::Label('MEncoder:'); $widgets->{'additional_settings_table'}->attach( $widgets->{'mencoder_label'}, 0, 2, 0, 1, ['fill'], ['expand'], 2, 2 ); $widgets->{'mencoder_label'}->show; $widgets->{'mencoder_label'}->set_alignment( 0, 0.5 ); # # Construct a GtkEntry 'mencoder_entry' $widgets->{'mencoder_entry'} = new Gtk2::Entry; $widgets->{'mencoder_entry'}->set_size_request( 40, -1 ); $widgets->{'additional_settings_table'}->attach( $widgets->{'mencoder_entry'}, 2, 4, 0, 1, [ 'expand', 'fill' ], ['expand'], 2, 2 ); $widgets->{'mencoder_entry'}->show; # # Construct a GtkLabel 'mplayer_label' $widgets->{'mplayer_label'} = new Gtk2::Label('MPlayer:'); $widgets->{'additional_settings_table'}->attach( $widgets->{'mplayer_label'}, 0, 2, 1, 2, ['fill'], ['expand'], 2, 2 ); $widgets->{'mplayer_label'}->show; $widgets->{'mplayer_label'}->set_alignment( 0, 0.5 ); # # Construct a GtkEntry 'mplayer_entry' $widgets->{'mplayer_entry'} = new Gtk2::Entry; $widgets->{'mplayer_entry'}->set_size_request( 40, -1 ); $widgets->{'additional_settings_table'}->attach( $widgets->{'mplayer_entry'}, 2, 4, 1, 2, [ 'expand', 'fill' ], ['expand'], 2, 2 ); $widgets->{'mplayer_entry'}->show; # # Construct a GtkLabel 'lsdvd_label' $widgets->{'lsdvd_label'} = new Gtk2::Label('lsdvd:'); $widgets->{'additional_settings_table'}->attach( $widgets->{'lsdvd_label'}, 0, 2, 2, 3, ['fill'], ['expand'], 2, 2 ); $widgets->{'lsdvd_label'}->show; $widgets->{'lsdvd_label'}->set_alignment( 0, 0.5 ); # # Construct a GtkEntry 'lsdvd_entry' $widgets->{'lsdvd_entry'} = new Gtk2::Entry; $widgets->{'lsdvd_entry'}->set_size_request( 40, -1 ); $widgets->{'additional_settings_table'}->attach( $widgets->{'lsdvd_entry'}, 2, 4, 2, 3, [ 'expand', 'fill' ], ['expand'], 2, 2 ); $widgets->{'lsdvd_entry'}->show; # # Construct a GtkCHECK 'cache_check' $widgets->{'cache_check'} = new Gtk2::CheckButton(msg("Cache DVD")); $widgets->{'additional_settings_table'}->attach( $widgets->{'cache_check'}, 0, 2, 4, 5, ['fill'], ['expand'], 2, 2 ); $widgets->{'cache_check'}->show; # # Construct a GtkLabel 'lsdvd_label' $widgets->{'cache_label'} = new Gtk2::Label(msg('Cache:')); $widgets->{'additional_settings_table'}->attach( $widgets->{'cache_label'}, 0, 2, 3, 4, ['fill'], ['expand'], 2, 2 ); $widgets->{'cache_label'}->show; $widgets->{'cache_label'}->set_alignment( 0, 0.5 ); # # Construct a GtkEntry for cache location'expand' $widgets->{'cache_directory_entry'} = new Gtk2::Entry; $widgets->{'cache_directory_entry'}->set_size_request( 40, -1 ); $widgets->{'additional_settings_table'}->attach( $widgets->{'cache_directory_entry'}, 2, 4, 3, 4, ['fill'], ['expand'], 2, 2 ); $widgets->{'cache_directory_entry'}->show; # # Construct a GtkLabel for default language $widgets->{'language_label'} = new Gtk2::Label(msg("Language:")); $widgets->{'additional_settings_table'}->attach( $widgets->{'language_label'}, 0, 2, 9, 10, ['fill'], ['expand'], 2, 2 ); $widgets->{'language_label'}->set_alignment( 0, 0.5 ); $widgets->{'language_label'}->set_size_request( 1, -1 ); $widgets->{'language_label'}->show; # # Construct a GtkEntry for default language $widgets->{'language_entry'} = new Gtk2::Entry; $widgets->{'additional_settings_table'}->attach( $widgets->{'language_entry'}, 2, 4, 9, 10, ['fill'], ['expand'], 2, 2 ); $widgets->{'language_entry'}->set_size_request( 10, -1 ); $widgets->{'language_entry'}->show; # # Construct a GtkCHECK 'compact_check' $widgets->{'compact_check'} = new Gtk2::CheckButton(msg("Compact box")); $widgets->{'additional_settings_table'}->attach( $widgets->{'compact_check'}, 0, 2, 7, 8, ['fill'], ['expand'], 2, 2 ); $widgets->{'compact_check'}->show; # # Construct a GtkCHECK 'enforce_size_check' $widgets->{'enforce_space_check'} = new Gtk2::CheckButton(msg("Enforce size")); $widgets->{'additional_settings_table'}->attach( $widgets->{'enforce_space_check'}, 2, 4, 7, 8, ['fill'], ['expand'], 2, 2 ); $widgets->{'enforce_space_check'}->show; # # Construct a GtkCHECK 'ppc_bug_check' $widgets->{'ppc_bug_check'} = new Gtk2::CheckButton(msg("PPC cropping")); $widgets->{'additional_settings_table'}->attach( $widgets->{'ppc_bug_check'}, 0, 2, 8, 9, ['fill'], ['expand'], 2, 2 ); $widgets->{'ppc_bug_check'}->show; # # Construct a GtkCHECK 'eject_check' $widgets->{'eject_check'} = new Gtk2::CheckButton(msg("Eject DVD")); $widgets->{'additional_settings_table'}->attach( $widgets->{'eject_check'}, 2, 4, 8, 9, ['fill'], ['expand'], 2, 2 ); $widgets->{'eject_check'}->show; # $widgets->{'vcd_type_label'} = new Gtk2::Label("VCD"); #$widgets->{'vcd_type_label'}->show; $widgets->{'additional_settings_table'}->attach( $widgets->{'vcd_type_label'}, 0, 1, 9, 10, [ 'expand', 'fill' ], ['expand'], 2, 2 ); $widgets->{'vcd_type_option'} = new Gtk2::OptionMenu; $widgets->{'vcd_type_menu'} = new Gtk2::Menu; $widgets->{'vcd_type_option'}->set_menu( $widgets->{'vcd_type_menu'} ); $widgets->{'vcd_type_menu'}->append( new Gtk2::MenuItem("VCD") ); $widgets->{'vcd_type_menu'}->append( new Gtk2::MenuItem("SVCD") ); $widgets->{'vcd_type_menu'}->append( new Gtk2::MenuItem("XVCD") ); $widgets->{'vcd_type_menu'}->append( new Gtk2::MenuItem("KVCD") ); #$widgets->{'vcd_type_option'}->show_all; $widgets->{'additional_settings_table'}->attach( $widgets->{'vcd_type_option'}, 1, 2, 9, 10, [ 'expand', 'fill' ], ['expand'], 2, 2 ); $widgets->{'vcd_format_label'} = new Gtk2::Label(""); #$widgets->{'vcd_format_label'}->show; $widgets->{'additional_settings_table'}->attach( $widgets->{'vcd_format_label'}, 2, 3, 9, 10, [ 'expand', 'fill' ], ['expand'], 2, 2 ); $widgets->{'vcd_format_option'} = new Gtk2::OptionMenu; $widgets->{'vcd_format_menu'} = new Gtk2::Menu; $widgets->{'vcd_format_option'}->set_menu( $widgets->{'vcd_format_menu'} ); $widgets->{'vcd_format_menu'}->append( new Gtk2::MenuItem("PAL") ); $widgets->{'vcd_format_menu'}->append( new Gtk2::MenuItem("NTSC") ); #$widgets->{'vcd_format_option'}->show_all; $widgets->{'additional_settings_table'}->attach( $widgets->{'vcd_format_option'}, 3, 4, 9, 10, [ 'expand', 'fill' ], ['expand'], 2, 2 ); # # Construct a GtkButton 'save_button' $widgets->{'save_button'} = Gtk2::Button->new_from_stock('gtk-save'); $widgets->{'additional_settings_table'}->attach( $widgets->{'save_button'}, 0, 2, 10, 11, [ 'expand', 'fill' ], [], 2, 2 ); $widgets->{'save_button'}->show; # Construct a GtkButton 'restore_button' $widgets->{'restore_button'} = Gtk2::Button->new_from_stock('gtk-revert-to-saved'); $widgets->{'additional_settings_table'}->attach( $widgets->{'restore_button'}, 2, 4, 10, 11, [ 'expand', 'fill' ], [], 2, 2 ); $widgets->{'restore_button'}->show; $widgets->{'main_hbox'}->set_child_packing( $widgets->{'left_vbox'}, 1, 1, 0, 'start' ); ### DEBUG WINDOW # Construct a mencoder output frame $widgets->{'mencoder_output_frame'} = new Gtk2::Frame(msg("Output log")); $widgets->{'mencoder_output_frame'}->set_border_width(2); $widgets->{'status_vbox'}->add( $widgets->{'mencoder_output_frame'} ); $widgets->{'output_vbox'} = new Gtk2::VBox; $widgets->{'output_vbox'}->show; # # Construct a mencoder output table $widgets->{'mencoder_output_table'} = new Gtk2::Table( 4, 1, 0 ); $widgets->{'mencoder_output_frame'}->add( $widgets->{'output_vbox'} ); $widgets->{'output_vbox'}->pack_start( $widgets->{'mencoder_output_table'}, 0, 0, 2 ); # # construct a save button for mencoder output $widgets->{'mencoder_output_save_button'} = Gtk2::Button->new_from_stock('ar_log_save'); $widgets->{'mencoder_output_table'}->attach( $widgets->{'mencoder_output_save_button'}, 0, 1, 0, 1, [ 'fill', 'expand' ], [], 2, 2 ); $widgets->{'mencoder_output_clear_button'} = Gtk2::Button->new_from_stock('ar_clear'); $widgets->{'mencoder_output_table'}->attach( $widgets->{'mencoder_output_clear_button'}, 2, 3, 0, 1, [ 'fill', 'expand' ], [], 2, 2 ); $widgets->{'mencoder_output_hide_button'} = Gtk2::Button->new_from_stock('ar_log_hide'); $widgets->{'mencoder_output_table'}->attach( $widgets->{'mencoder_output_hide_button'}, 3, 4, 0, 1, [ 'fill', 'expand' ], [], 2, 2 ); # Construct an mencoder output text $widgets->{'mencoder_output_text'} = new Gtk2::TextView; $widgets->{'mencoder_output_text'}->set_wrap_mode('word'); $widgets->{'mencoder_output_text'}->set_editable(0); $widgets->{'mencoder_output_scroll'} = new Gtk2::ScrolledWindow( undef, undef ); $widgets->{'mencoder_output_scroll'}->set_policy( 'automatic', 'always' ); $widgets->{'mencoder_output_scroll'}->set_size_request( -1, 150 ); $widgets->{'mencoder_output_scroll'}->add( $widgets->{'mencoder_output_text'} ); $widgets->{'mencoder_output_scroll'}->set_shadow_type(GTK_SHADOW_IN); $widgets->{'output_vbox'}->pack_start( $widgets->{'mencoder_output_scroll'}, 1, 1, 2 ); $widgets->{'mencoder_output_scroll'}->show_all; $widgets->{'mencoder_output_text'}->get_buffer->create_tag( "error", 'foreground' => "red" ); $widgets->{'mencoder_output_text'}->get_buffer->create_tag( "lsdvd", 'foreground' => 'white', 'size-points' => "0" ); $widgets->{'mencoder_output_text'}->get_buffer->create_tag( "mplayer", 'foreground' => "darkgrey", 'wrap_mode' => "none" ); ### STATUS BAR # Construct a GtkStatusbar $widgets->{'status_hbox'} = new Gtk2::HBox; $widgets->{'status_hbox'}->show; $widgets->{'status_vbox'}->add( $widgets->{'status_hbox'} ); $widgets->{'status_bar'} = new Gtk2::Statusbar; $widgets->{'status_hbox'}->pack_start( $widgets->{'status_bar'}, 1, 1, 2 ); $widgets->{'status_bar'}->show; # Construct hide/show mencoder output button $widgets->{'mencoder_output_show_button'} = Gtk2::Button->new(msg("Debug")); $widgets->{'mencoder_output_show_button'}->show; $widgets->{'status_hbox'}->pack_end( $widgets->{'mencoder_output_show_button'}, 0, 1, 2 ); ### COMPACT DIALOG $widgets->{'progress_dialog'} = new Gtk2::Dialog; $widgets->{'progress_dialog'}->set_title(msg('acidrip')); $widgets->{'progress_dialog'}->set_resizable(0); $widgets->{'progress_dialog'}->set_modal(1); $widgets->{'progress_dialog'}->realize; # Construct a GtkVBox 'additional_settings_vbox' $widgets->{'progress_vbox'} = $widgets->{'progress_dialog'}->vbox; $widgets->{'progress_vbox'}->show; # Construct a GtkHBox 'additional_settings_action_area' $widgets->{'progress_action_area'} = $widgets->{'progress_dialog'}->action_area; $widgets->{'progress_action_area'}->show; $widgets->{'progress_action_area'}->set_border_width(10); $widgets->{'progress_dialog_hide_button'} = new Gtk2::Button(msg("Full view")); $widgets->{'progress_dialog_hide_button'}->show; $widgets->{'progress_action_area'}->pack_end( $widgets->{'progress_dialog_hide_button'}, 0, 1, 0 ); ### TOOLTIPS $widgets->{'tooltips'} = new Gtk2::Tooltips(); $widgets->{'tooltips'}->set_tip( $widgets->{'scale_width_spin'}, msg('scale_width_spin')); $widgets->{'tooltips'}->set_tip( $widgets->{'scale_height_spin'}, msg('scale_height_spin')); $widgets->{'tooltips'}->set_tip( $widgets->{'crop_width_spin'}, msg('crop_width_spin')); $widgets->{'tooltips'}->set_tip( $widgets->{'crop_height_spin'}, msg('crop_height_spin')); $widgets->{'tooltips'}->set_tip( $widgets->{'crop_vertical_spin'}, msg('crop_vertical_spin')); $widgets->{'tooltips'}->set_tip( $widgets->{'crop_horizontal_spin'}, msg('crop_horizontal_spin')); $widgets->{'tooltips'}->set_tip( $widgets->{'crop_enable_check'}, msg('crop_enable_check')); $widgets->{'tooltips'}->set_tip( $widgets->{'scale_enable_check'}, msg('scale_enable_check')); $widgets->{'tooltips'}->set_tip( $widgets->{'crop_detect_button'}, msg('crop_detect_button')); $widgets->{'tooltips'}->set_tip( $widgets->{'video_codec_option'}, msg('video_codec_option') ); $widgets->{'tooltips'}->set_tip( $widgets->{'video_options_entry'}, msg('video_options_entry') ); $widgets->{'tooltips'}->set_tip( $widgets->{'video_bitrate_entry'}, msg('video_bitrate_entry') ); $widgets->{'tooltips'}->set_tip( $widgets->{'subp_option'}, msg('subp_option') ); $widgets->{'tooltips'}->set_tip( $widgets->{'read_dvd_button'}, msg('read_dvd_button') ); $widgets->{'tooltips'}->set_tip( $widgets->{'video_passes_spin'}, msg('video_passes_spin') ); $widgets->{'tooltips'}->set_tip( $widgets->{'dvd_device_entry'}, msg('dvd_device_entry') ); $widgets->{'tooltips'}->set_tip( $widgets->{'autoload_check'}, msg('autoload_check') ); $widgets->{'tooltips'}->set_tip( $widgets->{'overwrite_check'}, msg('overwrite_check') ); $widgets->{'tooltips'}->set_tip( $widgets->{'audio_codec_option'}, msg('audio_codec_option') ); $widgets->{'tooltips'}->set_tip( $widgets->{'audio_options_entry'}, msg('audio_options_entry') ); $widgets->{'tooltips'}->set_tip( $widgets->{'audio_track_option'}, msg('audio_track_option') ); $widgets->{'tooltips'}->set_tip( $widgets->{'filename_entry'}, msg('filename_entry') ); $widgets->{'tooltips'}->set_tip( $widgets->{'filesize_spin'}, msg('filesize_spin') ); $widgets->{'tooltips'}->set_tip( $widgets->{'save_button'}, msg('save_button') ); $widgets->{'tooltips'}->set_tip( $widgets->{'restore_button'}, msg('restore_button') ); $widgets->{'tooltips'}->set_tip( $widgets->{'start_button'}, msg('start_button') ); $widgets->{'tooltips'}->set_tip( $widgets->{'stop_button'}, msg('stop_button') ); $widgets->{'tooltips'}->set_tip( $widgets->{'view_button'}, msg('view_button') ); $widgets->{'tooltips'}->set_tip( $widgets->{'dvd_tree'}, msg('dvd_tree') ); $widgets->{'tooltips'}->set_tip( $widgets->{'mencoder_output_show_button'}, msg('mencoder_output_show_button') ); $widgets->{'tooltips'}->set_tip( $widgets->{'mencoder_output_hide_button'}, msg('mencoder_output_hide_button') ); $widgets->{'tooltips'}->set_tip( $widgets->{'mencoder_output_save_button'}, msg('mencoder_output_save_button') ); $widgets->{'tooltips'}->set_tip( $widgets->{'video_bitrate_lock_check'}, msg('video_bitrate_lock_check') ); $widgets->{'tooltips'}->set_tip( $widgets->{'scale_lock_check'}, msg('scale_lock_check') ); $widgets->{'tooltips'}->set_tip( $widgets->{'mencoder_output_clear_button'},msg('mencoder_output_clear_button') ); $widgets->{'tooltips'}->set_tip( $widgets->{'video_bpp_entry'}, msg('video_bpp_entry') ); $widgets->{'tooltips'}->set_tip( $widgets->{'more_options_entry'}, msg('more_options_entry') ); $widgets->{'tooltips'}->set_tip( $widgets->{'total_blocks_spin'}, msg('total_blocks_spin') ); $widgets->{'tooltips'}->set_tip( $widgets->{'mencoder_entry'}, msg('mencoder_entry') ); $widgets->{'tooltips'}->set_tip( $widgets->{'language_entry'}, msg('language_entry') ); $widgets->{'tooltips'}->set_tip( $widgets->{'cache_directory_entry'}, msg('cache_directory_entry') ); $widgets->{'tooltips'}->set_tip( $widgets->{'cache_check'}, msg('cache_check') ); $widgets->{'tooltips'}->set_tip( $widgets->{'precache_check'}, msg('precache_check') ); $widgets->{'tooltips'}->set_tip( $widgets->{'compact_check'}, msg('compact_check') ); $widgets->{'tooltips'}->set_tip( $widgets->{'enforce_space_check'}, msg('enforce_space_check') ); $widgets->{'tooltips'}->set_tip( $widgets->{'vf_pre_enable_check'}, msg('vf_pre_enable_check') ); $widgets->{'tooltips'}->set_tip( $widgets->{'vf_post_enable_check'}, msg('vf_post_enable_check') ); $widgets->{'tooltips'}->set_tip( $widgets->{'info_field_option'}, msg('info_field_option') ); $widgets->{'tooltips'}->set_tip( $widgets->{'ppc_bug_check'}, msg('ppc_bug_check') ); $widgets->{'tooltips'}->set_tip( $widgets->{'flickbook_preview_check'}, msg('flickbook_preview_check') ); $widgets->{'tooltips'}->set_tip( $widgets->{'vobsubout_check'}, msg('vobsubout_check') ); $widgets->{'tooltips'}->set_tip( $widgets->{'embed_preview_check'}, msg('embed_preview_check') ); $widgets->{'tooltips'}->set_tip( $widgets->{'eject_check'}, msg('eject_check') ); $widgets->{'tooltips'}->set_tip( $widgets->{'queue_button'}, msg('queue_button') ); $widgets->{'tooltips'}->set_tip( $widgets->{'vcd_type_option'}, msg('vcd_type_option') ); $widgets->{'tooltips'}->set_tip( $widgets->{'vcd_format_option'}, msg('vcd_format_option') ); $widgets->{'tooltips'}->set_tip( $widgets->{'audio_gain_spin'}, msg('audio_gain_spin') ); $widgets->{'tooltips'}->set_tip( $widgets->{'quit_button'}, msg('quit_button') ); $widgets->{'tooltips'}->set_tip( $widgets->{'shutdown_check'}, msg('shutdown_check') ); $widgets->{'queue_export_button'}->signal_connect( 'clicked', \&on_queue_export_button_clicked ); $widgets->{'queue_clear_button'}->signal_connect( 'clicked', \&on_queue_clear_button_clicked ); $widgets->{'preview_button'}->signal_connect( 'clicked', \&on_crop_preview_button_clicked ); $widgets->{'crop_detect_button'}->signal_connect( 'clicked', \&on_crop_detect_button_clicked ); $widgets->{'save_button'}->signal_connect( 'clicked', \&on_save_settings_button_clicked ); $widgets->{'restore_button'}->signal_connect( 'clicked', \&on_restore_defaults_button_clicked ); $widgets->{'start_button'}->signal_connect( 'clicked', \&on_start_button_clicked ); $widgets->{'stop_button'}->signal_connect( 'clicked', \&on_stop_button_clicked ); $widgets->{'queue_button'}->signal_connect( 'clicked', \&on_queue_button_clicked ); $widgets->{'stop_preview_button'}->signal_connect( 'clicked', \&on_stop_preview_button_clicked ); $widgets->{'view_button'}->signal_connect( 'clicked', \&on_view_button_clicked ); $widgets->{'scale_lock_check'}->signal_connect( 'toggled', \&on_scale_lock_check_clicked ); $widgets->{'mpegfile_option'}->signal_connect( 'changed', \&on_mpegfile_option_changed ); $widgets->{'video_bitrate_spin'}->signal_connect( 'value_changed', \&on_setting_changed); $widgets->{'mencoder_output_save_button'}->signal_connect( 'clicked', \&on_mencoder_output_save_button_clicked ); $widgets->{'mencoder_output_clear_button'}->signal_connect( 'clicked', \&on_mencoder_output_clear_button_clicked ); $widgets->{'mencoder_output_show_button'}->signal_connect( 'clicked', \&on_mencoder_output_show_button_clicked ); $widgets->{'mencoder_output_hide_button'}->signal_connect( 'clicked', \&on_mencoder_output_hide_button_clicked ); bless( $widgets, $class ); $widgets->connect_signals( 'toggled', \&on_setting_finished, 'tooltips_check', 'cache_check', 'autoload_check', 'crop_enable_check', 'precache_check', 'scale_enable_check', 'overwrite_check', 'vf_pre_enable_check', 'vf_post_enable_check', 'del_cache_check', 'video_bitrate_lock_check', 'shutdown_check', 'enforce_space_check', 'compact_check', 'ppc_bug_check', 'flickbook_preview_check', 'vobsubout_check', 'embed_preview_check', 'eject_check' ); $widgets->connect_signals( 'changed', \&on_setting_finished, 'video_passes_spin', 'total_blocks_spin', 'vf_pre_entry', 'vf_post_entry' ); $widgets->connect_signals( 'focus_out_event', \&on_setting_finished, 'mplayer_entry', 'lsdvd_entry', 'mencoder_entry', 'video_bitrate_entry', 'video_bitrate_spin', 'crop_height_spin', 'more_options_entry', 'crop_width_spin', 'crop_vertical_spin', 'crop_horizontal_spin', 'dvd_device_entry', 'language_entry', 'video_options_entry', 'filename_entry', 'audio_options_entry', 'scale_width_spin', 'scale_height_spin', 'info_name_entry', 'info_artist_entry', 'info_subject_entry', 'info_genre_entry', 'info_copyright_entry', 'info_comment_entry', 'cache_directory_entry', 'filesize_spin', 'title_entry', 'audio_gain_spin' ); $widgets->connect_signals( 'activate', \&on_setting_finished, 'dvd_device_entry' ); $widgets->connect_signals( 'changed', \&on_setting_changed, 'filesize_spin', 'crop_height_spin', 'scale_width_spin', 'scale_height_spin', 'crop_width_spin', 'crop_vertical_spin', 'crop_horizontal_spin', 'filename_entry', 'video_bitrate_spin' ); $widgets->{'dvd_device_entry'}->signal_connect( 'activate', \&on_read_dvd_button_clicked ); $widgets->{'video_bpp_entry'}->signal_connect( 'changed', \&on_bpp_changed ); $widgets->{'filesize_spin'}->signal_connect( 'changed', \&on_filesize_changed ); $widgets->{'read_dvd_button'}->signal_connect( 'clicked', \&on_read_dvd_button_clicked, $widgets ); $widgets->{'acidrip'}->signal_connect( 'delete_event', \&quit_acidrip ); $widgets->{'quit_button'}->signal_connect( 'clicked', \&quit_acidrip ); $widgets->{'progress_dialog_hide_button'}->signal_connect( 'clicked', \&progress_dialog_hide ); $widgets->{'progress_dialog_show_button'}->signal_connect( 'clicked', \&progress_dialog_show ); ################################################## # NB subp and audio combo connects in signals.pm # ################################################## Glib::Idle->add( sub { while ( Gtk2->events_pending() ) { Gtk2->main_iteration() } } ); return $widgets; } 1; acidrip-0.14/AcidRip/messages.pm0000644000076400001440000001441410030402203017010 0ustar chrisusers00000000000000package acidrip_messages; $messages = { 'language' => 'English', 'default' => 'English', 'messages' => { 'English' => { 'scale_width_spin' => "Width of the video output, default 480, smaller width will encode faster.", 'scale_height_spin' => "Height of the video output, default -2: calculates aspect based on crop and dvd information", 'crop_width_spin' => "Width of the crop, relative to original dvd video stream", 'crop_height_spin' => "Height of the crop, relative to the original dvd video stream", 'crop_vertical_spin' => "Vertical offset from top of video", 'crop_horizontal_spin' => "Horizontal offset from left side of video", 'crop_enable_check' => "Turn cropping on/off", 'scale_enable_check' => "Turn video scaling on/off" , 'crop_detect_button' => "Detect optimum crop values" , 'video_codec_option' => "Video output format to be used" , 'video_options_entry' => "Options specific to the selected video output" , 'video_bitrate_entry' => "Bitrate calculated to satify filesize. can be edited if desired" , 'subp_option' => "Subpicture to be used" , 'read_dvd_button' => "Read the DVD or directory" , 'video_passes_spin' => "Number of encoding passes. Check MPlayer docs for details on 2 or 3 pass encoding." , 'dvd_device_entry' => "Location of the DVD drive or other directory" , 'autoload_check' => "Automatically scan DVD or directory and crop (if enabled) when program is loaded. (Remember to save settings!)" , 'overwrite_check' => "Overwrite files if they already exist... woahh careful!" , 'audio_codec_option' => "Audio output format to be used" , 'audio_options_entry' => "Options specific to selected audio output" , 'audio_track_option' => "Audio track to use" , 'filename_entry' => "Name of output file:\n%T\tTrack title\n%N\tTrack number\n%L\ttrack length\n%f\tfirst title letter\n%w\tWidth\n%h\tHeight\n%b\tVideo bitrate\n%l\tLanguage" , 'filesize_spin' => "Desired size of file(s), select typical values, or enter your own. If value is RED then you do not have enough space in the given location. Disabled if bitrate lock is checked" , 'save_button' => "Store useful settings in $ENV{HOME}/.acidriprc" , 'restore_button' => "Restore default settings" , 'start_button' => "Begin encoding with current settings" , 'stop_button' => "Stop encoding" , 'view_button' => "Play back output file" , 'dvd_tree' => "Contents of currently loaded DVD or directory" , 'mencoder_output_show_button' => "Show lots of lovely information about what's going on, useful for troubleshooting." , 'mencoder_output_hide_button' => "Hide all of this junk..." , 'mencoder_output_save_button' => "Save all output information to $ENV{HOME}/acidrip.log." , 'video_bitrate_lock_check' => "Lock bitrate from automatic updating" , 'scale_lock_check' => "Lock height relative to width" , 'mencoder_output_clear_button'=> "Clear all output information" , 'video_bpp_entry' => "Estimated bits per pixel. Ideally you want to hit around 0.25 with a decent divx codec" , 'more_options_entry' => "Somewhere for any other options to go that are not handled here" , 'total_blocks_spin' => "Automatically split dvd into a given number of files by chapter boundaries" , 'mencoder_entry' => "Specify a set location for mencoder or similar, e.g. \"/mnt/nfs/usr/bin/mencoder\" or even \"nice mencoder\"" , 'language_entry' => "Set preferred language for audio, reload DVD to take effect." , 'cache_directory_entry' => "Specify a set location for caching the DVD title to, e.g. \"/tmp\". You do NOT need to cache the dvd." , 'cache_check' => "To cache or not to cache. Useful if you're impatient and can\'t leave the disc for more than 30 mins... other than that..." , 'precache_check' => "Caches all tracks before any encoding, otherwise tracks are cached and deleted at encode time." , 'compact_check' => "Show only encoding status when encoding title, smaller and less chance of accidentally stopping it!" , 'enforce_space_check' => "Refuse to encode if there appears to not be enough space in output directory (encoding only, not caching)" , 'vf_pre_enable_check' => "vf options to apply to video before cropping / scaling - see mplayer docs" , 'vf_post_enable_check' => "vf options to apply to video after cropping / scaling - see mplayer docs" , 'info_field_option' => "Set various attributes with the avi file. Few players besides MPlayer use this information." , 'ppc_bug_check' => "Mencoder\'s -sstep option doesn't work on PPC, use alternate (less reliable) crop method" , 'flickbook_preview_check' => "Previews film with selected still shots instead of entire playback (not possible if using ppc bug)" , 'vobsubout_check' => "Dump subtitles to seperate file instead of rendering directly to the video." , 'embed_preview_check' => "Show preview in space above, rather than a full size detached window" , 'eject_check' => "Eject DVD when finished" , 'queue_button' => "Add current setting to the queue" , 'vcd_type_option' => "Load specifications for chosen VCD standard" , 'vcd_format_option' => "Video size for VCD" , 'audio_gain_spin' => "Audio gain (dB) -200 = silence, +40 = x1000!" , 'quit_button' => "Quit AcidRip" , 'shutdown_check' => "Shutdown machine when encoding is completed" }, 'Francais' => { 'acidrip' => 'le acidrip' }, 'Deutsch' => { 'acidrip' => 'das acidrip' } } }; sub new { my $class = shift; my $language = shift; bless( $messages, $class ); $messages->{'language'} = $language; $messages->get_languages; return $messages; } sub msg { my $messages = shift; my $name = shift; return $messages->{'messages'}->{$messages->{'language'}}->{$name} if defined $messages->{'messages'}->{$messages->{'language'}}->{$name}; return $messages->{'messages'}->{$messages->{'default'}}->{$name} if defined $messages->{'messages'}->{$messages->{'default'}}->{$name}; return $name; } sub get_languages { my $messages = shift; return keys %{$messages->{'messages'}} } 1; acidrip-0.14/AcidRip/acidrip.pm0000644000076400001440000012440510100736635016637 0ustar chrisusers00000000000000#!/usr/bin/perl -w package acidrip; require 5.000; use strict; use POSIX; #needed for floor() use AcidRip::interface; use AcidRip::signals; use AcidRip::messages; use Data::Dumper; use File::Basename; use Gtk2::Helper; sub gui_check ($) { if (/SKIN/) { my $msg = "You have set gui=yes in your config file. this is not a valid MPlayer option, only there for debugging. Remove it and use gmplayer instead for a gui!"; message($msg); print $msg . "\n"; } } sub set_warning_text ($$) { my $widget = shift; my $warn = shift; $widget->modify_text( 'normal', Gtk2::Gdk::Color->new( $warn * 65535, 0, 0 ) ); } sub hhmmss ($) { my $s = shift; my $m = floor $s / 60; my $mins = $m % 60; my $hour = floor $m / 60; return sprintf( "%d:%02d:%02d", $hour, $mins, $s % 60 ); } sub split_track { if ( defined $::dvd->{'track'} && defined get_track()->{'chapter'}) { $::settings->{'blocks'} = undef; $::settings->{'blocks'} = (); my $start = $::settings->{'selected_chapters_start'} || 1; my $stop = $::settings->{'selected_chapters_end'} || get_track()->{'chapter'}[-1]->{'ix'}; my $total_length = get_selection_length(); my $length = 0; my $this_block = 1; my $old_length = $length; $::settings->{'blocks'}[0] = $start - 1; foreach my $chapter ( $start .. $stop ) { my $this_chapter = get_chapter($chapter); my $target = $total_length * $this_block / $::settings->{'total_blocks'}; $length += $this_chapter->{'length'}; $::settings->{'blocks'}[$this_block] = $chapter; $this_block++ if $old_length < $target && $length > $target; $old_length = $length; } $::settings->{'UI'} && set_warning_text( $::widgets->{'total_blocks_spin'}, ( scalar @{ $::settings->{'blocks'} } ) - 1 < $::settings->{'total_blocks'} ? 1 : 0 ); my $msg = "Blocks: "; for ( 1 .. @{ $::settings->{'blocks'} } - 1 ) { $msg .= " $_=[" . ( $::settings->{'blocks'}[ $_ - 1 ] + 1 ) . "-" . ( $::settings->{'blocks'}[$_] ) . "] "; } message($msg); return @{ $::settings->{'blocks'} }; } elsif ( defined $::dvd->{'track'}) { message("Can't split video files, only DVD's") if $::dvd->{'source'} eq 'file'; message("Can't split track - No chapters on this DVD track") if $::dvd->{'source'} eq "dvd"; } else { message("Can't split track - No DVD loaded!"); } } sub converttoint { my $total = 0; my $i; my $data = shift; for ( $i = 0 ; $i < length($data) ; $i++ ) { my $c = substr( $data, $i, 1 ); my $value = 256**$i * ord($c); $total += $value; } return $total; } sub get_track { my $ix = shift || $::settings->{'selected_track'}; return -1 if ! defined $::dvd->{'track'}; return -1 if ! scalar @{$::dvd->{'track'}}; foreach ( @{ $::dvd->{'track'} } ) { return $_ if $ix == $_->{'ix'}; } return -1; } sub get_track_param ($) { my $param = shift; my $track = get_track(); if (ref($track) eq 'HASH' and defined $track->{$param}) { return $track->{$param} } else { return -1 } } sub get_audio { my $ix = shift; my $track = get_track( shift || $::settings->{'selected_track'} ); foreach ( @{ $track->{'audio'} } ) { return $_ if $ix == $_->{'ix'}; } return -1; } sub get_chapter { my $ix = shift; my $track = get_track( shift || $::settings->{'selected_track'} ); foreach ( @{ $track->{'chapter'} } ) { return $_ if $ix == $_->{'ix'}; } return -1; } sub get_cell { my $ix = shift; my $track = get_track( shift || $::settings->{'selected_track'} ); foreach ( @{ $track->{'cell'} } ) { return $_ if $ix == $_->{'ix'}; } return -1; } sub message { my ( $data, $tag ) = @_; if ( defined $::widgets ) { my $context_id = $::widgets->{'status_bar'}->get_context_id('acidrip'); $::widgets->{'status_bar'}->pop($context_id); $::widgets->{'status_bar'}->push( $context_id, $data ); my $iter = $::widgets->{'mencoder_output_text'}->get_buffer->get_end_iter; if ($tag) { $::widgets->{'mencoder_output_text'}->get_buffer->insert_with_tags_by_name( $iter, "AcidRip message - $data\n", $tag ); } else { $::widgets->{'mencoder_output_text'}->get_buffer->insert( $iter, "AcidRip message - $data\n" ); } } else { print "AcidRip message - $data\n"; } } sub load_settings_to_interface { foreach my $value ( keys %{$::settings} ) { $::widgets->{ $value . "_entry" }->set_text( $::settings->{$value} ) if defined( $::widgets->{ $value . "_entry" } ) and $value ne $::widgets->{ $value . "_entry" }->get_text; $::widgets->{ $value . "_spin" }->set_value( $::settings->{$value} ) if defined( $::widgets->{ $value . "_spin" } ) and $value ne $::widgets->{ $value . "_spin" }->get_value_as_int; $::widgets->{ $value . "_check" }->set_active( $::settings->{$value} ) if defined( $::widgets->{ $value . "_check" } ); $::widgets->{ $value . "_option" }->set_history( $::settings->{$value} ) if ( $::settings->{$value} =~ /^\d+$/ ) and defined( $::widgets->{ $value . "_option" } ); } } sub set_setting ($$) { my ( $name, $data ) = @_; $::settings->{$name} = $data; $::widgets->{ $name . "_entry" }->set_text($data) if defined $::widgets->{ $name . "_entry" } and $data ne $::widgets->{ $name . "_entry" }->get_text; # and $::widgets->{$name . "_entry"}->get('editable'); $::widgets->{ $name . "_spin" }->set_value($data) if defined $::widgets->{ $name . "_spin" } and $data ne $::widgets->{ $name . "_spin" }->get_value; #and $::widgets->{$name . "_spin"}->get('editable'); } sub substitute_filename ($) { my $filename = shift; my $f = substr( $::settings->{'title'}, 0, 1 ); $filename =~ s/%N/$::settings->{'selected_track'}/g; # track Number $filename =~ s/%f/$f/g; # First letter of title $filename =~ s/%T/$::settings->{'title'}/g; # Title $filename =~ s/%L/$::settings->{'length'}/g; # Length $filename =~ s/%b/$::settings->{'video_bitrate'}/g; # bitrate $filename =~ s/%l/$::settings->{'language'}/g; # language $filename =~ s/%w/$::settings->{'scale_width'}/g; # width $filename =~ s/%h/$::settings->{'scale_height'}/g; # height return $filename; } sub get_parameters { split_track() if $::settings->{'total_blocks'} > 1; set_bitrate() if $::settings->{'this_block'} > 0; my %menc = (); my $length = get_track()->{'length'}; $menc{'video_options'} = $::settings->{'video_options'}; $menc{'video'} = "-ovc $::settings->{'video_codec'}"; $menc{'info'} = "-info srcform=\"DVD ripped by acidrip.sf.net\""; $menc{'info'} .= ":name=\"$::settings->{'info_name'}\"" if defined $::settings->{'info_name'} && $::settings->{'info_name'} ne ''; $menc{'info'} .= ":comment=\"$::settings->{'info_comment'}\"" if defined $::settings->{'info_comment'} && $::settings->{'info_comment'} ne ''; $menc{'info'} .= ":artist=\"$::settings->{'info_artist'}\"" if defined $::settings->{'info_artist'} && $::settings->{'info_artist'} ne ''; $menc{'info'} .= ":subject=\"$::settings->{'info_subject'}\"" if defined $::settings->{'info_subject'} && $::settings->{'info_subject'} ne ''; $menc{'info'} .= ":genre=\"$::settings->{'info_genre'}\"" if defined $::settings->{'info_genre'} && $::settings->{'info_genre'} ne ''; $menc{'info'} .= ":copyright=\"$::settings->{'info_copyright'}\"" if defined $::settings->{'info_copyright'} && $::settings->{'info_copyright'} ne ''; if ( $::settings->{'video_codec'} eq 'lavc' ) { $menc{'video'} = "-ovc lavc -lavcopts $::settings->{'lavc_options'}:vbitrate=$::settings->{'video_bitrate'}"; $menc{'video'} .= ":vpass=$::settings->{'video_pass'}" if $::settings->{'video_passes'} > 1; } if ( $::settings->{'video_codec'} eq 'divx4' ) { $menc{'video'} = "-ovc divx4 -divx4opts $::settings->{'divx4_options'}:br=$::settings->{'video_bitrate'}"; $menc{'video'} .= ":pass=$::settings->{'video_pass'}" if $::settings->{'video_passes'} > 1; } if ( $::settings->{'video_codec'} eq 'xvid' ) { $menc{'video'} = "-ovc xvid -xvidencopts $::settings->{'xvid_options'}:bitrate=$::settings->{'video_bitrate'}"; $menc{'video'} .= ":pass=$::settings->{'video_pass'}" if $::settings->{'video_passes'} > 1; } if ( $::settings->{'video_codec'} eq 'nuv' ) { $menc{'video'} = "-ovc nuv -nuvopts $::settings->{'nuv_options'}"; } if ( $::dvd->{'source'} eq "dvd" ) { $menc{'dvdplay'} = "dvd://$::settings->{'selected_track'}"; $menc{'dvdplay'} .= " -dvd-device $::settings->{'dvd_device'}" if $::settings->{'dvd_device'} ne ''; $menc{'dvdmenc'} = $menc{'dvdplay'}; if ( $::settings->{'mplayer_version'} < 1 ) { $menc{'dvdmenc'} = "-dvd $::settings->{'selected_track'}"; $menc{'dvdmenc'} .= " -dvd-device $::settings->{'dvd_device'}" if $::settings->{'dvd_device'} ne ''; } if ( $::settings->{'mplayer_version'} < 0.9 ) { $menc{'dvdplay'} = "-dvd $::settings->{'selected_track'}"; $menc{'dvdplay'} .= " -dvd-device $::settings->{'dvd_device'}" if $::settings->{'dvd_device'} ne ''; } } else { $menc{'dvdplay'} = quotemeta( get_track()->{'filename'} ); $menc{'dvdmenc'} = quotemeta( get_track()->{'filename'} ); } $menc{'audio_track'} = ''; $menc{'audio_track'} = "-alang $::settings->{'language'}" if ( $::settings->{'selected_audio'} == -1 ); $menc{'audio_track'} = "-nosound" if ( $::settings->{'selected_audio'} == -2 ); $menc{'audio_track'} = join( " ", "-aid", $::settings->{'selected_audio'} + 127 ) if ( $::settings->{'selected_audio'} > 0 ); $menc{'audio'} = "-oac $::settings->{'audio_codec'}"; $menc{'audio'} .= " -lameopts $::settings->{'audio_mp3lame_options'}" if $::settings->{'audio_codec'} eq 'mp3lame'; $menc{'audio'} .= " -lavcopts $::settings->{'audio_lavc_options'}" if $::settings->{'audio_codec'} eq 'lavc'; $menc{'audio'} = '' if ( $::settings->{'selected_audio'} == -2 ); $menc{'basename'} = substitute_filename( $::settings->{'filename'} ); $menc{'basename'} = $menc{'basename'} . "-" . $::settings->{'this_block'} if $::settings->{'this_block'}; $menc{'output'} = $::settings->{'video_pass'} == 1 ? "/dev/null" : $menc{'basename'} . ( $::settings->{'mpegfile'} ? ".mpg" : ".avi" ); $menc{'af'} = $::settings->{'audio_gain'} == 0 ? "" : "-af volume=" . $::settings->{'audio_gain'} . ":sc"; $menc{'af'} = '' if ( $::settings->{'selected_audio'} == -2 ); $menc{'mpegfile'} = $::settings->{'mpegfile'} ? "-of mpeg" : ""; $menc{'subp'} = $::settings->{'selected_subp'} > -1 ? "-sid " . ( $::settings->{'selected_subp'} - 1 ) : ""; $menc{'subout'} = $::settings->{'vobsubout'} ? "-vobsubout $menc{'basename'}" : ""; $menc{'scale'} = $::settings->{'scale_enable'} ? "scale=$::settings->{'scale_width'}:$::settings->{'scale_height'}" : ""; $menc{'crop'} = $::settings->{'crop_enable'} ? "crop=$::settings->{'crop_width'}:$::settings->{'crop_height'}:$::settings->{'crop_horizontal'}:$::settings->{'crop_vertical'}" : ''; $menc{'vf'} = ( $::settings->{'mplayer_version'} < 1 ) ? "-vop" : "-vf"; $menc{'vf_pre'} = $::settings->{'vf_pre'} if $::settings->{'vf_pre_enable'} && $::settings->{'vf_pre'} ne ''; $menc{'vf_post'} = $::settings->{'vf_post'} if $::settings->{'vf_post_enable'} && $::settings->{'vf_post'} ne ''; my $cw = $::settings->{'crop_width'} || get_track()->{'width'}; my $ch = $::settings->{'crop_height'} || get_track()->{'height'}; my @vfoptions; if ( $::settings->{'mplayer_version'} < 1 ) { push( @vfoptions, $menc{'vf_post'} ) if $menc{'vf_post'}; push( @vfoptions, $menc{'scale'} ) if $menc{'scale'}; push( @vfoptions, $menc{'crop'} ) if $menc{'crop'}; push( @vfoptions, $menc{'vf_pre'} ) if $menc{'vf_pre'}; $menc{'embed'} = $::settings->{'embed_preview'} ? " -vop scale=" . $::widgets->{'preview_socket'}->allocation->width . ":-2,$menc{'crop'} -wid " . $::widgets->{'preview_socket'}->get_id : ( @vfoptions ? "$menc{'vf'} " . join( ",", @vfoptions ) : '' ); } else { push( @vfoptions, $menc{'vf_pre'} ) if $menc{'vf_pre'}; push( @vfoptions, $menc{'crop'} ) if $menc{'crop'}; push( @vfoptions, $menc{'scale'} ) if $menc{'scale'}; push( @vfoptions, $menc{'vf_post'} ) if $menc{'vf_post'}; $menc{'crop'} .= "," if $menc{'crop'}; $menc{'embed'} = $::settings->{'embed_preview'} ? " -vf $menc{'crop'}scale=" . $::widgets->{'preview_socket'}->allocation->width . ":-2 -wid " . $::widgets->{'preview_socket'}->get_id : ( @vfoptions ? "$menc{'vf'} " . join( ",", @vfoptions ) : '' ); } $menc{'vf_filters'} = ($::settings->{'video_codec'} ne 'copy' && scalar(@vfoptions)) ? "$menc{'vf'} " . join( ",", @vfoptions ) : ""; $menc{'chapter'} = ''; if ( $::settings->{'total_blocks'} > 1 && $::settings->{'this_block'} > 0 && $::dvd->{'source'} eq "dvd") { $menc{'chapter'} = "-chapter " . ( $::settings->{'blocks'}[ $::settings->{'this_block'} - 1 ] + 1 ) . "-" . $::settings->{'blocks'}[ $::settings->{'this_block'} ]; $length = get_selection_length( $::settings->{'blocks'}[ $::settings->{'this_block'} - 1 ] + 1, $::settings->{'blocks'}[ $::settings->{'this_block'} ] ); } elsif ( $::settings->{'selected_chapters_start'} > 0 && $::settings->{'selected_chapters_end'} > 0 && $::dvd->{'source'} eq "dvd") { $menc{'chapter'} = "-chapter $::settings->{'selected_chapters_start'}-$::settings->{'selected_chapters_end'}"; $length = get_selection_length( $::settings->{'selected_chapters_start'}, $::settings->{'selected_chapters_end'} ); } my $frames = $::settings->{'ppc_bug'} ? 100 : 10; my $sstep = "-sstep " . int $length / ( 3 * $frames ) + 1; $sstep = "-ss " . int $length / 3 if $::settings->{'ppc_bug'}; $menc{'frames'} = "-frames $frames $sstep"; my $basename = basename substitute_filename( $::settings->{'filename'} ); $menc{'cache'} = $::settings->{'cache_directory'} . "/" . $basename . "-cache"; $menc{'cache'} = $::settings->{'cache_directory'} . "/" . $basename . "-" . $::settings->{'this_block'} . "-cache" if $::settings->{'this_block'}; $menc{'more_options'} = $::settings->{'more_options'}; return %menc; } sub get_command { my $command = shift; my %menc = get_parameters(); return "$::settings->{'mencoder'} $menc{'cache'} $menc{'audio'} $menc{'audio_track'} $menc{'video'} $menc{'vf_filters'} $menc{'more_options'} $menc{'af'} $menc{'audio_track'} $menc{'mpegfile'} -o \"$menc{'output'}\"" if $command eq "mencoder" && $::settings->{'cache'} && $::dvd->{'source'} eq "dvd"; return "$::settings->{'mencoder'} $menc{'dvdmenc'} $menc{'chapter'} $menc{'audio_track'} $menc{'subp'} $menc{'subout'} $menc{'info'} $menc{'audio'} $menc{'af'} $menc{'video'} $menc{'vf_filters'} $menc{'mpegfile'} $menc{'more_options'} -o \"$menc{'output'}\"" if $command eq "mencoder"; return "$::settings->{'mplayer'} $menc{'dvdplay'} $menc{'audio_track'} $menc{'af'} $menc{'chapter'} $menc{'frames'} -nocache $menc{'embed'}" if $command eq "preview" && $::settings->{'flickbook_preview'} && !$::settings->{'ppc_bug'}; return "$::settings->{'mplayer'} $menc{'embed'} $menc{'dvdplay'} $menc{'af'} $menc{'audio_track'} $menc{'chapter'} $menc{'subp'} -nocache" if $command eq "preview"; return "$::settings->{'mplayer'} -quiet \"$menc{'output'}\"" if $command eq "view"; return "$::settings->{'mplayer'} $menc{'dvdplay'} $menc{'chapter'} -v -v -dumpstream -dumpfile \"$menc{'cache'}\"" if $command eq "cache"; return "$::settings->{'mplayer'} $menc{'vf'} cropdetect $menc{'dvdplay'} -nosound -vo null $menc{'frames'} -nocache" if $command eq "cropdetect"; return "$::settings->{'mencoder'} $menc{'cache'} $menc{'audio'} $menc{'audio_track'} $menc{'af'} -ovc frameno -o frameno.avi" if $command eq "mencoder_frameno" && $::settings->{'cache'}; return "$::settings->{'mencoder'} $menc{'dvdmenc'} $menc{'chapter'} $menc{'audio'} $menc{'audio_track'} $menc{'af'} -ovc frameno -o frameno.avi" if $command eq "mencoder_frameno"; return "$::settings->{'mencoder'} $menc{'cache'} -oac copy $menc{'video'} $menc{'vf_filters'} $menc{'more_options'} $menc{'audio_track'} $menc{'mpegfile'} -o \"$menc{'output'}\"" if $command eq "mencoder_3pass" && $::settings->{'cache'}; return "$::settings->{'mencoder'} $menc{'dvdmenc'} $menc{'chapter'} $menc{'subp'} $menc{'subout'} $menc{'info'} -oac copy $menc{'video'} $menc{'vf_filters'} $menc{'mpegfile'} $menc{'more_options'} -o \"$menc{'output'}\"" if $command eq "mencoder_3pass"; return "unlink \"$menc{'cache'}\"" if $command eq "del_cache"; return "command not found!"; } sub set_bitrate { return -1 if !defined $::dvd->{'track'}; my $length; my $size; my $bitrate = 0; my $audio_rate = 128; my $this_track = get_track(); if ( $::settings->{'audio_codec'} eq 'mp3lame' && $::settings->{'audio_mp3lame_options'} =~ /br=(\d+)/ ) { $audio_rate = $1; } elsif ( $::settings->{'audio_codec'} eq 'lavc' && $::settings->{'audio_lavc_options'} =~ /abitrate=(\d+)/ ) { $audio_rate = $1; } elsif ( $::settings->{'audio_codec'} eq 'copy' ) { my $channels = $this_track->{'audio'}[ $::settings->{'selected_audio'} ]->{'channels'}; $audio_rate = 192 if $channels == 2; $audio_rate = 384 if $channels == 6; } if ( $::settings->{'this_block'} ) { $length = get_selection_length( $::settings->{'blocks'}[ $::settings->{'this_block'} - 1 ] + 1, $::settings->{'blocks'}[ $::settings->{'this_block'} ] ); $size = $::settings->{'filesize'}; } elsif ( $::settings->{'total_blocks'} > 1 ) { $length = get_selection_length(); $size = $::settings->{'filesize'} * ( scalar @{ $::settings->{'blocks'} } - 1 ); } else { $length = get_selection_length(); $size = $::settings->{'filesize'}; } if ( $::settings->{'video_bitrate_lock'} ) { set_filesize( $length, $audio_rate ); set_bpp(); return -1; } if ( $size == 0 || $length == 0 || $size !~ /^\d+$/ ) { $bitrate = -1 } else { $bitrate = int( ( ( $size * 8192 ) / $length ) - $audio_rate ) } $bitrate = 5000 if $bitrate > 5000; if ( $bitrate < 0 ) { message("Error setting bitrate") } set_setting( 'video_bitrate', $bitrate ); set_bpp(); } sub set_filesize ($$) { my $length = shift; my $audio_rate = shift; my $bitrate = $::widgets->{'video_bitrate_spin'}->get_value_as_int; my $size; if ( $bitrate == 0 || $length == 0 || $audio_rate !~ /^\d+$/ ) { $size = -1; } else { $size = int( ( ( $audio_rate + $bitrate ) * $length ) / 8192 ); } if ( $size < 0 ) { message("Error estimating filesize") } set_setting( 'filesize', $size ); #set_bpp(); } sub set_bpp { return -1 if ! defined $::dvd->{'track'}; return -1 if ! scalar @{$::dvd->{'track'}}; my $bpp = 0; my $fps = get_track()->{'fps'} || -1; my $wo = get_track()->{'width'} || -1; my $ho = get_track()->{'height'} || -1; my $ws = $::settings->{'scale_width'} || $wo; my $hs = $::settings->{'scale_height'} || $ho; my $br = $::settings->{'video_bitrate'}; my $wc = $::settings->{'crop_width'} || $wo; my $hc = $::settings->{'crop_height'} || $ho; my $aa = 0; if ( defined get_track()->{'aspect'} ) { my $aa = eval( get_track()->{'aspect'} ); #eval to allow fraction string to equate to a float } $aa = $wo / $ho if !$aa; if ( defined $aa && $br * $hc * $wc * $wo * $ho * $fps ) # moronic test for potential divide by zero! { $hs = $hs || $hc; $ws = $ws || $ho * $wc * $aa / $wo; $hs = $hc if $hs == -1; $ws = $wc if $ws == -1; $hs = ( $hc * $wo * $ws ) / ( $wc * $ho * $aa ) if $hs == -2; $ws = ( $wc * $ho * $hs * $aa ) / ( $hc * $wo ) if $ws == -2; $ws = sprintf( "%i", $ws ); $hs = sprintf( "%i", $hs ); $bpp = sprintf( "%.3f", ( $br * 1000 ) / ( $hs * $ws * $fps ) ) if $ws * $hs; if ( defined $::widgets && $ws > 0 && $hs > 0 ) { $::widgets->{'scale_height_estimate_entry'}->set_text($hs); $::widgets->{'video_bpp_entry'}->set_text($bpp); } } return $ws, $hs, $wc, $hc, $wo, $ho; } sub get_available_codecs { my $count = 0; #my $item; my $menc = $::settings->{'mencoder'}; system "$menc >/dev/null 2>&1"; print "MEncoder was not found! Acidrip is utterly useless without it! go install!\n" if $? >> 8 != 1; if ( open( MENC_VIDEO, "$menc -ovc help 2>&1 |" ) ) { while () { $::settings->{'mplayer_version'} = $1 if $_ =~ /MEncoder\s(\d\.\d)/; if ( $_ =~ /\s+(\w+)\s+-\s+(.+)/ ) { $::settings->{'available_video'}{$1} = "$1 - $2"; if ( defined $::widgets and $1 ne "frameno" ) { my $item = new Gtk2::MenuItem("$1"); $::widgets->{'video_codec_option'}->get_menu->append($item); $item->signal_connect( 'activate', \&on_option_changed, $1 ); $::widgets->{'video_options_entry'}->set_text( $::settings->{ $::settings->{'video_codec'} . '_options' } or "" ); $::widgets->{'video_codec_option'}->set_history($count) if $1 eq $::settings->{'video_codec'}; $count++; } } } $::widgets->{'video_codec_option'}->show_all if defined $::widgets; close MENC_VIDEO; } else { message("Mencoder codec test failed. Is MPlayer installed properly?") } if ( open( MENC_AUDIO, "$menc -oac help 2>&1 |" ) ) { my $got_mp3 = 0; $count = 0; while () { if ( $_ =~ /\s+(\w+)\s+-(.*)/ ) { $::settings->{'available_audio'}{$1} = "$1 - $2"; $got_mp3 = 1 if $1 eq "mp3lame" or $1 eq "lavc"; if ( defined $::widgets ) { my $item = new Gtk2::MenuItem("$1"); ( $::widgets->{'audio_codec_option'}->get_menu )->append($item); $item->signal_connect( 'activate', \&on_option_changed, $1 ); } $::widgets->{'audio_options_entry'}->set_text( $::settings->{ "audio_" . $::settings->{'audio_codec'} . '_options' } or '' ); $::widgets->{'audio_codec_option'}->set_history($count) if $1 eq $::settings->{'audio_codec'}; $count++; } } $::widgets->{'audio_codec_option'}->show_all if defined $::widgets; print "AcidRip could NOT find MP3 support in MPlayer! if you do want MP3 sound in your films," . "you will need to recompile MPlayer accordingly. See the docs on the MPlayer site.\n\n" if !$got_mp3; close MENC_AUDIO; } else { message("Mencoder codec test failed. Is MPlayer installed properly?") } } sub kill_mplayer { if ( $::settings->{'mencoder_pid'} > 0 ) { my $m = $::settings->{'mencoder_pid'} + 1; kill 'INT', $::settings->{'mencoder_pid'}; kill 'INT', $m if `ps $m | grep mencoder` || `ps $m | grep mplayer`; message("Encoding stopped."); $::settings->{'mencoder_pid'} = -1; } else { message("Nothing to stop!"); } } sub get_selection_length { my ( $start, $end ) = @_; my $length = 0; if ( defined get_track()->{'chapter'} ) { $start = ( $::settings->{'selected_chapters_start'} || 1 ) if !$start; $end = ( $::settings->{'selected_chapters_end'} || get_track->{'chapter'}[-1]->{'ix'} ) if !$end; for my $chapter ( $start .. $end ) { $length += get_chapter($chapter)->{'length'}; } } else { $length = get_track_param('length'); } return $length; } sub read_source ($) { my $path = shift; if ( -b $path || -c $path ) { return read_disc($path); } elsif ( -d $path ) { my $return = read_disc($path); if ($return) { return read_src_file($path); } else { return $return; } } else { return read_src_file($path); } } sub read_disc ($) { use vars qw(%lsdvd); my $dvd_device = shift; system("$::settings->{'lsdvd'} -h > /dev/null 2> /dev/null"); if ( !$? ) { eval(`$::settings->{'lsdvd'} -xp $dvd_device 2>/dev/null`); if ( !$? ) { $::dvd = {%lsdvd}; $Data::Dumper::Indent = 0; my $lsout = Dumper { %lsdvd }; $::widgets->{'mencoder_output_text'}->get_buffer->insert_with_tags_by_name( $::widgets->{'mencoder_output_text'}->get_buffer->get_end_iter, $lsout . "\n", 'lsdvd' ); $::dvd->{'status'} = "DVD read ok"; $::dvd->{'source'} = "dvd"; $Data::Dumper::Indent = 2; } else { $::dvd = undef; } } else { $::dvd = undef; } $::dvd->{'status'} = "lsdvd not found" if $? >> 8 == 127; $::dvd->{'status'} = "DVD device not found" if $? >> 8 == 1; $::dvd->{'status'} = "DVD not found. Drive empty?" if $? >> 8 == 2; system( "eject " . $dvd_device ) if $? >> 8 == 2 && $::settings->{'eject'}; $::dvd->{'status'} = "Can't read DVD. Not a valid DVD drive!" if $? >> 8 == 3; $::dvd->{'status'} = "Can't read DVD track. Faulty Disc?" if $? >> 8 == 4; return $?; } sub read_src_file ($) { my %files; my $path = shift; $files{'device'} = $path; $files{'source'} = "file"; open IDENTIFY, "$::settings->{'mplayer'} -identify -ao null -vo null -frames 0 $path" . ( -d $path ? '/*' : '' ) . " 2>&1 |"; while () { $files{'track'}[ scalar @{ $files{'track'} } ]{'filename'} = $1 if /ID_FILENAME=(.+)/; $files{'track'}[ scalar @{ $files{'track'} } - 1 ]{'ix'} = scalar @{ $files{'track'} } if /ID_FILENAME=(.+)/; $files{'track'}[ scalar @{ $files{'track'} } - 1 ]{'fps'} = $1 if /ID_VIDEO_FPS=(.+)/; $files{'track'}[ scalar @{ $files{'track'} } - 1 ]{'width'} = $1 if /ID_VIDEO_WIDTH=(.+)/; $files{'track'}[ scalar @{ $files{'track'} } - 1 ]{'height'} = $1 if /ID_VIDEO_HEIGHT=(.+)/; $files{'track'}[ scalar @{ $files{'track'} } - 1 ]{'aspect'} = $1 if /ID_VIDEO_ASPECT=(.+)/ && $1; $files{'track'}[ scalar @{ $files{'track'} } - 1 ]{'format'} = ( $1 eq '0x10000001' ? "MPEG1" : ( $1 eq '0x10000002' ? "MPEG2" : $1 ) ) if /ID_VIDEO_FORMAT=(.+)/; $files{'track'}[ scalar @{ $files{'track'} } - 1 ]{'bitrate'} = $1 if /ID_VIDEO_BITRATE=(.+)/ && $1; $files{'track'}[ scalar @{ $files{'track'} } - 1 ]{'audio'}[0]{'format'} = $1 if /ID_AUDIO_CODEC=(.+)/; $files{'track'}[ scalar @{ $files{'track'} } - 1 ]{'audio'}[0]{'ix'} = 1 if /ID_AUDIO_CODEC=(.+)/; $files{'track'}[ scalar @{ $files{'track'} } - 1 ]{'audio'}[0]{'aformat'} = $1 if /ID_AUDIO_FORMAT=(.+)/; $files{'track'}[ scalar @{ $files{'track'} } - 1 ]{'audio'}[0]{'bitrate'} = $1 if /ID_AUDIO_BITRATE=(.+)/; $files{'track'}[ scalar @{ $files{'track'} } - 1 ]{'audio'}[0]{'frequency'} = $1 if /ID_AUDIO_RATE=(.+)/; $files{'track'}[ scalar @{ $files{'track'} } - 1 ]{'audio'}[0]{'channels'} = $1 if /ID_AUDIO_NCH=(.+)/; if (/ID_LENGTH=(.+)/) { # this is the final line in the output, so might as well demlimit the files $files{'track'}[ scalar @{ $files{'track'} } - 1 ]{'length'} = $1; if ( defined $files{'track'}[ scalar @{ $files{'track'} } - 1 ]{'format'} && defined $files{'track'}[ scalar @{ $files{'track'} } - 1 ]{'fps'} && defined $files{'track'}[ scalar @{ $files{'track'} } - 1 ]{'bitrate'} && $files{'track'}[ scalar @{ $files{'track'} } - 1 ]{'format'} ne 'DVSD') { message("Scanning file \'$files{'track'}[scalar @{$files{'track'}} -1]{'filename'}\'"); } else { pop @{ $files{'track'} }; } } while ( Gtk2->events_pending() ) { Gtk2->main_iteration() } } close IDENTIFY; $::dvd = {%files}; if ( defined $files{'track'} ) { $::dvd->{'status'} = scalar @{ $files{'track'} } . " file" . ( scalar @{ $files{'track'} } != 1 ? 's' : '' ) . " read OK"; } else { $::dvd->{'status'} = "No valid files found"; $::dvd->{'status'} = "No read access to $path" if !-r $path; $::dvd->{'status'} = "$path does not exist!" if !-e $path; } return 0; } sub find_crop ($) { open STDIN, '/dev/null' or message("Can't read /dev/null: $!. May fail if in background"); my $crop_output; if ( defined $::dvd->{'track'} ) { my %crop; message( "Running " . get_command("cropdetect") ); open( CROP, get_command("cropdetect") . " 2>&1 |" ); while () { if ( $_ =~ /crop area.*\s(crop=\d*:\d*:\d*:\d*)/ ) { $crop{$1}++ } $crop_output .= $_; gui_check($_); } my @order = sort { $crop{$b} <=> $crop{$a} } keys %crop; close CROP; return ( $order[0], $crop_output ); } else { return ( -1, "crop detect failed" ) } } sub rebuild_queue_text { my $buffer = $::widgets->{'queue_text'}->get_buffer; $buffer->delete( $buffer->get_bounds ); for ( 1 .. @{$::playlist} ) { my %item = %{ @{$::playlist}[ $_ - 1 ] }; $buffer->insert( $buffer->get_end_iter, $item{'command'} . "\n" ); } } sub queued_encode_events { my $events = 0; foreach my $event (@{$::playlist}) { my %e= %{$event}; if ( $e{'command'} =~ /mencoder/ || $e{'command'} =~ /mplayer/ ) { $events++; } } return $events; } sub push_playlist_queue { message("Pushed events onto queue"); if ( !defined $::dvd->{'track'} ) { message("Hey, you gotta load DVD or file(s) first!"); return -1; } my %menc = get_parameters(); if ( -e $menc{'output'} && !$::settings->{'overwrite'} && $menc{'output'} ne "/dev/null" ) { message("File already exists, refusing to overwrite"); return -1; } my $directory = dirname( substitute_filename( $::settings->{'filename'} ) ); if ( !-d $directory ) { message("Output directory does not exist!"); return -1; } if ( !-w $directory ) { message("Can't write to output directory!"); return -1; } if ( ( !$::settings->{'enough_space'} ) && $::settings->{'enforce_space'} ) { message("Not enough space in output directory!"); return -1; } # Encode file for ( 1 .. $::settings->{'total_blocks'} ) { $::settings->{'this_block'} = $_ if $::settings->{'total_blocks'} > 1; if ( $::settings->{'cache'} && $::dvd->{'source'} eq "dvd" ) { $::settings->{'total_events'}++; $::playlist->prepend( get_command('cache'), 'cache', "Caching title..." ) if $::settings->{'precache'}; $::playlist->append( get_command('cache'), 'cache', "Caching title..." ) if !$::settings->{'precache'}; $::playlist->append( "eject $::settings->{'dvd_device'}", 'system', 'Ejecting DVD' ) if $::settings->{'eject'} && $::dvd->{'source'} eq "dvd" && ( ( $::settings->{'this_block'} == $::settings->{'total_blocks'} && !$::settings->{'precache'} ) || # last block on precache ( $::settings->{'this_block'} == 1 && $::settings->{'precache'} ) || # first block of normal cache $::settings->{'total_blocks'} == 1 # single block ); } my $message = "Encoding film"; $message .= ", Block " . $::settings->{'this_block'} . " of " . $::settings->{'total_blocks'} if $::settings->{'this_block'} > 0; my $twopassable = ( $::settings->{'video_codec'} eq "lavc" || $::settings->{'video_codec'} eq "divx4" || $::settings->{'video_codec'} eq "xvid" ); $::playlist->append( "unlink frameno.avi 2> /dev/null", 'system', "Removing frameno.avi if it exists" ) if $::settings->{'this_block'} == 1 || $::settings->{'total_blocks'} == 1; if ( $::settings->{'video_passes'} > 1 && $twopassable ) { $::playlist->append( get_command("mencoder_frameno"), 'encode', $message . ", frameno pass..." ) if $::settings->{'video_passes'} == 3; $::settings->{'video_pass'} = 1; $::playlist->append( get_command( "mencoder" . ( $::settings->{'video_passes'} == 3 ? "_3pass" : "" ) ), 'encode', $message . ", 1st pass..." ); $::settings->{'video_pass'} = 2; $::playlist->append( get_command( "mencoder" . ( $::settings->{'video_passes'} == 3 ? "_3pass" : "" ) ), 'encode', $message . ", 2nd pass..." ); $::playlist->append( "unlink frameno.avi 2> /dev/null", 'system', "Removing frameno.avi" ) if $::settings->{'video_passes'} == 3; $::playlist->append( "unlink divx2pass.log 2> /dev/null", 'system', "Removing divx2pass.log" ); } else { $::playlist->append( get_command("mencoder"), 'encode', $message ); } $::playlist->append( get_command("del_cache"), 'system', "Deleting cache file" ) if $::settings->{'cache'} && $::settings->{'del_cache'} && $::dvd->{'source'} eq "dvd"; } $::playlist->append( "eject $::settings->{'dvd_device'} 2> /dev/null", 'system', 'Ejecting DVD' ) if $::settings->{'eject'} && !$::settings->{'cache'}; $::playlist->append( "shutdown -h now", 'system', 'Shutting down... bye!' ) if $::settings->{'shutdown'}; } sub pop_playlist_queue { my %item = $::playlist->get(); message( "Running " . $item{'command'} ); message( $item{'message'} ); encode( $item{'command'} ) if $item{'type'} eq 'encode'; cache( $item{'command'} ) if $item{'type'} eq 'cache'; system( $item{'command'} ) if $item{'type'} eq 'system'; $item{'type'} ne 'system' ? return $? : return 0; } sub cache { #fork proofing open STDIN, '/dev/null' or message("Can't read /dev/null: $!. May fail if in background"); my $cache = shift; $cache =~ /"(.+)"/; my $file = $1; my $this_cell = -1; my $size = 0; my $start_chapter; my $stop_chapter; my $this_track = get_track(); if ( $::settings->{'total_blocks'} > 1 ) { $cache =~/-(\d+)-cache/; $start_chapter = $::settings->{'blocks'}[ $1 - 1 ] + 1; $stop_chapter = $::settings->{'blocks'}[ $1 ]; } else { $start_chapter = $::settings->{'selected_chapters_start'}; $stop_chapter = $::settings->{'selected_chapters_end'}; $start_chapter = 1 if $start_chapter == 0; $stop_chapter = $this_track->{'chapter'}[-1]->{'ix'} if $stop_chapter == 0; } my $total_chapters = $stop_chapter - $start_chapter + 1; my $this_event = $::settings->{'total_events'} - queued_encode_events(); $::settings->{'mencoder_pid'} = open( CACHE, "nice $cache 2>&1 |" ); while () { if (/### CELL (\d+)/) { if ( $this_cell != $1 + 1 ) { $this_cell = $1 + 1; my $this_chapter = 0; LOOP: foreach ( reverse( @{ $this_track->{'chapter'} } ) ) { $this_chapter = $_->{'ix'}; last LOOP if $_->{'startcell'} <= $this_cell; } $::widgets->{'cache_chapter'}->set_text( sprintf( "%d (%d/%d)", $this_chapter, $this_chapter + 1 - $start_chapter, $total_chapters ) ); my $progress = sprintf("%d", ($this_event - 1 + ($this_chapter - $start_chapter) / $total_chapters)*100/$::settings->{'total_events'}); $::widgets->{'acidrip'}->set_title(msg("acidrip") . ' - ' . $progress . '%'); $::widgets->{'progress_dialog'}->set_title(msg("acidrip") . ' - ' . $progress . '%'); } $::widgets->{'cache_size'}->set_text( sprintf( "%d", ( -s $file ) / 1048576 ) . "Mb" ) if -e $file; } while ( Gtk2->events_pending() ) { Gtk2->main_iteration() } } close CACHE; return $file; } sub encode { #fork proofing open STDIN, '/dev/null' or message("Can't read /dev/null: $!. May fail if in background"); my $menc = shift; if ( defined $::widgets ) { my $buffer = $::widgets->{'mencoder_output_text'}->get_buffer; my ( $sec, $fps, $size, $time, $rate, $prog ) = ( 0, 0, 0, 0, 0, -1 ); my $this_event = $::settings->{'total_events'} - queued_encode_events(); if ( $::settings->{'mencoder_pid'} = open( MENCODER, "$menc 2>&1 |" ) ) { $/ = "\r"; while () { if (/^Pos:\s*(\d+).\ds\s+(\d+)f\s+\(\s*(\d+)%\)\s+(\d+fps)\sTrem:\s+(\d+min)\s+(\d+mb).+\[([\d:]+)\]/) { if ( $1 ne $sec ) { $sec = $1; $::widgets->{'menc_seconds'}->set_text( hhmmss($1) ) } if ( $4 ne $fps ) { $fps = $4; $::widgets->{'menc_fps'}->set_text($4) } if ( $6 ne $size ) { $size = $6; $::widgets->{'menc_filesize'}->set_text($6) } if ( $5 ne $time ) { $time = $5; $::widgets->{'menc_time'}->set_text($5) } if ( $7 ne $rate ) { $rate = $7; $::widgets->{'menc_bitrate'}->set_text($7) } if ( $3 ne $prog ) { $prog = $3; $::widgets->{'menc_progress'}->set_fraction( $3 / 100 ); my $progress = sprintf("%d", ($this_event - 1 + ($3/100))*100/$::settings->{'total_events'}); $::widgets->{'acidrip'}->set_title(msg("acidrip") . ' - ' . $progress . '%'); $::widgets->{'progress_dialog'}->set_title(msg("acidrip") . ' - ' . $progress . '%'); } } else { s/\r/\n/g; $buffer->insert_with_tags_by_name( $buffer->get_end_iter, $_, 'mplayer' ) } while ( Gtk2->events_pending() ) { Gtk2->main_iteration() } } $/ = "\n"; } else { message( "Mencoder failed, is it properly installed?", 'error' ) } } else { message( "Mencoder failed, is it properly installed?", 'error' ) if !( $::settings->{'mencoder_pid'} = open( MENCODER, "$menc" ) ); } $::widgets->{'view_button'}->set_sensitive( -r ( substitute_filename( $::settings->{'filename'} . ( $::settings->{'mpegfile'} ? ".mpg" : ".avi" ) ) ) ? 1 : 0 ); close MENCODER; } package acidrip_settings; use vars qw($defaults); $defaults = { 'dvd_device' => '/dev/dvd', 'selected_track' => 0, 'selected_chapters_start' => 0, 'selected_chapters_end' => 0, 'filesize' => 700, 'total_blocks' => 1, 'this_block' => 0, 'blocks' => [], 'selected_audio' => -1, 'selected_subp' => -1, # Remember, the GUI is 1 based, mplayer is 0 based. 'audio_codec' => 'mp3lame', 'audio_gain' => 0, 'audio_options' => '', 'audio_mp3lame_options' => 'abr:br=128', 'audio_lavc_options' => 'acodec=mp3:abitrate=128', 'video_codec' => 'lavc', 'lavc_options' => 'vcodec=mpeg4:vhq:v4mv:vqmin=2', 'divx4_options' => '', 'xvid_options' => '', 'vuv_options' => '', 'video_options' => '', 'video_bitrate' => 0, 'video_bitrate_lock' => 0, 'filename' => $ENV{HOME} . '/%T', 'title' => 'unknown', 'mpegfile' => 0, 'length' => 0, 'scale_enable' => 1, 'scale_auto' => 1, 'scale_height' => -2, 'scale_width' => 480, 'crop_enable' => 1, 'crop_height' => 0, 'crop_width' => 0, 'crop_vertical' => 0, 'crop_horizontal' => 0, 'vf_pre' => 'pp=de', 'vf_pre_enable' => 1, 'vf_post' => '', 'vf_post_enable' => 0, 'video_pass' => 0, 'video_passes' => 1, 'more_options' => '', 'language' => 'English', 'mencoder' => 'mencoder', 'mplayer' => 'mplayer', 'lsdvd' => 'lsdvd', 'available_audio' => {}, 'available_video' => {}, 'mencoder_pid' => 0, 'autoload' => 0, 'overwrite' => 0, 'enforce_space' => 1, 'cache' => 0, 'precache' => 1, 'cache_directory' => '/tmp/', 'del_cache' => 0, 'tooltips' => 1, 'busy' => 0, 'UI' => 1, 'compact' => 1, 'enough_space' => 1, 'ppc_bug' => 0, 'embed_preview' => 1, 'eject' => 0, 'vobsubout' => 0, 'mplayer_version' => 1, 'flickbook_preview' => 0, 'export_script' => 0, 'info_artist' => '', 'info_genre' => '', 'info_name' => '', 'info_copyright' => '', 'info_subject' => '', 'shutdown' => 0, 'ui_language' => 'English', 'total_events' => 0 }; sub new { my $class = shift; my $settings = {}; foreach my $key ( keys %{$defaults} ) { $settings->{$key} = $defaults->{$key} } bless( $settings, $class ); return $settings; } sub get_default ($$) { my ( $settings, $value ) = @_; return $defaults->{$value} if ( defined $settings->{$value} ); return "unknown setting! - $value"; } sub restore_settings { my $settings = shift; foreach my $key ( keys %{$defaults} ) { $settings->{$key} = $defaults->{$key} unless $key eq "selected_track" } return $settings; } sub save_settings { my $settings = shift; my @save = ( 'dvd_device', 'filesize', 'filename', 'audio_codec', 'audio_mp3lame_options', 'audio_lavc_options', 'video_codec', 'scale_enable', 'autoload', 'mpegfile', 'eject', 'scale_auto', 'scale_height', 'scale_width', 'crop_enable', 'language', 'mencoder', 'mplayer', 'lsdvd', 'tooltips', 'video_passes', 'video_bitrate_lock', 'lavc_options', 'xvid_options', 'divx4_options', 'more_options', 'total_blocks', 'overwrite', 'cache', 'cache_directory', 'vf_pre_enable', 'audio_gain', 'vf_post_enable', 'vf_pre', 'vf_post', 'del_cache', 'ppc_bug', 'compact', 'flickbook_preview', 'enforce_space', 'vobsubout', 'video_bitrate', 'ui_language' ); if ( open( CONFIGFILE, '>', "$ENV{HOME}/.acidriprc" ) ) { foreach my $key (@save) { print CONFIGFILE "$key = $settings->{$key}\n" if $settings->{$key} ne ''; } close CONFIGFILE; } else { acidrip::message("Can't open config file for writing!\n"); } } sub load_settings { my $settings = shift; if ( open( CONFIGFILE, "$ENV{HOME}/.acidriprc" ) ) { while () { if ( $_ =~ /(\w+)\s=\s(.+)/ ) { $settings->{$1} = $2 } } close CONFIGFILE; } else { acidrip::message("No configuration file found, nevermind."); } return $settings; } package acidrip_playlist; use Data::Dumper; sub new { bless( [], shift ); } sub append { my $playlist = shift; my %item; $item{'command'} = shift; $item{'type'} = shift; # system, encode, cache, eval $item{'message'} = shift; push( @{$playlist}, \%item ); } sub prepend { my $playlist = shift; my %item; $item{'command'} = shift; $item{'type'} = shift; # system, encode, cache, eval $item{'message'} = shift; unshift( @{$playlist}, \%item ); } sub clear { my $playlist = shift; while ( @{$::playlist} ) { shift @{$::playlist}; } } sub get { my $playlist = shift; return %{ shift @{$playlist} }; } 1; acidrip-0.14/CHANGELOG0000644000076400001440000001010710125312427014552 0ustar chrisusers000000000000000.14 Ok. I started making changes after 0.12 came out in April. Right now it is the end of September. I fixed a load of stuff, but I just plain can't remember much, other than the main release focus: *********** Can encode from files and directories, not just DVD's! *********** So everything else will have to become: General bugfixes. 0.12 /dev/null no longer prevents overwrite shutodwn when complete support for -nuvopts removed frameno from video codecs gave up trying to use Rectangle for preview.. just crops instead now. batch file support bash script exporting filename variables %T, %N, %L etc... enter on dvd drive reads disc bitrate lock actually DOES something now! alternative file naming method based on variables - much clearer ad more flexible. added support for libavcodec audio, now two ways to get mp3 able to encode to mpeg files as well as avi 0.11 23/10/03 - super minor rerelease crashed if changing numebr of files with no DVD loaded - fixed test.pl checked for old version of lsdvd - fixed added automatic version detection for newer mplayer-1 branch corrected subtitle error numerous small fixes from nicolai langfeldt 0.10 Gtk2 overhaul, huzzah! Extra info about MPlayer exit codes, crashed etc... medium sized caching rewrite Eject functionality many other improvements 0.9 Large amounts of core changes to accomodate perl output in lsdvd increased checking for error in lsdvd bugfixes for not updating filename on detection added Flickbook preview mode added ppc sstep bug avoidance removal of DVDInfo.pm completely - did not warrant an object, methods were largely restrictive and redundant. changed old style -dvd # to newer dvd://# format - got mplayer to admit a bug! put in check for gui=yes - got mplayer to remove option completely! - i think! added notebook tabs, rearranged UI made more buttons insensitve when not relevant added perview tab 0.8 added warning colors for invalid paths (non existant / non writable) made GUI more sane and logical created status dialog box added info fields probably only used again by mplayer cropping values must have sane values if set by user - dynamic limits. allowed spaces and other metacharacters in filenames etc... as abandoned in 0.7 removed "directory" box - now works directly from filename entry. added basic caching facilites - subtitles not supported (needs lsdvd 0.7) allowed default language to change rewrote command building methods vastly improved title deriving methods (see lsdvd) fixed 2 pass operation on multiple files 0.7 lots of bugfixes changed config file to .acidriprc for conformity closed STDIN - can run properly in background now (i think) replaced many combo's and entry boxes with spinbuttons improved messaging system - needed for spinbuttons # allowed spaces, &'s etc in filename # removed - causes mencer to execute in a sh session instead of # running directly with execvp(), so process is a fscker to kill 0.6 added times for selected chapters added misc options box, e.g. -ofps 25 actually DID fix the i18n error that i didn't in 0.5.1! finally wrote a small test.pl stop button now halts ENTIRE system, not just current encode multiple file support. bit shaky but seems to work! 0.5.1 - just some fixes... added bitrate information to mencoder box preview button plays selected chapters fixed grammar error from mencoders i18n - . and , 0.5 gaping hole fixed for dvd device != /dev/dvd 2 pass encoding for lavc dix4 and xvid added i hope BPP calculations added - requires newer lsdvd 0.4 I really can't be arsed with changelog's "discrete" bitrate lock button output log window and most output's various bug fixes changed default width from -1 to 480 lsdvd setting on additional settings removal of a lot of naive redundant code addition of first command line implementation - alpha more debugging messages code abstraction, e.g. seperation of mencoder command construction from callback 0.3 Made track automatically select when chapter selected options for each video / audio codec should be saved move and compact scale / crop button area added loads of tooltips subp / audio extension only printed if defined, neater acidrip-0.14/MANIFEST0000644000076400001440000000041310030403701014457 0ustar chrisusers00000000000000AcidRip/acidrip.pm AcidRip/interface.pm AcidRip/signals.pm AcidRip/messages.pm COPYING CHANGELOG TODO MANIFEST Makefile.PL acidrip acidrip.spec test.pl lsdvd-0.10.tar.gz AcidRip/logo.png META.yml Module meta-data (added by MakeMaker) acidrip-0.14/lsdvd-0.10.tar.gz0000644000076400001440000010655610017441207016174 0ustar chrisusers00000000000000x?\ms8נG5'іe%EزKny(XH AZ@UnE$^ݍ~y 7Owsu}Ϡ٫i _^gMȇ"%q POB, eD J>q@I0R]AP8K2)w%hٌbP@W"yÌ $'kq|!x%Mad. TLY"#ЖLOxwFSEs*Tɖ"]]1 $XrTQG@vp=|Bac0YxEcMHSUw&"i`tqa`#.ַ@a#8",|SR  JI,EÖAa+/|74O~8ɱ.a?\F㼐vǝn~[ՎV}iQhfAv`%mKfo;{?P߫қ}S}{r IWY혲Qƪ3E{Upu}7/ hp7U g5 }ޏz?ܼ )|~z[>8IHjHգԌ =ego[;9ݑ}]_oU\;Z۷&4?חK^b46^w{s^u0]߃וaѾǪB{w}iHd.$mƼa8`̅=oȅvsZ<뙲bEdl10!%JP/(N'7}la{dT+ڝ/3=q+ҹZ2 7^(ܨ D6[I`+_~ܚжjD)Ix]CyvTN蒳HNQ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@ yYB dPu$$E-7ڧԴ&<}f[/*Ĥ@\|r}aX,jLRފ0 uZoMR?*uxCI5{'N~Zx 7rR,F}k֔IFnEA|~)_|]uʪIIeeIk&dXl"=8WhjKE&VE" Gwm!\N:?N{<; Hn)Gp8< ~'JC֎L^U Iw}d1AG%dN >QȻʉ̟3c&Su2[fڴ)IEMtWkPk)gMbwBpOxJ̧̽ii˙c[ ytdd|ߩ3yys<_+2WRAcn\{zw}qɹY4׮rf[:9>n[J6BX~8܇.r1 Ãl$Q3 :gǂ6G/pQft~|WSO,eX385Aӕaz,Yǚ'T/^1Yt'Sr+D4 TʚVO&Lg¥-T ^t"CcN6EŤoE?|fZS=Mqsp -8V'WNԴeԜʠ |"> :?Lqja h?;K柚AC=;6\YU<'V/ݝjekM+C_|N׈in;蟨/~3)o;iggƮHTRd&,m&s~oR*YLm-OXoO7-u_J K$N؊7onX- sҴ6# before, during and after stages e.g. for shutdown correctness make bitrate non editable when not locked, estimate filesize when bitrate is locked acidrip-0.14/Makefile.PL0000644000076400001440000000565210017441207015322 0ustar chrisusers00000000000000# # Makefile.PL for acidrip # - version 0.12 # require 5.008; use ExtUtils::MakeMaker; use strict; use Getopt::Std; use vars qw($opt_n); unless (getopts("n")) { die "Usage: $0 [-n]\n"; } # Check for non-standard modules that are used by this library. $| = 1; # autoflush on WriteMakefile( 'DISTNAME' => 'acidrip', 'NAME' => 'AcidRip', 'VERSION_FROM' => 'acidrip', 'EXE_FILES' => [ qw(acidrip) ], 'clean' => { FILES => '' }, 'dist' => { COMPRESS => 'gzip', SUFFIX => 'gz' }, 'PREREQ_PM' => { 'Gtk2' => 1, 'Glib' => 1 } ); package MY; # Pass Glade-Perl version number to pod2man sub manifypods { my $self = shift; my $ver = $self->{'VERSION'} || ""; local($_) = $self->SUPER::manifypods(@_); s/pod2mans*$/pod2man --release acidrip-$ver/m; $_; } print "\nRunning additional test to be sure acidrip will work\n"; print "test for lsdvd: "; my $lsdvd = `lsdvd -V 2>&1`; if ( $lsdvd !~ /0.(\d+)\s/ ) { die "Not Found!\n\n***************\n" . "AcidRip needs my little app \"lsdvd\" in order to see what is on your dvd\'s\n" . "Download it and install it (and libdvdread) before trying to use AcidRip.\n" . "If it\'s simply not on your path then set the full path inside AcidRip.\n" . "***************\n\n" } if ( $1 < 9 ) { die "Too old!\n\n***************\n" . "AcidRip needs at least version 0.9 of lsdvd, but version 0.$1 was found\n" . "Download it and install it (and libdvdread) before trying to use AcidRip.\n" . "***************\n\n" } print "found\n"; print "test for MPlayer: "; die "Not Found!\n\n***************\n" . "AcidRip is based around the MPlayer video player. it has not been found on\n" . "your current path. Install it from http://mplayerhq/hu see INSTALL.html or\n" . "INSTALL for installation instructions.\n" . "***************\n\n" if ( system "mplayer 2&>1 > /dev/null" ); print "found\n"; print "test for MEncoder: "; die "Not Found!\n\n***************\n" . "AcidRip uses MEncoder, which is part of MPlayer video player package. This\n" . "was not found. Install it from http://mplayerhq/hu see INSTALL.html or\n" . "INSTALL for installation instructions.\n" . "***************\n\n" if ( system "mencoder -ovc help 2> /dev/null | grep MEncoder > /dev/null" ); print "found\n"; print "test for MP3 support in mencoder: "; die "Not Found!\n\n***************\n" . "MEncoder was found, however it does not have MP3 support built into it.\n" . "If you DO want MP3 support you'll need to recompile mplayer with mp3 support\n" . "See INSTALL or INSTALL.html for more information\n" . "***************\n\n" if ( system "mencoder -oac help 2> /dev/null | grep mp3lame > /dev/null" ); print "found\n"; print "Everything looks good here...\n"; print "\nPlease send any feedback to me, I actually do want to know what you think of it."; print "\nMaybe then I can make it suck less. acid_kewpie\@users.sourceforge.net\n\n"; exit(0);