disc-cover-1.5.6/0000775000076500000000000000000010445763457014544 5ustar jvhemertwheel00000000000000disc-cover-1.5.6/._.DS_Store0000400000076500000000000000012210445763430016412 0ustar jvhemertwheel00000000000000Mac OS X  2 R@disc-cover-1.5.6/.DS_Store0000664000076500000000000001400410445763430016215 0ustar jvhemertwheel00000000000000Bud1 ORSinfoblAUTHORSinfoblob0¾›®Œ’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’ CHANGELOGinfoblob0¾›Ł„’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’COPYINGinfoblob0¾›®Œ’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’CVSinfoblob0¾›ŠZ’’’’’’’’’’’’’’’’’’’’’’’’’’’’ disc-coverinfoblob0¾›Ö ’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’docsinfoblob0¾›Æ’’’’’’’’’’’’’’’’’’’’’’’’’’’’ templatesinfoblob0¾›Æ’’’’’’’’’’’’ ’’’’’’’’’’’’’’’’TODOinfoblob0¾›®Œ’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’  @€ @€ @€ @ E DSDB `€ @€ @€ @disc-cover-1.5.6/AUTHORS0000664000076500000000000000007010445763430015600 0ustar jvhemertwheel00000000000000Author and maintainer J.I. van Hemert disc-cover-1.5.6/CHANGELOG0000664000076500000000000005674310445763430015764 0ustar jvhemertwheel00000000000000 2006-06-20 CHANGELOG - Disc-Cover Version 1.5.6 - fixed: version incorrectly displayed - fixed: proper encoding of languages through inputenc package (thanks to Matthias Drochner) Version 1.5.5 - fixed: better handling of double disc titles (patch by Lars at systemausfall.org) - fixed: isolatin1 is removed from the userpackages as it has become depreciated. (thanks to Markus Gapp) - fixed: AllMusic works again (new layout of website) - added: new template paper-box, which creates a sleeve that holds your cd. (contributed by Lothar Schweikle-Droll) - added: new template that places only a a picture on the front cover, which is scaled to fit the whole cover. - added: added option template_list, which generates list of feasible templates. (patch by Jereme Corrado, the new Debian maintainer) - changed: new template_list option used in the webserver index.cgi (patch by Jereme Corrado, the new Debian maintainer) - changed: better regular expression for getting covers from AllMusic.com (patch by Julius Gehr). Version 1.5.4 - fixed: fatal bug causing disc-cover not to work under Linux without -f flag (thanks to Thibaut Cousin for the quick response). Version 1.5.3 - changed: online.cgi works on SunOS - changed: Audio:CD library is no longer required when using the -f option. This makes setting up a webserver much easier. - added: new template that only prints backs of jewel cases, called backonly (Sebastian Kaps) - bugfix: latex templates set by user were overwritten (Christophe Labouisse)o - added: to the FAQ, how to include pictures without quality reduction. - bugfix: forgot \ in linewidth command for Disc 1&2 lines (Harry James Butler) - bugfix: fixed problem with = symbol in ttitle entries (Yaniv Aran). Version 1.5.2 - added: new option -u (or -uppercase) that fixes cddb entries written in all lowercase, which too many people still do! - bugfix: problem with title lines (Disc 1 & Disc 2) of double discs. Version 1.5.1 - changed: picture command \DCpicture now only provides the basic command for including a picture in LaTeX. This makes it possible to do almost anything with the picture now. - changed: the templates have been changed to use the new \DCpicture command, the picture will be centered and the border has been removed. Version 1.5.0 - bugfix: problems with title of double cd when both titles in cddb files were equal (thanks to Jacco de Kraker). - bugfix: misaligned lines when 'foreign' characters in capital appeared, like umlauts and such (thanks to Martin Hensel and Sebastian Djupsjöbacka). - changed: internal code for cover types has been replaced by external template files. This should make it easier for people to change templates and add new ones. Because of this move some configuration variables have become obsolete: $config_frontcover_height, $config_frontcover_width, $config_backcover_height, $config_backcover_width, $config_tevion_cover_height, $config_tevion_cover_width, $config_tevion_flap_height, $config_tevion_flap_width1, $config_tevion_flap_width2 - changed: moved disc-cover information bar to the bottom (should prevent printer problems). - changed: the LaTeX output (not the final result) to get rid of many (all?) LaTeX warnings (thanks to Martin Haefele). - changed: the LaTeX files made by Disc-Cover contain newcommands statements that can be used in templates to layout a cover. These commands all start with '\DC'. For example: \DCtracks gives the list of tracks already formatted, while \DCtitle just gives the title of the disc. - added: information about the system when using -V, for better bugreports. - added: new template for audio cassette tapes (use '-c tape') - added: \DCgenre can be used to include the genre in a template. Also its colour may be changed through the config file. - added: new script online.cgi and three pictures to determine whether a server is available or very busy. Version 1.4.0 - bugfix: fixed nonsense output and errors when first track title is empty (thanks to Raphael Goubet). - bugfix: no more warnings when $HOME is not defined (for webservers). - bugfix: some verbose message lacked Disc-Cover: prefix. - bugfix: when a picture is put on the front (or -allmusic is used), the extended disc info is trimmed down to make sure it fits below the picture. - changed: safer execution of external programs such as wget, mv and cp. Especially important for webservers. - changed: removed documentation in docs directory, it has become outdated. If anyone is interested in translating documentation, the full documentation now resides under 'disc-cover -H'. - added: new option '-allmusic', which searches on www.allmusic.com for a cover picture to put on the front cover. - added: new case type called 'sleeve', which just prints a front cover, but puts the tracklistings on it. (thanks for the suggestions Adam Perer et al.) - added: new case type called 'x-slim', which exchanges the flap and side. - added: three more entries to the FAQ about installation SuSE and Mike's grip program (many thanks to Thomas Kakolewski). Version 1.3.2 - changed: added message about Acrobat Reader when using '-t pdf' - fixed: (Glenn Huxtable) the size of the front cover in slim case mode was wrong. - added: new case for slim Tevion cases, thanks to Tilman Vogel for the patch. Use -c tevion-slim to produce it. - added: the ability to understand various artist cds, where every track is formatted using the 'artist / title' method. (suggested bu Ivan Fernandez) - added: algorithm that attempts to create a nice title for double cds (they often have things like 'disc 1' or '1/2' inserted) - added: new slim case type for people that still use letter instead of the standard A4, it is called letter-slim. It removes the flaptext to make room. Version 1.3.1 - fixed: problem with slim case where LaTeX (and thus Disc-Cover) would fail in producing a cover if no front picture was included by the user. - fixed: if the flaptext was empty, the box containing it (most top one) woulde be in the wrong size. - added: index.cgi script in freedb directory, which powers the on-line version of Disc-Cover. Version 1.3.0 - changed: much better layout of the tracks, especially tracknames that use multiple lines. Also, better aligned tracktime and tracktitle - added: configuration options to change height and width of both front and back cover, thereby getting rid of e-mails stating: I believe the xxx-cover should be h X w cm ;-) - changed: layout of covers and header text on the page is a bit different, everything is more compact and better centered on the page. - fixed: for some long cd titles the text of the title would be justified. - added: new command parameter '-c' to choose the type of case you want Disc-Cover to generate. The default is jewel, but also slimcase can be chosen to create a cover (in one piece) suitable for those slim case variants that save precious shelf space. Version 1.2.2 - fixed: with '-t cddb' extended track information was not inserted (thanks to Rodney Kanno for finding this one) - fixed: problems with multiple \n in -a option. - added: possibility for user to add latex style files, such as isolatin2 in the configuration file. - changed: increased width of sideflaps (artist/title) of backflap and improved centering of text on it. - added: option -S to create a default configuration for CDDB server (FreeDB is used of course) - changed: old option -n is back by popular demand, which makes creating new covers possible again. - fixed: problem of not being able to do standard input and output with cddb at the same time is solved. Better way of handling cddb type (does not read cache directory anymore). - fixed: t after an empty line in -a would result in a loss of the t. Version 1.2.1 - fixed: problem with ` quote in artis/title. - fixed: problem with quote in title/artist when creating file. - fixed: removed space between front and back to fix problems with letter paper format (thanks goes to Hans Ecke). - fixed: small bug in -H option, now uses pod2man instead of perldoc which I think is more common. - fixed: problems with \n and \t in extended disc info. Would have different results when reading a disc and using cddb files. - changed: most of the english documentation files have been moved into the manual page, these include FAQ, README and TODO. Use '-H' to see the manual. - changed: front is moved more into center of paper to have better 'sideflaps'. Read the FAQ about this. - changed: -V (verbose) flag gives much more information which can be helpful when you submit problems/bugs to the author. - changed: updated documentation (manual page), created internal links. - changed: system calls mkdir and rmdir replaced with perl's internal ones. Version 1.2.0 - added: support for double cds with the -2 option. - changed: size of covers (thanks to Roman Silar). - changed: removed disc-cover.1, replaced with -H option. Do a 'pod2man disc-cover > disc-cover.1' to get the old manual file back. - fixed: -e flag was not used in html and txt output. Version 1.1.1 - added: genre on last line of bottom text front cover with -g flag. - added: option '-C' to generate a configuration file based on current settings and commandline options. - fixed: 'defined(@array) is deprecated' bug. - fixed: problem with multiple (\n) lines in bottom text front cover. - fixed: problem with unvalid cdrom devices (thanks to Roman Shterenzon). - changed: everywhere, times are now in ISO 8601 format min:sec (thanks to Eduardo Pérez Ureta). - changed: out of date documentation updated, regarding features and required software. - removed: obsolete flags, options and documentation because of move to the AudioCD library. Version 1.1.0 - added: an additional flap on one side of the back cover. This will be visible when used with fully transparent jewel cases. By default the user's name taken from the comment field is inserted. Can be overridden with the config_flaptext variable in the configuration file or with the -b option. - added: cddb entry is displayed in comments on output page. - added: HTML output with the '-t html' option. - added: parameter -V that enables verbose output for debugging. - fixed: bug that caused disc-cover to choke on title/artist names with only one double quote (") inside. - fixed: extended disc info is trimmed to stop it from destroying the layout. - changed: parameter -r is now -R. - changed: disc-cover is now using the Audio::CD library. This should be more compatible, especially for FreeBSD users. Audio::CD uses the libcdaudio libraries. - changed: drastic change of the layout engine of cd contents. By scaling the postscript output it will always fit! But on the dark side, this could mean infinitely small fonts... - changed: lots of code cleanups (removed almost 300 lines) that make it easier to maintain (read: reducing chance or more bugs :) - changed: replaced command line parser with Getopt::Long library. Version 1.0.1 - fixed: bug that caused '-pic' not be recognised as a valid command line option. - fixed: problem of pictures included with '-eps' (should have been '-pic') not being removed from the temporary directory, thereby causing an error when the temporary directory itself was removed. Version 1.0.0 - added: configuration files for the user ($HOME/.disc-coverrc) and system (/etc/disc-cover.conf) mainly to set variables such as proxies, cddb servers, temp dir and output format. It uses Perl syntax. Sample included in "example.conf". - added: colour support. Colour title, artist, items, time, track numbers and extended information in your own preferred colour. - added: support for handling more than one cddb server. The default is still FreeDB, but more sites can be added in your own config file. - fixed: front cover graphics is now fully supported for PDF files. - fixed: security bug. The temporary files were a security risk. The new way of handling temporary files (placing them in a newly created directory) removes this risk. - fixed: rectangular brackets are correctly handled. - fixed: problems with \t in entries. For now every \t is converted into a space. Should be fixed to use actual tabs in LaTeX. - fixed: problem with '-eps' (now '-pic') when the path to the file was relative. - fixed: FreeDB bug that gave the wrong error when no cdrom was found. - fixed: problem with cdlabelgen when there is no artist. - changed: font of numbering of tracks has been changed to Sans Serif. - changed: removed dependence on LaTeX package 'rotating'. - changed: added dependence on LaTeX package 'ifthen'. - changed: copyright year. - changed: the option '-eps' has been changed to '-pic' because of the support of pictures in PDF files. - changed: lots of improvements in the manual page. Version 0.9.6 - added: new option '-n' to generate a new cddb file to be edited by hand (or script). Very handy for homebrewn cds. - added: new option '-eps ' to put a picture in EPS (Encapsulated PostScript) or PS (PostScript) on the front cover without scaling of converting. - added: preliminary support for characters not in the isolatin1 standard, still some missing characters. - fixed: bug that caused wrong layout (duplicate tracks) in the track listing. - fixed: removed multiple lines in extended track info. - fixed: problems with slashes in disc titles and artists are hopefully sorted out. - fixed: numerous small bugs in FreeDB.pm - fixed: problem in FreeDB.pm that made it output 'Warning can't find AutoLoader'. - changed: FreeDB shows error when ioctl does not work, such as reported on NetBSD. - changed: instead of the old Latex package epsfig we now use graphicx to do the picture on the front cover. - changed: because of license problems and frequent downtime of the cddb server disc-cover now uses the freedb server. - removed: quiet option '-q' because it has become obsolete. All screen output goes to stderr from now on. Version 0.9.5 - added: new option '-p ' to add a picture to the front cover. This requires the LaTeX package epsfig and the program convert that comes with ImageMagick. - changed: uses freedb.freedb.org instead of www.cddb.com - changed: better error handling of command line. - changed: better overall error handling and solution providing. - changed: better handling of wrong input (changes to FreeDB). Version 0.9.4 - fixed: problems that are occurring due to a change in the cddb servers. - fixed: some people have entries stored in the root of the cddb cache dir these will be used now as well. - fixed: problem where disc-cover would give the error 'Can't locate auto/FreeDB/end_program.al'. - added: distribution files for FreeDB to make a clean perl module. Version 0.9.3 - added: new option '-e' which results in extended track info to be added to the back cover whenever available. - added: Spanish documentation is back in docs/spanish - added: German documentation now in docs/german - changed: all of the cddb code has been transferred to a separate module called FreeDB, on which Disc-Cover is now dependent. - fixed: problem with empty track names producing invalid LaTeX code. - fixed: problem with two backslashes immediately following each other in a track name. - fixed: problems with external programs such as Latex, dvips, pdflatex and mv are now caught and a message will be displayed. Version 0.9.2 - fixed: problems with artist and cd titles over multiple lines in a cddb entry (is not in cddb protocol). - fixed: problems with track titles and extended track info over multiple lines in a cddb entry (track titles over multiple lines is not in cddb protocol). - fixed: problems with some cddb entry not having 'seconds' behind disc length (is not in cddb protocol). - changed: when the artist and cd title are too long to be put on the sides the font size is made smaller until it fits or until the font is tiny. - changed: latex parameters to change the page width, height and offsets are now in a perl variable at the start of disc-cover's code. Makes it more easy when people need small adjustments for there printer. - changed: the error message when the device can not be opened. Put in an extra line telling people to log out and in before trying again. - added: another LaTeX package called 'times' for those who had the default to something else and ended up with a horrible result. Enable this at the start of disc-cover's code. - added: documentation using pod. Also a man page build from this is included now. Version 0.9.1 - fixed: problem in entries having extended disc info with a \n at the end of a line, this resulted in a 'Could not find file error'. Version 0.9.0 - added: the front cover now gets the extended disc info printed on at the bottom. The contents can be overridden with the '-a ' command. - changed: font of the bottom text to sans-serif. - changed: documentation is updated and should be more useful. Removed documentation in Spanish because it is outdated and I do not speak or write Spanish. - fixed: better error handling if the cdrom device cannot be opened for reading (for instance if the user has no access rights). - fixed: better error handling when user selects wrong format. - removed: removed loose output format as it only makes maintenance more tedious. To compensate a tip is added to the FAQ for those who want to minimise the number of cuts. Version 0.8.5 - fixed: problems with some Latex distributions causing Disc-Cover not to produce dvi files. - fixed: some reported errors of tracks that were not appearing in the texfile with some cddb entries. - added: FAQ in docs/* directories. This file will answer questions I get in my mailbox too often. - fixed: problem when the cddb cache directory was a link. - fixed: quick hack to ensure the cache only finds one file, namely the first one it encounters. This should become an interactive process. Version 0.8.4 - added: option '-F' to force a cddb lookup. - added: standard logo for the cdlabelgen output ('-t lbl'), it's a penguin! - fixed: problems with interactive handling of inexact matches. - fixed: better check of categories in the cddb cache directory (~/.cddb), will add new genres from server to the list. - fixed: better handling of quiet option '-q`. Version 0.8.3 - added: proxy support. To activate supply a proxy server in the beginning for the $proxy_value variable. - fixed: removed ^M after track titles which caused some Latex distributions to fail. Version 0.8.2 - added: new format in plain ASCII, use '-t txt' - added: new format for use in cdlabelgen, use '-f lbl' - added: new format in Adobe's Portable Document Format (PDF), use '-f pdf' - added: ability to handle cds that have inexact matches. User will be prompted to choose which match should be used. Up to 10 matches. - fixed: bug of ^M in artist and title. - fixed: all '{\em ...}' in LaTeX changed to '\emph{...}' - fixed: error in substituting ':' for every '\' in a filename. - fixed: buf in calculating discid, could result in string of less than 8 characters. - changed: every pack('CCCP'...) in pack('C8'...), works better? Version 0.8.1 - fixed: a slash in a filename is translated to a colon. - added: caches files in a directory (default: $HOME/.cddb) for off line usage. This directory can be shared with cdcd. Version 0.8 - added: The files docs/spanish/* contain the appropriate documentation in Spanish for version 0.7. - added: The files docs/dutch/* contain the appropriate documentation in Dutch. - removed: dependencies on cdcd and cda. - removed: parameters '-cda' and '-cdcd'. - added: build-in support for querying a cddb database. This is very experimental! - changed: layout of the track numbers. Numbers below 10 are now right-aligned with numbers above and equal to 10. - fixes: some minor adjustments in the layout of the tracks on the back cover. Version 0.7 - added: the total time of a disc is added as the last line of the track list - added: possibility of using cddb formatted files as input. This way files produced by grip and cdda2wav can directly be used to generate layouts. The option '-f ' is used to select a file. - changed: the option '-f' is no longer used for choosing the layout format. Use '-loose' or '-connected'. - changed: the '-c' option is no longer used to select the program to connect to the database, from now on use '-cda' or '-cdcd'. - fixed: the artist and title of the cd at the sides of the jewel case have been exchanged. This much more reflects the way original disks are labelled: artist followed by title - fixed: a reported problem of filenames not properly being used. Sometimes an 'enter' character would stick to the end of a title causing this filename to appear "artist_-_title\n.ps". - fixed: filenames starting with a '-' would not work. - added: using '-o -' sends result to standard output. Version 0.6.1 - fixed: problems with artist/title containing Latex characters. Disc-Cover did not save the file to disc. - fixed: problem with the new connected format, the front cover was too small. - fixed: problem with the new connected format, the whole layout would not align on paper in letter format. Version 0.6 - added: a new layout of the covers on the page to make cutting an easier job. The option '-f' can be used to choose between 'loose' (default) or 'connected'. The format connected aligns both covers and connects them. This way the covers can be cut in 5 cuts opposed to 8 cuts in the loose format. Version 0.5.2 - fixed: bug that caused the artist name to be mangled under cdcd. Version 0.5.1 - changed: a nicer dotted line between the name and the length of a track. - fixed: problems with files when a title or artist had an apostrophe in their name. - fixed: problems when a cd had the artist or title missing. Version 0.5 - added: support for cda (comes with xmcd). Cdcd is the default way of communicating with cddb, if this fails cda is used. The parameter -c can be used to force the use of either cdcd or cda. - fixed: problems with LaTeX in the MLTex distribution are fixed. For some reason it does not understand the --interaction= option. Version 0.4.1 - fixed: problems when LaTeX was run, it paused and cause the program to stop. - fixed: the program could not detect if there was no disc in the drive. Version 0.4 - changed: the program no longer outputs to 'disc-cover.ps' as default, but to a file named after the artist and album name: 'artist_-_album.ps'. All spaces are replaced by underscores. - added: new command line parameter '-q' for quiet mode, no information or warnings will be displayed (only errors). Version 0.3 - changed: added some information on the output regarding the program. This lowers the covers, thereby fixing the problem some printers had with not printing the top cover correctly. - added: detects and exits if there is no disc loaded in the cdrom drive. - fixed: added support for special characters from the isolatin1 standard, by using the isolatin1 package for Latex. - added: support for cds up to 99 tracks (maximum number). Version 0.2 - fixed: bug when using -l or -d without -o, would result in a wrong filename. - removed: latex package dependency 'color', 'epsfig' and 'url'. - added: support for 22-27 tracks in smaller font. - added: support for 28-54 tracks in smaller font and two columns. Version 0.1 - initial release. J.I. van Hemert disc-cover-1.5.6/COPYING0000664000076500000000000004307610445763430015600 0ustar jvhemertwheel00000000000000 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. disc-cover-1.5.6/disc-cover0000755000076500000000000024363710445763430016534 0ustar jvhemertwheel00000000000000#!/usr/bin/perl -w # # Disc-Cover - using CDDB to create a cover for music cds. Default is # to output a postscript file called 'artist_-_album.ps' provided the # album is found in the CDDB database. # Copyright © 1999-2005 J.I. van Hemert # # 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. # # Author: J.I. van Hemert # # Physical mail: # J.I. van Hemert # CWI # P.O. Box 94079 # NL-1090 GB Amsterdam # The Netherlands # my $cvs_id_string = '$Id: disc-cover,v 1.6 2006/06/20 12:15:55 jvhemert Exp $'; ################################ # Default configuration values # ################################ my ($config_homedir) = ""; $config_homedir = "$ENV{HOME}" if (defined $ENV{HOME}); my ($config_tmp_dir) = '/tmp'; my (@config_template_dirs) = ('/usr/share/disc-cover/templates','/usr/lib/disc-cover/templates','templates'); my ($config_output_format) = 'ps'; my ($config_device) = "/dev/cdrom"; my ($config_cddb_cache_directory) = "$config_homedir/.cddb"; my ($config_flaptext) = split ',', (getpwuid($<))[6]; my ($config_version_config) = undef; my ($latex_user_packages) = ''; my ($latex_language_encoding) = 'latin1'; my ($flag_genre) = 0; my ($flag_with_extended_track_info) = 0; my (%config_latex_colors) = ( title => 'black', artist => 'black', discinfo => 'black', track_number => 'black', track_string => 'black', track_time => 'black', flaptext => 'black', track_extended => 'black', track_artist => 'black', 'genre' => 'black' ); my ($config_casetype) = "jewel"; my ($flag_various_artist_cd) = 0; my ($flag_double_disc_cdtitle) = 1; my ($flag_picture_use_allmusic) = 0; my ($flag_uppercase_fix) = 0; my ($flag_verbose) = 0; my ($flag_remove_temporary_files) = 0; # 0 means yes, remove files my ($latex_global_oddsidemargin, $latex_global_evenside_margin, $latex_global_voffset, $latex_global_footskip, $latex_global_textheight, $latex_global_textwidth) = ("-25pt", "-25pt", "-100pt", "0pt", "780pt", "170mm"); ############################ # Read configuration files # ############################ my ($config_version) = '1.5.6'; eval `cat "/etc/disc-cover.conf"` if (-f "/etc/disc-cover.conf"); if (defined($config_version_config) and $config_version_config ne $config_version) { warn "Warning: version of system configuration file \"/etc/disc-cover.conf\"\n($config_version_config) does not match current configuration version of Disc-Cover ($config_version)\n" } eval `cat "$config_homedir/.disc-coverrc"` if (-f "$config_homedir/.disc-coverrc"); if (defined($config_version_config) and $config_version_config ne $config_version) { warn "Warning: version of user configuration file \"$config_homedir/.disc-coverrc\"\n($config_version_config) does not match current configuration version of Disc-Cover ($config_version)\n" } ################################# # Non advisable to change these # ################################# my ($bottomtextfront) = undef; my ($config_cdserverrc) = "$config_homedir/.cdserverrc"; my ($version) = '1.5.6'; my ($process_number) = $$; my ($flag_move_end_file) = 0; my ($config_output_configuration_filename) = undef; my ($outputfile) = undef; my ($inputfile) = undef; my ($config_second_inputfile) = undef; my ($config_all_available_output_types) = 'tex dvi ps pdf cddb txt lbl html'; my ($latex_global_packages) = 'ifthen,graphicx,color,multicol'; my ($config_cover_picture) = undef; my ($config_cover_picture_no_convert_needed) = undef; ######################## # Start of main progam # ######################## use strict; use Getopt::Long; #TODO use Image::Magick; my @command_line = @ARGV; if ($version =~ "beta") { warn "+--------------------------------------+\n". "| This is a beta version ($version). |\n". "| It is for testing purposes only. |\n". "+--------------------------------------+\n"; } my $flag_show_help = 0; my $flag_show_cvs_version = 0; my $flag_show_manual = 0; my $flag_show_version = 0; my $flag_show_releaseversion = 0; my $flag_create_new_cddb = 0; my $flag_create_cdserverrc = 0; my $flag_template_list = 0; Getopt::Long::Configure("permute", "no_ignore_case"); GetOptions ("pic=s" => \$config_cover_picture_no_convert_needed, "p=s" => \$config_cover_picture, "t|type=s" => \$config_output_format, "f|file=s" => \$inputfile, "D|Device=s" => \$config_device, "o|output=s" => \$outputfile, "a|additional=s" => \$bottomtextfront, "V|Verbose" => \$flag_verbose, "R|Remove" => \$flag_remove_temporary_files, "S|Server" => \$flag_create_cdserverrc, "e|extended" => \$flag_with_extended_track_info, "n|new!" => \$flag_create_new_cddb, "h|help!" => \$flag_show_help, "H|Help!" => \$flag_show_manual, "u|uppercase!" => \$flag_uppercase_fix, "v|version!" => \$flag_show_version, "releaseversion!" => \$flag_show_releaseversion, "b|flaptext=s" => \$config_flaptext, "g|genre!" => \$flag_genre, "C|Configuration=s" => \$config_output_configuration_filename, "c|casetype=s" => \$config_casetype, "va|variousartists!" => \$flag_various_artist_cd, "allmusic!" => \$flag_picture_use_allmusic, "2|second=s" => \$config_second_inputfile, "CVS!" => \$flag_show_cvs_version, "template_list" => \$flag_template_list); ($flag_template_list) and print_template_list() and exit; ($flag_show_cvs_version) and print "$cvs_id_string" and exit; ($flag_show_help) and print print_help() and exit; ($flag_show_manual) and print_manual() and exit; ($flag_show_version) and print print_version_info() and exit; ($flag_show_releaseversion) and print "$version" and exit; ($flag_create_cdserverrc) and create_cdserverrc() and exit; if ($config_output_configuration_filename) { open CONF, "> $config_output_configuration_filename" or die "Could not open \"$config_output_configuration_filename\" for writing"; print CONF print_configuration_file(); close CONF; exit 0; } unless ($inputfile) { require Audio::CD; } print STDERR "Disc-Cover: running verbose version $version (config $config_version)\n" if ($flag_verbose); if ($flag_verbose) { print STDERR "Disc-Cover: command line string: ".join(' ',@command_line)."\n"; print STDERR "Disc-Cover: SYSTEM INFO\n"; print STDERR " OS version: ".`uname -a`; print STDERR " Perl version: ".`perl -V:version`; print STDERR " libcdaudio version: ".`echo /usr/lib/libcdaudio.so.*`; print STDERR " Audio-CD version: ".Audio::CD->VERSION."\n"; print STDERR " LaTeX version: ".`latex -v | head -1`; print STDERR " Dvips version: ".`dvips -v`; print STDERR " Convert version: ".`convert -v | head -1`; } $config_tmp_dir .= "/disc-cover-$process_number"; print STDERR "Disc-Cover: creating tmp dir ($config_tmp_dir)\n" if $flag_verbose; mkdir ("$config_tmp_dir", 0777) or die "Error: could not create temporary directory \"$config_tmp_dir\".\n\nSolution: check if you can create the directory yourself.\n"; my %discinfo = (); if ($flag_create_new_cddb) { my $cddb_data; my $audio_cd = Audio::CD->init($config_device); end_program("Device initialization failed.","Make sure \"$config_device\" points to a valid Cdrom device.") unless $audio_cd; my $cddb = $audio_cd->cddb; my $cdinfo = $audio_cd->stat; %discinfo = parse_cddb_file(create_new_cddb_entry($cdinfo, $cddb)) or end_program("Could not parse newly created cddb entry", "Internal error, please contact the author."); } elsif (!defined($inputfile)) { my $cddb_data; my $audio_cd = Audio::CD->init($config_device); end_program("Device initialization failed.","Make sure \"$config_device\" points to a valid Cdrom device.") unless $audio_cd; my $cddb = $audio_cd->cddb; my $cdinfo = $audio_cd->stat; end_program("Could not read cd.", "Insert an audio cd into cdrom drive \"$config_device\".", "Use the '-f file.cddb' option.") unless $cdinfo->present; $cddb->verbose($flag_verbose); print STDERR "Disc-Cover: calling Audio-CD library...\n" if ($flag_verbose); $cddb_data = $cddb->lookup; print STDERR "Disc-Cover: ...back from call to Audio-CD library.\n" if ($flag_verbose); if (!$cddb_data->title) { if (!-e $config_cdserverrc) { end_program("Could not find a \"$config_cdserverrc\" file.","Use \'disc-cover -S\' to create a default server configuration."); } else { end_program("Could not fetch cdrom information.","Check if the connection to the internet works.", "If the file is not in the cddb database you can make a new file\nas follows: 'disc-cover -n -t cddb -o newfile.cddb'. Edit this file and\ninsert the titles and artist, then do: 'disc-cover -f newfile.cddb'."); } } print STDERR "Disc-Cover: Audio-CD library says success, let's continue\n" if $flag_verbose; $discinfo{artist} = $cddb_data->artist; $discinfo{artist} =~ s/ //g; $discinfo{title} = $cddb_data->title; $discinfo{title} =~ s/ //g; $discinfo{extended} = $cddb_data->extended; $discinfo{extended} =~ s/ //g; $discinfo{genre} = $cddb_data->genre; $discinfo{genre} =~ s/ //g; $discinfo{discid} = sprintf("%x", $cddb->discid); $discinfo{discid} =~ s/ //g; $discinfo{length_minutes} = ($cdinfo->length)[0]; $discinfo{length_seconds} = ($cdinfo->length)[1]; $discinfo{total_tracks} = $cdinfo->total_tracks; my @track_names; my @track_extended; my @track_artist; my $various_artist_warning = 0; #if ($flag_various_artist_cd) #{ # $cddb_data->parse_track_artist = 1; #} foreach my $track (@{$cddb_data->tracks($cdinfo)}) { my $track_name = $track->name; if ($track->artist) { if ($flag_various_artist_cd) { push (@track_artist, $track->artist); } else { $track_name = $track->artist." / ".$track->name; $various_artist_warning++; } } push (@track_names, $track_name); push (@track_extended, $track->extended); } if ($various_artist_warning == $discinfo{total_tracks}) { warn "Warning: all the tracks of this cd contain a slash ' / ' in their track titles,\nwhich could mean it is a various artist cd that contains the form\n'artist / title' for each track. Use the flag '-va' to make a nicer format.\n"; } @track_names = map { s/ //g; $_ } @track_names; $discinfo{track_names} = \@track_names; @track_extended = map { s/ //g; $_ } @track_extended; $discinfo{track_extended} = \@track_extended; @track_artist = map { s/ //g; $_ } @track_artist; $discinfo{track_artist} = \@track_artist; my @track_length_minutes; my @track_length_seconds; foreach my $track (@{$cdinfo->tracks}) { push (@track_length_minutes, ($track->length)[0]); push (@track_length_seconds, ($track->length)[1]); } $discinfo{track_length_minutes} = \@track_length_minutes; $discinfo{track_length_seconds} = \@track_length_seconds; print STDERR "Disc-Cover: filled in disc information\n" if $flag_verbose; } else { print STDERR "Disc-Cover: you supplied me with the file \"$inputfile\"\n" if $flag_verbose; open (CDDB_FILE, "< $inputfile") or end_program("Could not open file \"$inputfile\"", "Check if this file exists and if it is readable."); my $cddb_contents = ""; while () { $cddb_contents = $cddb_contents.$_; } close CDDB_FILE; %discinfo = parse_cddb_file($cddb_contents) or end_program("Could not parse file \"$inputfile\".", "Check if this is a cddb file."); print STDERR "Disc-Cover: file sucessfully read as a CDDB entry\n" if $flag_verbose; } my %second_discinfo; if ($config_second_inputfile) { print STDERR "Disc-Cover: you supplied me with the second file \"$config_second_inputfile\"\n" if $flag_verbose; open (CDDB_FILE, "$config_second_inputfile") or end_program("Could not open file \"$config_second_inputfile\"", "Check if this file exists and if it is readable."); my $cddb_contents = ""; while () { $cddb_contents = $cddb_contents.$_; } close CDDB_FILE; %second_discinfo = parse_cddb_file($cddb_contents) or end_program("Could not parse file \"$config_second_inputfile\".", "Check if this is a cddb file."); uppercase_fix_on_discinfo(\%second_discinfo) if $flag_uppercase_fix; print STDERR "Disc-Cover: second file sucessfully read as a CDDB entry\n" if $flag_verbose; if ($flag_double_disc_cdtitle) { my $disctitle; my @discinfo_array1 = split '', $discinfo{title}; my @discinfo_array2 = split '', $second_discinfo{title}; my $counter = 0; my $smallest_array = $#discinfo_array1 < $#discinfo_array2 ? $#discinfo_array1 : $#discinfo_array2; while (($counter <= $smallest_array) and ($discinfo_array1[$counter] eq $discinfo_array2[$counter])) { $counter++; } #while ($discinfo_array1[$counter] ne " ") #{ # $counter--; #} $disctitle = join'', @discinfo_array1[0..$counter-1]; $disctitle =~ s/disc//g; # This could lead to problems, e.g., 'Super disc' $disctitle =~ s/disk//g; $disctitle =~ s/Disc//g; $disctitle =~ s/Disk//g; $disctitle =~ s/DISC//g; $disctitle =~ s/DISK//g; $disctitle =~ s/(^[\. -]*)|([\. -]*$)//g; $discinfo{title} = $disctitle; print STDERR "Disc-Cover: double disc title becomes \"$disctitle\"\n" if $flag_verbose; } } ($bottomtextfront) = $discinfo{extended} if (!defined($bottomtextfront)); { # Make sure that extended disc info fits front cover my (@test) = split("\n", $bottomtextfront); my $max_bottom_front_lines = 19; $max_bottom_front_lines = 4 if ($flag_picture_use_allmusic or $config_cover_picture_no_convert_needed or $config_cover_picture); if( $#test > $max_bottom_front_lines ) { warn "Warning: had to trim the extended disc info from ".(1+$#test)." to $max_bottom_front_lines to make it fit the front cover.\n"; splice (@test, $max_bottom_front_lines); } $bottomtextfront = join("\n", @test); } print STDERR "Disc-Cover: text on bottom of front cover: \"$bottomtextfront\"\n" if $flag_verbose; $bottomtextfront .= "\\n genre: $discinfo{genre}" if ($flag_genre); if (!defined($outputfile)) { $outputfile = $discinfo{artist}.' - '.$discinfo{title}; $outputfile =~ s/ /_/g; $outputfile =~ s#(["`'])##g; $outputfile =~ s#/#:#g; chomp $outputfile; } if (defined($outputfile) and ($outputfile ne "-")) { if($config_all_available_output_types =~ /\b$config_output_format\b/) { $outputfile =~ s/(\.$config_output_format)?$/.$config_output_format/; } if ($config_second_inputfile) { print STDERR "Output for cddb entries \"$discinfo{discid}\" and \"$second_discinfo{discid}\" goes to \"$outputfile\"\n"; } else { print STDERR "Output for cddb entry \"$discinfo{discid}\" goes to \"$outputfile\"\n"; } } if ($config_output_format =~ /lbl|txt|tex|html|cddb/) { open OUT, ">$outputfile" or end_program("Could not open \"$outputfile\"", "Check if a file or directory with the same name already exists","Is the directory writable?"); print STDERR "Disc-Cover: successfully opened file \"$outputfile\" for output\n" if $flag_verbose; } uppercase_fix_on_discinfo(\%discinfo) if $flag_uppercase_fix; ####### # LBL # ####### if ($config_output_format eq 'lbl') { print STDERR "Disc-Cover: starting output of type lbl\n" if $flag_verbose; print OUT "cdlabelgen \\\n"; if ($discinfo{artist} eq "") { printf OUT "-c \" \" \\\n"; } else { printf OUT "-c \"%s\" \\\n", $discinfo{artist}; } printf OUT "-s \"%s\" \\\n", $discinfo{title}; print OUT "-S 0.96 -e penguin.eps \\\n"; print OUT "-i \""; if ($config_second_inputfile) { print OUT "%Disc1%\\\n" }; for (my $i = 0; $i < $discinfo{total_tracks}; $i++) { printf OUT "%2d. %s %02d:%02d%%\\\n", ($i+1), $discinfo{track_names}[$i], $discinfo{track_length_minutes}[$i], $discinfo{track_length_seconds}[$i]; } printf OUT "%%CD length: %02d:%02d\n", $discinfo{length_minutes}, $discinfo{length_seconds}; if ($config_second_inputfile) { print OUT "%%Disc2%\\\n"; for (my $i = 0; $i < $second_discinfo{total_tracks}; $i++) { printf OUT "%2d. %s %02d:%02d%%\\\n", ($i+1), $second_discinfo{track_names}[$i], $second_discinfo{track_length_minutes}[$i], $second_discinfo{track_length_seconds}[$i]; } printf OUT "%%CD length: %02d:%02d\n", $second_discinfo{length_minutes}, $second_discinfo{length_seconds}; } print OUT "\""; print STDERR "Disc-Cover: finished output of type lbl\n" if $flag_verbose; } ######## # HTML # ######## elsif ($config_output_format eq 'html') { print STDERR "Disc-Cover: starting output of type html\n" if $flag_verbose; printf OUT "\n\n%s : %s\n\n\n", $discinfo{artist}, $discinfo{title}; printf OUT "\n\n"; printf OUT "




\n\n"; printf OUT "\n"; printf OUT "\n"; printf OUT "\n", $discinfo{artist}; if ($bottomtextfront eq "") { printf OUT "\n", $discinfo{title}; } else { printf OUT "\n", $bottomtextfront; } printf OUT "\n"; printf OUT "
%s%s%s", $discinfo{title}; printf OUT " - %s
\n\n"; printf OUT "

\n\n"; printf OUT "\n"; printf OUT "\n\n\n\n" if ($config_second_inputfile); for (my $i = 0; $i < $discinfo{total_tracks}; $i++) { printf OUT "\n"; printf OUT "\n", ($i+1); printf OUT "\n", $discinfo{track_names}[$i]; if (!$flag_various_artist_cd or $discinfo{track_artist}[$i] eq "") { printf OUT "\n"; } else { printf OUT "\n", $discinfo{track_artist}[$i]; } if ($discinfo{track_extended}[$i] eq "" or !$flag_with_extended_track_info) { printf OUT "\n"; } else { printf OUT "\n", $discinfo{track_extended}[$i]; } printf OUT "\n", $discinfo{track_length_minutes}[$i], $discinfo{track_length_seconds}[$i]; printf OUT "\n"; } printf OUT "\n\n\n"; if ($config_second_inputfile) { printf OUT "\n\n\n\n"; for (my $i = 0; $i < $second_discinfo{total_tracks}; $i++) { printf OUT "\n"; printf OUT "\n", ($i+1); printf OUT "\n", $second_discinfo{track_names}[$i]; if (!$flag_various_artist_cd or $second_discinfo{track_artist}[$i] eq "") { printf OUT "\n"; } else { printf OUT "\n", $second_discinfo{track_artist}[$i]; } if ($second_discinfo{track_extended}[$i] eq "" or !$flag_with_extended_track_info) { printf OUT "\n"; } else { printf OUT "\n", $second_discinfo{track_extended}[$i]; } printf OUT "\n", $second_discinfo{track_length_minutes}[$i], $second_discinfo{track_length_seconds}[$i]; printf OUT "\n"; } printf OUT "\n\n\n"; } printf OUT "
Disc 1
%02d%s %s %s%02d:%02d
\n"; printf OUT "CD length: %02d:%02d\n", $discinfo{length_minutes}, $discinfo{length_seconds}; printf OUT "
Disc 2
%02d%s %s %s%02d:%02d
\n"; printf OUT "CD length: %02d:%02d\n", $second_discinfo{length_minutes}, $second_discinfo{length_seconds}; printf OUT "
\n"; printf OUT "\n"; print STDERR "Disc-Cover: finished output of type html\n" if $flag_verbose; } ####### # TXT # ####### elsif ($config_output_format eq 'txt') { print STDERR "Disc-Cover: starting output of type txt\n" if $flag_verbose; printf OUT "Artist: %s\n", $discinfo{artist}; printf OUT "Title: %s\n", $discinfo{title}; print OUT "Disc 1\n" if ($config_second_inputfile); for (my $i = 0; $i < $discinfo{total_tracks}; $i++) { my $textended = ""; my $tartist = ""; if ($flag_with_extended_track_info and $discinfo{track_extended}[$i] ne "") { $textended = " - ".$discinfo{track_extended}[$i]; } if ($flag_various_artist_cd) { $tartist = $discinfo{track_artist}[$i]." / "; } printf OUT "%02d %s%s%s %02d:%02d\n", ($i+1), $tartist, $discinfo{track_names}[$i], $textended, $discinfo{track_length_minutes}[$i], $discinfo{track_length_seconds}[$i]; } printf OUT "CD length: %02d:%02d\n", $discinfo{length_minutes}, $discinfo{length_seconds}; if ($config_second_inputfile) { print OUT "Disc 2\n"; for (my $i = 0; $i < $second_discinfo{total_tracks}; $i++) { if ($second_discinfo{track_extended}[$i] eq "" or !$flag_with_extended_track_info) { printf OUT "%02d %s %02d:%02d\n", ($i+1), $second_discinfo{track_names}[$i], $second_discinfo{track_length_minutes}[$i], $discinfo{track_length_seconds}[$i]; } else { printf OUT "%02d %s %s %02d:%02d\n", ($i+1), $second_discinfo{track_names}[$i], $second_discinfo{track_extended}[$i], $second_discinfo{track_length_minutes}[$i], $second_discinfo{track_length_seconds}[$i]; } } printf OUT "CD length: %02d:%02d\n", $second_discinfo{length_minutes}, $second_discinfo{length_seconds}; } print STDERR "Disc-Cover: finished output of type txt\n" if $flag_verbose; } ######## # CDDB # ######## elsif ($config_output_format eq 'cddb') { print STDERR "Disc-Cover: starting output of type cddb\n" if $flag_verbose; my $cddb_cache_file = undef; end_program("CDDB type not supported with two cds", "do not use \'-t cddb\' and \'-2\' at the same time.\n") if ($config_second_inputfile); print OUT create_existing_cddb_entry(\%discinfo); # OBSOLETE CODE (FINALLY): made redundant because we have a function to create our own cddb #end_program("standard in to standard out with CDDB entries not possible", "do not use \'-f -\' and \'-o -\' together with \'-f cddb\'") if ($inputfile eq "-"); #if (defined($inputfile)) #{ # $cddb_cache_file = $inputfile; #} #else #{ # my (@subdirs, $sub); # if (-d $config_cddb_cache_directory) # { # opendir(DIR, $config_cddb_cache_directory) or end_program("Could not open $config_cddb_cache_directory for reading.", "Check the permissions and the contents of the directory $config_cddb_cache_directory."); # @subdirs = readdir(DIR); # closedir(DIR); # } # else # { # end_program("Could not find $config_cddb_cache_directory.","Check if this directory contains cddb entries.","If the directory is somewhere else, specify it in your configuration file or in the system's configuration file."); # } # # FILES: # { # foreach $sub (@subdirs) # { # if ($sub !~ /^\.\./) # { # my $try_file = "$config_cddb_cache_directory/$sub/$discinfo{discid}"; # if (-e $try_file) # { # $cddb_cache_file = $try_file; # last FILES; # } # } # } # } #} # #end_program("Could not find a cddb file entry in the cache directory \'$config_cddb_cache_directory\".", "Are there any entries in the directory?") unless defined $cddb_cache_file; # #open IN, "<$cddb_cache_file" or end_program("Could not read file \"$cddb_cache_file\""); #while () #{ # print OUT $_; #} #close IN; print STDERR "Disc-Cover: finished output of type cddb\n" if $flag_verbose; } ####### # TEX # ####### elsif ($config_output_format eq 'tex') { print STDERR "Disc-Cover: starting output of type tex\n" if $flag_verbose; print OUT print_whole_cover(); print STDERR "Disc-Cover: finished output of type tex\n" if $flag_verbose; } ####### # PDF # ####### elsif ($config_output_format eq 'pdf') { print STDERR "Disc-Cover: starting output of type pdf\n" if $flag_verbose; run_latex("pdflatex"); $flag_move_end_file = 1; print STDERR "If you use Acrobat Reader to print this file, make sure the option 'Fit to Page' is switched off.\n"; print STDERR "Disc-Cover: finished output of type pdf\n" if $flag_verbose; } ####### # DVI # ####### elsif ($config_output_format eq 'dvi') { print STDERR "Disc-Cover: starting output of type dvi\n" if $flag_verbose; run_latex("latex"); $flag_move_end_file = 1; print STDERR "Disc-Cover: finished output of type dvi\n" if $flag_verbose; } ###### # PS # ###### elsif ($config_output_format eq 'ps') { print STDERR "Disc-Cover: starting output of type ps\n" if $flag_verbose; run_latex("latex"); print STDERR "Disc-Cover: starting external dvi run\n" if $flag_verbose; my $dvi_string = $flag_verbose ? "(cd $config_tmp_dir ; dvips \"$config_tmp_dir/disc-cover.dvi\" -o \"$config_tmp_dir/disc-cover.ps\")" : "(cd $config_tmp_dir ; dvips \"$config_tmp_dir/disc-cover.dvi\" -o \"$config_tmp_dir/disc-cover.ps\" 2> /dev/null)"; if (system ($dvi_string) > 0) { end_program("Something went wrong while running dvips.", "Run disc-cover with argument '-r' as argument, then check if a .dvi\nfile is produced in \"$config_tmp_dir\"."); } $flag_move_end_file = 1; print STDERR "Disc-Cover: finished external dvi run\n" if $flag_verbose; print STDERR "Disc-Cover: finished output of type ps\n" if $flag_verbose; } ################################ # error: no valid format given # ################################ else { end_program("The type of format \"".$config_output_format."\" does not exist.", "Use \"-t