pax_global_header00006660000000000000000000000064134262614270014521gustar00rootroot0000000000000052 comment=5c6f9e4116d19e6ebabd543a2de0d87eb2f8cb58 abcde-2.9.3/000077500000000000000000000000001342626142700125725ustar00rootroot00000000000000abcde-2.9.3/.dir-locals.el000066400000000000000000000000771342626142700152270ustar00rootroot00000000000000((nil . ((indent-tabs-mode . t) (tab-width . 4)))) abcde-2.9.3/COPYING000066400000000000000000000432541342626142700136350ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 Lesser 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 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) 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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) year 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 Lesser General Public License instead of this License. abcde-2.9.3/FAQ000066400000000000000000000600601342626142700131260ustar00rootroot000000000000000. INTRODUCTION ============ Q. Who created abcde? Who develops it nowadays? A. It was originally created by Robert Woodcook. He decided to give up maintaining it at some point in 2002 and Jesus Climent took over. In 2012, Colin Tuckley and Steve McIntyre joined in to help. During 2015-2016 Andrew Strong helped out. Currently Steve maintains abcde. Contact Steve with comments or suggestions at the following email address: Steve McIntyre <93sam@@debian.org> 1. INSTALLATION ============ Q. How can I install abcde on my system? A. To get abcde you can use a pre-packaged version, available for Debian, FreeBSD, OpenBSD, NetBSD and others. In case you want to install your own release, you need to download the source and install the complementary programs (abcde is just a frontend and its functionality is provided by other programs). abcde needs cd-discid. Grab it from: http://www.hispalinux.es/~data/files/cd-discid/ Read the README files for a complete list of requirements. Q. I have a problem, and I reported some time ago. Have you solved it already? A. Maybe. Try downloading the master branch of the development from https://git.einval.com/cgi-bin/gitweb.cgi?p=abcde.git Q. When are you going to release a new version? A. When it is ready. :-) We keep on adding new ideas to the trunk (stored in the URL above) and release periodically when we think it's due. 2. EXECUTION ========= Q. I want to force abcde 2.x to behave more like 1.x. How do I do it? A. Put these options in your abcde.conf: INTERACTIVE=n OUTPUTTYPE=mp3 ID3TAGV=1 Q. Low on disk space? A. abcde has different algorithms to schedule ripping and encoding - to optimize for disk conservation, use -l. You can also define WAVOUTPUTDIR=/some/other/path to your /etc/abcde.conf or ~/.abcde.conf to store the WAV files on another NFS shared fisk, for example. Also, UNIX pipes have also been implemented, using "-P", so abcde reads and encodes the tracks from the CD at once. However, it has the drawback that only one format can be encoded at a time. Q. How can i make abcde encode faster? My CD reader is way faster than the pace it can encode my tracks. A. abcde can take advantage of SMP systems, just like make. Try 'abcde -j 2' - it'll run two encoder jobs while it rips the next track. You can also make use of systems which are networked, with the help of distmp3. For example, MachineA has a better CPU power and MachineB has a CD drive. Run distmp3host (included in distmp3) on Machine A, and then run abcde -r MachineA from MachineB (where "MachineA" is a dns name or IP address). Use this in combination with '-j 0' to shift all encoding off the local machine. Q. I am having problems with *my CD reading program* reading the drive as a user. A. You might have to add yourself (or the users who want to use abcde) to the cdrom group and change the permissions of the cdrom device to 660. If you have a SCSI cdrom drive, check the permissions of /dev/sg* as well. Q. I would like to give the trackname and the artist_name directly to the encoder (in my case oggenc), but found no documentation. A. That is not possible, since abcde gets the information from CDDB database. You can create a template and fill it with the option "-n". Also, you can get the CDDB entry and edit it yourself. abcde has also an option to drop back to a template if you like none of the CDDB entries, selecting 0 from the CDDB options. Q. (Thanks to Amaya) Where are those options and settings defined? Why dont you include a proper abcde.conf as an example? A. We do. It should be installed under /etc/abcde.conf and contains more or less all the defaults abcde uses. You can use $(HOME)/.abcde.conf to override those defaults. More information can be obtained from the man page which can be consulted using "man abcde". Q. I keep on getting files with ".ogg.ogg" extension. What am I doing wrong? A. The code for multiple-output adds automatically the extension of the different outputs you select with the "-o" extension (or with OUTPUTTYPE variable). Erase the ".${OUTPUTTYPE}" part from the OUTPUTFORMAT variable in /etc/abcde.conf or ~/.abcde.conf Q. I have modified some of the options, and now CDDB has stopped working. A. Check that you have modified everything in the right way. For instance, if you modify the HTTPGET program you might want to set some options of your own. If you use the predefined ones (wget, curl and fetch) abcde will try to use some defaults. Keep in mind that the output should go to the output as standard output, to be saved in a file for later use. If abcde seems to be ignoring your configuration options or not running commands such as the encoder, you may have misquoted something. Config options such as the following do not work: LAMEOPTS=-h -k Try this instead: LAMEOPTS='-h -k' Q. How can I separate the different output files I get using multiple-output support? A. Use the OUTPUT variable in PLAYLISTFORMAT and OUTPUTFORMAT. It holds the different output file types you passed to abcde (i.e., ogg, mp3, flac) during playlist creation and file/directory creation. Q. I have a CD with a data track, and abcde complaints it cannot read/encode it. A. From version 2.2 onwards, abcde includes some checkings with cdparanoia, to try to get this right. (It is not easy to find a data track on a CD. If you find a "data" track and you know the number, restart abcde specifying the tracks to be encoded, leaving out the data one). Q. I am requested to have "eject" when setting the speed although I do not use it for anything. A. If you do not use cdparanoia, eject is used for setting the speed of the cdrom drive. You can substitute it for "setcd" with "-x" as the argument, but you have to install it manually (setcd is, at least, available in Debian). Another way to get the same results is using the pre_read function, defined in your /etc/abcde.conf file. Q. I have a CD set with 1+ discs, and want to have them in the same directory, sorted properly. What can abcde do for me? A. Set abcde to rip the first CD and give it the option "-t 101". Use a generic name for the CD, and reuse it with the rest of the CDs, editing the CDDB entries. Use "-t 201" for the second CD and so on. Use "-w " to add a comment about the CD you are ripping (-w "disc #"). Alternatively you can use only the "-t ###" option and then move all the files to the same directory, but the tag/comment information on the files will differ. If you want the tagged track number to be set to the modified number you should use "-T ###". Even better! If you use "-W ", abcde will put a comment to every CD set ("CD ") and modify the number of the tracks both in the file name and the tag/comment information. Q. I have a live concert. I want to encode it in a single file. How do i do it? A. Use "-1" and it will be encoded in a single file. Use "cue" as an action to make a CUE sheet file where the information about the tracks is stored. Q. Can I use abcde to take a backup of my CD collection? A. Yes. Use "abcde -1 -o flac -a default,cue" and it will create a single-track FLAC file with an embedded cuesheet. Later on, you can use the command "abcde -o vorbis -d flac-file.flac" to extract the individual tracks in Ogg/Vorbis format. Of course you can select whatever format you want. 3. CDDB and Musicbrainz ==================== Q. I need to go through an HTTP proxy for CDDB access. A. No problem, just export your http_proxy variable first so wget/fetch/curl can see it. Q. I already store CDDB entries in my hard disc. Can I make use of them? A. Piece of cake. Just edit CDDBLOCALDIR to point to the repository and give abcde the "-L" flag to make use of it. Q. Fine, now it uses local CDDB, but I have no network connection. How can I disable CDDB checks? A. Use the "-L -n" combination. It will try to use local CDDB entries, and if nothing can be found, it will use a template. You will be also given the choice to edit such template. Q. How can I use some other CDDB information provider? A. abcde now uses FreeDB by default. To use a different FreeDB mirror or another CDDB service, change the CDDBURL option in your abcde.conf. Q. After requesting CDDB data, I received several answers which seem to be quite alike. Can I find out the difference between some of them? A. Yes. When asked which one you want to select, use "X,Y" where X and Y are the numbers of the selections you want to find the difference between. Q. I get stuck at the screen with multiple CDDB results. How do I exit this screen so I can make my final selection? A. abcde tries to use the system's default pager to display these results and thus the actual application used and the method to exit from this application may vary from system to system. Many systems will be using the applications 'more' or 'less' as their pager and the common key to exit this screen is the letter 'q'. If this does not work on your system you should investigate what your system's default pager application is and from there learn the correct method of exiting this screen. Q. I don't like CDDB/FreeDB. How can I use Musicbrainz instead? A. Set CDDBMETHOD=musicbrainz and try it! 4. abcde and Album Art =================== Q. Can abcde download album art? A. As of abcde 2.7 it is possible to download a suitable cover image from within abcde that can be used by applications such as Audacious and vlc to illustrate playback with an album cover. Many hardware playback devices such as iPODs will also use this image during playback and show it on the device's display. Q. How does album art downloading work? A. The details are contained in abcde within a new function called 'getalbumart' which can be called either from the commandline or from within an ~/.abcde.conf file. The technique works in 3 possible ways: 1. If CDDBMETHOD includes musicbrainz the album art is downloaded from coverartarchive by MBID (MusicBrainz Identifier) 2. If 1 fails, download is tried from amazon by ASIN (Amazon Standard Identification Number) 3. If if 1 and 2 fail or CDDBMETHOD is cddb the album art will be downloaded using glyrc by artist + album title You will need to install your distro's package of glyr, a music related metadata search engine, and it is strongly advised that you use 'musicbrainz' in your cddb lookups. To access the more advanced features of getalbumart it is also strongly advised that you install the ImageMagick package of your distro. getalbumart will work without ImageMagick but functionality will be reduced. Q. What settings and options should I select? A. If you want to operate abcde from the commandline only you will get reasonable results with something like either of the following: abcde -o mp3:-V2 -a default,getalbumart abcde -o mp3:-V2 -G But to experience all of the options of getalbumart you should also consider setting the following in your ~/.abcde.conf file: #----------------------------------------------------------------# CDDBMETHOD=musicbrainz # Use MusicBrainz for CDDB ACTIONS=default,getalbumart # Select the album art action + default # Give the path to the metadata search application glyrc. Add any # glyrc options: GLYRC=glyrc GLYRCOPTS= # Give the path to ImageMagick's 'identify' which is used to give a # commandline summary of the album art and also assist in any conversions. # Add any 'identify' options: IDENTIFY=identify IDENTIFYOPTS= # Give the path to ImageMagick's 'display' which will show the album art. # The options below are the abcde default, feel free to add your own: DISPLAYCMD=display DISPLAYCMDOPTS="-resize 512x512 -title abcde_album_art" # Give the path to ImageMagick's 'convert' which is used to convert album # art to the format specified in ALBUMARTTYPE. Add any 'convert' options: CONVERT=convert CONVERTOPTS= # If you want to run CONVERTOPTS on all files (including those specified # in ALBUMARTTYPE) set the following to "y": ALBUMARTALWAYSCONVERT="n" # By default the filename will be cover.jpg and the file format will # be jpeg. 'convert' will automagically change other formats to jpeg: ALBUMARTFILE="cover.jpg" ALBUMARTTYPE="JPEG" #----------------------------------------------------------------# There are more hints concerning commandline options in the sample abcde.conf file included with your abcde package. Good news is that the existing defaults will work well without any extra adjustments :). Q. Can I manually select album art? A. If you have set INTERACTIVE=y (this is the default) then you will have the opportunity to manually select the album art of your choice either from online by typing in a URL or by typing in the path to a local file. Q. What if I want my album art embedded? A. As of abcde 2.8.2 it is possible to have the album art automatically embedded in the mp3 container using eyeD3, embedded in the flac container using metaflac, embedded in the m4a container using AtomicParsley, embedded in the wv container using wvtag and embedded into an ogg container using vorbiscomment. There are 3 different ways to accomplish this: 1. Use the command line '-B' option (this will also call getalbumart) 2. Use the command line '-a embedalbumart' option to add to list of actions 3. Use 'embedalbumart' in the 'ACTIONS' list in ~/.abcde.conf Adding newer containers for album art embedding should be fairly straightforward and these will be added when the right combination of available abcde developer time and abcde user interest occurs... 4. FORMATS ======= Q. What formats can I encode my music to? A. As of version 2.8.2 abcde includes support for MP3, Ogg/Vorbis, Ogg/Speex, Flac, MPP/MP+(Musepack), AAC, AIFF (Audio Interchange File Format), Alac, WavPack, TTA (True Type Audio), APE (Monkey's Audio), Opus, AC3 and MP2. Q. I want the new *put the newest and coolest codec there* format to be supported by abcde. Abcde is so cool but i want to encode also to this new format... A. Patches are welcome! ;) No, seriously, if the format is usable, available for Linux and open source/free software, it should be fairly easy to integrate. Support for AAC (m4p) should be the next one to be introduced. Q. I use Debian/RedHat/(put your Unix flavour here) and MP3 encoding is not working. What am I doing wrong? A. Since MP3 is considered non-free (you get it for free, but hardware players and net broadcasters have to pay license fees), some release engineering groups and release management teams have decided not to provide MP3 encoding tools. These distributions or operating systems have decided to use Ogg/Vorbis as the default encoding format, since it contains no (known) patent claims and they are (supposed to be) completely Free (released under a BSD-like license). However, there is no strong (at the moment) hardware support, although some groups and companies are strongly working on getting it, real soon now. For that reason some people prefer to encode to MP3. UPDATE *** UPDATE There are known brands already selling Ogg/Vorbis portable players: Rio, iRiver, Neuros, iAudio,... Go buy one and you have no more reasons to use MP3. If you are among those individuals, you might need to add support for MP3 encoding to your system: Debian : check http://ftp.nerim.net/debian-marillat to install lame in your system. Others prefer bladeenc. Check www.apt-get.org or google. RedHat : search on rpmfind.net FreeBSD: By default includes LAME support. OpenBSD: Available by specifying you want to install the port with LAME support, or by just installing it later from the ports tree. NetBSD : Available in pkgsrc. Others : Please, help us here. Q. Huh! Why is MPPENCODER (with MPP) and .mpc the extension? A. Dunno. You must ask the guys who created and defined the format. The standard is MPEGplus (MPP/MP+) but the files use .mpc extension. Q. Why do I get .aac files instead of .m4a files when I encode with faac? A. Faac uses mp4v2 to create aac files in an m4a or mp4 container. Some Linux distros have disabled this mp4v2 support due to a licensing issue and this leave faac only capable of generating mpeg-2/ADTS streams. These streams should correctly have the .aac file extension and some players (such as Audacious) will not even play mpeg-2/ADTS streams when they are placed in an .m4a container. As of version 2.7 abcde tests the version of faac being used for mp4v2 support and then appropriately places the audio either in .m4a or .aac. Note that tagging is not possible with mpeg-2/ADTS streams in .aac. Q. How do I encode to Apple Lossless Audio Codec (alac)? A. As of abcde 2.7.1 there are 3 ways to encode to alac: using qaac, refalac or FFmpeg. To use qaac or refalac follow the installation directions here: http://www.andrews-corner.org/qaac.html#installation and then set your ~/.abcde.conf file as follows: AACENCODERSYNTAX=qaac QAAC="$HOME/.wine/drive_c/qaac/qaac.exe" # Or use the Open Source alac encoder with this small hack: # QAAC="$HOME/.wine/drive_c/qaac/refalac.exe" QAACENCOPTS="--alac --threading --verbose" OUTPUTTYPE="m4a" To use FFmpeg (or avconv) set your ~/.abcde.conf file as follows: AACENCODERSYNTAX=ffmpeg FFMPEG=ffmpeg # Or give the path to avconv instead: # FFMPEG=avconv FFMPEGENCOPTS="-c:a alac" OUTPUTTYPE="m4a" And then sit back and enjoy the music :) Q. Will FFmpeg be used with abcde for any other audio formats? A. The plan is to use FFmpeg (or avconv) when FFmpeg has a good quality native encoder available. For example FFmpeg has a low quality native native encoder for Vorbis and AAC which will not be used but a great reverse engineered alac encoder that has been used in abcde. FFmpeg also has a good WavPack encoder that has been added in abcde 2.7.1 which can be added into your ~/.abcde.conf file as follows: # WVENCODERSYNTAX=wavpack WVENCODERSYNTAX=ffmpeg # Appropriate PATH: WAVPACK=wavpack FFMPEG=ffmpeg # Appropriate options: FFMPEGENCOPTS="-c:a wavpack -compression_level 6" WAVPACKENCOPTS="-hx3" # Correct output type: OUTPUTTYPE="wv" You can see in this example how easy it is to switch from one WavPack encoder to another by changing the comment mark '#' on the WVENCODERSYNTAX line. For mp2 encoding with FFmpeg try the following: # MP2ENCODERSYNTAX=twolame MP2ENCODERSYNTAX=ffmpeg # Appropriate PATH: TWOLAME=twolame FFMPEG=ffmpeg FFMPEGENCOPTS='-c:a mp2 -b:a 320k' TWOLAMENCOPTS='--bitrate 320' # Correct output type: OUTPUTTYPE="mp2" Currently FFmpeg supports: alac, wavpack,mp2 and AIFF. FFmpeg native aac support will be added when it comes out of 'experimental'. FFmpeg is also used as the default encoder for the Matroska or mka container. A typical example, using the FFmpeg native ac3 encoder, is: MKAENCODERSYNTAX=ffmpeg FFMPEG=ffmpeg FFMPEGENCOPTS="-c:a ac3 -b:a 448k" OUTPUTTYPE="mka" Other suitable codecs for this usage are Vorbis, MP2, MP3, LC-AAC, HE-AAC, WMAv1, WMAv2, eAC3 and Opus. There is much more to come in the future for abcde and FFmpeg! 5. USEPIPES ======== Q. What is/are 'USEPIPES'?? A. This is a slightly different method of ripping and encoding with abcde utilising Unix pipes. Using this method a program sends as output what another programs expects as input without writing the information to the hard disk. For it to work with abcde, a ripper must send the data of the CD tracks which are ripped to the 'standard output', while sending other information and error messages to 'standard error' so that the encoder does not get confused. The encoder program needs to be able to encode the information send to it by reading from the standard input (which is what the ripper sends to the standard output). Usually Unix/Linux programs deal with the standard input/output by using the special file name '-', as in the following example: cdripper -o - | audioencoder -i - -o file.ext The 'cdripper' program uses the flag '-o' to identify the file it will output the data to. For the 'audioencoder' program to be able to read the output through a Unix pipe (the '|' symbol), the output needs to be sent to the standard output using the '-' special filename. Once the output has been piped to 'audioencoder' we use the same special filename to read the information as input with the '-i' flag and output it to 'file.ext' with the '-o' flag. Q. How do I use USEPIPES with abcde? A. You can run USEPIPES in either of two ways: 1. Add 'USEPIPES=y' to your ~/.abcde.conf file 2. Use the commandline option 'abcde -P' Q. Do all rippers and encoders work with USEPIPES? A. No :). Keep in mind that every ripper and encoder differs from in each other in the way they interact with pipes and not all rippers and encoders will use or understand the '-o' and '-' options. Currently (August 2015) the following rippers and encoders work: Rippers: cdparanoia, debug, libcdio, cdda2wav, flac, pird. Encoders: mp3enc, lame, bladeenc, oggenc, opusenc, flac, speexenc, mpcenc, wavpack, faac, neroAacEnc, fdkaac, qaac, fhgaacenc, ffmpeg, tta, ttaenc. Q. Can I add a ripper or encoder which is not supported? A. Sure! If you plan to use a ripper or encoder which is not supported you need to know how to use the ripper/encoder. For example, cdparanoia just uses '-' as the output filename and works. The program used to decode FLAC files (yes, abcde supports 'ripping' from a FLAC file :) uses '-c'. To add support for a ripper called 'cdripper' which uses the '-' special flag for outputting to the standard output, you need to open the config file (either /etc/abcde.conf or ~/.abcde.conf) and add the line: PIPERIPPER_cdripper="-" For an encoder called 'audioencoder' which uses '--stdin' to read the pipe input, you need to add: PIPE_audioencoder="--stdin" Of course, you should try your configuration and report it to the abcde developers so that it can be included in future versions of abcde. If you are familiar with POSIX shell programing, please open "abcde" and take a look at the lines below the one marked with "###USEPIPESSUPPORT###", the required syntax is reasonably clear. 6. MISC PROBLEMS ============= Q. What happened with normalize? A. Normalize has changed its name under Debian, which is the GNU/Linux distribution for developing abcde (well, is The GNU/Linux Distribution Steve uses, at the moment). Now it is called normalize-audio. If you are using some other flavour of OS, you need to change the name of the executable in your abcde.conf file. Q. I am using MacOSX and I am having problems to use abcde. A. Well, I have a Mac, but I use linux on it. I have not been able to find a way to make it work there, since I do not have the development tools installed. I have placed a basic support, but some user reports are just complaining about abcde not encoding the ripped tracks, as if icedax/cdda2wav/cdparanoia/cddafs would never end reading them. If you have such a system and experience problems, please, report them, and I will try to work them out with your help. Q. My hardware player (put it here) does not recognize the playlists created with abcde. What I am doing wrong? A. Try using "-m" when creating the playlists, or setting DOSPLAYLIST as an option in the config file. OBSOLETE -------- Q. I set KEEPWAVS to "y" but abcde insists on erasing my directory, along with the wav tracks. What I am doing wrong? A. The default action set includes clean, which cleans the temp directory, if nothing goes wrong. Take the "clean" out from the action list and you are done. UPDATE: KEEPWAVS unselects now the clean action. -- Steve McIntyre <93sam@@debian.org> abcde-2.9.3/Makefile000066400000000000000000000021031342626142700142260ustar00rootroot00000000000000abcde_version = abcde-2.9.3 INSTALL = /usr/bin/install -c prefix = /usr/local exec_prefix = $(prefix) bindir = $(exec_prefix)/bin sysconfdir = /etc datarootdir = $(prefix)/share docdir = $(datarootdir)/doc/$(abcde_version) mandir = $(datarootdir)/man DESTDIR = all: clean: install: $(INSTALL) -d -m 755 $(DESTDIR)$(bindir) $(INSTALL) -m 755 abcde cddb-tool abcde-musicbrainz-tool $(DESTDIR)$(bindir) $(INSTALL) -d -m 755 $(DESTDIR)$(sysconfdir) $(INSTALL) -m 644 abcde.conf $(DESTDIR)$(sysconfdir) $(INSTALL) -d -m 755 $(DESTDIR)$(docdir) $(INSTALL) -m 644 changelog COPYING FAQ README $(DESTDIR)$(docdir) $(INSTALL) -d -m 755 $(DESTDIR)$(mandir)/man1 $(INSTALL) -m 644 abcde.1 cddb-tool.1 $(DESTDIR)$(mandir)/man1 uninstall: -rm -v \ $(DESTDIR)$(bindir)/abcde \ $(DESTDIR)$(bindir)/cddb-tool \ $(DESTDIR)$(bindir)/abcde-musicbrainz-tool \ $(DESTDIR)$(sysconfdir)/abcde.conf \ $(DESTDIR)$(docdir)/changelog \ $(DESTDIR)$(docdir)/COPYING \ $(DESTDIR)$(docdir)/FAQ \ $(DESTDIR)$(docdir)/README \ $(DESTDIR)$(mandir)/man1/abcde.1 \ $(DESTDIR)$(mandir)/man1/cddb-tool.1 abcde-2.9.3/README000066400000000000000000000323671342626142700134650ustar00rootroot00000000000000ABCDE ===== abcde is a frontend command-line utility (actually, a shell script) that grabs tracks off a CD or a singletrack flac file with an embedded cuesheet, encodes them to Ogg/Vorbis, MP3, FLAC, Ogg/Speex, M4A, Opus, WavPack, Monkey's Audio (ape), MPP/MP+(Musepack) and/or AIFF format, and tags them, all in one go. Your finished Ogg/MP3/FLAC/Speex/M4A/Opus,WavPack/Ape/MPP/AIFF's are, by default, stored in a subdirectory of the current directory (named after the artist) with a filename based on the track title. Spaces are replaced by underscores, and apostrophes and control codes are filtered out. Colons are replaced with an underscore and a hyphen. The end result usually looks like: Our_Lady_Peace/01.Supermans_Dead.ogg. This filename munging is customizable, edit the mungefilename function in your abcde.conf to change it. abcde also has the ability to search for and download suitable album art as well as automatically embed the album art into the tracks of some containers. Many of the questions related of problems executing abcde have been moved to the FAQ, which should be distributed along with this package. Refer to that file for more help. MAJOR CHANGES ============= (see changelog for more details) Changes in 2.9.3 * Small bug fixes Changes in 2.9.2 * More fixes to Musicbrainz code Changes in 2.9.1 * Fixes in Musicbrainz code Changes in 2.9 * Allow for embedding of album art downloaded by the getalbumart fuction * Add support for another output encoding: Audio Interchange File Format (AIFF) * Reworked CD lookup code to fully support using all of CDDB, Musicbrainz and CD-Text * Correct Musicbrainz ID calculation for discs where PREGAP is non-zero * Add initial Irix support * Musicbrainz support now depends on WebService::MusicBrainz 1.x to support the v2 MusicBrainz web API * Major refactoring and shell quoting fixes * Many other bug fixes - see the changelog for a full list Changes in 2.8.1 * Fix for stupid bug introduced in abcde-musicbrainz-tool in 2.8 Changes in 2.8 * Add support for using multiple CD lookup services in order * Switch from cddb to musicbrainz as the default CD lookup service * Lots more bugs fixes - see the changes for more details. Changes in 2.7.2 * Support for output to the Matroska container (mka). * Add id3tag mp3 tagger as this is the tagger available to OpenBSD users. * Several bug fixes. See the changelog for more details. Changes in 2.7.1 * Rewrite and improvement of the abcde Makefile. * Support added for True Audio encoding. * Support added for encoding to MPEG-1 Audio Layer II (mp2) with either twolame or FFmpeg. * Support added for encoding to WavPack with FFmpeg. * Support added for encoding to m4a with either FFmpeg or avconv. This allows usage of the FFmpeg / avconv native alac encoder. * Support added for AAC encoding with fhgaacenc via Wine. * Support added for AAC encoding with qaac via Wine. (Also alac encoding with the open source refalac). * Several bug fixes. See the changelog for more details. Changes in 2.7 * Rewrite of the mungefilename function. * Support added for downloading album art. * Support added for ripping with libcdio (cd-paranoia). * Some error checking and a small help file added to abcde-musicbrainz-tool. * Substantial renovations of m4a encoding with a choice now between encoding with faac, NeroAacEnc and fdkaac. * Fixes to USEPIPES with the addition of several new encoders and rippers. Details on USEPIPES now available in the abcde FAQ doc. * Support added for encoding with Monkey's Audio (ape), tagging is with Robert Muth's apetag. * Support added for encoding with WavPack. * mp3 tagging renovated with version sniffing differentiating between eyeD3 versions. Tagging formalised with options now for id3, id3v2 and eyeD3. * Many, many bug fixes. See the changelog for more details. Changes in 2.6: * Lots of bugfixes Changes in 2.5: * Added working support for Musicbrainz using a perl helper script. Changes in 2.4: * Read TOC entries from the CD. The default uses cdrdao. The program mkcue is also optional. * Possibility to use CDDBCHOICE1,CDDBCHOICE2 (i.e., 1,3) to get a diff of two parsed CDDB entries. * Added SHOWCDDBFIELDS to define whether to show the YEAR and GENRE fields from the CDDB output. * Added the possibility of embeding a cuesheet on a singletrack flac file. A single BACKUP flag is most likely needed to use all the needed flags: "abcde -1 -o flac -a default,cue" * Added the possibility of using a singletrack flac file with an embedded cuesheet as a source to extract tracks from (use -X to specify an external CUE2DISCID implementation; check under examples in the distributed source code or package). * Added replaygain for Ogg/Vorbis and Ogg/FLAC. * Added M4A encoding. * Uses the default found $CDROMREADER instead of forcing cdparanoia when cdda2wav is installed. * BATCH mode has been split into two options: BATCHNORM and NOGAP. * Added -U option for non-UNICODE (non UTF-8) tag encoding. * Added -z for debug. * Added -f to force the removal of left files. * CUE support has changed from a flag (-M) to an action (cue). Changes in 2.3: * Support for mkcue, to create a CUE sheet of the CD structure. It can be used with "-1" to create a backup, so that later the original CD can be recreated. * New -o :,... way of passing specific options to an output. Now we can pass specific options without having to modify a config file. This feature was already present in the last versions of the 2.2 cycle. * Unix PIPEs, as a second way to encode files with a low disc space. * Option to erase the "encoded" entries from the status file. Allows one to encode the wav files (in case they were not erased) into another format. This is needed until status information is stored for each format. * The "ogg" output mode will be substituted for "vorbis" in the near future. This release adds a compatibility layer so that both entries work. * The FLAC encoder forces the files to be overwritten, in case they previously exists. This avoids a half-through abcde run to continue without errors in case it was cancelled during the FLAC encoding. * Added a post_read() function so that we can do things with the CD before we eject it. Changes in 2.2: * Support for MPP/MP+(Musepack) format. It can be downloaded from corecodecs.org. It is supposed to be Free (not only free), and released under the GPL... * New "-t " option for starting the numbering of the output files at a given starting number. Ideal for albums with more than one CD. * New "-T " option, similar to "-t" but also modifies the tag entries on the files themselves. * New "-w " to add a comment to the tracks of a given CD rip. Use quotes. * New "-W " option to combine both a comment with "CD #number" and a starting number for both the tracks and the tags with "#01" (that is, 101 for the 1st CD, 201 for the second...) * Support for keeping an existing playlist (and not add new entries to it), erase the existing one (overwrite) or append new entries to the existing one. * Under ./examples you will find a very basic way to make abcde run in the background and start a non-interactive rip of a CD, if it can find an audio CD in the tray. The abcded script depends on eject and cdparanoia being installed in your system. * New mungegenre function to switch off (or modify) the default behaviour of transforming uppercase characters to lowercase. * cdparanoia permits performing a query to the CD drive and obtain a list of valid audio tracks. So, now we perform such query and process the results. * Support for "None of the above" has been added with the "0" selection. A template is created, and the selection to edit it is defaulted to "y". New options in 2.1.19: * ONETRACK mode has been introduced. Setting the flag "-1" will create a single file with all the tracks from the CD. Changes in 2.1.18: * CDSPEED option defaults to eject. However, since cdparanoia has a built-in option to set the speed, we use it. There is not way (right now) to force the use of eject, but it will be introduced in a future release. Also one can use the pre_read function to set the speed with other program. New options in 2.1.16: * -S, CDSPEED and CDSPEEDOPTS for setting the speed of the CDROM. One can set the options in abcde.conf and pass the value on the command line. This option can be used with "eject -x ", "setcd -x " or the built-in cdparanoia option "-S ", if the CD reader supports it. * Added a pre-read function. Modify it at your pleasure in abcde.conf One can use it to close the CD drive. * -m option, to modify the playlist to include CRLF in every line. Some players insist on having those to work properly with playlists. New options in 2.1.15: * -V can be used to obtain some more information about the CDDB queries. * -v shows the version, basic help, and exits. New options from 2.1.10 to 2.1.13: * CDROMID has been introduced for cdda2wav use with SCSI devices. * Use -L to retrieve the CDDB entries from a local repository (also one can set CDDBUSELOCAL in the config file). * If CDDBCOPYLOCAL is set to "y" we store copies of the CDDB entries, under CDDBLOCALDIR (defaults to "~/.cddb). Modifications from 2.1.9 to 2.1.10: * Initial (still incomplete) MacOSX support is on the works. * A new tool (curl) has been added for MacOSX compatibility, as HTTPGET option. Options modified from 2.1.8 to 2.1.9: * KEEPWAVS option now sets the clean to "no". Options added/modified from 2.1.3 to 2.1.5: * Ogg/Speex added. Use "-o spx" to rip your audiobooks, for instance. Options added/modified from 2.1.1 to 2.1.3: * WGET has been substituted by HTTPGET. Now we support fetch as retrieval program. * KEEPWAVS has been introduced. Set it to "y" and the wav tracks will be kept. * CDDBPROTO is used to specify the protocol level in the CDDB retrieval. * DAGRAB has been introduced as a cd ripper. Options added/modified from 2.0.3 to 2.1.x: * -b use batch processing. It uses normalize-audio to adjust the volume of the songs, and a -g gapless option from lame to remove gaps. Only available for mp3+lame combination. * a new "normalize" option has been added to -a, to normalize the volume. * -o works now with a combination of the different outputs: ogg, mp3, flac. Combine them separated by ",". Example: "-o ogg,flac". * OUTPUTTYPE is no longer used for the output file type. From version 2.1 abcde implements multiple-output and the file type is always appended at the end of the file. The OUTPUT variable can be used in the PLAYLISTFORMAT and OUTPUTFORMAT to create different directory structures and playlist names for each of the output formats selected. * DYEAR can be used as DiskYear value in CDDB data. If the data is not supplied by the CDDB server, it can be added. Other options that changed from 1.x to 2.x: * -e doesn't exist anymore, abcde now presents you with all of the cddb data and asks you if you want to edit it. If you don't want to be asked, use -N or INTERACTIVE=n * The output type defaults to Ogg/Vorbis. Specify -o mp3 or OUTPUTTYPE=mp3 if you still want to output mp3's. * -l 2 is now just -l, LOWDISK=2 should now be LOWDISK=y * -V and -v are gone, abcde will now prompt you if you'd like to use Various Artists handling, after showing you the cddb data. * -P is now '-a playlist,clean', PLAYLISTONLY=y is now ACTIONS=playlist,clean * -p is now '-a playlist,move,clean', PLAYLIST=y is now ACTIONS=playlist,move,clean * cddb-tool has been cleaned up a little bit. 'get' is now 'query' and 'read', and the tempfile handling has been removed. * ID3COMMENT is now COMMENT. * FreeDB is now the default CDDB database. REQUIREMENTS ============ abcde requires the following backend tools to work: * An Ogg/Vorbis encoder (oggenc, the default, or vorbize) or: * An MP3 encoder (lame, gogo, bladeenc, l3enc, etc) or: * A FLAC encoder (flac) or: * An Ogg/Speex encoder (speexenc) or: * An MPP/MP+(Musepack) encoder (mpcenc) or: * An AAC encoder (faac, NeroAacEnc, fdkaac) or: * An Opus encoder )opusenc) or: * A Monkey's Ausio encoder (mac) or: * A WavPack encoder (wavpack) * normalize-audio for volume normalization. * CD Paranoia, an audio CD reading utility or: * icedax/cdda2wav, the audio CD reading utility cdparanoia was born from or: * cd-paranoia, an audio cd reading utility, courtesy of GNU libcdio or: * dagrab, another audio CD reading utility. * cd-discid, a CDDB DiscID reading program. Formerly bundled with abcde. It's available in Debian or http://linukz.org/cd-discid.shtml * An HTTP retrieval program: wget, fetch (FreeBSD) or curl (MacOSX) * id3, an id3 tagging program. Available at: http://lly.org/~rcw/id3/ * eyeD3, an id3 version 2.0 tagger. http://eyed3.nicfit.net/ * (optional) distmp3, a client/server for distributed mp3 encoding. You can get distmp3 at http://wlug.westbo.se/medlprog/medlprog.html Abcde's mailing list is abcde-users@lists.einval.com. Visit https://lists.einval.com/cgi-bin/mailman/listinfo/abcde-users to subscribe. Posts from non-subscribers are moderated to prevent spam. Abcde's current page is at https://abcde.einval.com/ and the latest upstream code is in git at https://git.einval.com/cgi-bin/gitweb.cgi?p=abcde.git -- Steve McIntyre <93sam@debian.org> Andrew Strong abcde was originally created by Robert Woodcock abcde-2.9.3/abcde000077500000000000000000005344671342626142700136010ustar00rootroot00000000000000#!/bin/bash # Copyright (c) 1998-2001 Robert Woodcock # Copyright (c) 2003-2006 Jesus Climent # Copyright (c) 2009-2012 Colin Tuckley # Copyright (c) 2012-2019 Steve McIntyre <93sam@@debian.org> # Copyright (c) 2015-2017 Andrew Strong # This code is hereby licensed for public consumption under either the # GNU GPL v2 or greater, or Larry Wall's Artistic license - your choice. # # 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., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA VERSION='2.9.3' usage () { echo "This is abcde v$VERSION." echo "Usage: abcde [options] [tracks]" echo "Options:" echo "-1 Encode the whole CD in a single file" echo "-a " echo " Actions to perform, comma separated:" echo " (cddb,read,getalbumart,embedalbumart,normalize,encode," echo " tag,move,replaygain,playlist,clean)" #echo "-A Experimental actions (retag, transcode)" echo "-b Enable batch normalization" echo "-B Embed albumart (this also activates getalbumart)" echo "-c " echo " Specify a configuration file (overrides system and user config files)" echo "-C " echo " Specify discid to resume from (only needed if you no longer have the cd)" echo "-d " echo " Specify CDROM device to grab (flac uses a single-track flac file)" echo "-D Debugging mode (equivalent to sh -x abcde)" echo "-e Erase encoded track information from status file" echo "-f Force operations that otherwise are considered harmful. Read \"man abcde\"" echo "-g Use \"lame --nogap\" for MP3 encoding. Disables low disk and pipes flags" echo "-G Get album art by using the 'getalbumart' action" echo "-h This help information" #echo "-i Tag files while encoding, when possible (local only) -NWY-" echo "-j <#> Number of encoder processes to run at once (localhost)" echo "-k Keep the wav tracks for later use" echo "-l Use low disk space algorithm" echo "-L Use local CDDB storage directory" echo "-m Modify playlist to include CRLF endings, to comply with some players" #echo " WARNING: Deprecated. Use \"cue\" action" #echo "-M Create a CUE file" echo "-n No lookup. Don't query CDDB, just create and use template" echo "-N Noninteractive. Never prompt for anything" echo "-o " echo " Output file type(s), comma separated" echo " (vorbis,mp3,flac,spx,mpc,wav,m4a,opus,mka,wv,ape,mp2,tta,aiff)." echo " Defaults to vorbis" echo "-p Pad track numbers with 0's (if less than 10 tracks)" echo "-P Use UNIX pipes to read+encode without wav files" echo "-Q CD lookup method(s), comma separated" echo " (musicbrainz,cddb,cdtext). Defaults to musicbrainz". echo "-r " echo " Also encode on these remote hosts" echo "-s " echo " Show fields from the CDDB info (year,genre)" echo "-S <#> Set the CD speed" echo "-t <#> Start the track numbering at a given number" echo "-T <#> Same as -t but modifies tag numbering" echo "-U Do NOT use UNICODE (UTF8) tags and comments" echo "-v Show version number and exit" echo "-V Be a bit more verbose about what is happening behind the scenes" echo "-x Eject CD after all tracks are read" echo "-w " echo " Add a comment to the CD tracks" echo "-W <#> Concatenate CDs: -T #01 -w \"CD #\"" echo "-z Use debug CDROMREADERSYNTAX option (needs cdparanoia)" echo "" echo "Tracks is a space-delimited list of tracks to grab." echo "Ranges specified with hyphens are allowed (i.e., 1-5)." echo "" #echo "Double hyphens are used to concatenate tracks" } addstatus () { echo "$@" >> "${ABCDETEMPDIR}/status" } # log [level] [message] # # log outputs the right message in a common format log () { BLURB="$1" shift case $BLURB in error) >&2 echo "[ERROR] abcde: $@" >&2 ;; warning) >&2 echo "[WARNING] $@" >&2 ;; info) >&4 echo "[INFO] $@" ;; esac } # Functions to replace the need of seq, which is too distribution dependent. f_seq_row () { i=$1 while [ $i -le $2 ] do echo $i i=$(( $i + 1 )) done } f_seq_line () { i=$1 if echo "$i" | grep "[[:digit:]]" > /dev/null 2>&1 ; then while [ $i -le $2 ] do printf "%d " "$i" i=$(( $i + 1 )) done echo else log error "syntax error while processing track numbers ($i)" exit 1 fi } # Functions to replace the need of awk {print $1} and {print $NF} get_first() { if [ X"$1" = "X" ]; then for first in $(cat); do break done else first=$1 fi echo "$first" } get_last() { if [ X"$1" = "X" ]; then for stdin in $(cat); do last=$stdin done else for last in $@ ; do :; done fi echo "$last" } # checkstatus [blurb] # Returns "0" if the blurb was found, returns 1 if it wasn't # Puts the blurb content, if available, on stdout. # Otherwise, returns "". checkstatus () { # Take the last line in the status file if there's multiple matches PATTERN="^$1(=.*)?$" BLURB=$(grep -E "$PATTERN" "${ABCDETEMPDIR}/status" | tail -n 1) if [ -z "$BLURB" ]; then # No matches found return 1 else # Matches found # See if there's a = in it if ( echo "$BLURB" | grep -q '=' ); then echo "$BLURB" | cut -f2- -d= fi return 0 fi } # checkwarnings [blurb] # Returns "0" if the blurb was found (meaning there was an warning), # returns 1 if it wasn't (yes this is a little backwards). # Does not print the blurb on stdout. # Otherwise, returns "". checkwarnings () { if [ -e "${ABCDETEMPDIR}/warnings" ]; then :; else return 1 fi # Take the last line in the status file if there's multiple matches PATTERN="^$1(:.*)?$" BLURB=$(grep -E "$PATTERN" "${ABCDETEMPDIR}/warnings" | tail -n 1) if [ -z "$BLURB" ]; then # negative, we did not have a negative... return 1 else # affirmative, we had a negative... return 0 fi } # checkerrors [blurb] # Returns "0" if the blurb was found (meaning there was an error), # returns 1 if it wasn't (yes this is a little backwards). # Does not print the blurb on stdout. # Otherwise, returns "". checkerrors () { if [ -e "${ABCDETEMPDIR}/errors" ]; then :; else return 1 fi # Take the last line in the status file if there's multiple matches PATTERN="^$1(:.*)?$" BLURB=$(grep -E "$PATTERN" "${ABCDETEMPDIR}/errors" | tail -n 1) if [ -z "$BLURB" ]; then # negative, we did not have a negative... return 1 else # affirmative, we had a negative... return 0 fi } # page [file] # Display a file. If it's too long to fit the current terminal size, # find the right pager in the system and use it page () { PAGEFILE="$1" local NUM_LINES=$(wc -l < "$PAGEFILE") local LINES="" # Check the terminal length every time we're called - the user # might have resized since last time we were here # First, try tput if new_checkexec tput; then LINES=$(tput lines) fi # If tput didn't work, 24 will do... if [ -z "$LINES" ]; then LINES=24 fi # Is the text long enough to need a pager? if [ "$NUM_LINES" -ge $LINES ]; then # Yes! # Use the debian sensible-pager wrapper to pick the pager user # has requested via their $PAGER environment variable if [ -x "/usr/bin/sensible-pager" ]; then /usr/bin/sensible-pager "$PAGEFILE" elif [ -x "$PAGER" ]; then # That failed, try to load the preferred pager, starting # with their PAGER variable $PAGER "$PAGEFILE" # If that fails, check for less elif [ -x /usr/bin/less ]; then /usr/bin/less -f "$PAGEFILE" # more should be on all UNIX systems elif [ -x /bin/more ]; then /bin/more "$PAGEFILE" else # No bananas, just cat the thing cat "$PAGEFILE" >&2 fi else # No, just cat the thing cat "$PAGEFILE" >&2 fi } # run_command [blurb] [command...] # Runs a command, silently if necessary, and updates the status file run_command () { vvecho "$@" BLURB="$1" shift # See if this is supposed to be silent if [ "$(checkstatus encode-output)" = "loud" ]; then "$@" >&2 RETURN=$? else # Special case for SMP, since # encoder output is never displayed, don't mute echos if [ -z "$BLURB" ] && [ "$MAXPROCS" != "1" ]; then "$@" >&2 RETURN=$? else "$@" >/dev/null 2>&1 RETURN=$? fi fi case "$1" in normalize|normalize-audio) if [ "$RETURN" = "2" ]; then # File was already normalized. RETURN=0 fi ;; esac if [ "$RETURN" != "0" ]; then # Put an error in the errors file. For various reasons we # can't capture a copy of the program's output but we can # log what we attempted to execute and the error code # returned by the program. if [ "$BLURB" ]; then TWEAK="$BLURB: " fi echo "${TWEAK}returned code $RETURN: $@" >> "${ABCDETEMPDIR}/errors" return $RETURN # Do not pass go, do not update the status file fi if [ "$BLURB" ]; then echo "$BLURB" >> "${ABCDETEMPDIR}/status" fi } # relpath() and slash() are Copyright (c) 1999 Stuart Ballard and # distributed under the terms of the GNU GPL v2 or later, at your option # Function to determine if a word contains a slash. slash () { case "$1" in */*) return 0;; *) return 1;; esac } # Function to give the relative path from one file to another. # Usage: relpath fromfile tofile # eg relpath music/Artist/Album.m3u music/Artist/Album/Song.mp3 # (the result would be Album/Song.mp3) # Output is relative path to $2 from $1 on stdout # This code has the following restrictions: # Multiple ////s are not collapsed into single /s, with strange effects. # Absolute paths and ../s are handled wrong in FR (but they work in TO) # If FR is a directory it must have a trailing / relpath () { FR="$1" TO="$2" case "$TO" in /*) ;; # No processing is needed for absolute paths *) # Loop through common prefixes, ignoring them. while slash "$FR" && [ "$(echo "$FR" | cut -d/ -f1)" = "$(echo "$TO" | cut -d/ -f1)" ] do FR="$(echo "$FR" | cut -d/ -f2-)" TO="$(echo "$TO" | cut -d/ -f2-)" done # Loop through directory portions left in FR, adding appropriate ../s. while slash "$FR" do FR="$(echo "$FR" | cut -d/ -f2-)" TO="../$TO" done ;; esac echo "$TO" } new_checkexec () { if [ ! "$@" = "" ]; then # Cut off any command-line option we added in X=$(echo "$@" | cut -d' ' -f2) WHICH=$(which "$X" 2>/dev/null) if [ -z "$WHICH" ]; then return 1 elif [ ! -x "$WHICH" ]; then return 2 fi fi return 0 } checkexec () { if [ ! "$@" = "" ]; then # Cut off any command-line option we added in X=$(echo "$@" | cut -d' ' -f2) # Test for built-in abcde.function [ "$X" != "${X#abcde.}" ] && type "$X" >/dev/null 2>&1 && return WHICH=$(which "$X" 2>/dev/null) if [ -z "$WHICH" ]; then log error "$X is not in your path." >&2 log info "Define the full path to the executable if it exists on your system." >&2 if [ -e /etc/debian_version ] ; then case $X in oggenc) MISSING_PACKAGE=vorbis-tools ;; lame|flac|cd-discid|eject|mkcue|icedax|glyrc) MISSING_PACKAGE=$X ;; esac log info "Hint: sudo apt-get install $MISSING_PACKAGE" >&2 fi exit 1 elif [ ! -x "$WHICH" ]; then log error "$X is not executable." >&2 exit 1 fi fi } # diffentries , # max_value: the range of entries goes from 1 to diffentries () { FILENAME=$1 shift local CDDBDIFFCHOICES=$1 shift local CDDBDIFFCHOICE="$@" if [ ! X"$DIFF" = "X" ]; then PARSECHOICE1=$(echo "$CDDBDIFFCHOICE" | cut -d"," -f1 | xargs printf %d 2>/dev/null) PARSECHOICE2=$(echo "$CDDBDIFFCHOICE" | cut -d"," -f2 | xargs printf %d 2>/dev/null) if [ "$PARSECHOICE1" -lt 1 ] || [ "$PARSECHOICE1" -gt "$CDDBDIFFCHOICES" ] || \ [ "$PARSECHOICE2" -lt 1 ] || [ "$PARSECHOICE2" -gt "$CDDBDIFFCHOICES" ] || \ [ "$PARSECHOICE1" -eq "$PARSECHOICE2" ]; then echo "Invalid diff range." >&2 echo "Please select two comma-separated numbers between 1 and $CDDBDIFFCHOICES" >&2 else # We parse the 2 choices to diff, store them in temporary files and diff them. for PARSECHOICE in $(echo "$CDDBDIFFCHOICE" | tr , \ ); do do_cddbparse "${ABCDETEMPDIR}/$FILENAME.$PARSECHOICE" > "${ABCDETEMPDIR}/$FILENAME.parsechoice.$PARSECHOICE" done echo "Showing diff between choices $PARSECHOICE1 and $PARSECHOICE2..." > "${ABCDETEMPDIR}/$FILENAME.diff" $DIFF $DIFFOPTS "${ABCDETEMPDIR}/$FILENAME.parsechoice.$PARSECHOICE1" \ "${ABCDETEMPDIR}/$FILENAME.parsechoice.$PARSECHOICE2" >> "${ABCDETEMPDIR}/$FILENAME.diff" page "${ABCDETEMPDIR}/$FILENAME.diff" fi else echo "The diff program was not found in your path." >&2 echo "Please choose a number between 0 and $CDDBDIFFCHOICES." >&2 fi } # getcddbinfo # Finds an specific field from cddbinfo getcddbinfo() { case $1 in TRACKNAME1) TRACKNAME="$(grep -a "^TTITLE$CDDBTRACKNUM=" "$CDDBDATA" | head -n 1 | cut -f2- -d= | tr -d \[:cntrl:\] | sed 's/\ \+$//')" ;; TRACKNAME) TRACKNAME="$(grep -a "^TTITLE$CDDBTRACKNUM=" "$CDDBDATA" | cut -f2- -d= | tr -d \[:cntrl:\] | sed 's/\ \+$//')" ;; TRACK-INFO) grep -a "^EXTT$CDDBTRACKNUM=" "$CDDBDATA" | cut -f2- -d= | tr -d \[:cntrl:\] | sed 's/\\n/\n/g' ;; esac } # gettracknum # Get the track number we are going to use for different actions gettracknum() { if [ -n "$STARTTRACKNUMBER" ] ; then # Get the trackpadding from the current track, also trim whitespace for MacOSX CURRENTTRACKPADDING=$(echo -n "$UTRACKNUM" | wc -c | tr -d ' ') REALTRACKNUM=$(expr $UTRACKNUM + 0) # Unpad TRACKNUM=$( printf %0.${CURRENTTRACKPADDING}d $((${REALTRACKNUM} + ${STARTTRACKNUMBER} - ${FIRSTTRACK}))) else TRACKNUM=${UTRACKNUM} fi } # makeids # # Calculate cddb disc ids without requiring specialized helper programs. # largely copied from cd-discid and musicbrainz examples. some of the steps # don't make sense, but they're necessary to match the ids generated by other # programs. # ## FIXME ## Right now, we get 2 frames more than with cue2discid ?? # data@petit:~$ sh /tmp/cue2discid /home/data/tmp/flac/01.Roisin_Murphy--Ruby_Blue.flac # processing offsetimes 00:00:00 04:47:10 08:20:37 11:46:46 17:45:36 21:41:57 27:32:21 32:03:73 35:39:28 38:27:33 43:50:38 44:42:34 # 980b4b0c 12 150 21685 37687 53146 80061 97782 124071 144448 160603 173208 197438 201334 2895 # data@petit:~$ metaflac --export-cuesheet-to=- /home/data/tmp/flac/01.Roisin_Murphy--Ruby_Blue.flac| python /home/data/sources/abcde/trunk/examples/cue2discid # 980b4b0c 12 150 21685 37687 53146 80061 97782 124071 144448 160603 173208 197438 201334 2893 # # Variables: OFFSETS, TRACKS, LEADOUT, [LEADIN] makeids () { if [ X"$LEADOUT" = "X" ]; then log warning "Error trying to calculate disc ids without lead-out information." exit 1 fi # default to a two second lead-in IDMAGICNUM=150 LEADIN=${LEADIN:=150} # number of cdframes per second CDFRAMES=75 # reset cddb checksum for cddb disc-id calululation CDDBCKSUM=0 COOKEDOFFSETS="" for OFFSET in $OFFSETS do COOKEDOFFSETS="${COOKEDOFFSETS} $(($OFFSET + $LEADIN))" OFFSETTIME=$(( ($OFFSET + $LEADIN) / $CDFRAMES )) while [ $OFFSETTIME -gt 0 ]; do CDDBCKSUM=$(($CDDBCKSUM + $OFFSETTIME % 10)) OFFSETTIME=$(($OFFSETTIME / 10)) done done COOKEDOFFSETS="${COOKEDOFFSETS:1}" # eat the leading space PREGAP=$(echo $OFFSETS | cut -f1 -d' ') TOTALTIME=$(( (($LEADOUT + $LEADIN + $PREGAP) / $CDFRAMES) - (($LEADIN + $PREGAP) / $CDFRAMES))) vvecho "makeids: PREGAP $PREGAP, LEADIN $LEADIN, LEADOUT $LEADOUT" # Calculate both the cddb discid *and* the musicbrainz discid # now. We'll use the cddb discid for reference in most cases # for consistency, but we also have the musicbrainz discid for # when we need it printf -v CDDBDISCID "%08lx" $(( ($CDDBCKSUM % 0xff) * 16777216 | $TOTALTIME * 256 | $TRACKS)) CDDBTRACKINFO="${CDDBDISCID} $((TRACKS)) ${COOKEDOFFSETS} $((($LEADOUT + $LEADIN + $IDMAGICNUM) / $CDFRAMES))" case $CDDBMETHOD in *musicbrainz*) # FIXME: don't assume the first track is 1 MBDISCID=$($MUSICBRAINZ --command calcid --discinfo 1 $TRACKS $LEADIN $(($PREGAP + $LEADOUT)) $OFFSETS) error=$? if [ $error != 0 ]; then log error "$MUSICBRAINZ failed to run; ABORT" exit $error fi MBTRACKINFO="${MBDISCID} $((TRACKS)) ${COOKEDOFFSETS} $((($LEADOUT + $LEADIN + $IDMAGICNUM) / $CDFRAMES))" ;; esac } do_replaygain() { if checkstatus replaygain; then :; else run_command "" echo "Adding replaygain information..." for TMPOUTPUT in $( echo "$OUTPUTTYPE" | tr , \ ) do case $TMPOUTPUT in vorbis|ogg) OUTPUT=$OGGOUTPUTCONTAINER ;; opus) OUTPUT=$OPUSOUTPUTCONTAINER ;; flac) OUTPUT=$FLACOUTPUTCONTAINER ;; *) OUTPUT=$TMPOUTPUT ;; esac OUTPUTFILES="" REPLAYINDEX=0 for UTRACKNUM in $TRACKQUEUE do CDDBTRACKNUM=$(expr $UTRACKNUM - 1) # Unpad getcddbinfo TRACKNAME splitvarious TRACKFILE="$(mungetrackname "$TRACKNAME")" ARTISTFILE="$(mungeartistname "$TRACKARTIST")" ALBUMFILE="$(mungealbumname "$DALBUM")" GENRE="$(mungegenre "$GENRE")" YEAR=${CDYEAR:-$CDYEAR} gettracknum if [ "$ONETRACK" = "y" ]; then if [ "$VARIOUSARTISTS" = "y" ]; then OUTPUTFILE="$(eval echo \""$VAONETRACKOUTPUTFORMAT"\")" else OUTPUTFILE="$(eval echo \""$ONETRACKOUTPUTFORMAT"\")" fi else if [ "$VARIOUSARTISTS" = "y" ]; then OUTPUTFILE="$(eval echo \""$VAOUTPUTFORMAT"\")" else OUTPUTFILE="$(eval echo \""$OUTPUTFORMAT"\")" fi fi OUTPUTFILES[$REPLAYINDEX]="$OUTPUTDIR/$OUTPUTFILE.$OUTPUT" (( REPLAYINDEX = $REPLAYINDEX + 1 )) done case "$OUTPUT" in flac) run_command "replaygain-flac" nice $ENCNICE $METAFLAC $FLACGAINOPTS "${OUTPUTFILES[@]}" ;; vorbis|ogg) run_command "replaygain-vorbis" nice $ENCNICE $VORBISGAIN $VORBISGAINOPTS "${OUTPUTFILES[@]}" ;; mp3) run_command "replaygain-mp3" nice $ENCNICE $MP3GAIN $MP3GAINOPTS "${OUTPUTFILES[@]}" ;; mpc) run_command "replaygain-mpc" nice $ENCNICE $MPCGAIN "${OUTPUTFILES[@]}" ;; wv) run_command "replaygain-wv" nice $ENCNICE $WVGAIN $WVGAINOPTS "${OUTPUTFILES[@]}" ;; *);; esac done if checkerrors "replaygain-.{3,6}"; then :; else run_command "replaygain" true fi fi } # This code splits the a Various Artist track name from one of the following # forms: # # forward: Artist / Track # forward-dash: Artist - Track # reverse: Track / Artist # reverse-dash: Track - Artist # colon: Artist: Track # trailing-paren: Artist (Track) # # variables used: # VARIOUSARTISTS, VARIOUSARTISTSTYLE, TRACKNAME, TRACKARTIST splitvarious () { if [ "$VARIOUSARTISTS" = "y" ] && [ ! "$ONETRACK" = "y" ]; then case "$VARIOUSARTISTSTYLE" in forward) DTITLEARTIST="$(echo "$TRACKNAME" | sed 's- / -~-g')" TRACKARTIST="$(echo "$DTITLEARTIST" | cut -f1 -d~)" TRACKNAME="$(echo "$DTITLEARTIST" | cut -f2 -d~)" ;; forward-dash) DTITLEARTIST="$(echo "$TRACKNAME" | sed 's, - ,~,g')" TRACKARTIST="$(echo "$DTITLEARTIST" | cut -f1 -d~)" TRACKNAME="$(echo "$DTITLEARTIST" | cut -f2 -d~)" ;; reverse) DTITLEARTIST="$(echo "$TRACKNAME" | sed 's- / -~-g')" TRACKARTIST="$(echo "$DTITLEARTIST" | cut -f2 -d~)" TRACKNAME="$(echo "$DTITLEARTIST" | cut -f1 -d~)" ;; reverse-dash) DTITLEARTIST="$(echo "$TRACKNAME" | sed 's, - ,~,g')" TRACKARTIST="$(echo "$DTITLEARTIST" | cut -f2 -d~)" TRACKNAME="$(echo "$DTITLEARTIST" | cut -f1 -d~)" ;; colon) DTITLEARTIST="$(echo "$TRACKNAME" | sed 's-: -~-g')" TRACKARTIST="$(echo "$DTITLEARTIST" | cut -f1 -d~)" TRACKNAME="$(echo "$DTITLEARTIST" | cut -f2 -d~)" ;; trailing-paren) DTITLEARTIST="$(echo "$TRACKNAME" | sed 's,^\(.*\) (\(.*\)),\1~\2,')" TRACKARTIST="$(echo "$DTITLEARTIST" | cut -f2 -d~)" TRACKNAME="$(echo "$DTITLEARTIST" | cut -f1 -d~)" ;; esac elif [ "$VARIOUSARTISTS" = "y" ] && [ "$ONETRACK" = "y" ]; then TRACKARTIST="Various" else TRACKARTIST="$DARTIST" fi } do_getgenreid () { local genre=$(echo "${@}" | tr 'A-Z' 'a-z') local id="" case ${genre} in "blues") id=0 ;; "classic rock") id=1 ;; "country") id=2 ;; "dance") id=3 ;; "disco") id=4 ;; "funk") id=5 ;; "grunge") id=6 ;; "hip-hop") id=7 ;; "jazz") id=8 ;; "metal") id=9 ;; "new age") id=10 ;; "oldies") id=11 ;; "other") id=12 ;; "pop") id=13 ;; "r&b") id=14 ;; "rap") id=15 ;; "reggae") id=16 ;; "rock") id=17 ;; "techno") id=18 ;; "industrial") id=19 ;; "alternative") id=20 ;; "ska") id=21 ;; "death metal") id=22 ;; "pranks") id=23 ;; "soundtrack") id=24 ;; "euro-techno") id=25 ;; "ambient") id=26 ;; "trip-hop") id=27 ;; "vocal") id=28 ;; "jazz+funk") id=29 ;; "fusion") id=30 ;; "trance") id=31 ;; "classical") id=32 ;; "instrumental") id=33 ;; "acid") id=34 ;; "house") id=35 ;; "game") id=36 ;; "sound clip") id=37 ;; "gospel") id=38 ;; "noise") id=39 ;; "alt. rock") id=40 ;; "bass") id=41 ;; "soul") id=42 ;; "punk") id=43 ;; "space") id=44 ;; "meditative") id=45 ;; "instrum. pop") id=46 ;; "instrum. rock") id=47 ;; "ethnic") id=48 ;; "gothic") id=49 ;; "darkwave") id=50 ;; "techno-indust.") id=51 ;; "electronic") id=52 ;; "pop-folk") id=53 ;; "eurodance") id=54 ;; "dream") id=55 ;; "southern rock") id=56 ;; "comedy") id=57 ;; "cult") id=58 ;; "gangsta") id=59 ;; "top 40") id=60 ;; "christian rap") id=61 ;; "pop/funk"|"pop / funk") id=62 ;; "jungle") id=63 ;; "native american") id=64 ;; "cabaret") id=65 ;; "new wave") id=66 ;; "psychadelic") id=67 ;; "rave") id=68 ;; "showtunes") id=69 ;; "trailer") id=70 ;; "lo-fi") id=71 ;; "tribal") id=72 ;; "acid punk") id=73 ;; "acid jazz") id=74 ;; "polka") id=75 ;; "retro") id=76 ;; "musical") id=77 ;; "rock & roll") id=78 ;; "hard rock") id=79 ;; "folk") id=80 ;; "folk/rock") id=81 ;; "national folk") id=82 ;; "swing") id=83 ;; "fusion") id=84 ;; "bebob") id=85 ;; "latin") id=86 ;; "revival") id=87 ;; "celtic") id=88 ;; "bluegrass") id=89 ;; "avantgarde") id=90 ;; "gothic rock") id=91 ;; "progress. rock") id=92 ;; "psychadel. rock") id=93 ;; "symphonic rock") id=94 ;; "slow rock") id=95 ;; "big band") id=96 ;; "chorus") id=97 ;; "easy listening") id=98 ;; "acoustic") id=99 ;; "humour") id=100 ;; "speech") id=101 ;; "chanson") id=102 ;; "opera") id=103 ;; "chamber music") id=104 ;; "sonata") id=105 ;; "symphony") id=106 ;; "booty bass") id=107 ;; "primus") id=108 ;; "porn groove") id=109 ;; "satire") id=110 ;; "slow jam") id=111 ;; "club") id=112 ;; "tango") id=113 ;; "samba") id=114 ;; "folklore") id=115 ;; "ballad") id=116 ;; "power ballad") id=117 ;; "rhythmic soul") id=118 ;; "freestyle") id=119 ;; "duet") id=120 ;; "punk rock") id=121 ;; "drum solo") id=122 ;; "a capella") id=123 ;; "euro-house") id=124 ;; "dance hall") id=125 ;; "goa") id=126 ;; "drum & bass") id=127 ;; "club-house") id=128 ;; "hardcore") id=129 ;; "terror") id=130 ;; "indie") id=131 ;; "britpop") id=132 ;; "negerpunk") id=133 ;; "polsk punk") id=134 ;; "beat") id=135 ;; "christian gangsta rap") id=136 ;; "heavy metal") id=137 ;; "black metal") id=138 ;; "crossover") id=139 ;; "contemporary christian")id=140 ;; "christian rock") id=141 ;; "merengue") id=142 ;; "salsa") id=143 ;; "thrash metal") id=144 ;; "anime") id=145 ;; "jpop") id=146 ;; "synthpop") id=147 ;; "rock/pop"|"rock / pop") id=148 ;; *) id=255 ;; esac echo ${id} return 0 } # do_tag [tracknumber] # id3 tags a filename # variables used: # TRACKS, TRACKNAME, TRACKARTIST, TAGGER, TAGGEROPTS, VORBISCOMMENT, METAFLAC, # COMMENT, DALBUM, DARTIST, CDYEAR, CDGENRE do_tag () { COMMENTOUTPUT="$(eval echo "${COMMENT}")" if [ -z "$COMMENTOUTPUT" ]; then COMMENTOUTPUT="$(getcddbinfo TRACK-INFO)" fi CDDBDISCID=$(echo "$CDDBTRACKINFO" | cut -d' ' -f1) run_command "" echo "Tagging track $1 of $TRACKS: $TRACKNAME..." # If we want to start the tracks with a given number, we need to modify the # TRACKNUM value before evaluation if [ -n "$STARTTRACKNUMBERTAG" ] ; then gettracknum fi for OUTPUT in $(echo "$OUTPUTTYPE" | tr , \ ) do case "$OUTPUT" in mp3) # id3v2 v0.1.9 claims to have solved the -c bug, so we merge both id3 and id3v2 GENREID=$(do_getgenreid "${CDGENRE}") # Set TPE2 in case we have a Various Artists rip. TPE2="" if [ "$VARIOUSARTISTS" = "y" ]; then TPE2="Various" fi case "$ID3SYNTAX" in id3) run_command "tagtrack-$OUTPUT-$1" nice $ENCNICE \ $TAGGER $TAGGEROPTS -c "$COMMENTOUTPUT" \ -A "$DALBUM" -a "$TRACKARTIST" -t "$TRACKNAME" \ -y "$CDYEAR" -g "$GENREID" \ -T "${TRACKNUM:-$1}" \ "${ABCDETEMPDIR}/track$1.$OUTPUT" ;; id3v2) # FIXME # track numbers in mp3 come with 1/10, so we cannot # happily substitute them with $TRACKNUM run_command "tagtrack-$OUTPUT-$1" nice $ENCNICE \ $TAGGER $TAGGEROPTS -c "$COMMENTOUTPUT" \ -A "$DALBUM" -a "$TRACKARTIST" -t "$TRACKNAME" \ -y "$CDYEAR" -g "$GENREID" \ -T "${TRACKNUM:-$1}/$TRACKS" \ ${TPE2:+--TPE2 "$TPE2"} \ "${ABCDETEMPDIR}/track$1.$OUTPUT" ;; id3tag) # FIXME # track numbers in mp3 come with 1/10, so we cannot # happily substitute them with $TRACKNUM run_command "tagtrack-$OUTPUT-$1" nice $ENCNICE \ $TAGGER $TAGGEROPTS -c "$COMMENTOUTPUT" \ -A "$DALBUM" -a "$TRACKARTIST" -s "$TRACKNAME" \ -y "$CDYEAR" -g "$GENREID" \ -t "${TRACKNUM:-$1}" ${TRACKNUM:+-T "$TRACKS"} \ "${ABCDETEMPDIR}/track$1.$OUTPUT" ;; eyed3*) # FIXME # track numbers in mp3 come with 1/10, so we cannot # happily substitute them with $TRACKNUM case "$ID3SYNTAX" in eyed3_06) addopts=( \ ${ENCODING:+--set-encoding="$ENCODING"} \ ${TPE2:+--set-text-frame=TPE2:"$TPE2"} \ # We set 'recording-date' so the date tag will show # in Audacious, vlc and friends... Andrew. ${CDYEAR:+--set-text-frame="TDRC:$CDYEAR"} \ ${COMMENTOUTPUT:+--comment=::"$COMMENTOUTPUT"} \ );; *) addopts=( \ ${ENCODING:+--encoding="$ENCODING"} \ ${TPE2:+--text-frame=TPE2:"$TPE2"} \ # We set 'recording-date' so the date tag will show # in Audacious, vlc and friends... Andrew. ${CDYEAR:+--text-frame="TDRC:$CDYEAR"} \ ${COMMENTOUTPUT:+--comment "$COMMENTOUTPUT"} \ );; esac run_command "tagtrack-$OUTPUT-$1" nice $ENCNICE $TAGGER $TAGGEROPTS \ -A "$DALBUM" \ -a "$TRACKARTIST" -t "$TRACKNAME" \ -G "$GENREID" -n "${TRACKNUM:-$1}" \ ${TRACKNUM:+-N "$TRACKS"} \ "${addopts[@]}" \ "${ABCDETEMPDIR}/track$1.$OUTPUT" ;; *) log error "Internal error: ID3SYNTAX has an illegal value" exit 1 ;; esac ;; vorbis|ogg) case "$OGGENCODERSYNTAX" in vorbize|oggenc) # vorbiscomment can't do in-place modification, mv the file first if [ -f "${ABCDETEMPDIR}/track$1.$OGGOUTPUTCONTAINER" ] && \ [ ! -f "${ABCDETEMPDIR}/track$1.uncommented.$OGGOUTPUTCONTAINER" ]; then mv "${ABCDETEMPDIR}/track$1.$OGGOUTPUTCONTAINER" \ "${ABCDETEMPDIR}/track$1.uncommented.$OGGOUTPUTCONTAINER" fi ( # These are from # https://www.xiph.org/vorbis/doc/v-comment.html echo ARTIST="$TRACKARTIST" echo ALBUM="$DALBUM" echo TITLE="$TRACKNAME" if [ -n "$CDYEAR" ]; then echo DATE="$CDYEAR" fi if [ -n "$CDGENRE" ]; then echo GENRE="$CDGENRE" fi echo TRACKNUMBER="${TRACKNUM:-$1}" # TRACKTOTAL is not in the proposed, minimal list of standard field names from # xiph.org: https://www.xiph.org/vorbis/doc/v-comment.html but is in common usage # and read by mediainfo, ffprobe, vlc, Aqualung, ogg123, Foobar. And now abcde :) # The tag is quietly ignored by Audacious, MPlayer, mpv, XMMS.... echo TRACKTOTAL="${TRACKS}" if [ -n "$DISCNUMBER" ]; then echo DISCNUMBER="$DISCNUMBER" fi echo CDDB="${CDDBDISCID}" if [ "$(eval echo ${COMMENT})" != "" ]; then case "$COMMENTOUTPUT" in *=*) echo "$COMMENTOUTPUT";; *) echo COMMENT="$COMMENTOUTPUT";; esac fi ) | run_command "tagtrack-$OUTPUT-$1" nice $ENCNICE \ $VORBISCOMMENT $VORBISCOMMENTOPTS -w \ "${ABCDETEMPDIR}/track$1.uncommented.$OGGOUTPUTCONTAINER" \ "${ABCDETEMPDIR}/track$1.$OGGOUTPUTCONTAINER" # Doublecheck that the commented file was created # successfully before wiping the original if [ -f "${ABCDETEMPDIR}/track$1.$OGGOUTPUTCONTAINER" ]; then rm -f "${ABCDETEMPDIR}/track$1.uncommented.$OGGOUTPUTCONTAINER" else mv "${ABCDETEMPDIR}/track$1.uncommented.$OGGOUTPUTCONTAINER" \ "${ABCDETEMPDIR}/track$1.$OGGOUTPUTCONTAINER" fi ;; esac ;; opus) run_command "tagtrack-$OUTPUT-$1" true ;; mka) run_command "tagtrack-$OUTPUT-$1" true ;; aiff) run_command "tagtrack-$OUTPUT-$1" true ;; flac) ( echo ARTIST="$TRACKARTIST" echo ALBUM="$DALBUM" echo TITLE="$TRACKNAME" if [ -n "$CDYEAR" ]; then echo DATE="$CDYEAR" fi if [ -n "$CDGENRE" ]; then echo GENRE="$CDGENRE" fi echo TRACKNUMBER="${TRACKNUM:-$1}" # TRACKTOTAL is not in the proposed, minimal list of standard field names from # xiph.org: https://www.xiph.org/vorbis/doc/v-comment.html but is in common usage # and read by mediainfo, ffprobe, vlc, Aqualung, ogg123, Foobar. And now abcde :) # The tag is quietly ignored by Audacious, MPlayer, mpv, XMMS.... echo TRACKTOTAL="${TRACKS}" if [ -n "$DISCNUMBER" ]; then echo DISCNUMBER="$DISCNUMBER" fi echo CDDB="${CDDBDISCID}" if [ -n "$(eval echo "${COMMENT}")" ]; then case "$COMMENTOUTPUT" in *=*) echo "$COMMENTOUTPUT";; *) echo COMMENT="$COMMENTOUTPUT";; esac fi ) | run_command "tagtrack-$OUTPUT-$1" nice $ENCNICE $METAFLAC $METAFLACOPTS \ ${IMPORTCUESHEET:+--import-cuesheet-from="${ABCDETEMPDIR}/$CUEFILE"} \ --import-tags-from=- "${ABCDETEMPDIR}/track$1.$FLACOUTPUTCONTAINER" ;; spx) run_command "tagtrack-$OUTPUT-$1" true ;; mpc) run_command "tagtrack-$OUTPUT-$1" true ;; wv) run_command "tagtrack-$OUTPUT-$1" true ;; ape) # This tagging syntax is suitable for Robert Muth's application 'apetag', the Monkey's Audio # Console port (mac) used for encoding does not have the ability to tag. run_command "tagtrack-$OUTPUT-$1" nice $ENCNICE "$APETAG" -i "${ABCDETEMPDIR}/track$1.ape" -m overwrite \ -p artist="$TRACKARTIST" -p album="$DALBUM" -p title="$TRACKNAME" -p track="${TRACKNUM:-$1}" \ -p year="$CDYEAR" -p genre="$CDGENRE" ${COMMENTOUTPUT:+-p comment="$COMMENTOUTPUT"} ;; mp2) # Using Mutagen's mid3v2 for tagging with id3v2.4.0. Interesting enough vlc, MPlayer and XMMS ignore # these tags but they are read by Audacious, Xine, Aqualung, mediainfo, ffplay, ffprobe. FFmpeg does # not currently tag mp2 audio so twolame and FFmpeg will both use mid3v2... run_command "tagtrack-$OUTPUT-$1" nice $ENCNICE "$MID3V2" --verbose -A "$DALBUM" \ -a "$TRACKARTIST" -t "$TRACKNAME" -y "$CDYEAR" -g "$CDGENRE" \ -T "${TRACKNUM:-$1}/$TRACKS" ${TPE2:+--TPE2 "$TPE2"} \ ${COMMENTOUTPUT:+--comment="$COMMENTOUTPUT"} \ "${ABCDETEMPDIR}/track$1.mp2" ;; aac) run_command "tagtrack-$OUTPUT-$1" true ;; m4a) case "$AACENCODERSYNTAX" in fdkaac) # We will use inline tagging... run_command "tagtrack-$OUTPUT-$1" true ;; neroAacEnc) # Tag post encode with neroAacTag... run_command "tagtrack-$OUTPUT-$1" nice $ENCNICE "$NEROAACTAG" \ "${ABCDETEMPDIR}/track$1.m4a" \ -meta:artist="$TRACKARTIST" -meta:album="$DALBUM" \ -meta:title="$TRACKNAME" -meta:track="${TRACKNUM:-$1}" \ -meta:year="$CDYEAR" -meta:genre="$CDGENRE" -meta:comment="$COMMENT" ;; faac) run_command "tagtrack-$OUTPUT-$1" true ;; qaac) run_command "tagtrack-$OUTPUT-$1" true ;; fhgaacenc) # Tag post encode with AtomicParsley. Note that previous problems with seg fault when using # 'overWrite' cannot be reproduced with newer versions: https://bitbucket.org/wez/atomicparsley run_command "tagtrack-$OUTPUT-$1" nice $ENCNICE "$ATOMICPARSLEY" \ "${ABCDETEMPDIR}/track$1.m4a" --artist="$TRACKARTIST" --album="$DALBUM" \ --title="$TRACKNAME" --tracknum="${TRACKNUM:-$1}" \ --year="$CDYEAR" --genre="$CDGENRE" --comment="$COMMENT" \ $ATOMICPARSLEYOPTS --overWrite ;; ffmpeg) run_command "tagtrack-$OUTPUT-$1" true ;; esac ;; tta) # We use mid3v2 tagging for True Audio: run_command "tagtrack-$OUTPUT-$1" nice $ENCNICE "$MID3V2" --verbose -A "$DALBUM" \ -a "$TRACKARTIST" -t "$TRACKNAME" -y "$CDYEAR" -g "$CDGENRE" \ -T "${TRACKNUM:-$1}/$TRACKS" ${TPE2:+--TPE2 "$TPE2"} \ ${COMMENTOUTPUT:+--comment="$COMMENTOUTPUT"} "${ABCDETEMPDIR}/track$1.tta" ;; wav) run_command "tagtrack-$OUTPUT-$1" true ;; esac done if checkerrors "tagtrack-(.{3,6})-$1"; then :; else run_command "tagtrack-$1" true fi } # do_nogap_encode # variables used: # OUTPUTTYPE, {FOO}ENCODERSYNTAX, ENCNICE, ENCODER, ENCODEROPTS do_nogap_encode () { # The commands here don't go through run_command because they're never # supposed to be silenced echo "Encoding gapless MP3 tracks: $TRACKQUEUE" for OUTPUT in $(echo "$OUTPUTTYPE" | tr , \ ) do case "$OUTPUT" in mp3) case "$MP3ENCODERSYNTAX" in lame) ( cd "${ABCDETEMPDIR}" TRACKFILES= for THISTRACKNUM in $TRACKQUEUE do TRACKFILES="$TRACKFILES track$THISTRACKNUM.wav" done nice $ENCNICE $MP3ENCODER $MP3ENCODEROPTS --nogap $TRACKFILES RETURN=$? if [ "$RETURN" != "0" ]; then echo "nogap-encode: $MP3ENCODER returned code $RETURN" >> "${ABCDETEMPDIR}/errors" else for THISTRACKNUM in $TRACKQUEUE do run_command "encodetrack-$OUTPUT-$THISTRACKNUM" true done fi ) ;; esac ;; esac done if checkerrors "nogap-encode"; then :; else if [ ! "$KEEPWAVS" = "y" ] ; then if [ ! "$KEEPWAVS" = "move" ] ; then rm -f "$IN" fi fi fi # Other encoders fall through to normal encoding as the tracks have not # been entered in the status file. } # do_encode [tracknumber] [hostname] # If no hostname is specified, encode locally # variables used: # TRACKS, TRACKNAME, TRACKARTIST, DISTMP3, DISTMP3OPTS, {FOO}ENCODERSYNTAX, OUTPUTTYPE, ENCODEROPTS, # DALBUM, DARTIST, ENCNICE, CDYEAR, CDGENRE, COMMENT do_encode () { if [ "$USEPIPES" = "y" ]; then case "$OUTPUT" in mp3) TEMPARG="PIPE_$MP3ENCODERSYNTAX" ;; vorbis|ogg) TEMPARG="PIPE_$OGGENCODERSYNTAX" ;; opus) TEMPARG="PIPE_$OPUSENCODERSYNTAX" ;; mka) TEMPARG="PIPE_$MKAENCODERSYNTAX" ;; aiff) TEMPARG="PIPE_$AIFFENCODERSYNTAX" ;; flac) TEMPARG="PIPE_$FLACENCODERSYNTAX" ;; spx) TEMPARG="PIPE_$SPEEXENCODER" ;; mpc) TEMPARG="PIPE_$MPCENCODER" ;; wv) TEMPARG="PIPE_$WVENCODERSYNTAX" ;; tta) TEMPARG="PIPE_$TTAENCODERSYNTAX" ;; aac) TEMPARG="PIPE_$AACENCODERSYNTAX" ;; m4a) TEMPARG="PIPE_$AACENCODERSYNTAX" ;; esac IN="$( eval echo "\$$TEMPARG" )" else IN="${ABCDETEMPDIR}/track$1.wav" fi # We need IN to proceed, if we are not using pipes. if [ -s "$IN" ] || [ X"$USEPIPES" = "Xy" ] ; then for TMPOUTPUT in $(echo "$OUTPUTTYPE" | tr , \ ) do case "$TMPOUTPUT" in vorbis|ogg) OUTPUT=$OGGOUTPUTCONTAINER ;; opus) OUTPUT=$OPUSOUTPUTCONTAINER ;; mka) OUTPUT=$MKAOUTPUTCONTAINER ;; aiff) OUTPUT=$AIFFOUTPUTCONTAINER ;; flac) OUTPUT=$FLACOUTPUTCONTAINER ;; *) OUTPUT=$TMPOUTPUT ;; esac OUT="${ABCDETEMPDIR}/track$1.$OUTPUT" if [ "$NOGAP" = "y" ] && checkstatus "encodetrack-$OUTPUT-$1" ; then continue fi if [ X"$USEPIPES" = "Xy" ]; then RUN_COMMAND="" # We need a way to store the creation of the files when using PIPES RUN_COMMAND_PIPES="run_command encodetrack-$OUTPUT-$1 true" # When piping it does not make sense to have a higher nice for # reading than for encoding, since it will be hold by the # encoding process. Setting an effective nice, to calm down a # bit the reading process. EFFECTIVE_NICE=$READNICE else run_command "" echo "Encoding track $1 of $TRACKS: $TRACKNAME..." RUN_COMMAND="run_command encodetrack-$OUTPUT-$1" EFFECTIVE_NICE=$ENCNICE fi case "$OUTPUT" in mp3) case "$2" in %local*%) case "$MP3ENCODERSYNTAX" in lame|gogo) $RUN_COMMAND nice $EFFECTIVE_NICE $MP3ENCODER $MP3ENCODEROPTS "$IN" "$OUT" ;; bladeenc) $RUN_COMMAND nice $EFFECTIVE_NICE $MP3ENCODER $MP3ENCODEROPTS -quit "$IN" "$OUT" ;; l3enc|xingmp3enc) $RUN_COMMAND nice $EFFECTIVE_NICE $MP3ENCODER "$IN" "$OUT" $MP3ENCODEROPTS ;; mp3enc) $RUN_COMMAND nice $EFFECTIVE_NICE $MP3ENCODER -if "$IN" -of "$OUT" $MP3ENCODEROPTS ;; esac ;; *) $RUN_COMMAND nice $DISTMP3NICE $DISTMP3 $DISTMP3OPTS "$2" "$IN" "$OUT" >/dev/null 2>&1 ;; esac ;; vorbis|ogg) case "$2" in %local*%) case "$OGGENCODERSYNTAX" in vorbize) $RUN_COMMAND nice $EFFECTIVE_NICE $OGGENCODER $OGGENCODEROPTS -w "$OUT" "$IN" ;; oggenc) $RUN_COMMAND nice $EFFECTIVE_NICE $OGGENCODER $OGGENCODEROPTS -o "$OUT" "$IN" ;; esac ;; *) $RUN_COMMAND nice $DISTMP3NICE $DISTMP3 $DISTMP3OPTS "$2" "$IN" "$OUT" >/dev/null 2>&1 ;; esac ;; opus) case "$2" in %local*%) case "$OPUSENCODERSYNTAX" in opusenc) # Tag the file at encode time, as it can't be done after encoding. if [ "$DOTAG" = "y" ]; then $RUN_COMMAND nice $EFFECTIVE_NICE $OPUSENCODER $OPUSENCODEROPTS \ --artist "$TRACKARTIST" --album "$DALBUM" --title "$TRACKNAME" \ --genre "$CDGENRE" --date "$CDYEAR" --comment TRACKNUMBER="$1" \ ${COMMENT:+--comment COMMENT="$COMMENT"} "$IN" "$OUT" else $RUN_COMMAND nice $EFFECTIVE_NICE $OPUSENCODER $OPUSENCODEROPTS "$IN" "$OUT" fi ;; esac ;; *) $RUN_COMMAND nice $DISTMP3NICE $DISTMP3 $DISTMP3OPTS "$2" "$IN" "$OUT" >/dev/null 2>&1 ;; esac ;; mka) case "$MKAENCODERSYNTAX" in ffmpeg) if [ "$DOTAG" = "y" ]; then $RUN_COMMAND nice $EFFECTIVE_NICE $MKAENCODER -i "$IN" $MKAENCODEROPTS \ -metadata artist="$TRACKARTIST" -metadata album="$DALBUM" \ -metadata title="$TRACKNAME" -metadata track="${TRACKNUM:-$1}" \ -metadata date="$CDYEAR" -metadata genre="$CDGENRE" \ -metadata comment="$COMMENT" "$OUT" else $RUN_COMMAND nice $EFFECTIVE_NICE $MKAENCODER -i "$IN" $MKAENCODEROPTS "$OUT" fi ;; esac ;; aiff) case "$AIFFENCODERSYNTAX" in ffmpeg) if [ "$DOTAG" = "y" ]; then $RUN_COMMAND nice $EFFECTIVE_NICE $AIFFENCODER -i "$IN" $AIFFENCODEROPTS \ -metadata artist="$TRACKARTIST" -metadata album="$DALBUM" \ -metadata title="$TRACKNAME" -metadata track="${TRACKNUM:-$1}" \ -metadata date="$CDYEAR" -metadata genre="$CDGENRE" \ -metadata comment="$COMMENT" "$OUT" else $RUN_COMMAND nice $EFFECTIVE_NICE $AIFFENCODER -i "$IN" $AIFFENCODEROPTS "$OUT" fi ;; esac ;; flac) case "$2" in %local*%) case "$FLACENCODERSYNTAX" in flac) $RUN_COMMAND nice $EFFECTIVE_NICE $FLACENCODER -f $FLACENCODEROPTS -o "$OUT" "$IN" ;; esac ;; *) vecho -n "DISTMP3:" vecho "$DISTMP3 $DISTMP3OPTS $2 $IN $OUT >/dev/null 2>&1" $RUN_COMMAND nice $DISTMP3NICE $DISTMP3 $DISTMP3OPTS "$2" "$IN" "$OUT" > /dev/null 2>&1 ;; esac ;; spx) if [ -n "$(eval echo "${COMMENT}")" ]; then case "$COMMENT" in *=*) ;; *) COMMENT="COMMENT=$COMMENT" ;; esac fi # Tag the file at encode time, as it can't be done after encoding. if [ "$DOTAG" = "y" ]; then $RUN_COMMAND nice $EFFECTIVE_NICE $SPEEXENCODER $SPEEXENCODEROPTS \ --author "$TRACKARTIST" --title "$TRACKNAME" \ ${COMMENT:+--comment "$COMMENT"} "$IN" "$OUT" else $RUN_COMMAND nice $EFFECTIVE_NICE $SPEEXENCODER $SPEEXENCODEROPTS "$IN" "$OUT" fi ;; mpc) # Tag the file inline at encode time. if [ "$DOTAG" = "y" ]; then $RUN_COMMAND nice $EFFECTIVE_NICE $MPCENCODER $MPCENCODEROPTS \ --artist "$TRACKARTIST" --album "$DALBUM" \ --title "$TRACKNAME" --track "$1" --genre "$CDGENRE" \ --year "$CDYEAR" ${COMMENT:+--comment "$COMMENT"} "$IN" "$OUT" else $RUN_COMMAND nice $EFFECTIVE_NICE $MPCENCODER $MPCENCODEROPTS "$IN" "$OUT" fi ;; tta) case "$TTAENCODERSYNTAX" in # tta is the newer version with a small syntax change... tta) $RUN_COMMAND nice $EFFECTIVE_NICE $TTAENCODER -e $TTAENCODEROPTS "$IN" "$OUT" ;; ttaenc) $RUN_COMMAND nice $EFFECTIVE_NICE $TTAENCODER -e $TTAENCODEROPTS "$IN" -o "$OUT" ;; esac ;; wv) case "$WVENCODERSYNTAX" in wavpack) if [ "$DOTAG" = "y" ]; then $RUN_COMMAND nice $EFFECTIVE_NICE $WVENCODER $WVENCODEROPTS \ -w Artist="$TRACKARTIST" -w Album="$DALBUM" \ -w Title="$TRACKNAME" -w Track="$1" -w Genre="$CDGENRE" \ -w Year="$CDYEAR" ${COMMENT:+-w Comment="$COMMENT"} "$IN" -o "$OUT" else $RUN_COMMAND nice $EFFECTIVE_NICE $WVENCODER $WVENCODEROPTS "$IN" -o "$OUT" fi ;; ffmpeg) if [ "$DOTAG" = "y" ]; then $RUN_COMMAND nice $EFFECTIVE_NICE $WVENCODER -i "$IN" $WVENCODEROPTS \ -metadata artist="$TRACKARTIST" \ -metadata album="$DALBUM" -metadata title="$TRACKNAME" \ -metadata track="${TRACKNUM:-$1}" -metadata date="$CDYEAR" \ -metadata genre="$CDGENRE" -metadata comment="$COMMENT" "$OUT" else $RUN_COMMAND nice $EFFECTIVE_NICE $WVENCODER -i "$IN" $WVENCODEROPTS "$OUT" fi ;; esac ;; ape) $RUN_COMMAND nice $EFFECTIVE_NICE $APENCODER "$IN" "$OUT" $APENCODEROPTS ;; mp2) case "$MP2ENCODERSYNTAX" in twolame) $RUN_COMMAND nice $EFFECTIVE_NICE $MP2ENCODER $MP2ENCODEROPTS "$IN" "$OUT" ;; ffmpeg) $RUN_COMMAND nice $EFFECTIVE_NICE $MP2ENCODER -i "$IN" $MP2ENCODEROPTS "$OUT" ;; esac ;; aac) # aac container is only used to catch faac encoded files where faac # is compiled without mp4 support (with libmp4v2). $RUN_COMMAND nice $EFFECTIVE_NICE $AACENCODER $AACENCODEROPTS -o "$OUT" "$IN" ;; m4a) case "$AACENCODERSYNTAX" in faac) if [ "$DOTAG" = "y" ]; then $RUN_COMMAND nice $EFFECTIVE_NICE $AACENCODER $AACENCODEROPTS \ --artist "$TRACKARTIST" --album "$DALBUM" \ --title "$TRACKNAME" --track "${TRACKNUM:-$1}" \ --year "$CDYEAR" --genre "$CDGENRE" --comment "$COMMENT" -o "$OUT" "$IN" else $RUN_COMMAND nice $EFFECTIVE_NICE $AACENCODER $AACENCODEROPTS -o "$OUT" "$IN" fi ;; neroAacEnc) $RUN_COMMAND nice $EFFECTIVE_NICE $AACENCODER $AACENCODEROPTS -if "$IN" -of "$OUT" ;; fdkaac) if [ "$DOTAG" = "y" ]; then $RUN_COMMAND nice $EFFECTIVE_NICE $AACENCODER $AACENCODEROPTS \ --artist "$TRACKARTIST" --album "$DALBUM" \ --title "$TRACKNAME" --track "$1" --genre "$CDGENRE" \ --date "$CDYEAR" --comment "$COMMENT" "$IN" -o "$OUT" else $RUN_COMMAND nice $EFFECTIVE_NICE $AACENCODER $AACENCODEROPTS "$IN" -o "$OUT" fi ;; qaac) if [ "$DOTAG" = "y" ]; then $RUN_COMMAND nice $EFFECTIVE_NICE $WINE $AACENCODER $AACENCODEROPTS \ --artist "$TRACKARTIST" --album "$DALBUM" \ --title "$TRACKNAME" --track "${TRACKNUM:-$1}" \ --date "$CDYEAR" --genre "$CDGENRE" --comment "$COMMENT" -o "$OUT" "$IN" else $RUN_COMMAND nice $EFFECTIVE_NICE $WINE $AACENCODER $AACENCODEROPTS -o "$OUT" "$IN" fi ;; fhgaacenc) $RUN_COMMAND nice $EFFECTIVE_NICE $WINE $AACENCODER $AACENCODEROPTS "$IN" "$OUT" ;; ffmpeg) if [ "$DOTAG" = "y" ]; then $RUN_COMMAND nice $EFFECTIVE_NICE $AACENCODER -i "$IN" \ $AACENCODEROPTS -metadata artist="$TRACKARTIST" \ -metadata album="$DALBUM" -metadata title="$TRACKNAME" \ -metadata track="${TRACKNUM:-$1}" -metadata date="$CDYEAR" \ -metadata genre="$CDGENRE" -metadata comment="$COMMENT" "$OUT" else $RUN_COMMAND nice $EFFECTIVE_NICE $AACENCODER -i "$IN" $AACENCODEROPTS "$OUT" fi ;; esac ;; wav) # In case of wav output we need nothing. Just keep the wavs. # But we need the following to allow full logging and subsequent # successful cleaning of ${ABCDETEMPDIR}. echo "encodetrack-$OUTPUT-$UTRACKNUM" >> "${ABCDETEMPDIR}/status" ;; esac $RUN_COMMAND_PIPES done # Only remove .wav if the encoding succeeded if checkerrors "encodetrack-(.{3,6})-$1"; then :; else run_command "encodetrack-$1" true if [ ! "$KEEPWAVS" = "y" ] ; then if [ ! "$KEEPWAVS" = "move" ] ; then rm -f "$IN" fi fi fi else run_command "" echo "HEH! The file we were about to encode disappeared:" run_command "" echo ">> $IN" run_command "encodetrack-$1" false fi } # do_preprocess [tracknumber] # variables used: # TRACKS, TRACKNAME, TRACKARTIST, DISTMP3, DISTMP3OPTS, {FOO}ENCODERSYNTAX, # OUTPUTTYPE, ENCODEROPTS, DALBUM, DARTIST, ENCNICE, CDYEAR, CDGENRE, COMMENT #do_preprocess () #{ # IN="${ABCDETEMPDIR}/track$1.wav" # # We need IN to proceed. # if [ -s "$IN" ] ; then # for OUTPUT in $(echo $OUTPUTTYPE | tr , \ ) # do # #OUT="${ABCDETEMPDIR}/track$1.$OUTPUT" # run_command "" echo "Pre-processing track $1 of $TRACKS..." # case "$POSTPROCESSFORMAT" in # all|wav*) # run_command "preprocess-$OUTPUT-$1" nice $PRENICE $WAV_PRE $IF $OF ;; # mp3) # run_command "preprocess-$OUTPUT-$1" nice $PRENICE $MP3_PRE $IF $OF ;; # ogg) # run_command "preprocess-$OUTPUT-$1" nice $PRENICE $OGG_PRE $IF $OF ;; # flac) # run_command "preprocess-$OUTPUT-$1" nice $PRENICE $FLAC_PRE $IF $OF ;; # spx) # run_command "preprocess-$OUTPUT-$1" nice $PRENICE $SPX_PRE $IF $OF ;; # esac # done # # Only remove .wav if the encoding succeeded # if checkerrors "preprocess-(.{3,4})-$1"; then # run_command "preprocess-$1" false # else # run_command "preprocess-$1" true # fi # else # if [ "$(checkstatus encode-output)" = "loud" ]; then # echo "HEH! The file we were about to pre-process disappeared:" # echo ">> $IN" # fi # run_command "preprocess-$1" false # fi #} # do_postprocess [tracknumber] # variables used: # TRACKS, TRACKNAME, TRACKARTIST, DISTMP3, DISTMP3OPTS, {FOO}ENCODERSYNTAX, OUTPUTTYPE, ENCODEROPTS, # DALBUM, DARTIST, ENCNICE, CDYEAR, CDGENRE, COMMENT #do_postprocess () #{ # for POSTPROCESSFORMAT in $(echo $POSTPROCESSFORMATS | tr , \ ) # do # IN="${ABCDETEMPDIR}/track$1.$POSTPROCESSFORMAT" # # We need IN to proceed. # if [ -s "$IN" ] ; then # #OUT="${ABCDETEMPDIR}/track$1.$OUTPUT" # run_command "" echo "Post-processing track $1 of $TRACKS..." # case "$POSTPROCESSFORMAT" in # mp3) # run_command "postprocess-$OUTPUT-$1" nice $POSTNICE $MP3_POST $IF $OF ;; # ogg) # run_command "postprocess-$OUTPUT-$1" nice $POSTNICE $OGG_POST $IF $OF ;; # flac) # run_command "postprocess-$OUTPUT-$1" nice $POSTNICE $FLAC_POST $IF $OF ;; # spx) # run_command "postprocess-$OUTPUT-$1" nice $POSTNICE $SPX_POST $IF $OF ;; # esac # # Only remove .wav if the encoding succeeded # if checkerrors "postprocess-(.{3,4})-$1"; then # run_command "postprocess-$1" false # else # run_command "postprocess-$1" true # fi # else # if [ "$(checkstatus encode-output)" = "loud" ]; then # echo "HEH! The file we were about to post-process disappeared:" # echo ">> $IN" # fi # run_command "postprocess-$1" false # fi # done #} # do_single_gain # variables used: # FIXME # do_single_gain () { : } # do_batch_gain # variables used: # MP3GAIN, MP3GAINOPTS, VORBISGAIN, VORBISGAINOPTS, MPCGAIN # FIXME # do_batch_gain () { # The commands here don't go through run_command because they're never supposed to be silenced echo "Batch analizing gain in tracks: $TRACKQUEUE" ( cd "${ABCDETEMPDIR}" BLURB= TRACKFILES= for UTRACKNUM in $TRACKQUEUE do TRACKFILES="$TRACKFILES track$UTRACKNUM.mp3" done # FIXME # Hard-coded batch option! $NORMALIZER -b $NORMALIZEROPTS $TRACKFILES RETURN=$? if [ "$RETURN" != "0" ]; then echo "batch-normalize: $NORMALIZER returned code $RETURN" >> "${ABCDETEMPDIR}/errors" else for UTRACKNUM in $TRACKQUEUE do echo "normalizetrack-$UTRACKNUM" >> "${ABCDETEMPDIR}/status" done fi ) } # do_batch_normalize # variables used: # NORMALIZER, NORMALIZEROPTS do_batch_normalize () { # The commands here don't go through run_command because they're never supposed to be silenced echo "Batch normalizing tracks: $TRACKQUEUE" ( cd "${ABCDETEMPDIR}" BLURB= TRACKFILES= for UTRACKNUM in $TRACKQUEUE do TRACKFILES="$TRACKFILES track$UTRACKNUM.wav" done # XXX: Hard-coded batch option! $NORMALIZER -b $NORMALIZEROPTS $TRACKFILES RETURN=$? if [ "$RETURN" != "0" ]; then echo "batch-normalize: $NORMALIZER returned code $RETURN" >> "${ABCDETEMPDIR}/errors" else for UTRACKNUM in $TRACKQUEUE do echo "normalizetrack-$UTRACKNUM" >> "${ABCDETEMPDIR}/status" done fi ) } # do_normalize [tracknumber] # variables used: # TRACKS, TRACKNAME, NORMALIZER, NORMALIZEROPTS do_normalize () { IN="${ABCDETEMPDIR}/track$1.wav" if [ -e "$IN" ] ; then run_command "" echo "Normalizing track $1 of $TRACKS: $TRACKNAME..." run_command "normalizetrack-$1" $NORMALIZER $NORMALIZEROPTS "$IN" else if [ "$(checkstatus encode-output)" = "loud" ]; then echo "HEH! The file we were about to normalize disappeared:" echo ">> $IN" fi run_command "normalizetrack-$1" false "File $IN was not found" fi } # do_move [tracknumber] # Deduces the outfile from environment variables # Creates directory if necessary # variables used: # TRACKNUM, TRACKNAME, TRACKARTIST, DALBUM, OUTPUTFORMAT, CDGENRE, CDYEAR do_move () { for TMPOUTPUT in $(echo "$OUTPUTTYPE" | tr , \ ) do # For now, set OUTPUT as TMPOUTPUT, and then change it once we have # defined the OUTPUTFILE: OUTPUT="$TMPOUTPUT" # Create ALBUMFILE, ARTISTFILE, TRACKFILE ALBUMFILE="$(mungealbumname "$DALBUM")" ARTISTFILE="$(mungeartistname "$TRACKARTIST")" TRACKFILE="$(mungetrackname "$TRACKNAME")" GENRE="$(mungegenre "$GENRE")" YEAR=${CDYEAR:-$CDYEAR} # If we want to start the tracks with a given number, we need to modify # the TRACKNUM value before evaluation gettracknum # Supported variables for OUTPUTFORMAT are GENRE, YEAR, ALBUMFILE, # ARTISTFILE, TRACKFILE, and TRACKNUM. if [ "$ONETRACK" = "y" ]; then if [ "$VARIOUSARTISTS" = "y" ]; then OUTPUTFILE="$(eval echo \""$VAONETRACKOUTPUTFORMAT"\")" else OUTPUTFILE="$(eval echo \""$ONETRACKOUTPUTFORMAT"\")" fi else if [ "$VARIOUSARTISTS" = "y" ]; then OUTPUTFILE="$(eval echo \""$VAOUTPUTFORMAT"\")" else OUTPUTFILE="$(eval echo \""$OUTPUTFORMAT"\")" fi fi if checkerrors "tagtrack-$OUTPUT-$1"; then :; else # Once we know the specific output was successful, we can change # the OUTPUT to the value containing the container case $TMPOUTPUT in vorbis|ogg) OUTPUT=$OGGOUTPUTCONTAINER ;; opus) OUTPUT=$OPUSOUTPUTCONTAINER ;; mka) OUTPUT=$MKAOUTPUTCONTAINER ;; aiff) OUTPUT=$AIFFOUTPUTCONTAINER ;; flac) OUTPUT=$FLACOUTPUTCONTAINER ;; *) OUTPUT=$TMPOUTPUT ;; esac # Check that the directory for OUTPUTFILE exists, if it doesn't, create it OUTPUTFILEDIR="$(dirname "$OUTPUTDIR/$OUTPUTFILE")" case $OUTPUT in wav) if [ "$DOCLEAN" != "y" ] && [ "$FORCE" != "y" ]; then # FIXME # introduce warnings? : else # mkdir -p shouldn't return an error if the directory already exists mkdir -p "$OUTPUTFILEDIR" run_command "movetrack-$1" mv "${ABCDETEMPDIR}/track$1.$OUTPUT" "$OUTPUTDIR/$OUTPUTFILE.$OUTPUT" if checkstatus "movetrack-output-$OUTPUT"; then :; else run_command "movetrack-output-$OUTPUT" true fi fi ;; *) # mkdir -p shouldn't return an error if the directory already exists mkdir -p "$OUTPUTFILEDIR" run_command "movetrack-$1" mv "${ABCDETEMPDIR}/track$1.$OUTPUT" "$OUTPUTDIR/$OUTPUTFILE.$OUTPUT" if checkstatus "movetrack-output-$OUTPUT"; then :; else run_command "movetrack-output-$OUTPUT" true fi ;; esac # Lets move the cue file if CUEFILE=$(checkstatus cuefile) >/dev/null ; then if [ -r "${ABCDETEMPDIR}/$CUEFILE" ]; then if checkstatus "movecue-$OUTPUT"; then :; else # Silence the Copying output since it overlaps with encoding processes... #run_command "" vecho "Copying cue file to its destination directory..." if checkstatus onetrack >/dev/null ; then case $OUTPUT in wav) if [ "$DOCLEAN" != "y" ] && [ "$FORCE" != "y" ]; then # We dont have the dir, since it was not created before. : else run_command "movecue-$OUTPUT" cp "${ABCDETEMPDIR}/$CUEFILE" "$OUTPUTDIR/$OUTPUTFILE.cue" fi ;; # NOTE: Creating a cue file with the 3-char-extension files is to comply with # http://brianvictor.tripod.com/mp3cue.htm#details [a-z0-9][a-z0-9][a-z0-9]) run_command "movecue-$OUTPUT" cp "${ABCDETEMPDIR}/$CUEFILE" "$OUTPUTDIR/$OUTPUTFILE.cue" ;; *) run_command "movecue-$OUTPUT" cp "${ABCDETEMPDIR}/$CUEFILE" "$OUTPUTDIR/$OUTPUTFILE.$OUTPUT.cue" ;; esac else run_command "movecue-$OUTPUT" cp "${ABCDETEMPDIR}/$CUEFILE" "$OUTPUTFILEDIR/$CUEFILE" fi echo "movecue-$OUTPUT" >> "${ABCDETEMPDIR}/status" fi fi fi fi done } # do_playlist # Create the playlist if wanted # Variables used: # PLAYLISTFORMAT, PLAYLISTDATAPREFIX, VAPLAYLISTFORMAT, VAPLAYLISTDATAPREFIX, # VARIOUSARTISTS, OUTPUTDIR do_playlist () { for TMPOUTPUT in $(echo "$OUTPUTTYPE" | tr , \ ) do case $TMPOUTPUT in vorbis|ogg) OUTPUT=$OGGOUTPUTCONTAINER ;; opus) OUTPUT=$OPUSOUTPUTCONTAINER ;; mka) OUTPUT=$MKAOUTPUTCONTAINER ;; aiff) OUTPUT=$AIFFOUTPUTCONTAINER ;; flac) OUTPUT=$FLACOUTPUTCONTAINER ;; *) OUTPUT=$TMPOUTPUT ;; esac # Create a playlist file for the playlist data to go into. # We used to wipe it out if it existed. Now we request permission if interactive. for LASTTRACK in $TRACKQUEUE; do :; done ALBUMFILE="$(mungealbumname "$DALBUM")" ARTISTFILE="$(mungeartistname "$DARTIST")" GENRE="$(mungegenre "$GENRE")" YEAR=${CDYEAR:-$CDYEAR} if [ "$VARIOUSARTISTS" = "y" ] ; then PLAYLISTFILE="$(eval echo "$VAPLAYLISTFORMAT")" else PLAYLISTFILE="$(eval echo "$PLAYLISTFORMAT")" fi FINALPLAYLISTDIR="$(dirname "$OUTPUTDIR/$PLAYLISTFILE")" mkdir -p "$FINALPLAYLISTDIR" if [ -s "$OUTPUTDIR/$PLAYLISTFILE" ]; then echo -n "Erase, Append to, or Keep the existing playlist file? [e/a/k] (e): " >&2 if [ "$INTERACTIVE" = "y" ]; then while [ "$DONE" != "y" ]; do read ERASEPLAYLIST case $ERASEPLAYLIST in e|E|a|A|k|K) DONE=y ;; "") ERASEPLAYLIST=e ; DONE=y ;; *) ;; esac done else echo e >&2 ERASEPLAYLIST=e fi # Once we erase the playlist, we use append to create the new one. [ "$ERASEPLAYLIST" = "e" ] || [ "$ERASEPLAYLIST" = "E" ] && rm -f "$OUTPUTDIR/$PLAYLISTFILE" && ERASEPLAYLIST=a else # The playlist does not exist, so we can safelly use append to create the new list ERASEPLAYLIST=a fi if [ "$ERASEPLAYLIST" = "a" ] || [ "$ERASEPLAYLIST" = "A" ]; then touch "$OUTPUTDIR/$PLAYLISTFILE" for UTRACKNUM in $TRACKQUEUE do # Shares some code with do_move since the filenames have to match CDDBTRACKNUM=$(expr $UTRACKNUM - 1) # Unpad getcddbinfo TRACKNAME splitvarious TRACKFILE="$(mungetrackname "$TRACKNAME")" ARTISTFILE="$(mungeartistname "$TRACKARTIST")" ALBUMFILE="$(mungealbumname "$DALBUM")" # If we want to start the tracks with a given number, we need to modify the # TRACKNUM value before evaluation gettracknum if [ "$VARIOUSARTISTS" = "y" ]; then OUTPUTFILE="$(eval echo \""$VAOUTPUTFORMAT\"")" else OUTPUTFILE="$(eval echo \""$OUTPUTFORMAT\"")" fi if [ "$VARIOUSARTISTS" = "y" ]; then if [ "$VAPLAYLISTDATAPREFIX" ] ; then echo "${VAPLAYLISTDATAPREFIX}$OUTPUTFILE.$OUTPUT" >> "$OUTPUTDIR/$PLAYLISTFILE" else relpath "$PLAYLISTFILE", "$OUTPUTFILE.$OUTPUT" >> "$OUTPUTDIR/$PLAYLISTFILE" fi else if [ "$PLAYLISTDATAPREFIX" ]; then echo "${PLAYLISTDATAPREFIX}$OUTPUTFILE.$OUTPUT" >> "$OUTPUTDIR/$PLAYLISTFILE" else relpath "$PLAYLISTFILE", "$OUTPUTFILE.$OUTPUT" >> "$OUTPUTDIR/$PLAYLISTFILE" fi fi done fi ## this will convert the playlist to have CRLF line-endings, if specified ## (some hardware players insist on CRLF endings) if [ "$DOSPLAYLIST" = "y" ]; then awk '{sub("\r$",""); printf "%s\r\n", $0}' "$OUTPUTDIR/$PLAYLISTFILE" > "${ABCDETEMPDIR}/PLAYLISTFILE.tmp" cat "${ABCDETEMPDIR}/PLAYLISTFILE.tmp" | sed 's/\//\\/' > "$OUTPUTDIR/$PLAYLISTFILE" fi echo "playlistcomplete" >> "${ABCDETEMPDIR}/status" done } # abcde.cue2discid # This function reads a cuefile on stdin and writes an extended # cddb query on stdout. Any PREGAP for track 1 is properly # handled, although cue files embedded in FLAC files do not # appear to properly store the PREGAP setting. :( abcde.cue2discid () { cddb_sum () { val=$1 ret=0 while [ "$val" -gt 0 ] ; do ret=$(( $ret + ( $val % 10) )) val=$(( $val / 10 )) done echo "$ret" } msf2lba () { OIFS="$IFS" IFS=":" set -- $1 IFS="$OIFS" local first second third first=$(( $1 + 0 )) second=$(( $2 + 0 )) third=$(( $3 + 0 )) echo $(( ((($first * 60) + $second) * 75) + $third )) } OFFSET=150 PREGAP=0 LEADOUT=0 LEADIN=88200 i=0 N=0 while read line ; do set -- $line case "$1" in TRACK) i=$(( i + 1 )) ;; INDEX) if [ "$2" -eq 1 ] ; then LBA=$(msf2lba $3) START=$(( $LBA + $PREGAP + $OFFSET )) eval TRACK$i=$START X=$(cddb_sum $(( $START / 75 )) ) N=$(( $N + $X )) fi ;; PREGAP) PREGAP=$(msf2lba $2) ;; REM) case "$2" in FLAC__lead-out) LEADOUT=$(( $4 / 588 )) ;; FLAC__lead-in) LEADIN=$(( $3 / 588 )) ;; esac ;; esac done TRACKS=$i LEADOUT=$(( $LEADOUT + $LEADIN )) LENGTH=$(( $LEADOUT/75 - $TRACK1/75 )) CDDBDISCID=$(( ( $N % 255 ) * 2**24 | $LENGTH * 2**8 | $TRACKS )) printf %08x %i ${CDDBDISCID} $TRACKS j=1 while [ $j -le $TRACKS ] ; do eval echo -n "\" \$TRACK$j\"" j=$(( $j + 1)) done echo $(( $LEADOUT / 75 )) } # abcde.mkcue # abcde.mkcue [--wholedisk] # This creates a cuefile directly from the extended discid information # The --wholedisk option controls whether we're ripping data from the # start of track one or from the start of the disk (usually, but not # always the same thing!) # # Track one leadin/pregap (if any) handeling: # --wholedisk specified: # TRACK 01 AUDIO # INDEX 00 00:00:00 # INDEX 01 # Remaining track index values unchanged from disc TOC # # --wholedisk not specified # TRACK 01 AUDIO # PREGAP # INDEX 01 00:00:00 # Remaining track index values offset by # # Variables used: # CDDBTRACKINFO abcde.mkcue () { echomsf () { printf "$1%02i:%02i:%02i\n" $(($2/4500)) $((($2/75)%60)) $(($2%75)) } local MODE DISCID TRACKS local i OFFSET LBA local CUEWAVFILE if [ "$1" = "--wholedisk" ] ; then MODE=INDEX else MODE=PREGAP fi vecho "One track is $ONETRACK" TRACKFILE="$(mungetrackname "$TRACKNAME")" ARTISTFILE="$(mungeartistname "$TRACKARTIST")" ALBUMFILE="$(mungealbumname "$DALBUM")" if [ "$ONETRACK" = "y" ]; then if [ "$VARIOUSARTISTS" = "y" ]; then CUEWAVFILE="$(eval echo \""$VAONETRACKOUTPUTFORMAT"\" | sed -e 's@^.*/@@').$OUTPUT" else CUEWAVFILE="$(eval echo \""$ONETRACKOUTPUTFORMAT"\" | sed -e 's@^.*/@@').$OUTPUT" fi vecho "Cue wav file is $CUEWAVFILE" else CUEWAVFILE="dummy.wav" fi set -- $CDDBTRACKINFO DISCID=$1 TRACKS=$2 shift 2 echo "REM DISCID $DISCID" echo FILE \""$CUEWAVFILE"\" WAVE if [ $1 -ne 150 ] && [ $MODE = "PREGAP" ] ; then OFFSET=$1 else OFFSET=150 fi i=1 while [ $i -le "$TRACKS" ] ; do LBA=$(( $1 - $OFFSET )) printf " TRACK %02i AUDIO\n" $i if [ "$i" -eq 1 ] && [ "$1" -ne 150 ] ; then if [ "$MODE" = PREGAP ] ; then echomsf " PREGAP " $(($"OFFSET" - 150)) else echo " INDEX 00 00:00:00" fi fi echomsf " INDEX 01 " "$LBA" i=$(( $i + 1)) shift done } # do_discid # This is essentially the start of things do_discid () { if [ -z "${CDDBDISCID}" ]; then vecho -n "Getting CD track info... " # In OSX, unmount the disc before a query if [ "$OSFLAVOUR" = "OSX" ]; then diskutil unmount "${CDROM#/dev/}" fi case "$CDROMREADERSYNTAX" in flac) if $METAFLAC $METAFLACOPTS --export-cuesheet-to=- "$CDROM" > /dev/null 2>&1 ; then case "$CUE2DISCID" in # FIXME # right now we have 2 cue2discid internal # implementations: builtin and abcde.cue2discid. Test # both of them and decide which one we want to use. builtin) #vecho "Using builtin cue2discid implementation..." CUESHEET="$(metaflac $METAFLACOPTS --export-cuesheet-to=- "$CDROM")" #TRACKS=$(echo $CUESHEET | grep -E "TRACK \+[[:digit:]]\+ \+AUDIO" |wc -l) #TRACKS=0 OFFSETTIMES=( $(echo "$CUESHEET" | sed -n -e's/\ *INDEX 01\ \+//p' ) ) TRACKS=${#OFFSETTIMES[@]} unset OFFSETS vecho "processing offsetimes ${OFFSETTIMES[@]}" for OFFSETTIME in ${OFFSETTIMES[@]}; do OFFSETS="$OFFSETS $(( 10#${OFFSETTIME:0:2} * 4500 + 10#${OFFSETTIME:3:2} * 75 + 10#${OFFSETTIME:6:2} ))" done LEADOUT=$(( $(echo "$CUESHEET" | grep lead-out | get_last) * 75 / 44100 )) LEADIN=$(( $(echo "$CUESHEET" | grep lead-in | get_last) * 75 / 44100 )) makeids ;; *) #vecho "Using external python cue2discid implementation..." CDDBTRACKINFO=$($METAFLAC $METAFLACOPTS --export-cuesheet-to=- "$CDROM" | $CUE2DISCID) ;; esac else log error "the input flac file does not contain a cuesheet." exit 1 fi ;; cdparanoia|debug) CDPARANOIAOUTPUT="$( $CDROMREADER -"$CDPARANOIACDROMBUS" "$CDROM" -Q --verbose 2>&1 )" RET=$? if [ ! "$RET" = "0" ];then log warning "something went wrong while querying the CD... Maybe a DATA CD or the CD is not loaded?" fi TRACKS="$(echo "$CDPARANOIAOUTPUT" | grep -E '^[[:space:]]+[[:digit:]]' | tail -n 1 | get_first | tr -d "." | tr '\n' ' ')" CDPARANOIAAUDIOTRACKS="$TRACKS" LEADOUT="$(echo "$CDPARANOIAOUTPUT" | grep -Eo '^TOTAL[[:space:]]+([[:digit:]]+)' | get_last)" OFFSETS="$(echo "$CDPARANOIAOUTPUT" | awk '/^ +.*\[/ {print $4}')" makeids ;; *) # Calculate the cddb discid in all # cases now. We'll use the cddb discid # for reference in most cases for # consistency. Also calculate the # musicbrainz discid if we need it. CDDBTRACKINFO=$($CDDISCID "$CDROM") if [ "$CDDISCID_NEEDS_PAUSE"x = "y"x ]; then sleep 6 fi CDDBDISCID=$(echo "$CDDBTRACKINFO" | cut -d' ' -f1) case "$CDDBMETHOD" in *musicbrainz*) MBTRACKINFO=$($MUSICBRAINZ --command id --device "$CDROM") error=$? if [ $error != 0 ]; then log error "$MUSICBRAINZ failed to run; ABORT" exit $error fi MBDISCID=$(echo "$MBTRACKINFO" | cut -d' ' -f1) ;; esac esac # Make sure there's a CD in there by checking cd-discid's return code if [ ! "$?" = "0" ]; then if [ "$CDROMREADERSYNTAX" = "flac" ] ; then log error "cuesheet information from the flac file could not be read." log error "Perhaps the flac file does not contain a cuesheet?." exit 1 else log error "CD could not be read. Perhaps there's no CD in the drive?" exit 1 fi fi # In OSX, remount the disc again if [ "$OSFLAVOUR" = "OSX" ]; then diskutil mount "${CDROM#/dev/}" fi WEHAVEACD=y CDDBDISCID=$(echo "$CDDBTRACKINFO" | cut -f1 -d' ') else CDDBTRACKINFO=$(cat "$WAVOUTPUTDIR/abcde.${CDDBDISCID}/cddbdiscid") fi # Get a full enumeration of tracks, sort it, and put it in the TRACKQUEUE. # This needs to be done now because a section of the resuming code will need # it later. # get the number of digits to pad TRACKNUM with - we'll use this later # a CD can only hold 99 tracks, but since we support a feature for starting # numbering the tracks from a given number, we might need to set it as a # variable for the user to define... or obtain it somehow. if [ "$PADTRACKS" = "y" ] ; then TRACKNUMPADDING=2 fi ABCDETEMPDIR="$WAVOUTPUTDIR/abcde.${CDDBDISCID}" if [ -z "$TRACKQUEUE" ]; then if [ ! "$STRIPDATATRACKS" = "n" ]; then case "$CDROMREADERSYNTAX" in cdparanoia|libcdio|debug) if [ "$WEHAVEACD" = "y" ]; then vecho "Querying the CD for audio tracks..." CDPARANOIAOUTPUT="$( $CDROMREADER -"$CDPARANOIACDROMBUS" "$CDROM" -Q --verbose 2>&1 )" RET=$? if [ ! "$RET" = "0" ];then log warning "something went wrong while querying the CD... Maybe a DATA CD?" fi TRACKS="$(echo "$CDPARANOIAOUTPUT" | grep -E '^[[:space:]]+[[:digit:]]' | tail -n 1 | get_first | tr -d "." | tr '\n' ' ')" CDPARANOIAAUDIOTRACKS="$TRACKS" else # Previous versions of abcde would store the tracks on a file, instead of the status record. if [ -f "${ABCDETEMPDIR}/cdparanoia-audio-tracks" ]; then echo "cdparanoia-audio-tracks=$( cat "${ABCDETEMPDIR}/cdparanoia-audio-tracks" )" >> "${ABCDETEMPDIR}/status" rm -f "${ABCDETEMPDIR}/cdparanoia-audio-tracks" fi if [ -f "${ABCDETEMPDIR}/status" ] && TRACKS=$(checkstatus cdparanoia-audio-tracks); then :; else TRACKS=$(echo "$CDDBTRACKINFO" | cut -f2 -d' ') fi fi ;; *) TRACKS=$(echo "$CDDBTRACKINFO" | cut -f2 -d' ') ;; esac else TRACKS=$(echo "$CDDBTRACKINFO" | cut -f2 -d' ') fi if echo "$TRACKS" | grep "[[:digit:]]" > /dev/null 2>&1 ;then :;else log info "The disc does not contain any tracks. Giving up..." exit 0 fi echo -n "Grabbing entire CD - tracks: " if [ ! "$PADTRACKS" = "y" ] ; then TRACKNUMPADDING=$(echo -n $TRACKS | wc -c | tr -d ' ') fi TRACKS=$(printf "%0.${TRACKNUMPADDING}d" $TRACKS) X=1 while [ $X -le $TRACKS ] do PT=$(printf "%0.${TRACKNUMPADDING}d" $X) TRACKQUEUE="$TRACKQUEUE $PT" X=$(($X + 1)) done echo "$TRACKQUEUE" else TRACKS=$(echo "$CDDBTRACKINFO" | cut -f2 -d' ') # User-supplied track queue. # Weed out non-numbers, whitespace, then sort and weed out duplicates TRACKQUEUE=$(echo "$TRACKQUEUE" | sed 's-[^0-9 ]--g' | tr ' ' '\n' | grep -v ^$ | sort -n | uniq | tr '\n' ' ' | sed 's- $--g') # Once cleaned, obtain the highest value in the trackqueue for number padding for LASTTRACK in $TRACKQUEUE; do :; done if [ ! "$PADTRACKS" = "y" ] ; then TRACKNUMPADDING=$(echo -n "$LASTTRACK" | wc -c | tr -d ' ') fi # Now we normalize the trackqueue for TRACK in $TRACKQUEUE; do PADTRACKNUM=$(printf "%0.${TRACKNUMPADDING}d" $(expr ${TRACK} + 0 )) PADTRACKQUEUE="$PADTRACKQUEUE $PADTRACKNUM" done TRACKQUEUE="$PADTRACKQUEUE" echo Grabbing tracks: "$TRACKQUEUE" fi QUEUEDTRACKS=$(echo $TRACKQUEUE | wc -w | tr -d ' ') # We have the discid, create a temp directory after it to store all the temp # info if [ -e "${ABCDETEMPDIR}" ]; then echo -n "abcde: attempting to resume from ${ABCDETEMPDIR}" # It already exists, see if it's a directory if [ ! -d "${ABCDETEMPDIR}" ]; then # This is a file/socket/fifo/device/etc, not a directory # Complain and exit echo >&2 echo "abcde: file ${ABCDETEMPDIR} already exists and does not belong to abcde." >&2 echo "Please investigate, remove it, and rerun abcde." >&2 exit 1 fi echo -n . # It's a directory, let's see if it's writable by us if [ ! -r "${ABCDETEMPDIR}" ] || [ ! -w "${ABCDETEMPDIR}" ] || [ ! -x "${ABCDETEMPDIR}" ]; then # Nope, complain and exit echo >&2 echo "abcde: directory ${ABCDETEMPDIR} already exists and is not writeable." >&2 echo "Please investigate, remove it, and rerun abcde." >&2 exit 1 fi echo . # Check to see the version of abcde that was used. If it's not # the same version as we are, bail. RESUME_VERSION="$(checkstatus abcde-version)" if [ "$RESUME_VERSION" != "$VERSION" ]; then # Nope, complain and exit echo >&2 echo "abcde: Working directory ${ABCDETEMPDIR} was created using version $RESUME_VERSION." >&2 echo "abcde: Current version is $VERSION." >&2 echo "abcde: Refusing to resume with a version mismatch." >&2 echo "Please remove it, and rerun abcde." >&2 exit 1 fi echo . # See if it's populated if [ ! -f "${ABCDETEMPDIR}/cddbdiscid" ]; then # Wipe and start fresh echo "abcde: ${ABCDETEMPDIR}/cddbdiscid not found. Abcde must remove and recreate" >&2 echo -n "this directory to continue. Continue [y/N]? " >&2 if [ "$INTERACTIVE" = "y" ]; then read ANSWER else echo y >&2 ANSWER=y fi if [ "$ANSWER" != "y" ]; then exit 1 fi rm -rf "${ABCDETEMPDIR}" || exit 1 mkdir -p "${ABCDETEMPDIR}" if [ "$?" -gt "0" ]; then # Directory already exists or could not be created echo "abcde: Temp directory ${ABCDETEMPDIR} could not be created." >&2 exit 1 fi else # Everything is fine. Check for ^encodetracklocation- # and encode-output entries in the status file and # remove them. These are not relevant across sessions. echo "Resuming" >> "${ABCDETEMPDIR}/status" if [ -f "${ABCDETEMPDIR}/status" ]; then mv "${ABCDETEMPDIR}/status" "${ABCDETEMPDIR}/status.old" grep -v ^encodetracklocation- < "${ABCDETEMPDIR}/status.old" \ | grep -v ^encode-output > "${ABCDETEMPDIR}/status" fi # Remove old error messages if [ -f "${ABCDETEMPDIR}/errors" ]; then rm -f "${ABCDETEMPDIR}/errors" fi fi else # We are starting from scratch mkdir -p "${ABCDETEMPDIR}" if [ "$?" -gt "0" ]; then # Directory already exists or could not be created echo "abcde: Temp directory ${ABCDETEMPDIR} could not be created." >&2 exit 1 fi cat /dev/null > "${ABCDETEMPDIR}/status" # Store the abcde version in the status file. echo "abcde-version=$VERSION" >> "${ABCDETEMPDIR}/status" fi if [ X"$DOCUE" = "Xy" ] && [ X"$WEHAVEACD" = "Xy" ]; then if checkstatus cuefile > /dev/null 2>&1 ; then :; else CUEFILE=cue-$(echo "$CDDBTRACKINFO" | cut -f1 -d' ').txt vecho "Creating cue file..." case "$CDROMREADERSYNTAX" in flac) if $METAFLAC --export-cuesheet-to=- "$CDROM" > "${ABCDETEMPDIR}/$CUEFILE"; then echo "cuefile=$CUEFILE" >> "${ABCDETEMPDIR}/status" else log warning "the input flac file does not contain a cuesheet." fi ;; *) if $CUEREADER $CUEREADEROPTS > "${ABCDETEMPDIR}/$CUEFILE"; then echo "cuefile=$CUEFILE" >> "${ABCDETEMPDIR}/status" else log warning "reading the CUE sheet is still considered experimental" log warning "and there was a problem with the CD reading. abcde will continue," log warning "but consider reporting the problem to the abcde authors" fi ;; esac fi fi # If we got the CDPARANOIA status and it is not recorded, save it now if [ -n "$CDPARANOIAAUDIOTRACKS" ]; then if checkstatus cdparanoia-audio-tracks > /dev/null 2>&1; then :; else echo "cdparanoia-audio-tracks=$CDPARANOIAAUDIOTRACKS" >> "${ABCDETEMPDIR}/status" fi fi # Create the discid files echo "$CDDBTRACKINFO" > "${ABCDETEMPDIR}/cddbdiscid" case "$CDDBMETHOD" in *musicbrainz*) echo "$MBTRACKINFO" > "${ABCDETEMPDIR}/mbdiscid" ;; esac } # do_cleancue # Create a proper CUE file based on the CUE file we created before. do_cleancue() { if CUEFILE_IN="${ABCDETEMPDIR}"/$(checkstatus cuefile); then CUEFILE_OUT=$CUEFILE_IN.out ### FIXME ### checkstatus cddb if [ -e "$CDDBDATA" ]; then vecho "Adding metadata to the cue file..." # FIXME It doesn't preserve spaces! Why? # FIXME parse $track into PERFORMER and TITLE - abcde already has code for this? n=1 echo "PERFORMER \"$DARTIST\"" >> "$CUEFILE_OUT" echo "TITLE \"$DALBUM\"" >> "$CUEFILE_OUT" # Set IFS to to prevent read from swallowing spaces and tabs OIFS="$IFS" IFS=' ' cat "$CUEFILE_IN" | while read line do if echo "$line" | grep "INDEX 01" > /dev/null 2>&1 ; then # FIXME # Possible patch: remove the line above, uncomment the 2 lines below. # echo "$line" >> "$CUEFILE_OUT" # if echo "$line" | grep "^[[:space:]]*TRACK" > /dev/null 2>&1 ; then eval track="\$TRACK$n" n=$(( $n + 1 )) echo " TITLE \"$track\"" >> "$CUEFILE_OUT" # When making a single-track rip, put the # actual file name into the file declaration # in the cue file so that it is usable by # music players and the like elif [ "$ONETRACK" = "y" ] && echo "$line" | grep '^FILE "dummy.wav" WAVE' > /dev/null 2>&1 ; then TRACKFILE="$(mungetrackname "$TRACKNAME")" ARTISTFILE="$(mungeartistname "$TRACKARTIST")" ALBUMFILE="$(mungealbumname "$DALBUM")" if [ "$VARIOUSARTISTS" = "y" ]; then OUTPUTFILE="$(eval echo \""$VAONETRACKOUTPUTFORMAT"\" | sed -e 's@^.*/@@').$OUTPUT" else OUTPUTFILE="$(eval echo \""$ONETRACKOUTPUTFORMAT"\" | sed -e 's@^.*/@@').$OUTPUT" fi echo "FILE \"$OUTPUTFILE\" WAVE" >> "$CUEFILE_OUT" continue fi # FIXME # If the lines above are uncommented, remove the line below. echo "$line" >> "$CUEFILE_OUT" done IFS="$OIFS" mv "$CUEFILE_OUT" "$CUEFILE_IN" echo "cleancuefile" >> "${ABCDETEMPDIR}/status" fi fi } # do_cddbparse # Parses a CDDB file and outputs the title and the track names. # Variables: CDDBFILE do_cddbparse () { CDDBPARSEFILE="$1" # List out disc title/author and contents if [ "$ONETRACK" = "y" ]; then vecho "ONETRACK mode selected: displaying only the title of the CD..." fi echo "---- $(grep -a DTITLE "${CDDBPARSEFILE}" | cut '-d=' -f2- | tr -d \\r\\n ) ----" if [ X"$SHOWCDDBYEAR" = "Xy" ]; then PARSEDYEAR=$(grep -a DYEAR "${CDDBPARSEFILE}" | cut '-d=' -f2-) if [ ! X"$PARSEDYEAR" = "X" ]; then echo "Year: $PARSEDYEAR" fi fi if [ X"$SHOWCDDBGENRE" = "Xy" ]; then PARSEDGENRE=$(grep -a DGENRE "${CDDBPARSEFILE}" | cut '-d=' -f2-) if [ ! X"$PARSEDGENRE" = "X" ]; then echo "Genre: $PARSEDGENRE" fi fi if [ ! "$ONETRACK" = "y" ]; then for TRACK in $(f_seq_row 1 $TRACKS) do echo "$TRACK": "$(grep -a ^TTITLE$(($TRACK - 1))= "${CDDBPARSEFILE}" | cut -f2- -d= | tr -d \\r\\n)" done fi } # do_localcddb_read # Check for a local CDDB file, and report success do_localcddb_read () { if checkstatus cddb-readcomplete && checkstatus cddb-choice >/dev/null; then :; else CDDBLOCALSTATUS="notfound" CDDBDISCID=$(echo "$CDDBTRACKINFO" | cut -d' ' -f1) USELOCALRESP="y" if [ "$CDDBLOCALRECURSIVE" = "y" ]; then CDDBLOCALRESULTS="$(find "${CDDBLOCALDIR}" -name "${CDDBDISCID}" -type f 2> /dev/null)" if [ ! "${CDDBLOCALRESULTS}" = "" ]; then if (( $(echo "${CDDBLOCALRESULTS}" | wc -l) == 1 )); then CDDBLOCALFILE="${CDDBLOCALRESULTS}" CDDBLOCALMATCH=single elif (( $(echo "${CDDBLOCALRESULTS}" | wc -l) > 1 )); then CDDBLOCALMATCH=multiple fi else CDDBLOCALMATCH=none fi elif [ "$CDDBLOCALMATCH" = "none" ] && [ -r "${CDDBLOCALDIR}/${CDDBDISCID}" ]; then CDDBLOCALFILE="${CDDBLOCALDIR}/${CDDBDISCID}" CDDBLOCALMATCH=single else CDDBLOCALMATCH=none fi # If the user has selected to check a local CDDB repo, we proceed with it case $CDDBLOCALMATCH in multiple) echo "Processing multiple matching CDDB entries..." > "${ABCDETEMPDIR}/cddblocalchoices" X=0 echo "$CDDBLOCALRESULTS" | while read RESULT ; do X=$(( $X + 1 )) # List out disc title/author and contents CDDBLOCALREAD="${ABCDETEMPDIR}/cddblocalread.$X" cat "$RESULT" > "${CDDBLOCALREAD}" { echo -n "#$X: " do_cddbparse "${CDDBLOCALREAD}" echo "" ##FIXME## QUICK HACK !!!! if [ ! "$INTERACTIVE" = "y" ]; then break ; fi } >> "${ABCDETEMPDIR}/cddblocalchoices" done page "${ABCDETEMPDIR}/cddblocalchoices" CDDBLOCALCHOICES=$( echo "$CDDBLOCALRESULTS" | wc -l ) # Setting the choice to an impossible integer to avoid errors in the numeric comparisons CDDBLOCALCHOICENUM=-1 if [ "$INTERACTIVE" = "y" ]; then while [ "$CDDBLOCALCHOICENUM" -lt 0 ] || [ "$CDDBLOCALCHOICENUM" -gt "$CDDBLOCALCHOICES" ]; do echo "Locally cached CDDB entries found." >&2 echo -n "Which one would you like to use (0 for none)? [0-$CDDBLOCALCHOICES]: " >&2 read CDDBLOCALCHOICE [ x"$CDDBLOCALCHOICE" = "x" ] && CDDBLOCALCHOICE="1" # FIXME # Introduce diff's if echo $CDDBLOCALCHOICE | grep -E "[[:space:]]*[[:digit:]]+,[[:digit:]]+[[:space:]]*" > /dev/null 2>&1 ; then diffentries cddblocalread "$CDDBLOCALCHOICES" "$CDDBLOCALCHOICE" elif echo $CDDBLOCALCHOICE | grep -E "[[:space:]]*[[:digit:]]+[[:space:]]*" > /dev/null 2>&1 ; then # Make sure we get a valid choice CDDBLOCALCHOICENUM=$(echo $CDDBLOCALCHOICE | xargs printf %d 2>/dev/null) if [ "$CDDBLOCALCHOICENUM" -lt 0 ] || [ "$CDDBLOCALCHOICENUM" -gt "$CDDBLOCALCHOICES" ]; then echo "Invalid selection. Please choose a number between 0 and $CDDBLOCALCHOICES." >&2 fi fi done else CDDBLOCALCHOICENUM=1 fi if [ ! "$CDDBLOCALCHOICENUM" = "0" ]; then #echo "Using local copy of CDDB data" echo "# DO NOT ERASE THIS LINE! Added by abcde to imitate cddb output" > "${ABCDETEMPDIR}/cddbread.1" cat "${ABCDETEMPDIR}/cddblocalread.$CDDBLOCALCHOICENUM" >> "${ABCDETEMPDIR}/cddbread.1" echo "local" > "${ABCDETEMPDIR}/datasource.1" echo 999 > "${ABCDETEMPDIR}/cddbquery" # Assuming 999 isn't used by CDDB echo cddb-readcomplete >> "${ABCDETEMPDIR}/status" do_cddbparse "${ABCDETEMPDIR}/cddbread.1" > "${ABCDETEMPDIR}/cddbchoices" echo cddb-choice=1 >> "${ABCDETEMPDIR}/status" CDDBLOCALSTATUS="found" else #echo "Not using local copy of CDDB data" CDDBLOCALSTATUS="notfound" fi ;; single) # List out disc title/author and contents do_cddbparse "${CDDBLOCALFILE}" #if [ "$CDROMREADERSYNTAX" = "flac" ] ; then # echo -n "Embedded cuesheet entry found, use it [Y/n]? " >&2 #else echo -n "Locally cached CDDB entry found, use it [Y/n]? " >&2 #fi if [ "$INTERACTIVE" = "y" ]; then read USELOCALRESP while [ "$USELOCALRESP" != "y" ] && [ "$USELOCALRESP" != "n" ] && [ "$USELOCALRESP" != "" ] ; do echo -n 'Invalid selection. Please answer "y" or "n": ' >&2 read USELOCALRESP done [ x"$USELOCALRESP" = "x" ] && USELOCALRESP="y" else echo "y" >&2 fi if [ "$USELOCALRESP" = "y" ]; then #echo "Using local copy of CDDB data" echo "# DO NOT ERASE THIS LINE! Added by abcde to imitate cddb output" > "${ABCDETEMPDIR}/cddbread.1" cat "${CDDBLOCALFILE}" >> "${ABCDETEMPDIR}/cddbread.1" echo "local" > "${ABCDETEMPDIR}/datasource.1" echo 999 > "${ABCDETEMPDIR}/cddbquery" # Assuming 999 isn't used by CDDB echo cddb-readcomplete >> "${ABCDETEMPDIR}/status" do_cddbparse "${CDDBLOCALFILE}" > "${ABCDETEMPDIR}/cddbchoices" echo cddb-choice=1 >> "${ABCDETEMPDIR}/status" CDDBLOCALSTATUS="single" else #echo "Not using local copy of CDDB data" CDDBLOCALSTATUS="notfound" fi ;; none) CDDBLOCALSTATUS="notfound" ;; esac fi } # do_cdtext_read # Try to read CD-Text from the drive using icedax / cdda2wav do_cdtext_read () { if new_checkexec icedax; then CDTEXT_READER=icedax elif new_checkexec cdda2wav; then CDTEXT_READER=cdda2wav else # Didn't find either, bail return 0 fi if checkstatus cdtext-readcomplete; then NUM_RESPONSES=$(checkstatus "cdtext-entries") NUM_CDDB_MATCHES=$(($NUM_CDDB_MATCHES + $NUM_RESPONSES)) vecho "Re-using existing data from CD-Text" else vecho "Obtaining CD-Text results..." local SOURCE_WORKDIR="${ABCDETEMPDIR}/data-cdtext" mkdir -p "${SOURCE_WORKDIR}" if [ "$OSFLAVOUR" = "OSX" ] ; then # Hei, we have to unmount the device before running anything like cdda2wav/icedax in OSX diskutil unmount "${CDROM#/dev/}" # Also, in OSX the cdrom device for cdda2wav/icedax changes... CDDA2WAVCDROM="IODVDServices" elif [ "$OSFLAVOUR" = "FBSD" ] || [ "$OSFLAVOUR" = "IRIX" ]; then CDDA2WAVCDROM="$CDROMID" else if [ "$CDROMID" = "" ]; then CDDA2WAVCDROM="$CDROM" else CDDA2WAVCDROM="$CDROMID" fi fi # Do we have CD-Text on the disc (and can the drive read it?) ( cd "${SOURCE_WORKDIR}" && rm -f audio.* audio_* # Even redirect fd 0 to our output file. It seems cdda2wav # writes to stdin too these days. Bizarre, buggy # behaviour! Should be harmless for icedax. ${CDTEXT_READER} -J -v titles -D "${CDDA2WAVCDROM}" > "${SOURCE_WORKDIR}/cd-text" 2>&1 0>&1 ) grep -a -q '^CD-Text: detected' "${SOURCE_WORKDIR}/cd-text" ERRORCODE=$? if [ $ERRORCODE -ne 0 ]; then # No CD-Text found, bail return 0 fi NUM_CDDB_MATCHES=$(($NUM_CDDB_MATCHES + 1)) # Make an empty template $CDDBTOOL template "$(cat "${ABCDETEMPDIR}/cddbdiscid")" > "${SOURCE_WORKDIR}/cddbread.${NUM_CDDB_MATCHES}" echo "cddb-read-${NUM_CDDB_MATCHES}-complete" >> "${ABCDETEMPDIR}/status" rm -f "${SOURCE_WORKDIR}/cddbread.${NUM_CDDB_MATCHES}" # XXX FIXME - this is a hack and should be replaced by proper # character set tracking for the CDDB data we have. if [ "$CDDBPROTO" -ge 6 ]; then # convert to Unicode iconv -f iso-8859-1 -t utf-8 <"${SOURCE_WORKDIR}/audio.cddb" >"${SOURCE_WORKDIR}/cddbread.${NUM_CDDB_MATCHES}" else # copy verbatim, assuming CD-TEXT is in ISO-8859-1 format # apparently icedax/cdda2wav have no support for 16-bit # characters yet, either cp -p "${SOURCE_WORKDIR}/audio.cddb" "${SOURCE_WORKDIR}/cddbread.${NUM_CDDB_MATCHES}" fi CDDBDISCID=$(echo "$CDDBTRACKINFO" | cut -d' ' -f1) ATITLE=$(grep -a -e '^DTITLE=' "${SOURCE_WORKDIR}/cddbread.${NUM_CDDB_MATCHES}" | cut -c8- | tr -d \\r\\n) echo "CD-Text" > "${SOURCE_WORKDIR}/datasource.${NUM_CDDB_MATCHES}" echo "none ${CDDBDISCID} ${ATITLE}" >> "${SOURCE_WORKDIR}/cddbquery.${NUM_CDDB_MATCHES}" ( cd "${SOURCE_WORKDIR}" rm -f audio_* audio.* for file in cddbread.* cddbquery.* datasource.*; do if [ -f "$file" ]; then cp "$file" "${ABCDETEMPDIR}" fi done ) echo "cdtext-readcomplete" >> "${ABCDETEMPDIR}/status" echo "cdtext-entries=1" >> "${ABCDETEMPDIR}/status" fi } # do_musicbrainz_read # Work with the musicbrainz WS API, then transform the results here so # they look (very) like the results from CDDB. Maybe not the best way # to go, but it Works For Me (TM) # # List out all the matches individually into $SOURCE_WORKDIR/cddbread.X # do_musicbrainz_read () { if checkstatus musicbrainz-readcomplete; then NUM_RESPONSES=$(checkstatus "musicbrainz-entries") NUM_CDDB_MATCHES=$(($NUM_CDDB_MATCHES + $NUM_RESPONSES)) vecho "Re-using existing data from $NUM_RESPONSES Musicbrainz match(es)" else vecho "Obtaining Musicbrainz results..." # If MB is to be used, interpret the query results and read all # the available entries. CDDBDISCID=$(echo "$CDDBTRACKINFO" | cut -d' ' -f1) MBDISCID=$(echo "$MBTRACKINFO" | cut -d' ' -f1) local SOURCE_WORKDIR="${ABCDETEMPDIR}/data-musicbrainz" mkdir -p "${SOURCE_WORKDIR}" ${MUSICBRAINZ} --command data --discid "${MBDISCID}" --workdir "${SOURCE_WORKDIR}" --start ${NUM_CDDB_MATCHES} error=$? if [ $error != 0 ]; then log error "$MUSICBRAINZ failed to run; ABORT" exit $error fi # Check for no matches. # The helper script will write disc matches out to # cddbread.*. Count how many we have NUM_RESPONSES=$(ls -1 "${SOURCE_WORKDIR}"/cddbread.* 2>/dev/null | wc -l) if [ $NUM_RESPONSES -gt 0 ] ; then # One or more exact matches i=1 while [ $i -le $NUM_RESPONSES ]; do NUM_CDDB_MATCHES=$(($NUM_CDDB_MATCHES + 1)) i=$(($i + 1)) echo cddb-read-${NUM_CDDB_MATCHES}-complete >> "${ABCDETEMPDIR}/status" ATITLE=$(grep -a -e '^DTITLE=' "${SOURCE_WORKDIR}/cddbread.${NUM_CDDB_MATCHES}" | cut -c8- | tr -d \\r\\n) echo "none ${CDDBDISCID} ${ATITLE}" >> "${SOURCE_WORKDIR}/cddbquery.${NUM_CDDB_MATCHES}" echo "Musicbrainz" > "${SOURCE_WORKDIR}/datasource.${NUM_CDDB_MATCHES}" cp -f "${SOURCE_WORKDIR}/"*."${NUM_CDDB_MATCHES}" "${ABCDETEMPDIR}" done fi echo "musicbrainz-readcomplete" >> "${ABCDETEMPDIR}/status" echo "musicbrainz-entries=$NUM_RESPONSES" >> "${ABCDETEMPDIR}/status" fi } # do_cddb_read do_cddb_read () { local SOURCE_WORKDIR="${ABCDETEMPDIR}/data-cddb" mkdir -p "${SOURCE_WORKDIR}" ########### # cddbstat ########### # Perform CDDB protocol version check if it hasn't already been done if checkstatus cddb-statcomplete; then :; else if [ "$CDDBAVAIL" = "n" ]; then ERRORCODE=no_query echo 503 > "${SOURCE_WORKDIR}/cddbstat" else rc=1 CDDBUSER=$(echo "$HELLOINFO" | cut -f1 -d'@') CDDBHOST=$(echo "$HELLOINFO" | cut -f2- -d'@') while [ $rc -eq 1 ] && [ "$CDDBPROTO" -ge 3 ]; do vecho "Checking CDDB server status..." $CDDBTOOL stat "$CDDBURL" "$CDDBUSER" "$CDDBHOST" "$CDDBPROTO" > "${SOURCE_WORKDIR}/cddbstat" RESPONSECODE=$(head -n 1 "${SOURCE_WORKDIR}/cddbstat" | cut -f1 -d' ') case "$RESPONSECODE" in 210) # 210 OK, status information follows (until terminating `.') rc=0 ;; 501) # 501 Illegal CDDB protocol level: . CDDBPROTO=$(($CDDBPROTO - 1)) ;; *) # Try a cddb query, since freedb2.org doesn't support the stat or ver commands # FreeDB TESTCD disc-id is used for query $CDDBTOOL query "$CDDBURL" "$CDDBPROTO" "$CDDBUSER" "$CDDBHOST" 03015501 1 296 344 > "${SOURCE_WORKDIR}/cddbstat" RESPONSECODE=$(head -n 1 "${SOURCE_WORKDIR}/cddbstat" | cut -f1 -d' ') case "$RESPONSECODE" in 2??) # Server responded, everything seems OK rc=0 ;; *) # unknown error break ;; esac ;; esac done if [ $rc -eq 1 ]; then CDDBAVAIL="n" fi fi echo cddb-statcomplete >> "${ABCDETEMPDIR}/status" fi ########### # cddbquery ########### CDDBDISCID=$(echo "$CDDBTRACKINFO" | cut -d' ' -f1) CDDBLOCALFILE="${CDDBLOCALDIR}/${CDDBDISCID}" # Perform CDDB query if it hasn't already been done if checkstatus cddb-querycomplete; then :; else if [ "$CDDBAVAIL" = "n" ]; then ERRORCODE=no_query echo 503 > "${SOURCE_WORKDIR}/cddbquery" # The default CDDBLOCALSTATUS is "notfound" # This part will be triggered if the user CDDB repo does not # contain the entry, or if we are not trying to use the repo. else vecho "Querying the CDDB server..." CDDBUSER=$(echo "$HELLOINFO" | cut -f1 -d'@') CDDBHOST=$(echo "$HELLOINFO" | cut -f2- -d'@') $CDDBTOOL query "$CDDBURL" "$CDDBPROTO" "$CDDBUSER" "$CDDBHOST" "$CDDBTRACKINFO" > "${SOURCE_WORKDIR}/cddbquery" ERRORCODE=$? case $ERRORCODE in 0) # success ;; 12|13|14) # no match found in database, wget/fetch error, # or user requested not to use CDDB. Make up an # error code (503) that abcde will recognize later # and compensate by making a template echo 503 > "${SOURCE_WORKDIR}/cddbquery" ;; *) # strange and unknown error echo "ERRORCODE=$ERRORCODE" echo "abcde: $CDDBTOOL returned unknown error code" ;; esac fi echo cddb-querycomplete >> "${ABCDETEMPDIR}/status" fi ########### # cddbread ########### # If it's not to be used, generate a template. # Then, display it (or them) and let the user choose/edit it if checkstatus cddb-readcomplete; then NUM_RESPONSES=$(checkstatus "cddb-entries") NUM_CDDB_MATCHES=$(($NUM_CDDB_MATCHES + $NUM_RESPONSES)) vecho "Re-using existing data from $NUM_RESPONSES cddb match(es)" else RESPONSECODE=$(head -n 1 "${SOURCE_WORKDIR}/cddbquery" | cut -f1 -d' ') vecho "Obtaining CDDB results..." case "$RESPONSECODE" in 200) # One exact match, retrieve it # 200 [section] [discid] [artist] / [title] NUM_RESPONSES=1 NUM_CDDB_MATCHES=$(($NUM_CDDB_MATCHES + $NUM_RESPONSES)) $CDDBTOOL read "$CDDBURL" "$CDDBPROTO" "$CDDBUSER" "$CDDBHOST" \ $(cut -f2,3 -d' ' "${SOURCE_WORKDIR}/cddbquery") \ > "${SOURCE_WORKDIR}/cddbread.${NUM_CDDB_MATCHES}" cat "${SOURCE_WORKDIR}/cddbquery" | cut -f2- -d' ' > "${SOURCE_WORKDIR}/cddbquery.${NUM_CDDB_MATCHES}" echo "cddb" > "${SOURCE_WORKDIR}/datasource.${NUM_CDDB_MATCHES}" echo "cddb-read-${NUM_CDDB_MATCHES}-complete" >> "${ABCDETEMPDIR}/status" ;; 202|403|409|500|503) # TODO: Explain these error codes a little more accurately: # http://ftp.freedb.org/pub/freedb/misc/freedb_CDDB_protcoldoc.zip # No match response: ;; 210|211) # Multiple exact, (possibly multiple) inexact matches vecho -n "Retrieving multiple matches... " grep -v '^[.]$' "${SOURCE_WORKDIR}/cddbquery" | ( # IN A SUB-SHELL - VARIABLES MODIFIED # HERE DO NOT PERSIST IN THE PARENT read DISCINFO # eat top line while read DISCINFO do NUM_CDDB_MATCHES=$(($NUM_CDDB_MATCHES + 1)) if checkstatus "cddb-read-${NUM_CDDB_MATCHES}-complete"; then :; else $CDDBTOOL read "$CDDBURL" "$CDDBPROTO" "$CDDBUSER" "$CDDBHOST" \ $(echo "$DISCINFO" | cut -f1,2 -d' ') \ > "${SOURCE_WORKDIR}/cddbread.${NUM_CDDB_MATCHES}" echo "$DISCINFO" > "${SOURCE_WORKDIR}/cddbquery.${NUM_CDDB_MATCHES}" echo "cddb" > "${SOURCE_WORKDIR}/datasource.${NUM_CDDB_MATCHES}" echo "cddb-read-${NUM_CDDB_MATCHES}-complete" >> "${ABCDETEMPDIR}/status" fi done ) # Need to re-count the entries here to be able # to incrememnt $NUM_CDDB_MATCHES in the # parent NUM_RESPONSES=$(ls -1 "${SOURCE_WORKDIR}"/datasource.* 2>/dev/null | wc -l) NUM_CDDB_MATCHES=$(($NUM_CDDB_MATCHES + $NUM_RESPONSES)) vecho "done." ;; 999) # Using local copy. NUM_RESPONSES=1 NUM_CDDB_MATCHES=$(($NUM_CDDB_MATCHES + $NUM_RESPONSES)) echo "cddb-read-${NUM_CDDB_MATCHES}-complete" >> "${ABCDETEMPDIR}/status" ;; esac ( cd "${SOURCE_WORKDIR}" for file in cddbread.* cddbquery.* datasource.*; do if [ -f "$file" ]; then cp "$file" "${ABCDETEMPDIR}" fi done ) echo "cddb-readcomplete" >> "${ABCDETEMPDIR}/status" echo "cddb-entries=$NUM_RESPONSES" >> "${ABCDETEMPDIR}/status" fi } # do_cddbedit do_cddbedit () { if checkstatus cddb-edit >/dev/null; then CDDBDATA="${ABCDETEMPDIR}/cddbread.$(checkstatus cddb-choice)" VARIOUSARTISTS="$(checkstatus variousartists)" VARIOUSARTISTSTYLE="$(checkstatus variousartiststyle)" return 0 fi if [ "$INTERACTIVE" = "y" ]; then # We should show the CDDB results both when we are not using the local CDDB repo # or when we are using it but we could not find a proper match if [ "$CDDBUSELOCAL" = "y" ] && [ "$CDDBLOCALSTATUS" = "notfound" ] || [ ! "$CDDBUSELOCAL" = "y" ]; then # Display the ${ABCDETEMPDIR}/cddbchoices file created above if [ -r "${ABCDETEMPDIR}/cddbchoices" ]; then CHOICE=$(checkstatus cddb-choice) if [ -n "$CHOICE" ] ; then case $NUM_CDDB_MATCHES in 1) cat "${ABCDETEMPDIR}/cddbchoices" ;; *) ATITLE=$(grep -a ^DTITLE= "${ABCDETEMPDIR}/cddbread.$CHOICE" | cut -f2- -d= | tr -d \\r\\n) SOURCE=$(cat "${ABCDETEMPDIR}/datasource.$CHOICE") echo "Selected: #$CDCHOICENUM ($SOURCE) ($ATITLE)" do_cddbparse "${ABCDETEMPDIR}/cddbread.$CHOICE" ;; esac else page "${ABCDETEMPDIR}/cddbchoices" CDDBCHOICENUM="" # Setting the choice to an impossible integer to avoid errors in the numeric comparisons CDCHOICENUM=-1 # I'll take CDDB read #3 for $400, Alex while [ $CDCHOICENUM -lt 0 ] || [ $CDCHOICENUM -gt $NUM_CDDB_MATCHES ]; do echo -n "Which entry would you like abcde to use (0 for none)? [0-$NUM_CDDB_MATCHES]: " >&2 read CDDBCHOICE [ X"$CDDBCHOICE" = "X" ] && CDDBCHOICE=1 if echo $CDDBCHOICE | grep -E "[[:space:]]*[[:digit:]]+,[[:digit:]]+[[:space:]]*" > /dev/null 2>&1 ; then if [ ! X"$DIFF" = "X" ]; then PARSECHOICE1=$(echo $CDDBCHOICE | cut -d"," -f1 | xargs printf %d 2>/dev/null) PARSECHOICE2=$(echo $CDDBCHOICE | cut -d"," -f2 | xargs printf %d 2>/dev/null) if [ "$PARSECHOICE1" -lt 1 ] || [ "$PARSECHOICE1" -gt "$NUM_CDDB_MATCHES" ] || \ [ "$PARSECHOICE2" -lt 1 ] || [ "$PARSECHOICE2" -gt "$NUM_CDDB_MATCHES" ] || \ [ "$PARSECHOICE1" -eq "$PARSECHOICE2" ]; then echo "Invalid diff range." >&2 echo "Please select two comma-separated numbers between 1 and $NUM_CDDB_MATCHES" >&2 else # We parse the 2 choices to diff, store them in temporary files and diff them. for PARSECHOICE in $(echo $CDDBCHOICE | tr , \ ); do do_cddbparse "${ABCDETEMPDIR}/cddbread.$PARSECHOICE" \ > "${ABCDETEMPDIR}/cddbread.parsechoice.$PARSECHOICE" done echo "Showing diff between choices $PARSECHOICE1 and $PARSECHOICE2..." \ > "${ABCDETEMPDIR}/cddbread.diff" $DIFF $DIFFOPTS "${ABCDETEMPDIR}/cddbread.parsechoice.$PARSECHOICE1" \ "${ABCDETEMPDIR}/cddbread.parsechoice.$PARSECHOICE2" \ >> "${ABCDETEMPDIR}/cddbread.diff" page "${ABCDETEMPDIR}/cddbread.diff" fi else echo "The diff program was not found in your path." >&2 echo "Please choose a number between 0 and $NUM_CDDB_MATCHES." >&2 fi elif echo $CDDBCHOICE | grep -E "[[:space:]]*[[:digit:]]+[[:space:]]*" > /dev/null 2>&1 ; then # Make sure we get a valid choice CDCHOICENUM=$(echo $CDDBCHOICE | xargs printf %d 2>/dev/null) if [ "$CDCHOICENUM" -lt 0 ] || [ "$CDCHOICENUM" -gt "$NUM_CDDB_MATCHES" ]; then echo "Invalid selection. Please choose a number between 0 and $NUM_CDDB_MATCHES." >&2 fi fi done if [ "$CDCHOICENUM" = "0" ]; then vecho "Creating empty CDDB template..." UNKNOWNDISK=y $CDDBTOOL template $(cat "${ABCDETEMPDIR}/cddbdiscid") > "${ABCDETEMPDIR}/cddbread.0" echo "template" > "${ABCDETEMPDIR}/datasource.0" else ATITLE=$(grep -a ^DTITLE= "${ABCDETEMPDIR}/cddbread.$CDCHOICENUM" | cut -f2- -d= | tr -d \\r\\n) SOURCE=$(cat "${ABCDETEMPDIR}/datasource.$CDCHOICENUM") echo "Selected: #$CDCHOICENUM ($SOURCE) ($ATITLE)" >&2 fi do_cddbparse "${ABCDETEMPDIR}/cddbread.$CDCHOICENUM" echo "cddb-choice=$CDCHOICENUM" >> "${ABCDETEMPDIR}/status" fi fi else # We need some code to show the selected option when local repository is selected and we have found a match vecho "Using cached CDDB match..." >&2 # Display the ${ABCDETEMPDIR}/cddbchoices file created above if [ -r "${ABCDETEMPDIR}/cddbchoices" ]; then CHOICE=$(checkstatus cddb-choice) if [ "$USELOCALRESP" = "y" ]; then :; else if [ -n "$CHOICE" ] ; then case $NUM_CDDB_MATCHES in 0) UNKNOWNDISK=y echo "Selected template." ;; 1) cat "${ABCDETEMPDIR}/cddbchoices" ;; *) echo "Selected: #$CHOICE" do_cddbparse "${ABCDETEMPDIR}/cddbread.$CHOICE" ;; esac fi fi fi fi else # We're noninteractive - pick the first choice. # But in case we run a previous instance and selected a choice, use it. if [ -r "${ABCDETEMPDIR}/cddbchoices" ]; then # Show the choice if we are not using the locally stored one # or when the local search failed to find a match. PREVIOUSCHOICE=$(checkstatus cddb-choice) if [ "$CDDBUSELOCAL" = "y" ] && [ "$CDDBLOCALSTATUS" = "notfound" ] || [ ! "$CDDBUSELOCAL" = "y" ]; then #if [ "$PREVIOUSCHOICE" ]; then cat "${ABCDETEMPDIR}/cddbchoices" #fi fi if [ ! -z "$PREVIOUSCHOICE" ] ; then CDCHOICENUM=$PREVIOUSCHOICE else CDCHOICENUM=1 echo "cddb-choice=$CDCHOICENUM" >> "${ABCDETEMPDIR}/status" fi echo "Selected: #$CDCHOICENUM ($(grep -a ^DTITLE= "${ABCDETEMPDIR}/cddbread.$CDCHOICENUM" | cut -f2- -d= | tr -d \\r\\n))" >&2 fi fi # sanity check if checkstatus cddb-choice >/dev/null; then :; else echo "abcde: internal error: cddb-choice not recorded." >&2 exit 1 fi CDDBDATA="${ABCDETEMPDIR}/cddbread.$(checkstatus cddb-choice)" CDDBSOURCE=$(cat "${ABCDETEMPDIR}/datasource.$(checkstatus cddb-choice)") echo -n "Edit selected CDDB data " >&2 if [ "$INTERACTIVE" = "y" ]; then if [ "$UNKNOWNDISK" = "y" ]; then echo -n "[Y/n]? " >&2 read EDITCDDB [ "$EDITCDDB" != "n" ] && EDITCDDB=y else echo -n "[y/N]? " >&2 read EDITCDDB fi else echo "[y/N]? " >&2 EDITCDDB=n fi if [ "$EDITCDDB" = "y" ]; then CDDBDATAMD5SUM=$($MD5SUM "$CDDBDATA" | cut -d " " -f 1); # Use the debian sensible-editor wrapper to pick the editor that the # user has requested via their $EDITOR environment variable if [ -x "/usr/bin/sensible-editor" ]; then /usr/bin/sensible-editor "$CDDBDATA" elif [ -n "$EDITOR" ]; then if [ -x "$(which "${EDITOR%%\ *}")" ]; then # That failed, try to load the preferred editor, starting # with their EDITOR variable $EDITOR "$CDDBDATA" fi # If that fails, check for a vi elif which vi >/dev/null 2>&1; then vi "$CDDBDATA" elif [ -x /usr/bin/vim ]; then /usr/bin/vim "$CDDBDATA" elif [ -x /usr/bin/vi ]; then /usr/bin/vi "$CDDBDATA" elif [ -x /bin/vi ]; then /bin/vi "$CDDBDATA" # nano should be on all (modern, i.e., sarge) debian systems elif which nano >/dev/null 2>&1 ; then nano "$CDDBDATA" elif [ -x /usr/bin/nano ]; then /usr/bin/nano "$CDDBDATA" # mg should be on all OpenBSD systems elif which mg >/dev/null 2>&1 ; then mg "$CDDBDATA" elif [ -x /usr/bin/mg ]; then /usr/bin/mg "$CDDBDATA" # bomb out else log warning "no editor available. Check your EDITOR environment variable." fi # delete editor backup file if it exists if [ -w "$CDDBDATA~" ]; then rm -f "$CDDBDATA~" fi fi # Some heuristics first. Look at Disc Title, and if it starts with # "Various", then we'll assume Various Artists if [ "$(grep -a ^DTITLE= "$CDDBDATA" | cut -f2- -d= | grep -aEci '^(various|soundtrack|varios|sonora|ost)')" != "0" ]; then echo "Looks like a Multi-Artist CD" >&2 VARIOUSARTISTS=y else echo -n "Is the CD multi-artist [y/N]? " >&2 if [ "$INTERACTIVE" = "y" ]; then read VARIOUSARTISTS else echo n >&2 VARIOUSARTISTS=n fi fi if [ "$VARIOUSARTISTS" = "y" ] && [ ! "$ONETRACK" = "y" ]; then # Set a default DEFAULTSTYLE=1 # Need NUMTRACKS before cddb-tool will return it: NUMTRACKS=$(grep -a -E '^TTITLE[0-9]+=' "$CDDBDATA" | wc -l) if [ "$(grep -ac "^TTITLE.*\/" "$CDDBDATA")" -gt "$(( $NUMTRACKS / 2 ))" ]; then # More than 1/2 tracks contain a "/", so guess forward DEFAULTSTYLE=1 elif [ "$(grep -ac "^TTITLE.*\-" "$CDDBDATA")" -gt "$(( $NUMTRACKS / 2 ))" ]; then # More than 1/2 contain a "-", so guess forward-dash DEFAULTSTYLE=2 elif [ "$(grep -ac "^TTITLE.*(.*)" "$CDDBDATA")" -gt "$(( $NUMTRACKS / 2 ))" ]; then # More than 1/2 contain something in parens, so guess trailing-paren DEFAULTSTYLE=6 fi echo "1) Artist / Title" >&2 echo "2) Artist - Title" >&2 echo "3) Title / Artist" >&2 echo "4) Title - Artist" >&2 echo "5) Artist: Title" >&2 echo "6) Title (Artist)" >&2 echo "7) This is a single-artist CD" >&2 echo -n "Which style of multiple artist entries is it? [1-7] ($DEFAULTSTYLE): " >&2 if [ "$INTERACTIVE" = "y" ]; then read VARIOUSARTISTSTYLE else echo $DEFAULTSTYLE >&2 VARIOUSARTISTSTYLE=$DEFAULTSTYLE fi VARIOUSARTISTSTYLE=$(echo 0$VARIOUSARTISTSTYLE | xargs printf %d) # If they press Enter, then the default style (0) was chosen while [ "$VARIOUSARTISTSTYLE" -lt 0 ] || [ "$VARIOUSARTISTSTYLE" -gt 7 ]; do echo "Invalid selection. Please choose a number between 1 and 7." echo -n "Selection [1-7]: " read VARIOUSARTISTSTYLE VARIOUSARTISTSTYLE=$(echo "0$VARIOUSARTISTSTYLE" | xargs printf "%d") done if [ "$VARIOUSARTISTSTYLE" = "0" ]; then VARIOUSARTISTSTYLE="$DEFAULTSTYLE" fi vecho "Selected: $VARIOUSARTISTSTYLE" case "$VARIOUSARTISTSTYLE" in 1) # Artist / Title VARIOUSARTISTSTYLE=forward ;; 2) # Artist - Title VARIOUSARTISTSTYLE=forward-dash ;; 3) # Title / Artist VARIOUSARTISTSTYLE=reverse ;; 4) # Title - Artist VARIOUSARTISTSTYLE=reverse-dash ;; 5) # Artist: Title VARIOUSARTISTSTYLE=colon ;; 6) # Title (Artist) VARIOUSARTISTSTYLE=trailing-paren ;; 7) # Single Artist VARIOUSARTISTS=n ;; esac fi echo "variousartists=$VARIOUSARTISTS" >> "${ABCDETEMPDIR}/status" echo "variousartiststyle=$VARIOUSARTISTSTYLE" >> "${ABCDETEMPDIR}/status" if [ "$EDITCDDB" = "y" ] && [ "$CDDBSOURCE" = "cddb" ] && [ "$UNINTENTIONALLY_ANGER_THE_FREEDB_PEOPLE" = "y" ]; then if [ "$CDDBDATAMD5SUM" != "" ] && [ "$CDDBDATAMD5SUM" != "$($MD5SUM "$CDDBDATA" | cut -d " " -f 1)" ]; then # This works but does not have the necessary error checking # yet. If you are familiar with the CDDB spec # (see http://www.freedb.org/src/latest/DBFORMAT) # and can create an error-free entry on your own, then put # UNINTENTIONALLY_ANGER_THE_FREEDB_PEOPLE=y in your # abcde.conf to enable it. Put CDDBSUBMIT=email@address in # your abcde.conf to change the email address submissions are # sent to. # submit the modified file, if they want if [ "$NOSUBMIT" != "y" ]; then echo -n "Do you want to submit this entry to $CDDBSUBMIT [y/N]? " read YESNO while [ "$YESNO" != "y" ] && [ "$YESNO" != "n" ] && [ "$YESNO" != "Y" ] && \ [ "$YESNO" != "N" ] && [ "$YESNO" != "" ] do echo -n 'Invalid selection. Please answer "y" or "n": ' read YESNO done if [ "$YESNO" = "y" ] || [ "$YESNO" = "Y" ]; then echo -n "Sending..." $CDDBTOOL send "$CDDBDATA" "$CDDBSUBMIT" echo "done." fi fi fi fi ### FIXME ### # User CDDBLOCALPOLICY to find out if we store the file or not... # Cache edited CDDB entry in the user's cddb dir if [ "$CDDBCOPYLOCAL" = "y" ]; then # Make sure the cache directory exists mkdir -p "$CDDBLOCALDIR" NUM_LINES=$(( $(wc -l < "$CDDBDATA") - 1 )) OUTPUT_FILE="$(echo "$CDDBTRACKINFO" | cut -d' ' -f1)" tail -n "$NUM_LINES" < "$CDDBDATA" > "${CDDBLOCALDIR}/${OUTPUT_FILE}" fi echo "cddb-edit" >> "${ABCDETEMPDIR}/status" } # do_getalbumart # try to download CD cover do_getalbumart() { if checkstatus "get-album-art"; then :; else # set variables ALBUMFILE="$(mungealbumname "$DALBUM")" ARTISTFILE="$(mungeartistname "$DARTIST")" GENRE="$(mungegenre "$GENRE")" YEAR=${CDYEAR:-$CDYEAR} # have we got a musicbrainz mbid or amazon asin? case "$CDDBMETHOD" in *musicbrainz*) # try musicbrainz mbid if [ -s "${ABCDETEMPDIR}/mbid.$(checkstatus cddb-choice)" ]; then MBID=$(cat "${ABCDETEMPDIR}/mbid.$(checkstatus cddb-choice)") vecho "trying to get cover from coverartarchive.orq with musicbrainz mbid $MBID" >&2 ALBUMARTURL="http://coverartarchive.org/release/$MBID/front" vecho "cover URL: $ALBUMARTURL" >&2 $HTTPGET "$ALBUMARTURL" > "${ABCDETEMPDIR}/$ALBUMARTFILE" if [ $? -ne 0 ]; then vecho "could not download cover from musicbrainz" >&2 # try amazon asin if [ -s "${ABCDETEMPDIR}/asin.$(checkstatus cddb-choice)" ]; then ASIN=$(cat "${ABCDETEMPDIR}/asin.$(checkstatus cddb-choice)") vecho "trying to get cover from amazon.com with asin $ASIN" >&2 ALBUMARTURL="http://ec1.images-amazon.com/images/P/$ASIN.01.LZZZZZZZZ.jpg" vecho "cover URL: $ALBUMARTURL" >&2 $HTTPGET "$ALBUMARTURL" > "${ABCDETEMPDIR}/$ALBUMARTFILE" if [ $? -ne 0 ]; then vecho "could not download cover from amazon" >&2 else # Check that size is reasonable; sometimes when there is no cover image # on amazon.com a 1x1 pixel gif image will be downloaded instead: FILESIZE=$(wc -c < "${ABCDETEMPDIR}/$ALBUMARTFILE") if [ "$FILESIZE" -lt 1024 ]; then rm "${ABCDETEMPDIR}/$ALBUMARTFILE" vecho "could not download cover from amazon" >&2 fi fi else vecho "no amazon ID found" >&2 fi fi else vecho "no musicbrainz ID found" >&2 fi ;; esac # use glyrc if [ ! -s "${ABCDETEMPDIR}/$ALBUMARTFILE" ]; then vecho "trying to get cover with glyrc for $ARTISTFILE / $ALBUMFILE" >&2 env LC_ALL=C $GLYRC cover --artist "$ARTISTFILE" --album "$ALBUMFILE" --write "${ABCDETEMPDIR}/$ALBUMARTFILE" $GLYRCOPTS if [ $? -ne 0 ]; then vecho "could not download cover with glyrc" >&2 else ALBUMARTURL="glyrc" fi fi if [ "$INTERACTIVE" = "y" ]; then if [ -s "${ABCDETEMPDIR}/$ALBUMARTFILE" ]; then # display properties of coverart when identify is available if new_checkexec "$IDENTIFY"; then $IDENTIFY $IDENTIFYOPTS "${ABCDETEMPDIR}/$ALBUMARTFILE" >&2 fi # display coverart when DISPLAY is set and display command is available if new_checkexec "$DISPLAYCMD" && [ "$DISPLAY" != "" ]; then $DISPLAYCMD $DISPLAYCMDOPTS "${ABCDETEMPDIR}/$ALBUMARTFILE" >&2 & fi else # nothing downloaded yet vecho "automatic album art downloading failed" >&2 fi # see if the user can find a better album art manually echo -n "Do you want to enter URL or local path for the album art [y/N]? " >&2 read YESNO while [ "$YESNO" != "y" ] && [ "$YESNO" != "n" ] && [ "$YESNO" != "Y" ] && \ [ "$YESNO" != "N" ] && [ "$YESNO" != "" ] do echo -n 'Invalid selection. Please answer "y" or "n": ' >&2 read YESNO done if [ "$YESNO" = "y" ] || [ "$YESNO" = "Y" ]; then echo -n "Enter URL or local path (ENTER to cancel) :" >&2 read ALBUMARTURL if [ ! -z "$ALBUMARTURL" ]; then if [[ ${ALBUMARTURL} =~ (https?|ftp|file)://.* ]]; then $HTTPGET "$ALBUMARTURL" > "${ABCDETEMPDIR}/$ALBUMARTFILE" if [ ! -s "${ABCDETEMPDIR}/$ALBUMARTFILE" ]; then vecho "unable to download $ALBUMARTURL" >&2 fi else # it's a local path cp "$ALBUMARTURL" "${ABCDETEMPDIR}/$ALBUMARTFILE" if [ ! -s "${ABCDETEMPDIR}/$ALBUMARTFILE" ]; then vecho "unable to copy $ALBUMARTURL to ${ABCDETEMPDIR}/$ALBUMARTFILE" >&2 fi fi fi fi fi # convert to ALBUMARTTYPE if ImageMagick is available, if not assume correct type if [ -s "${ABCDETEMPDIR}/$ALBUMARTFILE" ] && new_checkexec "$IDENTIFY"; then ALBUMARTURLTYPE=$($IDENTIFY "${ABCDETEMPDIR}/$ALBUMARTFILE" | cut -d' ' -f2) if [ "$ALBUMARTURLTYPE" != "$ALBUMARTTYPE" ] || [ "$ALBUMARTALWAYSCONVERT" = "y" ]; then if new_checkexec "$CONVERT"; then mv "${ABCDETEMPDIR}/$ALBUMARTFILE" "${ABCDETEMPDIR}/$ALBUMARTFILE.tmp" $CONVERT "${ABCDETEMPDIR}/$ALBUMARTFILE.tmp" $CONVERTOPTS "${ABCDETEMPDIR}/$ALBUMARTFILE" rm -f "${ABCDETEMPDIR}/$ALBUMARTFILE.tmp" else rm -f "${ABCDETEMPDIR}/$ALBUMARTFILE" vecho "sorry, cannot convert $ALBUMARTURLTYPE to $ALBUMARTTYPE" >&2 vecho "without ImageMagick convert" >&2 fi fi fi # copy to target directories if [ -s "${ABCDETEMPDIR}/$ALBUMARTFILE" ]; then for OUTPUT in $(echo "$OUTPUTTYPE" | tr , \ ) do # put cover in the same place as the album if [ "$ONETRACK" = "y" ] ; then if [ "$VARIOUSARTISTS" = "y" ] ; then ALBUMARTDIR="$(eval echo "$VAONETRACKOUTPUTFORMAT")" else ALBUMARTDIR="$(eval echo "$ONETRACKOUTPUTFORMAT")" fi else if [ "$VARIOUSARTISTS" = "y" ] ; then ALBUMARTDIR="$(eval echo "$VAOUTPUTFORMAT")" else ALBUMARTDIR="$(eval echo "$OUTPUTFORMAT")" fi fi FINALALBUMARTDIR="$(dirname "$OUTPUTDIR/$ALBUMARTDIR")" vecho "copying cover to target directory $FINALALBUMARTDIR" >&2 mkdir -p "$FINALALBUMARTDIR" cp "${ABCDETEMPDIR}/$ALBUMARTFILE" "$FINALALBUMARTDIR" done rm -f "${ABCDETEMPDIR}/$ALBUMARTFILE" echo "get-album-art=$ALBUMARTURL" >> "${ABCDETEMPDIR}/status" else log warning "could not get cover" echo "get-album-art=none" >> "${ABCDETEMPDIR}/status" fi fi } # Optionally embed the albumart downloaded by the getalbumart fuction. # FIXME: It would be nice to have this also selectable from within the # FIXME: getalbumart function itself. Andrew do_embedalbumart() { # Set variables: ALBUMFILE="$(mungealbumname "$DALBUM")" ARTISTFILE="$(mungeartistname "$DARTIST")" GENRE="$(mungegenre "$GENRE")" YEAR=${CDYEAR:-$CDYEAR} # Allow for multiple output formats: for OUTPUT in $(echo "$OUTPUTTYPE" | tr , \ ) do # Find the output directory for multi track encodes: if [ "$ONETRACK" != "y" ] ; then if [ "$VARIOUSARTISTS" = "y" ] ; then FINDPATH="$(eval echo "$VAOUTPUTFORMAT")" else FINDPATH="$(eval echo "$OUTPUTFORMAT")" fi fi # Find the output directory for single track encodes: if [ "$ONETRACK" = "y" ] ; then if [ "$VARIOUSARTISTS" = "y" ] ; then FINDPATH="$(eval echo "$VAONETRACKOUTPUTFORMAT")" else FINDPATH="$(eval echo "$ONETRACKOUTPUTFORMAT")" fi fi FINALDIR="$(dirname "$OUTPUTDIR/$FINDPATH")" cd "$FINALDIR" # Instructions for each format, feel free to add more. It would be nice to # make the backup directory selectable and perhaps also have an option for # the bold to simply have the image deleted. Work for another day... Andrew. if [ -e "$ALBUMARTFILE" ] ; then case "$OUTPUT" in mp3) for i in *.mp3 do "$EYED3" --add-image "$ALBUMARTFILE":FRONT_COVER "$i" done mkdir "$FINALDIR"/albumart_backup mv "$ALBUMARTFILE" "$FINALDIR"/albumart_backup vecho "Successfully embedded the album art into your $OUTPUT tracks" >&2 ;; flac) for i in *.flac do "$METAFLAC" --import-picture-from="$ALBUMARTFILE" "$i" done mkdir "$FINALDIR"/albumart_backup mv "$ALBUMARTFILE" "$FINALDIR"/albumart_backup vecho "Successfully embedded the album art into your $OUTPUT tracks" >&2 ;; m4a) for i in *.m4a do "$ATOMICPARSLEY" "$i" --artwork "$ALBUMARTFILE" --overWrite done mkdir "$FINALDIR"/albumart_backup mv "$ALBUMARTFILE" "$FINALDIR"/albumart_backup vecho "Successfully embedded the album art into your $OUTPUT tracks" >&2 ;; wv) for i in *.wv do "$WVTAG" --write-binary-tag "Cover Art (Front)=@$ALBUMARTFILE" "$i" done mkdir "$FINALDIR"/albumart_backup mv "$ALBUMARTFILE" "$FINALDIR"/albumart_backup vecho "Successfully embedded the album art into your $OUTPUT tracks" >&2 ;; ogg) # ---------------- # This technique is drawn from 2 sources (the first link being the primary source): # 1. https://github.com/biapy/howto.biapy.com/blob/master/various/mussync-tools # 2. https://github.com/acabal/scripts/blob/master/ogg-cover-art # In abcde a few steps are used in this sequence: # # 1. Create a 'legal' header for the cover art image # 2. Makes a copy of the existing tags # 3. base64 the cover art image # 4. Copy the original tags + the base64 image back to the original ogg file # # Might need some fine tuning but it is a start for abcde 2.9. Andrew. # FIXME: I am not sure if there is a maximum size for images converted in this # way, but this could be perhaps handled by CONVERTOPTS called from do_getalbumart. # ---------------- # First some variables we can reuse: # Use MIMETYPECOVER to allow use of either png or the more common jpeg: MIMETYPECOVER=$(file -b --mime-type "$ALBUMARTFILE") EXPORTTAGS="${ABCDETEMPDIR}/export_ogg_tags" BUILDHEADER="${ABCDETEMPDIR}/build_header" # Now build the header, gory details are here: # https://xiph.org/flac/format.html#metadata_block_picture # Picture Type: printf "0: %.8x" 3 | xxd -r -g0 > "$BUILDHEADER" # Mime type length printf "0: %.8x" $(echo -n "$MIMETYPECOVER" | wc -c) | xxd -r -g0 >> "$BUILDHEADER" # Mime type: echo -n "$MIMETYPECOVER" >> "$BUILDHEADER" # Description length. FIXME: I have used 'Cover Image' but I am not sure # if this is better left as an empty field. Andrew printf "0: %.8x" $(echo -n "Cover Image" | wc -c) | xxd -r -g0 >> "$BUILDHEADER" # Description: echo -n "Cover Image" >> "$BUILDHEADER" # Picture width: printf "0: %.8x" 0 | xxd -r -g0 >> "$BUILDHEADER" # Picture height: printf "0: %.8x" 0 | xxd -r -g0 >> "$BUILDHEADER" # Picture color depth: printf "0: %.8x" 0 | xxd -r -g0 >> "$BUILDHEADER" # Picture color count: printf "0: %.8x" 0 | xxd -r -g0 >> "$BUILDHEADER" # Image file size: printf "0: %.8x" $(wc -c "$ALBUMARTFILE" | cut --delimiter=' ' --fields=1) | xxd -r -g0 >> "$BUILDHEADER" # cat the image file: cat "$ALBUMARTFILE" >> "$BUILDHEADER" # Now process each ogg file by first exporting the original tags then # appending the cover image and finally copying the whole thing back # to the original image: for i in *.ogg do # Make a backup of the existing tags: "$VORBISCOMMENT" --list --raw "$i" > "EXPORTTAGS" # base64 the file and then mix it all together with the exported tags: echo "metadata_block_picture=$(base64 --wrap=0 < "$BUILDHEADER")" >> "EXPORTTAGS" # Update the original ogg file with exported tags and the appended base64'd image: "$VORBISCOMMENT" --write --raw --commentfile "EXPORTTAGS" "$i" # Delete the EXPORTTAGS file ready to be recreated for the next file in the loop, # note that the header file BUILDHEADER will be reused for each file in the loop: rm "EXPORTTAGS" done mkdir "$FINALDIR"/albumart_backup mv "$ALBUMARTFILE" "$FINALDIR"/albumart_backup vecho "Successfully embedded the album art into your $OUTPUT tracks" >&2 ;; *) vecho "Sorry, abcde does not embed album art for the $OUTPUT container..." >&2 esac else vecho "Suitable cover image not found, no embedding done..." >&2 fi done } # do_cdread [tracknumber] # do_cdread onetrack [firsttrack] [lasttrack] # do_cdread () { # The commands here don't go through run_command because they're never supposed to be silenced # return codes need to be doublechecked anyway, however if [ "$1" = "onetrack" ]; then # FIXME # Add the possibility of grabbing ranges of tracks in onetrack # FIXME # Until then, we grab the whole CD in one track, no matter what # the user said # We need the first and last track for cdda2wav/icedax FIRSTTRACK=$2 LASTTRACK=$(expr $3 + 0) # Unpad UTRACKNUM=$FIRSTTRACK case "$CDROMREADERSYNTAX" in flac) READTRACKNUMS="-" ;; cdparanoia|libcdio) #XX FIXME XX # Add a variable to check if tracks are provided in command line and if not, rip the whole CD # We must make sure to rip from sector 0, both lines below work # READTRACKNUMS="-- -$LASTTRACK" ;; READTRACKNUMS="[.0]-" ;; cdda2wav | icedax) READTRACKNUMS="$FIRSTTRACK+$LASTTRACK" ;; pird) READTRACKNUMS="$FIRSTTRACK..$LASTTRACK" ;; *) echo "abcde error: $CDROMREADERSYNTAX does not support ONETRACK mode" exit 1 ;; esac else UTRACKNUM=$1 fi CDDBTRACKNUM=$(expr $UTRACKNUM - 1) # Unpad if [ "$USEPIPES" = "y" ]; then TEMPARG="PIPERIPPER_$CDROMREADERSYNTAX" FILEARG="$( eval echo "\$$TEMPARG" )" PIPE_MESSAGE="and encoding " else WAVDATA="${ABCDETEMPDIR}/track$UTRACKNUM.wav" case "$CDROMREADERSYNTAX" in ## FIXME ## Find the cases for flac, to avoid exceptions flac) FILEARG="--output-name=$WAVDATA" ;; *) FILEARG="$WAVDATA" ;; esac fi if [ "$1" = "onetrack" ]; then echo "Grabbing ${PIPE_MESSAGE}tracks $UTRACKNUM - $LASTTRACK as one track ..." >&2 else if [ -r "$CDDBDATA" ]; then getcddbinfo TRACKNAME echo "Grabbing ${PIPE_MESSAGE}track $UTRACKNUM: $TRACKNAME..." >&2 else echo "Grabbing ${PIPE_MESSAGE}track $UTRACKNUM..." >&2 fi fi case "$CDROMREADERSYNTAX" in ### FIXME ### use an exception for flac, since it uses -o ### FIXME ### Shall we just use -o $FILEARG ?? flac) # Avoid problems with math expressions by unpadding the given UTRACKNUM STRIPTRACKNUM=$(expr $UTRACKNUM + 0 ) nice $READNICE $FLAC -d -f --cue="${READTRACKNUMS:-$STRIPTRACKNUM.1-$(($STRIPTRACKNUM + 1)).0}" "$FILEARG" "$CDROM" ;; cdparanoia|libcdio) if [ "$USEPIPES" = "y" ]; then nice $READNICE $CDROMREADER -"$CDPARANOIACDROMBUS" "$CDROM" "${READTRACKNUMS:-$UTRACKNUM}" "$FILEARG" else nice $READNICE $CDROMREADER -"$CDPARANOIACDROMBUS" "$CDROM" "${READTRACKNUMS:-$UTRACKNUM}" "$FILEARG" >&2 fi ;; cdda2wav|icedax) if [ "$OSFLAVOUR" = "OSX" ] ; then # Hei, we have to unmount the device before running anything like cdda2wav/icedax in OSX diskutil unmount "${CDROM#/dev/}" # Also, in OSX the cdrom device for cdda2wav/icedax changes... CDDA2WAVCDROM="IODVDServices" elif [ "$OSFLAVOUR" = "FBSD" ] || [ "$OSFLAVOUR" = "IRIX" ]; then CDDA2WAVCDROM="$CDROMID" else if [ "$CDROMID" = "" ]; then CDDA2WAVCDROM="$CDROM" else CDDA2WAVCDROM="$CDROMID" fi fi if [ "$USEPIPES" = "y" ]; then nice $READNICE $CDROMREADER -D "$CDDA2WAVCDROM" -t "${READTRACKNUMS:-$UTRACKNUM}" "$FILEARG" else nice $READNICE $CDROMREADER -D "$CDDA2WAVCDROM" -t "${READTRACKNUMS:-$UTRACKNUM}" "$FILEARG" >&2 fi ;; dagrab) # I cannot get USEPIPES to work with dagrab so just this: nice $READNICE $CDROMREADER -d "$CDROM" -f "$FILEARG" -v "$UTRACKNUM" >&2 ;; pird) if [ "$USEPIPES" = "y" ]; then nice $READNICE $CDROMREADER -j "${READTRACKNUMS:-$UTRACKNUM}" "$CDROM" "$FILEARG" else # Write ripped audio data to stdout and redirect to $FILEARG. # Progress is written to stderr by default and thus >&2 is not required. nice $READNICE $CDROMREADER -j "${READTRACKNUMS:-$UTRACKNUM}" "$CDROM" "$PIPERIPPER_pird" > "$FILEARG" fi ;; cddafs) # Find the track's mounted path REALTRACKNUM=$(expr $UTRACKNUM + 0) # Unpad FILEPATH=$(mount | grep "$CDROM on" | sed 's/^[^ ]* on \(.*\) (.*/\1/') FILEPATH=$(find "$FILEPATH" | grep "/$REALTRACKNUM "); # If the file exists, copy it if [ -e "$FILEPATH" ] ; then if [ "$USEPIPES" = "y" ]; then nice $READNICE $CDROMREADER "$FILEPATH" "$FILEARG" else nice $READNICE $CDROMREADER "$FILEPATH" "$FILEARG" >&2 fi else false fi ;; debug) if [ "$USEPIPES" = "y" ]; then nice $READNICE $CDROMREADER -"$CDPARANOIACDROMBUS" "$CDROM" -w "$UTRACKNUM-[:1]" "$FILEARG" else nice $READNICE $CDROMREADER -"$CDPARANOIACDROMBUS" "$CDROM" -w "$UTRACKNUM-[:1]" "$FILEARG" >&2 fi ;; esac RETURN=$? # If we get some error or we get some missing wav # (as long as we dont use pipes) if [ "$RETURN" != "0" ] || ( [ ! -s "$WAVDATA" ] && [ X"$USEPIPES" != "Xy" ] ); then # Thank goodness errors is only machine-parseable up to the # first colon, otherwise this woulda sucked if [ "$RETURN" = "0" ] || [ ! -s "$WAVDATA" ]; then RETURN=73 # fake a return code as cdparanoia return 0 also on aborted reads fi if [ "$USEPIPES" = "y" ]; then echo "readencodetrack-$UTRACKNUM: $CDROMREADER returned code $RETURN" >> "${ABCDETEMPDIR}/errors" else echo "readtrack-$UTRACKNUM: $CDROMREADER returned code $RETURN" >> "${ABCDETEMPDIR}/errors" fi return $RETURN else if [ "$USEPIPES" = "y" ]; then echo "readencodetrack-$UTRACKNUM" >> "${ABCDETEMPDIR}/status" else echo "readtrack-$UTRACKNUM" >> "${ABCDETEMPDIR}/status" fi if [ "$1" = "onetrack" ]; then echo onetrack >> "${ABCDETEMPDIR}/status" fi fi } # do_cdspeed # No values accepted, only uses env variables do_cdspeed () { if "$CDSPEED" "$CDSPEEDOPTS" "$CDSPEEDVALUE" >/dev/null ; then vecho "Setting CD speed to ${CDSPEEDVALUE}x" else echo "abcde: unable to set the device speed" >&2 fi } # vecho [message] # # vecho outputs a message if EXTRAVERBOSE is 1 or more vecho () { if [ x"$EXTRAVERBOSE" != "x" ] && [ "$EXTRAVERBOSE" -gt 0 ] ; then case $1 in warning) shift ; log warning "$@" ;; *) >&4 echo "$@" ;; esac fi } # vvecho [message] # # vvecho outputs a message if EXTRAVERBOSE is 2 or more vvecho () { if [ x"$EXTRAVERBOSE" != "x" ] && [ "$EXTRAVERBOSE" -gt 1 ] ; then case $1 in warning) shift ; log warning "$@" ;; *) >&4 echo "$@" ;; esac fi } # decho [message] # # decho outputs a debug message if DEBUG is selected decho () { if [ x"$DEBUG" != "x" ]; then if echo "$1" | grep "^\[" > /dev/null 2>&1 ; then DEBUGECHO=$(echo "$@" | tr -d '[]') echo >&4 "[DEBUG] $DEBUGECHO: $(eval echo \\$${DEBUGECHO})" else echo >&4 "[DEBUG] $1" fi fi } # User-redefinable functions # Custom filename munging: mungefilename () { echo "$@" | sed -e 's/^\.*//' -e 's/ /_/g' | tr -d ":><|*/\"'?[:cntrl:]" } # Custom filename munging specific to track names: mungetrackname () { mungefilename "$@" } # Custom filename munging specific to artist names: mungeartistname () { mungefilename "$@" } # Custom filename munging specific to album names: mungealbumname () { mungefilename "$@" } # Custom genre munging: mungegenre () { echo "$CDGENRE" | tr "[:upper:]" "[:lower:]" } # pre_read # Empty pre_read function, to be defined in the configuration file. pre_read () { : } # post_read # Empty post_read function, to be defined in the configuration file. post_read () { : } # post_encode # Empty post_encode function, to be defined in the configuration file. post_encode () { : } ############################################################################### # End of functions # # Start of execution ############################################################################### # Builtin defaults # CDDB # Currently three supported options ("musicbrainz", "cddb" for freedb.org and "cdtext") CDDBMETHOD=musicbrainz CDDBURL="http://freedb.freedb.org/~cddb/cddb.cgi" CDDBSUBMIT=freedb-submit@freedb.org CDDBPROTO=6 HELLOINFO="$(whoami)@$(hostname)" CDDBCOPYLOCAL="n" CDDBLOCALPOLICY="always" CDDBLOCALRECURSIVE="y" CDDBLOCALDIR="$HOME/.cddb" CDDBUSELOCAL="n" # List of fields we parse and show during the CDDB parsing... SHOWCDDBFIELDS="year,genre" INTERACTIVE=y #CDROMREADERSYNTAX=cdparanoia ENCODERSYNTAX=default MP3ENCODERSYNTAX=default OGGENCODERSYNTAX=default OPUSENCODERSYNTAX=default MKAENCODERSYNTAX=default AIFFENCODERSYNTAX=default FLACENCODERSYNTAX=default SPEEXENCODERSYNTAX=default MPCENCODERSYNTAX=default WVENCODERSYNTAX=default TTAENCODERSYNTAX=default APENCODERSYNTAX=default MP2ENCODERSYNTAX=default AACENCODERSYNTAX=default NORMALIZERSYNTAX=default CUEREADERSYNTAX=default OUTPUTFORMAT='${ARTISTFILE}-${ALBUMFILE}/${TRACKNUM}.${TRACKFILE}' # Use the following VAOUTPUTFORMAT to revert to 2.0.x VA format: #VAOUTPUTFORMAT=${OUTPUTFORMAT} VAOUTPUTFORMAT='Various-${ALBUMFILE}/${TRACKNUM}.${ARTISTFILE}-${TRACKFILE}' ONETRACKOUTPUTFORMAT='${ARTISTFILE}-${ALBUMFILE}/${ALBUMFILE}' VAONETRACKOUTPUTFORMAT='Various-${ALBUMFILE}/${ALBUMFILE}' PLAYLISTFORMAT='${ARTISTFILE}-${ALBUMFILE}.${OUTPUT}.m3u' PLAYLISTDATAPREFIX='' VAPLAYLISTFORMAT='${ARTISTFILE}-${ALBUMFILE}.${OUTPUT}.m3u' VAPLAYLISTDATAPREFIX='' DOSPLAYLIST=n COMMENT='' ID3TAGV=id3v2.4 ENCNICE=10 READNICE=10 DISTMP3NICE=10 VARIOUSARTISTS=n VARIOUSARTISTSTYLE=forward KEEPWAVS=n PADTRACKS=n NOGAP=n BATCHNORM=n NOCDDBQUERY=n # If using scsi devices, cdda2wav/icedax needs a CDROMID, instead of a device node # i.e. CDROMID="1,0,0" CDROMID="" # If we are using the IDE bus, we need CDPARANOIACDROMBUS defined as "d" # If we are using the ide-scsi emulation layer, we need to define a "g" CDPARANOIACDROMBUS="d" # program paths - defaults to checking your $PATH # mp3 LAME=lame GOGO=gogo BLADEENC=bladeenc L3ENC=l3enc XINGMP3ENC=xingmp3enc MP3ENC=mp3enc # ogg VORBIZE=vorbize OGGENC=oggenc #opus OPUSENC=opusenc # flac FLAC=flac # speex SPEEXENC=speexenc # mpc (Musepack) MPCENC=mpcenc # wv (wavpack) # WVENC is retained in abcde 2.7.1 for backwards compatibility # with abcde 2.7: WVENC=wavpack WAVPACK=wavpack # True Audio: 'tta' is the newer version, 'ttaenc' is the older version: TTA=tta TTAENC=ttaenc # ape APENC=mac APETAG=apetag # mp2 TWOLAME=twolame # m4a FAAC=faac NEROAACENC=neroAacEnc FDKAAC=fdkaac # Note that the qaac PATH will almost always require adjustment # as it is a Windows application being run through Wine. More # detailed notes in the sample abcde.conf file in the abcde tarball. QAAC=qaac FHGAACENC=fhgaacenc # The path to 'avconv' rather than 'ffmpeg'can be used here: FFMPEG=ffmpeg ID3=id3 ID3V2=id3v2 MID3V2=mid3v2 EYED3=eyeD3 ID3TAG=id3tag VORBISCOMMENT=vorbiscomment METAFLAC=metaflac NEROAACTAG=neroAacTag ATOMICPARSLEY=AtomicParsley WVTAG=wvtag WINE=wine CDPARANOIA=cdparanoia CD_PARANOIA="cd-paranoia" CDDA2WAV=icedax DAGRAB=dagrab CDDAFS=cp PIRD=pird CDDISCID="cd-discid" CDDBTOOL=cddb-tool MUSICBRAINZ=abcde-musicbrainz-tool EJECT=eject MD5SUM=md5sum DISTMP3=distmp3 NORMALIZE="normalize-audio" CDSPEED=eject VORBISGAIN=vorbisgain MP3GAIN=mp3gain MPCGAIN=mpcgain WVGAIN=wvgain # For Wavpack replay gain we set both the default of 'track gain' # as well as this option for 'album gain'. Better media players # such as vlc can select either or neither. Andrew. WVGAINOPTS='-a' MKCUE=mkcue MKTOC=cdrdao DIFF=diff CUE2DISCID=builtin GLYRC=glyrc IDENTIFY=identify CONVERT=convert DISPLAYCMD=display # Options for programs called from abcde: # # aiff # These options needed by FFmpeg for tagging and selection of id3v2 version: # 1. '-write_id3v2 1' allows id3v2 tagging while '-write_id3v2 0' disables tagging # 2. '-id3v2_version 4' gives version id3v2.4 while '3' gives id3v2.3 AIFFENCOPTS="-write_id3v2 1 -id3v2_version 4" # mp3 LAMEOPTS= GOGOOPTS= BLADEENCOPTS= L3ENCOPTS= XINGMP3ENCOPTS= MP3ENCOPTS= MP3GAINOPTS="-a -k" # ogg VORBIZEOPTS= OGGENCOPTS= VORBISGAINOPTS="--album" #opus OPUSENCOPTS= # flac # The flac option is a workaround for an error where flac fails # to encode with error 'floating point exception'. This is flac # error in get_console_width(), corrected in flac 1.3.1 FLACOPTS="--silent" FLACGAINOPTS="--add-replay-gain" # speex SPEEXENCOPTS= # mpc MPCENCOPTS= # wv WAVPACKENCOPTS= # True Audio has no useful options but it is here anyway :) TTAENCOPTS= # ape # Monkey's Audio Console (mac) chokes without a mode setting # so we set one here. APENCOPTS='-c4000' # mp2 TWOLAMENCOPTS= # m4a FAACENCOPTS= NEROACENCOPTS= # fdkaac chokes without either a bitrate or bitrate-mode specified so # we set bitrate here. FDKAACENCOPTS='--bitrate 192k' QAACENCOPTS= FHGAACENCOPTS= FFMPEGENCOPTS= ID3OPTS= ID3TAGOPTS= EYED3OPTS="" ATOMICPARSLEYOPTS= CDPARANOIAOPTS= PIRDOPTS= CDDA2WAVOPTS= DAGRABOPTS= CDDAFSOPTS="-f" CDDBTOOLOPTS= EJECTOPTS= DISTMP3OPTS= NORMALIZEOPTS= CDSPEEDOPTS="-x" CDSPEEDVALUE= MKCUEOPTS= MKTOCOPTS="" VORBISCOMMENTOPTS="-R" METAFLACOPTS="--no-utf8-convert" DIFFOPTS= GLYRCOPTS= IDENTIFYOPTS= CONVERTOPTS= DISPLAYCMDOPTS="-resize 512x512 -title abcde_album_art" # Defaults for album art downloads ALBUMARTFILE="cover.jpg" ALBUMARTTYPE="JPEG" ALBUMARTALWAYSCONVERT="n" # Default to one process if -j isn't specified MAXPROCS=1 # List of actions to perform - by default, run to completion ACTIONS=cddb,read,encode,tag,move,clean # This option is basically for Debian package dependencies: # List of preferred outputs - by default, run with whatever we have in the path DEFAULT_OUTPUT_BINARIES=vorbis:oggenc,flac:flac,mp3:lame,mp3:bladeenc,spx:speex,m4a:fdkaac:opus # List of preferred cdromreaders - by default, run whichever we have in the path DEFAULT_CDROMREADERS="cdparanoia icedax cdda2wav libcdio pird" # fd for when `vecho` and `log info` called with redirected stdout exec 4>&1 # Assume fetch if under FreeBSD. curl is used for Mac OS X. wget is used for # Linux/OpenBSD. ftp is user for NetBSD. # Let's use these checkings to determine the OS flavour, which will be used # later UNAME="$(uname)" if [ X"$UNAME" = "XFreeBSD" ] ; then HTTPGET=fetch MD5SUM=md5 NEEDCDROMID=y OSFLAVOUR=FBSD elif [ X"$UNAME" = "XDarwin" ] ; then HTTPGET=curl # By default md5sum is not installed, use md5 instead: MD5SUM=md5 OSFLAVOUR=OSX # We should have diskutil in OSX, but let's be sure... NEEDDISKUTIL=y CDROMREADERSYNTAX=cddafs # We won't find the eject program in OSX, and doing checkexec will fail further below... unset EJECT elif [ X"$UNAME" = "XOpenBSD" ] ; then HTTPGET=ftp MD5SUM=md5 OSFLAVOUR=OBSD elif [ X"$UNAME" = "XNetBSD" ] ; then HTTPGET=ftp MD5SUM=md5 OSFLAVOUR=NBSD elif [ X"$UNAME" = X"SunOS" ] ; then HTTPGET="" MD5SUM=md5 OSFLAVOUR=SunOS elif [ X"$UNAME" = X"IRIX64" ] ; then HTTPGET="wget" OSFLAVOUR=IRIX NEEDCDROMID=y # Apparently necessary - see # https://abcde.einval.com/bugzilla/show_bug.cgi?id=29 CDDISCID_NEEDS_PAUSE=y else HTTPGET=wget fi # If CDDBAVAIL is set to n, no CDDB read is done CDDBAVAIL=y # There we go.. # But before we get into business, let us chop off any GREP environmental # variables. GREP_OPTIONS="" GREP_COLOR="" if [ -z "$OUTPUTDIR" ]; then OUTPUTDIR=$(pwd) fi if [ -z "$WAVOUTPUTDIR" ]; then WAVOUTPUTDIR="$OUTPUTDIR" fi # Load system defaults if [ -r /etc/abcde.conf ]; then . /etc/abcde.conf fi # Load user preference defaults if [ -r "$HOME/.abcde.conf" ]; then . "$HOME/.abcde.conf" fi # By this time, we need some HTTPGETOPTS already defined. # If the user has defined a non-default HTTPGET method, we should not be empty. if [ "$HTTPGETOPTS" = "" ] ; then case $HTTPGET in wget) HTTPGETOPTS="-q -nv -e timestamping=off -O -";; curl) HTTPGETOPTS="-f -s -L";; fetch)HTTPGETOPTS="-q -o -";; ftp) HTTPGETOPTS="-a -V -o - ";; *) log warning "HTTPGET in non-standard and HTTPGETOPTS are not defined." ;; esac fi # If the CDROM has not been set yet, find a suitable one. # If this is a devfs system, default to /dev/cdroms/cdrom0 # instead of /dev/cdrom if [ "$CDROM" = "" ] ; then if [ -e /dev/cdroms/cdrom0 ]; then CDROM=/dev/cdroms/cdrom0 elif [ "$OSFLAVOUR" = "OSX" ] && [[ $(diskutil list) =~ CD_part[^/]*(disk.)$'\n' ]]; then CDROM=/dev/${BASH_REMATCH[1]} elif [ -e /dev/cdrom ]; then CDROM=/dev/cdrom elif [ -e /dev/sr0 ]; then CDROM=/dev/sr0 elif [ -e /dev/cd0c ]; then CDROM=/dev/cd0c elif [ -e /dev/acd0c ]; then CDROM=/dev/acd0c elif [ -e /dev/disk1 ]; then CDROM=/dev/disk1 fi fi # We used to use EXTRAVERBOSE=y to turn on more debug output. Now # that's changed to a number to allow for more control. Deal with # EXTRAVERBOSE=y/n, set it to 1/0 for backwards compatibility. case "$EXTRAVERBOSE" in *y*|*Y*) EXTRAVERBOSE=1 ;; *n*|*N*) EXTRAVERBOSE=0 ;; esac # Parse command line options while getopts 1a:bBc:C:d:DefgGhj:klLmMnNo:pPQ:r:s:S:t:T:UvVxX:w:W:z opt ; do case "$opt" in 1) ONETRACK=y ;; a) ACTIONS="$OPTARG" ;; A) EXPACTIONS="$OPTARG" ;; b) BATCHNORM=y ;; B) GETALBUMART=y ; EMBEDALBUMART=y ;; c) if [ -e "$OPTARG" ]; then . "$OPTARG" else log error "config file \"$OPTARG\" cannot be found." exit 1 fi ;; C) CDDBDISCID="$( echo "${OPTARG#abcde.}" | tr -d /)" ;; d) CDROM="$OPTARG" ;; D) set -x ;; h) usage; exit ;; e) ERASEENCODEDSTATUS=y ;; E) ENCODING="$OPTARG" ;; f) FORCE=y ;; g) NOGAP=y ;; G) GETALBUMART=y ;; i) INLINETAG=y ;; j) MAXPROCS="$OPTARG" ;; k) KEEPWAVS=y ;; l) LOWDISK=y ;; L) CDDBUSELOCAL=y ;; n) CDDBAVAIL=n ;; N) INTERACTIVE=n ;; m) DOSPLAYLIST=y ;; M) DOCUE=y ;; o) OUTPUTTYPE="$OPTARG" ;; p) PADTRACKS=y ;; P) USEPIPES=y ;; Q) CDDBMETHOD="$OPTARG" ;; r) REMOTEHOSTS="$OPTARG" ;; R) CDDBLOCALRECURSIVE=y ;; s) SHOWCDDBFIELDS="$OPTARG" ;; S) CDSPEEDVALUE="$OPTARG" ;; t) STARTTRACKNUMBER="$OPTARG" ;; T) STARTTRACKNUMBER="$OPTARG" ; STARTTRACKNUMBERTAG="y" ;; U) CDDBPROTO=5 ;; v) echo "This is abcde v$VERSION." echo "Usage: abcde [options] [tracks]" echo "abcde -h for extra help" exit ;; V) EXTRAVERBOSE=$(($EXTRAVERBOSE + 1)) ;; x) EJECTCD="y" ;; X) CUE2DISCID="$OPTARG" ;; w) COMMENT="$OPTARG" ;; W) if echo "$OPTARG" | grep "[[:digit:]]" > /dev/null 2>&1 ; then STARTTRACKNUMBER="${OPTARG}$(printf "%02d" "${STARTTRACKNUMBER:-01}")" STARTTRACKNUMBERTAG="y" COMMENT="CD${OPTARG}" DISCNUMBER="${OPTARG}" else log error "argument of -W must be integer" exit 1 fi ;; z) DEBUG=y ; CDROMREADERSYNTAX=debug ; EJECTCD="n" ;; ?) usage; exit ;; esac done shift $(($OPTIND - 1)) # Here it comes the worse part of the whole thing. From here until we start # ripping, we have a mixture of sanity checks, verifications, default settigs # and other crazy stuff that interdepends, but hey, someone has to do it. # If NOCDDBQUERY is set, don't query the CDDB server. if [ "$NOCDDBQUERY" = "y" ]; then CDDBAVAIL="n" fi # If the user specified a flac file, then switch to special flac mode if echo "$CDROM" | grep -i '.flac$' > /dev/null 2>&1 ; then if [ ! -f "$CDROM" ]; then log error "the defined file for FLAC ripping cannot be found" >&2 exit 1 fi vecho warning "switching to flac CDROMREADERSYNTAX..." CDROMREADERSYNTAX=flac # We have a builtin version of cue2discid... case "$CUE2DISCID" in builtin);; *) NEEDCUE2DISCID=y;; esac NEEDMETAFLAC=y EJECTCD=n fi # If the user provided a CDDBDISCID, disable eject if [ -n "${CDDBDISCID}" ] || [ "$CDROMREADERSYNTAX" = "flac" ]; then EJECTCD=n ; fi # Check the available cd rippers in the system, from the ones we know. if [ "$CDROMREADERSYNTAX" = "" ]; then for DEFAULT_CDROMREADER in $DEFAULT_CDROMREADERS; do if new_checkexec "$DEFAULT_CDROMREADER"; then CDROMREADERSYNTAX="$DEFAULT_CDROMREADER" break fi done if [ "$CDROMREADERSYNTAX" = "" ]; then log error "no cdreader found in your PATH" log error "hints: are all dependencies installed? has the \$PATH been modified?" exit 1 fi fi # Decide if we can continue. if [ "$ONETRACK" = "y" ]; then # FIXME # remove check as soon as we find out about the other readers case "$CDROMREADERSYNTAX" in flac) ;; cdparanoia | libcdio) ;; cdda2wav | icedax) ;; pird) ;; *) log error "$CDROMREADERSYNTAX does not support ONETRACK mode" exit 1 ;; esac if [ "$BATCHNORM" = "y" ]; then log warning "BATCHNORM mode is not compatible with ONETRACK mode. Disabling..." BATCHNORM=n fi if [ "$NOGAP" = "y" ]; then log warning "NOGAP mode is not compatible with ONETRACK mode. Disabling..." NOGAP=n fi # It does not matter how many tracks we want. In ONETRACK mode we grab them all # FIXME # allow ranges of tracks to be selected for onetrack ripping if [ $# -gt 0 ]; then log warning "ONETRACK mode selected, grabbing all tracks..." fi else while [ $# -gt 0 ]; do # Range parsing code courtesy of Vincent Ho # Cleaned up to use shell built-ins by Charles Steinkuehler if [ "${1#*[^0-9-]}" != "$1" ]; then log error "syntax error while processing track numbers ($1)" exit 1 else RSTART=${1%%-*} REND=${1##*-} while [ "${RSTART:=1}" -le "${REND:=0}" ] ; do TRACKQUEUE="$TRACKQUEUE $RSTART" RSTART=$(( $RSTART + 1 )) done fi shift done fi # List of valid actions: cddb,read,normalize,encode,tag,move,playlist,clean # List of experimental actions: retag,transcode # Determine what actions are to be done from $ACTIONS and set the # following environment variables for them: DOCDDB=n DOREAD=n DONORMALIZE=n DOPREPROCESS=n DOENCODE=n DOPOSTPROCESS=n DOTAG=n DOMOVE=n DOREPLAYGAIN=n DOPLAYLIST=n DOCLEAN=n ## FIXME ## Lets keep compatibility with -M [ "$DOCUE" != "y" ] && DOCUE=n for ACTION in $(echo "$ACTIONS" | tr , \ ) do case $ACTION in default) DOCDDB=y; DOREAD=y; DOENCODE=y; DOTAG=y; DOMOVE=y; DOCLEAN=y;; cue) DOCUE=y ; MAKECUEFILE=y ;; cddb) DOCDDB=y;; read) DOREAD=y;; normalize) DONORMALIZE=y; DOREAD=y;; # preprocess) DOPREPROCESS=y; DOREAD=y;; encode) DOENCODE=y; DOREAD=y;; # postprocess) DOPREPROCESS=y; DOENCODE=y; DOREAD=y;; tag) DOTAG=y; DOREAD=y; DOENCODE=y; DOCDDB=y;; move) DOMOVE=y; DOTAG=y; DOREAD=y; DOENCODE=y; DOCDDB=y;; replaygain) DOCDDB=y; DOREAD=y; DOENCODE=y; DOTAG=y; DOMOVE=y; DOREPLAYGAIN=y;; playlist) DOCDDB=y; DOPLAYLIST=y;; clean) DOCLEAN=y;; getalbumart) GETALBUMART=y;; embedalbumart) GETALBUMART=y; EMBEDALBUMART=y;; esac done if [ "$DONORMALIZE" = "y" ] && [ "$DOREPLAYGAIN" = "y" ]; then # FIXME # should we abort on error or just inform the user? log warning "selected both normalize and replaygain actions" fi for SHOWCDDBFIELD in $(echo "$SHOWCDDBFIELDS" | tr , \ ); do case $SHOWCDDBFIELD in y*|Y*) SHOWCDDBYEAR="y";; g*|G*) SHOWCDDBGENRE="y";; *) ;; esac done # At this point a CDROM has to be defined, so we check it exists. if [ X"$CDROM" != "X" ] ; then if [ "$NEEDCDROMID" = "y" ] ; then if [ "$CDROMREADERSYNTAX" = "cdda2wav" ] || [ "$CDROMREADERSYNTAX" = "icedax" ]; then if [ "$OSFLAVOUR" = "IRIX" ]; then if [ -z "$CDROMID" ]; then CDROMID="$(echo "$CDROM" | sed -e 's;/dev/scsi/sc\([0-9]*\)d\([0-9]*\)l\([0-9]*\)$;\1,\2,\3;')" fi fi if ! echo "$CDROMID" | grep "^[0-9],[0-9],[0-9]$" >/dev/null 2>&1 ; then log error "CDROMID not in the right format for $CDROMREADERSYNTAX" log error "Use \"cdrecord -scanbus\" to obtain an adequate ID and set CDROMID accordingly" exit 1 fi fi elif [ ! -e "$CDROM" ] && [ X"$DOREAD" = "Xy" ]; then log error "CDROM device cannot be found." exit 1 fi # avoid processing if we are not going to hit the CDROM. elif [ X"$DOREAD" = "Xy" ]; then log error "CDROM has not been defined or cannot be found" exit 1 fi # USEPIPES pre-tests, before we get into more serious stuff # Not compatible with: # - multiple outputs # - normalize # - lowdisk algorithm # - anything else? if [ X"$USEPIPES" = "Xy" ]; then NUM_OUTPUT_TYPES="$(echo "$OUTPUTTYPE" | tr , \ | wc -w )" if [ "$NUM_OUTPUT_TYPES" -gt 1 ]; then log error "Unix pipes not compatible with multiple outputs" exit 1 fi if [ X"$DONORMALIZE" = "Xy" ]; then log error "Unix pipes not compatible with normalizer" # FIXME # Do we need to exit or shall we just disable the mode? exit 1 fi if [ X"$BATCHNORM" = "Xy" ]; then log error "Unix pipes not compatible with BATCHNORM encoding" exit 1 fi if [ X"$NOGAP" = "Xy" ]; then log error "Unix pipes not compatible with NOGAP encoding" exit 1 fi if [ X"$DOENCODE" = "Xn" ]; then vecho warning "Disabling Unix pipes since we are not encoding!" USEPIPES=n fi if [ X"$LOWDISK" = "Xy" ]; then log error "Unix pipes not compatible with lowdisk algorithm" exit 1 fi fi # LOWDISK pre-tests, before we get into more problematic stuff # Not compatible with anything that needs all the files in the hard disc: # - BATCHNORM # - NOGAP lame mode if [ X"$LOWDISK" = "Xy" ]; then if [ X"$BATCHNORM" = "Xy" ]; then log error "Unix pipes not compatible with BATCHNORM encoding" exit 1 fi if [ X"$NOGAP" = "Xy" ]; then log error "Unix pipes not compatible with NOGAP encoding" exit 1 fi fi # BATCHNORM pre-tests, before we get into serious problems # Not compatible with if [ "$BATCHNORM" = "y" ] && [ "$DONORMALIZE" = "n" ]; then vecho warning "Disabling BATCHNORM since we are not normalizing!" BATCHNORM=n fi # Check the encoding format from the ones available in the system, if nothing has been configured. if [ X"$OUTPUTTYPE" = "X" ]; then for DEFAULT_OUTPUT in $( echo "$DEFAULT_OUTPUT_BINARIES" | tr , \ ); do DEFAULT_OUTPUT_FORMAT="$(echo "$DEFAULT_OUTPUT" | cut -d ":" -f 1)" DEFAULT_OUTPUT_BINARY="$(echo "$DEFAULT_OUTPUT" | cut -d ":" -f 2)" if [ -x "$(which "$DEFAULT_OUTPUT_BINARY")" ] ; then OUTPUTTYPE=$DEFAULT_OUTPUT_FORMAT vecho "No default output type defined. Autoselecting $OUTPUTTYPE..." >&2 break fi done if [ X"$OUTPUTTYPE" = "X" ]; then log error "no encoder found in the PATH" log error "hints: are all dependencies installed? has the \$PATH been modified?" exit 1 fi fi # Decide which CDROM reader we're gonna use case "$CDROMREADERSYNTAX" in cdparanoia|debug) CDROMREADER="$CDPARANOIA" CDROMREADEROPTS="$CDPARANOIAOPTS" ;; libcdio) # GNU's libcdio package will use cd-paranoia but I believe will be happy with # the standard cdparanoia options. If I am wrong this will need to be fixed :). CDROMREADER="$CD_PARANOIA" CDROMREADEROPTS="$CDPARANOIAOPTS" ;; cdda2wav | icedax) CDROMREADER="$CDDA2WAV" CDROMREADEROPTS="$CDDA2WAVOPTS" ;; dagrab) CDROMREADER="$DAGRAB" CDROMREADEROPTS="$DAGRABOPTS" ;; pird) CDROMREADER="$PIRD" CDROMREADEROPTS="$PIRDOPTS" ;; cddafs) CDROMREADER="$CDDAFS" CDROMREADEROPTS="$CDDAFSOPTS" ;; flac) CDROMREADER="$FLAC" CDROMREADEROPTS="$FLACOPTS" ;; esac # There's only one normalize... case "$NORMALIZERSYNTAX" in default|normalize) NORMALIZER="$NORMALIZE" NORMALIZEROPTS="$NORMALIZEOPTS" ;; esac # Allow -o OUTPUT(1):OPTIONS(1),...,OUTPUT(N):OPTIONS(N) mode of operation case "$OUTPUTTYPE" in *:*) for OUTPUT in $(echo "$OUTPUTTYPE" | tr \ \|| tr , \ ); do OUTPUT="$(echo "$OUTPUT" | tr \| \ )" case "$OUTPUT" in vorbis:*|ogg:*) OGGENCODEROPTSCLI="$( echo $OUTPUT | cut -d: -f2- )" ;; opus:*) OPUSENCODEROPTSCLI="$( echo $OUTPUT | cut -d: -f2- )" ;; mka:*) MKAENCODEROPTSCLI="$( echo $OUTPUT | cut -d: -f2- )" ;; aiff:*) AIFFENCODEROPTSCLI="$( echo $OUTPUT | cut -d: -f2- )" ;; mp3:*) MP3ENCODEROPTSCLI="$( echo $OUTPUT | cut -d: -f2- )" ;; flac:*) FLACENCODEROPTSCLI="$( echo $OUTPUT | cut -d: -f2- )" ;; spx:*) SPEEXENCODEROPTSCLI="$( echo $OUTPUT | cut -d: -f2- )" ;; mpc:*) MPCENCODEROPTSCLI="$( echo $OUTPUT | cut -d: -f2- )" ;; wv:*) WVENCODEROPTSCLI="$( echo $OUTPUT | cut -d: -f2- )" ;; tta:*) TTAENCODEROPTSCLI="$( echo $OUTPUT | cut -d: -f2- )" ;; ape:*) APENCODEROPTSCLI="$( echo $OUTPUT | cut -d: -f2- )" ;; mp2:*) MP2ENCODEROPTSCLI="$( echo $OUTPUT | cut -d: -f2- )" ;; m4a:*|aac:*) AACENCODEROPTSCLI="$( echo $OUTPUT | cut -d: -f2- )" ;; esac done # Allows commandline selection of options while using multiple outputs. # Example: abcde -o 'flac:-8,mp3:-b 320' Patch by Matthias Andree. for OUTPUT in $(echo "$OUTPUTTYPE" | tr -d ' ' | tr , ' '); do TEMPOUTPUT=${OUTPUT%%:*} TEMPOUTPUTTYPE="${TEMPOUTPUTTYPE:+$TEMPOUTPUTTYPE,}$TEMPOUTPUT" done OUTPUTTYPE="$TEMPOUTPUTTYPE" ;; esac # If nothing has been specified, use oggenc for oggs and lame for mp3s and flac # for flacs and speexenc for speex and mpcenc for mpcs and fdkaac for m4as and # wavpack for wvs... # Getting ready for multiple output changes for OUTPUT in $(echo "$OUTPUTTYPE" | tr , \ ) do case $OUTPUT in vorbis|ogg) [ "$OGGENCODERSYNTAX" = "default" ] && OGGENCODERSYNTAX=oggenc [ "$DOTAG" = "y" ] && NEEDCOMMENTER=y [ "$DOREPLAYGAIN" = "y" ] && NEEDVORBISGAIN=y OGGOUTPUTCONTAINER=ogg ;; opus) [ "$OPUSENCODERSYNTAX" = "default" ] && OPUSENCODERSYNTAX=opusenc OPUSOUTPUTCONTAINER=opus ;; mka) [ "$MKAENCODERSYNTAX" = "default" ] && MKAENCODERSYNTAX=ffmpeg MKAOUTPUTCONTAINER=mka ;; aiff) [ "$AIFFENCODERSYNTAX" = "default" ] && AIFFENCODERSYNTAX=ffmpeg AIFFOUTPUTCONTAINER=aiff ;; mp3) [ "$MP3ENCODERSYNTAX" = "default" ] && MP3ENCODERSYNTAX=lame [ "$DOTAG" = "y" ] && NEEDTAGGER=y [ "$DOREPLAYGAIN" = "y" ] && NEEDMP3GAIN=y [ "$EMBEDALBUMART" = "y" ] && NEEDEYED3=y ;; flac) [ "$FLACENCODERSYNTAX" = "default" ] && FLACENCODERSYNTAX=flac [ "$DOTAG" = "y" ] && NEEDMETAFLAC=y [ "$DOREPLAYGAIN" = "y" ] && NEEDMETAFLAC=y [ "$ONETRACK" = "y" ] && [ "$DOCUE" = "y" ] && NEEDMETAFLAC=y [ "$EMBEDALBUMART" = "y" ] && NEEDMETAFLAC=y ;; spx) [ "$SPEEXENCODERSYNTAX" = "default" ] && SPEEXENCODERSYNTAX=speexenc # [ "$DOREPLAYGAIN" = "y" ] && ;; mpc) [ "$MPCENCODERSYNTAX" = "default" ] && MPCENCODERSYNTAX=mpcenc [ "$DOREPLAYGAIN" = "y" ] && NEEDMPCGAIN=y ;; wv) [ "$WVENCODERSYNTAX" = "default" ] && WVENCODERSYNTAX=wavpack [ "$DOTAG" = "y" ] [ "$DOREPLAYGAIN" = "y" ] && NEEDWVGAIN=y [ "$WVENCODERSYNTAX" = "ffmpeg" ] && DOREPLAYGAIN=n [ "$EMBEDALBUMART" = "y" ] && NEEDWVTAG=y ;; ape) [ "$APENCODERSYNTAX" = "default" ] && APENCODERSYNTAX=mac [ "$DOTAG" = "y" ] && NEEDAPETAG=y ;; mp2) [ "$MP2ENCODERSYNTAX" = "default" ] && MP2ENCODERSYNTAX=twolame [ "$DOTAG" = "y" ] && NEEDMID3V2=y [ "$MP2ENCODERSYNTAX" = "ffmpeg" ] && [ "$DOTAG" = "y" ] && NEEDMID3V2=y ;; tta) [ "$TTAENCODERSYNTAX" = "default" ] && TTAENCODERSYNTAX=tta [ "$DOTAG" = "y" ] && NEEDMID3V2=y [ "$TTAENCODERSYNTAX" = "ttaenc" ] && [ "$DOTAG" = "y" ] && NEEDMID3V2=y ;; aac) [ "$AACENCODERSYNTAX" = "default" ] && AACENCODERSYNTAX=faac [ "$DOTAG" = "n" ] # Neither Faac nor AtomicParsley can tag the .aac files which are used for faac # compiled without libmp4v2... Andrew. ;; m4a) [ "$AACENCODERSYNTAX" = "default" ] && AACENCODERSYNTAX=fdkaac [ "$AACENCODERSYNTAX" = "faac" ] && [ "$DOTAG" = "y" ] && CHECKFAACBUILD=y [ "$AACENCODERSYNTAX" = "neroAacEnc" ] && NEEDNEROAACTAG=y [ "$AACENCODERSYNTAX" = "qaac" ] && NEEDWINE=y [ "$AACENCODERSYNTAX" = "fhgaacenc" ] && NEEDWINE=y && NEEDATOMICPARSLEY=y [ "$AACENCODERSYNTAX" = "ffmpeg" ] && [ "$DOTAG" = "y" ] [ "$EMBEDALBUMART" = "y" ] && NEEDATOMICPARSLEY=y ;; wav) if [ "$KEEPWAVS" = "y" ]; then vecho "Setting the KEEPWAVS option, since the resulting wav files were requested..." fi KEEPWAVS=move ;; *) log error "Invalid OUTPUTTYPE defined" exit 1 ;; esac done # decide which encoder case "$MP3ENCODERSYNTAX" in lame) MP3ENCODEROPTS="${MP3ENCODEROPTSCLI:-$LAMEOPTS}" MP3ENCODER="$LAME" ;; gogo) MP3ENCODEROPTS="${MP3ENCODEROPTSCLI:-$GOGOOPTS}" MP3ENCODER="$GOGO" ;; bladeenc) MP3ENCODEROPTS="${MP3ENCODEROPTSCLI:-$BLADEENCOPTS}" MP3ENCODER="$BLADEENC" ;; l3enc) MP3ENCODEROPTS="${MP3ENCODEROPTSCLI:-$L3ENCOPTS}" MP3ENCODER="$L3ENC" ;; xingmp3enc) MP3ENCODEROPTS="${MP3ENCODEROPTSCLI:-$XINGMP3ENCOPTS}" MP3ENCODER="$XINGMP3ENC" ;; mp3enc) MP3ENCODEROPTS="${MP3ENCODEROPTSCLI:-$MP3ENCOPTS}" MP3ENCODER="$MP3ENC" ;; esac case "$OGGENCODERSYNTAX" in vorbize) OGGENCODEROPTS="${OGGENCODEROPTSCLI:-$VORBIZEOPTS}" OGGENCODER="$VORBIZE" ;; oggenc) OGGENCODEROPTS="${OGGENCODEROPTSCLI:-$OGGENCOPTS}" OGGENCODER="$OGGENC" ;; esac case "$OPUSENCODERSYNTAX" in opusenc) OPUSENCODEROPTS="${OPUSENCODEROPTSCLI:-$OPUSENCOPTS}" OPUSENCODER="$OPUSENC" ;; esac case "$MKAENCODERSYNTAX" in ffmpeg) MKAENCODEROPTS="${MKAENCODEROPTSCLI:-$FFMPEGENCOPTS}" MKAENCODER="$FFMPEG" ;; esac case "$AIFFENCODERSYNTAX" in ffmpeg) AIFFENCODEROPTS="${AIFFENCODEROPTSCLI:-$AIFFENCOPTS}" AIFFENCODER="$FFMPEG" ;; esac case "$FLACENCODERSYNTAX" in flac) FLACENCODEROPTS="${FLACENCODEROPTSCLI:-$FLACOPTS}" FLACENCODER="$FLAC" if [ "$DOREPLAYGAIN" = "y" ]; then FLACENCODEROPTS="${FLACENCODEROPTS} --replay-gain" fi # FLAC streams can be encapsulated on a Ogg transport layer if echo "$FLACENCODEROPTS" | grep -E -- "(^| )--ogg($| )" > /dev/null 2>&1 ;then log error "FLAC on an Ogg container is not yet supported" log error "due to problem with adding comments to such files" exit 1 FLACOUTPUTCONTAINER=ogg else FLACOUTPUTCONTAINER=flac fi ;; esac case "$SPEEXENCODERSYNTAX" in speexenc) SPEEXENCODEROPTS="${SPEEXENCODEROPTSCLI:-$SPEEXENCOPTS}" SPEEXENCODER="$SPEEXENC" ;; esac case "$MPCENCODERSYNTAX" in mpcenc) MPCENCODEROPTS="${MPCENCODEROPTSCLI:-$MPCENCOPTS}" MPCENCODER="$MPCENC" ;; esac case "$WVENCODERSYNTAX" in wavpack) # Syntax changed slightly between abcde 2.7 and abcde 2.7.1, # and in the interests of backward compatibility: if [ -z "$WAVPACKENCOPTS" ] && [ -n "$WVENCOPTS" ]; then WVENCODEROPTS="${WVENCODEROPTSCLI:-$WVENCOPTS}" WVENCODER="$WAVPACK" else WVENCODEROPTS="${WVENCODEROPTSCLI:-$WAVPACKENCOPTS}" WVENCODER="$WAVPACK" fi ;; ffmpeg) WVENCODEROPTS="${WVENCODEROPTSCLI:-$FFMPEGENCOPTS}" WVENCODER="$FFMPEG" ;; esac case "$TTAENCODERSYNTAX" in tta) TTAENCODEROPTS="${TTAENCODEROPTSCLI:-$TTAENCOPTS}" TTAENCODER="$TTA" ;; ttaenc) TTAENCODEROPTS="${TTAENCODEROPTSCLI:-$TTAENCOPTS}" TTAENCODER="$TTAENC" ;; esac case "$APENCODERSYNTAX" in mac) APENCODEROPTS="${APENCODEROPTSCLI:-$APENCOPTS}" APENCODER="$APENC" ;; esac case "$MP2ENCODERSYNTAX" in twolame) MP2ENCODEROPTS="${MP2ENCODEROPTSCLI:-$TWOLAMENCOPTS}" MP2ENCODER="$TWOLAME" ;; ffmpeg) MP2ENCODEROPTS="${MP2ENCODEROPTSCLI:-$FFMPEGENCOPTS}" MP2ENCODER="$FFMPEG" ;; esac case "$AACENCODERSYNTAX" in # Some elaborate 'if' work to keep backward compatibility for those # who don't realise that AACENCOPTS does not work with abcde from # version 2.7 onwards. faac) if [ -z "$FAACENCOPTS" ] && [ -n "$AACENCOPTS" ]; then AACENCODEROPTS="${AACENCODEROPTSCLI:-$AACENCOPTS}" AACENCODER="$FAAC" else AACENCODEROPTS="${AACENCODEROPTSCLI:-$FAACENCOPTS}" AACENCODER="$FAAC" fi ;; neroAacEnc) if [ -z "$NEROAACENCOPTS" ] && [ -n "$AACENCOPTS" ]; then AACENCODEROPTS="${AACENCODEROPTSCLI:-$AACENCOPTS}" AACENCODER="$NEROAACENC" else AACENCODEROPTS="${AACENCODEROPTSCLI:-$NEROAACENCOPTS}" AACENCODER="$NEROAACENC" fi ;; fdkaac) if [ -z "$FDKAACENCOPTS" ] && [ -n "$AACENCOPTS" ]; then AACENCODEROPTS="${AACENCODEROPTSCLI:-$AACENCOPTS}" AACENCODER="$FDKAAC" else AACENCODEROPTS="${AACENCODEROPTSCLI:-$FDKAACENCOPTS}" AACENCODER="$FDKAAC" fi ;; qaac) if [ -z "$QAACENCOPTS" ] && [ -n "$AACENCOPTS" ]; then AACENCODEROPTS="${AACENCODEROPTSCLI:-$AACENCOPTS}" AACENCODER="$QAAC" else AACENCODEROPTS="${AACENCODEROPTSCLI:-$QAACENCOPTS}" AACENCODER="$QAAC" fi ;; fhgaacenc) if [ -z "$FHGAACENCOPTS" ] && [ -n "$AACENCOPTS" ]; then AACENCODEROPTS="${AACENCODEROPTSCLI:-$AACENCOPTS}" AACENCODER="$FHGAACENC" else AACENCODEROPTS="${AACENCODEROPTSCLI:-$FHGAACENCOPTS}" AACENCODER="$FHGAACENC" fi ;; ffmpeg) if [ -z "$FFMPEGENCOPTS" ] && [ -n "$AACENCOPTS" ]; then AACENCODEROPTS="${AACENCODEROPTSCLI:-$AACENCOPTS}" AACENCODER="$FFMPEG" else AACENCODEROPTS="${AACENCODEROPTSCLI:-$FFMPEGENCOPTS}" AACENCODER="$FFMPEG" fi ;; esac # and which tagger case "$ID3TAGV" in id3v1) TAGGER="$ID3" ID3SYNTAX=id3 TAGGEROPTS="$ID3OPTS" ;; id3v2.3) TAGGER="$ID3V2" ID3SYNTAX=id3v2 TAGGEROPTS="$ID3V2OPTS" ;; id3tag) TAGGER="$ID3TAG" ID3SYNTAX=id3tag TAGGEROPTS="$ID3TAGOPTS" ;; id3v2.4) TAGGER="$EYED3" # Note that eyeD3 is set to tag in utf-16 (below). This causes # trouble with CDDBPROTO=5 (which we test here) but also # with cached cddb files in latin1 (which we cannot test). if [ "$CDDBPROTO" -lt 6 ]; then log warning "You cannot have id3v2.4 tags encoded in latin1. Setting CDDBPROTO to 6 for now." CDDBPROTO=6 fi # eyeD3 version 0.7 changed syntax if $EYED3 --help 2>&1 | grep -q -- --set-encoding ; then # only if it offers the --set-encoding, assume <= 0.6.x ID3SYNTAX=eyed3_06 TAGGEROPTS="--set-encoding utf16-LE $EYED3OPTS" else # anything wrong, any failure, assume >= 0.7 ID3SYNTAX=eyed3 TAGGEROPTS="--encoding utf16 $EYED3OPTS" fi ;; *) log error "Error: ID3TAGV must be either \"id3v1\", \"id3v2.3\" or \"id3v2.4\"" exit 1 ;; esac # NOGAP is specific to lame. Other encoders fail ... if [ "$NOGAP" = "y" ] && [ ! "$MP3ENCODER" = "lame" ]; then log warning "the NOGAP option is specific to lame. Deactivating..." NOGAP=n fi # Options for mkcue case "$CUEREADERSYNTAX" in default|mkcue) CUEREADEROPTS="${CDROM}" CUEREADER="$MKCUE" ;; abcde.mkcue) CUEREADEROPTS="$MKCUEOPTS ${CDROM}" CUEREADER="$MKCUE" ;; esac # which information retrieval tool are we using? case "$CDDBTOOL" in cddb) ;; musicbrainz) ;; esac # Check if both OGGEOUTPUTCONTAINER and FLACOUTPUTCONTAINER are the same, and differentiante them if [ X"$OGGOUTPUTCONTAINER" = "Xogg" ] && [ X"$FLACOUTPUTCONTAINER" = "Xogg" ]; then log error "FLAC on an Ogg container is not yet supported" log error "due to problem with adding comments to such files" exit 1 OGGOUTPUTCONTAINER=ogg.ogg FLACOUTPUTCONTAINER=flac.ogg vecho warning "modified file endings due to conflicting transport" vecho warning "layers in Ogg/Vorbis and Ogg/FLAC" fi # Clean up nice options (either use '-n NICELEVEL or -NICELEVEL') if [ "$ENCNICE" ]; then ENCNICE="-n $ENCNICE" fi if [ "$READNICE" ]; then READNICE="-n $READNICE" fi if [ "$DISTMP3NICE" ]; then DISTMP3NICE="-n $DISTMP3NICE" fi # Don't check for stuff if it's not needed if [ "$REMOTEHOSTS" ]; then NEEDDISTMP3=y fi if [ "$DONORMALIZE" = "y" ]; then NEEDNORMALIZER=y fi if [ "$EJECTCD" = "y" ]; then NEEDEJECT=y fi if [ ! "$CDDBAVAIL" = "n" ] && [ "$DOCDDB" = "y" ]; then # Need an http tool to be able to do CDDB case $CDDBMETHOD in *cddb*) NEEDHTTPGET=y;; esac fi if [ "$DOCUE" = "y" ]; then NEEDCUEREADER=y fi if [ X"$CDSPEEDVALUE" != "X" ] && [ "$DOREAD" = "y" ]; then case "$CDROMREADERSYNTAX" in cdparanoia|libcdio|debug) CDROMREADEROPTS="$CDPARANOIAOPTS -S $CDSPEEDVALUE" ;; pird) CDROMREADEROPTS="$PIRDOPTS -s $CDSPEEDVALUE" ;; ### FIXME ### translate "cue2discid" from python to bash flac) NEEDMETAFLAC=y ; NEEDCUE2DISCID=y ; CDSPEEDVALUE="" ;; *) NEEDCDSPEED=y ;; esac fi if [ "$GETALBUMART" = "y" ]; then NEEDHTTPGET="y" NEEDGLYRC="y" fi ###USEPIPESSUPPORT### # Rippers with USEPIPE support PIPERIPPER_cdparanoia="-" PIPERIPPER_libcdio="-" # Note that by default in abcde cdda2wav redirects to icedax. PIPERIPPER_cdda2wav="-" PIPERIPPER_debug="-" PIPERIPPER_flac="-c " PIPERIPPER_pird="-" # Encoders with USEPIPE support PIPE_mp3enc="-sti" PIPE_lame="-" PIPE_bladeenc="stdin" PIPE_oggenc="-" PIPE_opusenc="-" PIPE_flac="-" PIPE_speexenc="-" PIPE_mpcenc="-" PIPE_wavpack="-" PIPE_faac="-" PIPE_qaac="-" PIPE_fhgaacenc="-" PIPE_ffmpeg="-" PIPE_tta="-" PIPE_ttaenc="-" # Both neroAacEnc and fdkaac seem to manage without the addition of # the 'ignorelength' option in PIPE_$AACENCODERSYNTAX when piping # in this manner. Andrew. PIPE_neroAacEnc="-" PIPE_fdkaac="-" # Figure out if we can use pipes with the ripper/encoder combination # exit otherwise if [ "$USEPIPES" = "y" ]; then PIPERIPPERSVARCHECK="PIPERIPPER_${CDROMREADERSYNTAX}" case "$OUTPUT" in mp3) PIPEENCODERSVARCHECK="PIPE_$MP3ENCODERSYNTAX" ;; vorbis|ogg) PIPEENCODERSVARCHECK="PIPE_$OGGENCODERSYNTAX" ;; opus) PIPEENCODERSVARCHECK="PIPE_$OPUSENCODERSYNTAX" ;; mka) PIPEENCODERSVARCHECK="PIPE_$MKAENCODERSYNTAX" ;; aiff) PIPEENCODERSVARCHECK="PIPE_$AIFFENCODERSYNTAX" ;; flac) PIPEENCODERSVARCHECK="PIPE_$FLACENCODERSYNTAX" ;; spx) PIPEENCODERSVARCHECK="PIPE_$SPEEXENCODERSYNTAX" ;; mpc) PIPEENCODERSVARCHECK="PIPE_$MPCENCODERSYNTAX" ;; wv) PIPEENCODERSVARCHECK="PIPE_$WVENCODERSYNTAX" ;; tta) PIPEENCODERSVARCHECK="PIPE_$TTAENCODERSYNTAX" ;; m4a) PIPEENCODERSVARCHECK="PIPE_$AACENCODERSYNTAX" ;; aac) PIPEENCODERSVARCHECK="PIPE_$AACENCODERSYNTAX" ;; esac decho "PIPERIPPERSVARCHECK: $( eval echo "\$$PIPERIPPERSVARCHECK" )" if [ "$( eval echo "\$$PIPERIPPERSVARCHECK" )" = "$" ] || \ [ "$( eval echo "\$$PIPERIPPERSVARCHECK" )" = "" ] ; then log error "no support for pipes with given ripper" log error "read the FAQ file from the source tarball to get help." exit 1; fi decho "PIPEENCODERSVARCHECK: $( eval echo "\$$PIPEENCODERSVARCHECK" )" if [ "$( eval echo "\$$PIPEENCODERSVARCHECK" )" = "$" ] || \ [ "$( eval echo "\$$PIPEENCODERSVARCHECK" )" = "" ] ; then log error "no support for pipes with given encoder" log error "read the FAQ file from the source tarball to get help" exit 1; fi fi # Make sure a buncha things exist for X in $CDROMREADER $CDDISCID ${NEEDTAGGER+$TAGGER} $MP3ENCODER \ $OGGENCODER $OPUSENCODER $MKAENCODER $FLACENCODER $SPEEXENCODER $MPCENCODER \ $AACENCODER $WVENCODER $CDDBTOOL $APENCODER $MP2ENCODER $TTAENCODER $AIFFENCODER \ ${NEEDHTTPGET+$HTTPGET} ${NEEDDISTMP3+$DISTMP3} \ ${NEEDCOMMENTER+$VORBISCOMMENT} ${NEEDMETAFLAC+$METAFLAC} \ ${NEEDNORMALIZER+$NORMALIZER} ${NEEDEJECT+$EJECT} \ ${NEEDDISKUTIL+diskutil} ${NEEDCDSPEED+$CDSPEED} \ ${NEEDVORBISGAIN+$VORBISGAIN} ${NEEDMP3GAIN+$MP3GAIN} \ ${NEEDMPCGAIN+$MPCGAIN} ${NEEDCUEREADER+$CUEREADER} \ ${NEEDWVGAIN+WVGAIN} ${NEEDAPETAG+$APETAG} \ ${NEEDCUE2DISCID+$CUE2DISCID} ${NEEDNEROAACTAG+$NEROAACTAG} \ ${NEEDGLYRC+$GLYRC} ${NEEDWINE+$WINE} ${NEEDATOMICPARSLEY+$ATOMICPARSLEY} \ ${NEEDMID3V2+$MID3V2} ${NEEDEYED3+$EYED3} ${NEEDWVTAG+$WVTAG} do checkexec "$X" done # Under Debian and Ubuntu faac is compiled without libmp4v2 which means no support # for the mp4 container and no tagging capability. (AtomicParsley also cannot tag # these files). The resulting files are actually ADTS streams which belong in an # aac container and with some version sniffing this is all cleaned up below. If # faac is compiled with libmp4v2 inline tagging occurs with faac. # FIXME: Should this be in this location? (Better incorporated into the checks above.) if [ "$CHECKFAACBUILD" = "y" ] && [ "$AACENCODERSYNTAX" = "faac" ] ; then if faac --help 2>&1 | grep -q -F 'MP4 support unavailable.'; then echo "WARNING: Your copy of Faac does not have mp4 support" echo "WARNING: Encoding untagged files to aac..." # Replace m4a with aac for single and multi-output encodes: OUTPUTTYPE=$(echo "$OUTPUTTYPE" | sed 's/m4a/aac/') else echo "Using Faac to Tag AAC Tracks..." fi fi # And last but not least, check if we can diff between files. We do not abort, # since diffing is not critical... if [ -x "$(which "$DIFF")" ]; then :; else vecho warning "Disabling diff since we cannot find it in the \$PATH..." DIFF="" fi ## Now that we have metaflac, check if we need cue2discid #case $CDROMREADERSYNTAX in # flac) # CDDBTRACKINFO=$($METAFLAC --show-tag=CDDB $CDROM | cut -d"=" -f2 | grep -E "[a-f0-9]{8}") # if [ "$CDDBTRACKINFO" = "" ]; then # checkexec ${NEEDCUE2DISCID+$CUE2DISCID} # fi # ;; #esac CDROMREADER="$CDROMREADER $CDROMREADEROPTS" CDDBTOOL="$CDDBTOOL $CDDBTOOLOPTS" HTTPGET="$HTTPGET $HTTPGETOPTS" # Here it used to say: # One thousand lines in, we can start doing stuff with things # Well, right now we are at line 3737 ;) # Hey, for grins, as of 2016-08-30 this is now line 4814! -GR # Export needed things so they can be read in this subshell export CDDBTOOL # Path and options for the tool to query CDDB export ABCDETEMPDIR # Path to the tmpdir for this rip export TRACKQUEUE # 0-padded list of tracks to be processed export LOWDISK # Are we using the low-diskspace algorithm? export EJECTCD # Should we eject the CD when we're finished ripping? export EJECT # The commend to use to eject the CD, if we have one export EJECTOPTS # Options to that command export CDROM # Device path for the CD device export CDDBDATA # The filename we're using for CD lookup data export REMOTEHOSTS # List of remote hosts for parallel encoding, if given export MAXPROCS # The number of *local* encodes to do in parallel export HTTPGET # Program to use to grab files via http export MD5SUM # Program to calculate MD5 checksums if [ "$DOREAD" = "y" ]; then # User-definable function to set some things. Use it for # - closing the CD tray with eject -t # - set the CD speed value with eject -x vecho -n "Executing customizable pre-read function... " pre_read # Execute the user-defined pre-read function. Close the CD with it. vecho "done." fi # Get ABCDETEMPDIR created and status file initialized do_discid if [ "$DOCDDB" = "y" ]; then # start with a sane default: CDDBLOCALSTATUS=notfound if [ $CDDBUSELOCAL = "y" ]; then do_localcddb_read fi if checkstatus cddb-choice > /dev/null; then : else NUM_CDDB_MATCHES=0 if [ "$CDDBLOCALSTATUS" = "notfound" ] ; then idx=0 for CDDBMETHCHOICE in $(echo "$CDDBMETHOD" | tr -d ' ' | tr , ' ') do addstatus "Lookup method $idx: $CDDBMETHCHOICE" idx=$(($idx + 1)) vecho "Found $NUM_CDDB_MATCHES matches so far" vecho "Trying lookup method ${CDDBMETHCHOICE}" # Run all the desired data acquisition methods, in the order # specified by the user. Each will use its own temporary # subdirectory, then copy the cddbread.* etc. files up into # ${ABCDETEMPDIR} case "$CDDBMETHCHOICE" in cddb) do_cddb_read ;; musicbrainz) do_musicbrainz_read ;; cdtext) do_cdtext_read ;; *) echo "Unknown lookup method $CDDBMETHCHOICE. Aborting." >&2 exit 1 ;; esac done rm -f "${ABCDETEMPDIR}/cddbchoices" CDDBDISCID=$(echo "$CDDBTRACKINFO" | cut -d' ' -f1) if [ $NUM_CDDB_MATCHES = 0 ]; then # If we got no matches, we need to # generate a blank CDDB template. vecho "Unable to find any matches, generating unknown template." echo "No lookup matches." >> "${ABCDETEMPDIR}/cddbchoices" $CDDBTOOL template $(cat "${ABCDETEMPDIR}/cddbdiscid") > "${ABCDETEMPDIR}/cddbread.0" echo "template" > "${ABCDETEMPDIR}/datasource.0" # List out disc title/author and contents of template echo ---- Unknown Artist / Unknown Album ---- >> "${ABCDETEMPDIR}/cddbchoices" UNKNOWNDISK=y for TRACK in $(f_seq_row 1 $TRACKS) do echo "$TRACK:" "$(grep -a ^TTITLE$(($TRACK - 1))= "${ABCDETEMPDIR}/cddbread.0" | cut -f2- -d= | tr -d \\r\\n)" >> "${ABCDETEMPDIR}/cddbchoices" done echo >> "${ABCDETEMPDIR}/cddbchoices" echo cddb-read-0-complete >> "${ABCDETEMPDIR}/status" echo cddb-choice=0 >> "${ABCDETEMPDIR}/status" echo 503 > "${ABCDETEMPDIR}/cddbquery" else # We have matches; create the cddbchoices and cddbquery # files from all the inputs we have if [ $NUM_CDDB_MATCHES = 1 ]; then echo "Retrieved 1 match..." >> "${ABCDETEMPDIR}/cddbchoices" echo -n "200 " > "${ABCDETEMPDIR}/cddbquery" cat "${ABCDETEMPDIR}/cddbquery.1" >> "${ABCDETEMPDIR}/cddbquery" else echo "Retrieved $NUM_CDDB_MATCHES matches..." >> "${ABCDETEMPDIR}/cddbchoices" echo "210 Found exact matches, list follows (until terminating .)" > "${ABCDETEMPDIR}/cddbquery" for X in $(f_seq_row 1 $NUM_CDDB_MATCHES) do cat "${ABCDETEMPDIR}/cddbquery.$X" >> "${ABCDETEMPDIR}/cddbquery" done echo "." >> "${ABCDETEMPDIR}/cddbquery" fi for X in $(f_seq_row 1 $NUM_CDDB_MATCHES) do ATITLE=$(grep -a -e '^DTITLE=' "${ABCDETEMPDIR}/cddbread.$X" | cut -c8- | tr -d \\r\\n) SOURCE=$(cat "${ABCDETEMPDIR}/datasource.$X") echo "#$X ($SOURCE): ---- ${ATITLE} ----" >> "${ABCDETEMPDIR}/cddbchoices" for TRACK in $(f_seq_row 1 $TRACKS) do echo "$TRACK:" "$(grep -a ^TTITLE$(($TRACK - 1))= "${ABCDETEMPDIR}/cddbread.$X" | cut -f2- -d= | tr -d \\r\\n)" >> "${ABCDETEMPDIR}/cddbchoices" done echo >> "${ABCDETEMPDIR}/cddbchoices" done fi fi fi do_cddbedit eval "$($CDDBTOOL parse "$CDDBDATA")" fi # Before reading tracks, we set the speed of the device if [ X"$CDSPEEDVALUE" != "X" ]; then case "$CDROMREADERSYNTAX" in cdparanoia|libcdio|debug) ;; pird) ;; flac) ;; *) do_cdspeed ;; esac fi # Define the first and last track, since we might need them later in several places FIRSTTRACK=$( get_first $TRACKQUEUE ) LASTTRACK=$( get_last $TRACKQUEUE ) if [ -f "${ABCDETEMPDIR}/status" ] && [ X"$ERASEENCODEDSTATUS" = "Xy" ]; then mv "${ABCDETEMPDIR}/status" "${ABCDETEMPDIR}/status.old" grep -v ^encodetracklocation- < "${ABCDETEMPDIR}/status.old" \ | grep -v ^encode-output > "${ABCDETEMPDIR}/status" fi if checkstatus onetrack ; then ONETRACK=y ; fi if [ "$ONETRACK" = "y" ]; then # Reuse the CUEFILE in case we created it (now or in a previous run) if CUEFILE=$(checkstatus cuefile); then IMPORTCUESHEET=y fi fi # Create playlist if needed (backgroundable) and start reading in tracks ( if [ ! "$ONETRACK" = "y" ]; then if [ "$DOPLAYLIST" = "y" ]; then echo Creating playlist... >&2 do_playlist fi fi if [ "$GETALBUMART" = "y" ]; then do_getalbumart fi # For the lowdisk option, only one program is running at once so the encoder # can be unsilenced right away. if [ "$LOWDISK" = "y" ] || [ "$ONETRACK" = "y" ]; then echo "encode-output=loud" >> "${ABCDETEMPDIR}/status" fi if [ "$ONETRACK" = "y" ]; then TRACKS=$FIRSTTRACK if [ "$USEPIPES" = "y" ]; then if checkstatus "readencodetrack-$FIRSTTRACK"; then :; else do_cdread onetrack $FIRSTTRACK $LASTTRACK | do_encode $FIRSTTRACK %local0% > /dev/null 2>&1 fi else if checkstatus "readtrack-$FIRSTTRACK"; then :; else do_cdread onetrack $FIRSTTRACK $LASTTRACK fi fi else for UTRACKNUM in $TRACKQUEUE do if [ "$DOREAD" = "y" ]; then if [ "$USEPIPES" = "y" ]; then if checkstatus "readencodetrack-$UTRACKNUM"; then :; else # Read, pipe, shut up! do_cdread $UTRACKNUM | do_encode $UTRACKNUM %local0% > /dev/null 2>&1 fi else if checkstatus "readtrack-$UTRACKNUM"; then :; else do_cdread $UTRACKNUM fi if [ "$?" != "0" ]; then # CD read failed - don't give the goahead to # the encoder echo NO exit fi fi fi if [ "$NOGAP" = "y" ] || [ "$BATCHNORM" = "y" ]; then : else # If we are not reading, set the encode output to loud already, so # that we can see the output of the first track. if [ "$MAXPROCS" = "1" ] && [ ! "$DOREAD" = "y" ]; then echo "encode-output=loud" >> "${ABCDETEMPDIR}/status" fi echo NEXTTRACK # Get the encoder machine churning again if [ "$DOREAD" = "y" ]; then if [ "$LOWDISK" = "y" ] && [ "$DOENCODE" = "y" ]; then until checkstatus "encodetrack-$UTRACKNUM" do if checkerrors "encodetrack-$UTRACKNUM"; then break fi sleep 2 done fi fi fi done fi # Now that we're done the encoding can be loud again - # if we're not using SMP. if [ "$MAXPROCS" = "1" ]; then echo "encode-output=loud" >> "${ABCDETEMPDIR}/status" fi # All tracks read, start encoding. if [ "$NOGAP" = "y" ] || [ "$BATCHNORM" = "y" ] || [ "$ONETRACK" = "y" ]; then echo NEXTTRACK fi # Execute the user-defined post_read function before ejecting CD post_read # We are now finished with the cdrom - it can be safely ejected. Note that # abcde will not have completed yet. if [ "$EJECTCD" = "y" ]; then # We check if the disk we are processing is actually the disk inside the # CD tray. If not, we do not eject the CD, since it might be so that the # user ejected it manually. #CURRENTTRACKINFO=$($CDDISCID $CDROM) #if if [ "$?" != "1" ] && [ "$CURRENTTRACKINFO" = "$CDDBTRACKINFO" ] ; then # More FreeBSD bits. if [ X"$UNAME" = X"FreeBSD" ] ; then # FreeBSD eject uses the EJECT environment variable to name the CDROM # but in this script EJECT is in the envionment and names the program eject=$EJECT unset EJECT # The FreeBSD eject needs "adc0" not "/dev/adc0c" cd="$(echo "$CDROM" | sed -e 's=.*/==;s=[a-h]$==;')" $eject $EJECTOPTS $cd elif [ X"$UNAME" = X"Darwin" ] ; then diskutil eject "${CDROM#/dev/}" 0 elif [ -x "$(which "$EJECT")" ]; then $EJECT $EJECTOPTS "$CDROM" fi #fi fi ) | ( ## Do we need to pre-process #if [ x"$PREPROCESS" = "x" ] ; then # cat #else # for PRETRACKNUM in $TRACKQUEUE # do # read GOAHEAD # if [ "$GOAHEAD" = "NO" ]; then break; fi # PREPROCEED= # until [ $PREPROCEED ] # do # if checkstatus "readtrack-$PRETRACKNUM"; then PREPROCEED=y; break; fi # # all locations are working, wait and try again later # if [ ! $PREPROCEED ]; then sleep 3; fi # done # ( do_preprocess $PRETRACKNUM # echo "NEXTTRACK" # ) & # done #fi # #) | ( # In BATCHNORM and/or NOGAP modes, we want all tracks to be read first. #BACK if [ "$BATCHNORM" = "y" ] || [ "$NOGAP" = "y" ]; then read GOAHEAD # For blocking - will contain either "NO" or "NEXTTRACK" if [ "$GOAHEAD" != "NO" ]; then for LASTTRACK in $TRACKQUEUE; do :; done if checkstatus "readtrack-$LASTTRACK"; then if [ "$DONORMALIZE" = "y" ] && [ "$BATCHNORM" = "y" ]; then if checkstatus "normalizetrack-$LASTTRACK"; then :; else do_batch_normalize; fi if checkerrors batch-normalize; then exit 1; fi fi if [ "$DOENCODE" = "y" ] && [ "$NOGAP" = "y" ]; then if [ "$DONORMALIZE" = "y" ]; then for UTRACKNUM in $TRACKQUEUE do if checkstatus "readtrack-$UTRACKNUM"; then if checkstatus "normalizetrack-$UTRACKNUM"; then :; else do_normalize "$UTRACKNUM"; fi fi done fi if checkstatus "encodetrack-$LASTTRACK"; then :; else do_nogap_encode; fi if checkerrors nogap-encode; then exit 1; fi fi fi fi fi # If we are using ONETRACK, we can proceed with the normal encoding using just the $FIRSTTRACK as TRACKQUEUE if [ "$ONETRACK" = "y" ] ; then TRACKQUEUE="$FIRSTTRACK" TRACKS="$FIRSTTRACK" fi # Do the encoding, including parallelization of remote encoding # Figure out where each track is going to be encoded ENCODELOCATIONS="$(echo "$REMOTEHOSTS" | tr , ' ')" if [ "$MAXPROCS" != "0" ]; then for NUM in $(f_seq_row 1 $MAXPROCS) do ENCODELOCATIONS="$ENCODELOCATIONS %local$NUM%" done fi # Strip whitespace ENCODELOCATIONS=$(echo $ENCODELOCATIONS) for UTRACKNUM in $TRACKQUEUE do # Wait for our cue read GOAHEAD # For blocking - will contain either "NO" or "NEXTTRACK" if [ "$GOAHEAD" = "NO" ]; then break; fi # find out where this track is to be encoded if [ "$DOENCODE" = "y" ] && [ "$USEPIPES" != "y" ]; then # Make sure we have a place to encode this, if not, exit stage right if [ -z "$ENCODELOCATIONS" ]; then continue fi PROCEED= until [ $PROCEED ] do for LOCATION in $ENCODELOCATIONS do PREVIOUSTRACK="$(checkstatus "encodetracklocation-$LOCATION")" # check first if a track has ever been assigned to this location if [ -z "$PREVIOUSTRACK" ]; then PROCEED=y; break; fi # If it errored out, rebuild $ENCODELOCATIONS without this location in it if checkerrors "encodetrack-$PREVIOUSTRACK"; then for TEMPLOCATION in $ENCODELOCATIONS do if [ "$TEMPLOCATION" != "$LOCATION" ]; then TEMPENCODELOCATIONS="$TEMPENCODELOCATIONS $TEMPLOCATION" fi done ENCODELOCATIONS=$(echo $TEMPENCODELOCATIONS) ABORT=y PROCEED=y break fi # We're still here, this location must have been previously assigned, # and last completed without error - check if it's done with the # previous track yet if checkstatus "encodetrack-$PREVIOUSTRACK"; then PROCEED=y; break; fi done # all locations are working, wait and try again later if [ ! "$PROCEED" ]; then sleep 3; fi done # Record the location we're about to encode the next track at echo "encodetracklocation-$LOCATION=$UTRACKNUM" >> "${ABCDETEMPDIR}/status" fi # Don't proceed with the rest of the loop if we can't encode if [ "$ABORT" ]; then continue; fi ## FIXME ## Add here ## run_command "tagtrack-$OUTPUT-$1" $METAFLAC $METAFLACOPTS ${IMPORTCUESHEET:+--import-cuesheet-from="${ABCDETEMPDIR}/$CUEFILE"} --import-tags-from=- "${ABCDETEMPDIR}/track$1.$FLACOUTPUTCONTAINER" # Set TRACKNUM, TRACKNAME if [ -e "$CDDBDATA" ]; then if [ "$ONETRACK" = "y" ]; then TRACKNAME="$DALBUM" TRACKNUM="$FIRSTTRACK" splitvarious else TRACKNUM="$UTRACKNUM" CDDBTRACKNUM=$(expr $UTRACKNUM - 1) # Unpad getcddbinfo TRACKNAME splitvarious fi fi # You can't encode a file which needs to be normalized before finishing # You can't tag a file before it's finished encoding - # thus all of this is backgrounded together ( if [ "$DONORMALIZE" = "y" ]; then if checkstatus "readtrack-$UTRACKNUM"; then if checkstatus "normalizetrack-$UTRACKNUM"; then :; else do_normalize "$UTRACKNUM"; fi fi fi if [ "$DOENCODE" = "y" ] && [ "$USEPIPES" != "y" ]; then if checkstatus "readtrack-$UTRACKNUM"; then if [ "$DONORMALIZE" = "y" ]; then if checkstatus "normalizetrack-$UTRACKNUM"; then if checkstatus "encodetrack-$UTRACKNUM"; then :; else do_encode "$UTRACKNUM" "$LOCATION" "$OUTPUT"; fi fi else if checkstatus "encodetrack-$UTRACKNUM"; then :; else do_encode "$UTRACKNUM" "$LOCATION" "$OUTPUT"; fi fi fi fi if [ "$DOTAG" = "y" ]; then if checkstatus "encodetrack-$UTRACKNUM"; then if checkstatus "tagtrack-$UTRACKNUM"; then :; else do_tag "$UTRACKNUM"; fi fi # Lets tag the cue file if checkstatus cleancuefile >/dev/null; then :; else if checkstatus cuefile >/dev/null ; then do_cleancue fi fi fi if [ "$DOMOVE" = "y" ]; then if checkstatus "tagtrack-$UTRACKNUM"; then if checkstatus "movetrack-$UTRACKNUM"; then :; else do_move "$UTRACKNUM"; fi fi fi ) & done # Go through it again and make sure there's no distmp3 stragglers, otherwise # we'll delete the files they're working on # Do NOT play ball if there is no ball to play (so ABORT if needed) ## FIXME ## Check also for files which are encoded using PIPEs. if [ "$DOENCODE" = "y" ] && [ "$USEPIPES" != "y" ] && [ ! "$ABORT" ]; then PROCEED= until [ $PROCEED ] do PROCEED=y for LOCATION in $ENCODELOCATIONS do CHECKTRACK="$(checkstatus "encodetracklocation-$LOCATION")" # "How can he give us a status update, if he's DEAD?" if checkstatus "encodetrack-$CHECKTRACK"; then continue fi # Nothing to see here please go quietly back to your homes if [ -z "$CHECKTRACK" ]; then continue; fi # You're still here? Maybe there is something... if checkstatus "encodetrack-$CHECKTRACK"; then :; else PROCEED= ; break; fi done # hold up if [ ! $PROCEED ]; then sleep 5; fi done fi # If the above didn't catch the stragglers, this will wait if [ "$DOREPLAYGAIN" = "y" ]; then do_replaygain fi if [ "$EMBEDALBUMART" = "y" ]; then do_embedalbumart fi # Execute the user-defined post_encode function before cleaning up post_encode # Check to see if run_command logged any errors if [ -f "${ABCDETEMPDIR}/errors" ]; then log error "The following commands failed to run:" cat "${ABCDETEMPDIR}/errors" # Don't clean up DOCLEAN=n fi if [ "$KEEPWAVS" = "y" ];then # Don't clean up DOCLEAN=n fi # Check if we have moved all the formats we had previously encoded, if we are not using the FORCE. if [ "$DOCLEAN" = "y" ] && [ ! "$FORCE" = "y" ]; then ENCODED_FORMATS=$(grep -E "^encodetrack-(.{3,6})-(.{1,2})$" "${ABCDETEMPDIR}/status" | cut -d"-" -f2 | sort -u | tr '\n' '|') MOVED_FORMATS=$(grep -E "^movetrack-output-(.{3,6})$" "${ABCDETEMPDIR}/status" | cut -d"-" -f3 | sort -u | tr '\n' '|') if [ "$ENCODED_FORMATS" != "$MOVED_FORMATS" ]; then log warning "The encoded formats does not match with the moved ones" log warning "Formats encoded: $( echo "$ENCODED_FORMATS" | tr "|" " " )" log warning "Formats moved: $( echo "$MOVED_FORMATS" | tr "|" " " )" log warning "Use \"abcde -a clean -f -C ${CDDBDISCID}\" to force the removal of the remaining data." DOCLEAN=n fi fi if [ "$DOCLEAN" = "y" ]; then # Wipe all the evidence # Gimme gimme gimme some more time! sleep 5 rm -rf "${ABCDETEMPDIR}" echo "Finished." else echo "Finished. Not cleaning ${ABCDETEMPDIR}." fi ) exit 0 # b:is_bash # vim:tabstop=4 abcde-2.9.3/abcde-musicbrainz-tool000077500000000000000000000264111342626142700170610ustar00rootroot00000000000000#!/usr/bin/perl # Copyright (c) 2012-2018 Steve McIntyre <93sam@debian.org> # This code is hereby licensed for public consumption under either the # GNU GPL v2 or greater, or Larry Wall's Artistic license - your choice. # # 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., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # abcde-musicbrainz-tool # # Helper script for abcde to work with the MusicBrainz WS API (v2) use strict; use utf8; use POSIX qw(ceil); use Digest::SHA; use MusicBrainz::DiscID; use WebService::MusicBrainz 1.0.4; use Getopt::Long; use Pod::Usage; my $FRAMES_PER_S = 75; my ($device, $command, $discid, @discinfo, $workdir, $help, $man, $start); Getopt::Long::Configure ('no_ignore_case'); Getopt::Long::Configure ('no_auto_abbrev'); GetOptions ("device=s" => \$device, "command=s" => \$command, "discid=s" => \$discid, "discinfo=i{5,}" => \@discinfo, "workdir=s" => \$workdir, "start=s" => \$start, "help|h" => \$help, "man" => \$man) or pod2usage(-verbose => 0, -exitcode => 2); if (@ARGV) { print STDERR "Extraneous arguments given.\n"; pod2usage(-verbose => 0, -exitcode => 2); } pod2usage(-verbose => 1, -exitcode => 0) if $help; pod2usage(-verbose => 2, -exitcode => 0) if $man; # defaults if (!defined($device)) { $device = "/dev/cdrom"; } if (!defined($command)) { $command = "id"; } if (!defined($workdir)) { $workdir = "/tmp"; } if (!defined($start)) { $start = "0"; } sub calc_sha1($) { my $filename = shift; my $s = Digest::SHA->new(1); $s->addfile($filename); return $s->hexdigest; } if ($command =~ m/^id/) { my $disc = new MusicBrainz::DiscID($device); # read the disc in the default disc drive */ if ( $disc->read() == 0 ) { printf STDERR "Error: %s\n", $disc->error_msg(); exit(1); } printf("%s ", $disc->id()); printf("%d ", $disc->last_track_num() + 1 - $disc->first_track_num()); for ( my $i = $disc->first_track_num; $i <= $disc->last_track_num; $i++ ) { printf("%d ", $disc->track_offset($i)); } printf("%d\n", $disc->sectors() / $FRAMES_PER_S); undef $disc; } elsif ($command =~ m/data/) { if (!defined $discid or !$discid) { print STDERR "Discid undefined.\n"; exit(1); } my $ws = WebService::MusicBrainz->new(); my $response = $ws->search(discid => { discid => $discid, inc => ['artists', 'artist-credits', 'recordings'] }); if ($response->{'error'}) { print STDERR "MusicBrainz lookup returned an error \"$response->{'error'}\"\n"; exit(0); } my $releasenum = $start; my @sums; if ($response->{'releases'}) { my @releases = @{ $response->{'releases'} }; foreach my $release (@releases) { my $a_artist = ""; my $number_artists = @{ $release->{'artist-credit'}}; if ($number_artists > 0) { for (my $i = 0; $i < $number_artists; $i++) { if ($i > 0) { $a_artist = $a_artist . @{ $release->{'artist-credit'} }[$i-1]->{'joinphrase'}; } $a_artist = $a_artist . @{ $release->{'artist-credit'} }[$i]->{'name'}; } } my $va = 0; my $rel_year = ""; if ($a_artist =~ /Various Artists/) { $va = 1; } if ($release->{'release-events'}) { my @release_events = @{ $release->{'release-events'} }; if (@release_events > 0) { $rel_year = substr(@release_events[0]->{'date'},0,4); } } $releasenum++; open (OUT, "> $workdir/cddbread.$releasenum"); binmode OUT, ":utf8"; print OUT "# xmcd style database file\n"; print OUT "#\n"; print OUT "# Track frame offsets:\n"; my @offsets = @{ $response->{'offsets'}}; foreach my $offset (@offsets) { printf OUT "# %d\n", $offset; } # Locate the media that contains a disc with the discid we requested # initially. The API may return multiple media associated with the # release, including media with different discids my @mediums = grep { my @disks = @{ $_->{'discs'} }; grep { $_->{'id'} eq $discid } @disks; } @{ $release->{'media'} }; if (not @mediums) { # This release doesn't have a media with our requested dicsid # Shouldn't happen (?), skip it next; } # Only consider the first medium my $medium = @mediums[0]; my @tracks = @{ $medium->{'tracks'} }; my $total_len = 0; for (my $i = 0; $i < scalar(@tracks); $i++) { my $track = $tracks[$i]; $total_len += $track->{'length'}; } print OUT "#\n"; printf OUT "# Disc length: %d seconds\n", $total_len / 1000.0; print OUT "#\n"; print OUT "# Submitted via: XXXXXX\n"; print OUT "#\n"; print OUT "#blues,classical,country,data,folk,jazz,newage,reggae,rock,soundtrack,misc\n"; print OUT "#CATEGORY=none\n"; print OUT "DISCID=" . $discid . "\n"; print OUT "DTITLE=" . $a_artist. " / " . $release->{'title'} . "\n"; print OUT "DYEAR=" . $rel_year . "\n"; print OUT "DGENRE=\n"; for (my $i = 0; $i < scalar(@tracks); $i++) { my $track = $tracks[$i]; my $t_name = $track->{'title'}; my $number_artists = @{$track->{'recording'}->{'artist-credit'}}; if ($va and $number_artists > 0) { my $t_artist = ""; for (my $j = 0; $j < $number_artists; $j++) { if ($j > 0) { $t_artist = $t_artist . @{$track->{'recording'}->{'artist-credit'}}[$j-1]->{'joinphrase'}; } $t_artist = $t_artist . @{$track->{'recording'}->{'artist-credit'}}[$j]->{'name'}; } printf OUT "TTITLE%d=%s / %s\n", $i, $t_artist, $t_name; } else { printf OUT "TTITLE%d=%s\n", $i, $t_name; } } print OUT "EXTD=\n"; for (my $i = 0; $i < scalar(@tracks); $i++) { printf OUT "EXTT%d=\n", $i; } print OUT "PLAYORDER=\n"; print OUT ".\n"; close OUT; # save release mbid open (OUT, "> $workdir/mbid.$releasenum"); print OUT $release->{'id'}; close OUT; # save release asin open (OUT, "> $workdir/asin.$releasenum"); print OUT $release->{'asin'}; close OUT; # Check to see that this entry is unique; generate a checksum # and compare to any previous checksums my $checksum = calc_sha1("$workdir/cddbread.$releasenum"); foreach my $sum (@sums) { if ($checksum eq $sum) { unlink("$workdir/cddbread.$releasenum"); $releasenum--; last; } } push (@sums, $checksum); } } else { # No release events found - looks like we have a stub # entry. We can parse it, but it's going to be very # different. print STDERR "MusicBrainz lookup only returned a stub, trying to cope\n"; my $va = 0; my $a_artist = ""; my $a_title = ""; my $rel_year = ""; if ($response->{'artist'}) { $a_artist = $response->{'artist'}; } if ($response->{'title'}) { $a_title = $response->{'title'}; } if ($a_artist =~ /Various Artists/) { $va = 1; } $releasenum++; open (OUT, "> $workdir/cddbread.$releasenum"); binmode OUT, ":utf8"; print OUT "# xmcd style database file\n"; print OUT "#\n"; print OUT "# Musicbrainz stub entry - check carefully!\n"; print OUT "#\n"; my @tracks = @{ $response->{'tracks'} }; my $total_len = 0; for (my $i = 0; $i < scalar(@tracks); $i++) { my $track = $tracks[$i]; $total_len += $track->{'length'}; } printf OUT "# Disc length: %d seconds\n", $total_len / 1000.0; print OUT "#\n"; print OUT "# Submitted via: XXXXXX\n"; print OUT "#\n"; print OUT "#blues,classical,country,data,folk,jazz,newage,reggae,rock,soundtrack,misc\n"; print OUT "#CATEGORY=none\n"; print OUT "DISCID=" . $discid . "\n"; print OUT "DTITLE=" . $a_artist. " / " . $a_title . "\n"; print OUT "DYEAR=" . $rel_year . "\n"; print OUT "DGENRE=\n"; for (my $i = 0; $i < scalar(@tracks); $i++) { my $track = $tracks[$i]; my $t_name = $track->{'title'}; if ($va) { my $t_artist = $track->{'artist'}; printf OUT "TTITLE%d=%s / %s\n", $i, $t_artist, $t_name; } else { printf OUT "TTITLE%d=%s\n", $i, $t_name; } } print OUT "EXTD=\n"; for (my $i = 0; $i < scalar(@tracks); $i++) { printf OUT "EXTT%d=\n", $i; } print OUT "PLAYORDER=\n"; print OUT ".\n"; close OUT; # Check to see that this entry is unique; generate a checksum # and compare to any previous checksums my $checksum = calc_sha1("$workdir/cddbread.$releasenum"); foreach my $sum (@sums) { if ($checksum eq $sum) { unlink("$workdir/cddbread.$releasenum"); $releasenum--; last; } } push (@sums, $checksum); } } elsif ($command =~ m/calcid/) { # Calculate MusicBrainz ID from disc offsets; see # https://musicbrainz.org/doc/DiscIDCalculation if ($#discinfo < 5) { print STDERR "Insufficient or missing discinfo data.\n"; exit(1); } my ($first, $last, $leadin, $leadout, @offsets) = @discinfo; my $s = Digest::SHA->new(1); $s->add(sprintf "%02X", int($first)); $s->add(sprintf "%02X", int($last)); my @a; for (my $i = 0; $i < 100; $i++) { $a[$i] = 0; } my $i = 0; foreach my $o ($leadout, @offsets) { $a[$i++] = int($o) + int($leadin); } for (my $i = 0; $i < 100; $i++) { $s->add(sprintf "%08X", $a[$i]); } my $id = $s->b64digest; # CPAN Digest modules do not pad their Base64 output, so we have to do it. while (length($id) % 4) { $id .= '='; } $id =~ tr#+#.#; $id =~ tr#/#_#; $id =~ tr#=#-#; print $id; if (-t STDOUT) { print "\n"; } } else { print STDERR "Unknown command given.\n"; pod2usage(1); exit(1); } __END__ =head1 NAME abcde-musicbrainz-tool - Musicbrainz query tool =head1 SYNOPSIS abcde-musicbrainz-tool [options] Options: --command {id|data|calcid} mode of operation (default: id) --device read from CD-ROM device DEV (default: /dev/cdrom) --discid Disc ID to query with --command data. --discinfo
  • [ [...]] Disc information for --command calcid. --workdir working directory (default: /tmp) --help print option summary --man full documentation =head1 OPTIONS =over 8 =item B<--command> I<{id|data|calcid}> Select mode of operation: =over 8 =item B Read the disc-ID from the disc in the given device, and print it, the number of tracks, their start sectors, and the duration of the disc in seconds, to stdout. Format: ID TRACKCOUNT OFFSET1 [OFFSET2 [...]] LENGTH_S =item B Query MusicBrainz web service and store data into the workdir into cddbread.1, cddbread.2, ... files in the workdir. =item B Calculate MusicBrainz ID from given B<--discinfo> data. =back =item B<--device> Specify CD-ROM drive's device name, to read ID from with B<--command id>. =item B<--discid> Supply disc ID for B<--command data>. =item B<--discinfo> I< [ [...]]> Supply disc information for B<--command calcid>. =item B<--workdir> I The cddbread.* output files from B<--command data> go into this directory. =item B<--help> Print a brief help message and exit. =item B<--man> Display full manual and exit. =back abcde-2.9.3/abcde.1000066400000000000000000000721771342626142700137300ustar00rootroot00000000000000.TH abcde 1 .SH NAME abcde \- Grab an entire CD and compress it to Ogg/Vorbis, MP3, FLAC, Ogg/Speex, AAC, WavPack, Monkey's Audio (ape), MPP/MP+(Musepack), True Audio (tta), MP2 format and/or AIFF (Audio Interchange File Format). .SH SYNOPSIS .B abcde .I [options] [tracks] .SH DESCRIPTION Ordinarily, the process of grabbing the data off a CD and encoding it, then tagging or commenting it, is very involved. .BR abcde is designed to automate this. It will take an entire CD and convert it into a compressed audio format - Ogg/Vorbis, MPEG Audio Layer III (MP3), Free Lossless Audio Codec (FLAC), Ogg/Speex, MPP/MP+(Musepack), M4A (AAC) wv (WavPack), Monkey's Audio (ape), Opus, True Audio (tta), MPEG Audio Layer II (MP2) or AIFF (Audio Interchange File Format) format(s). With one command, it will: .TP .B * Do a CDDB or Musicbrainz query over the Internet to look up your CD or use a locally stored CDDB entry, or read CD-TEXT from your CD if it's available .TP .B * Download the album art appropriate for your music tracks with many user configurable options for download and post download alterations including automated embedding of the album art for some containers .TP .B * Grab an audio track (or all the audio CD tracks) from your CD .TP .B * Normalize the volume of the individual file (or the album as a single unit) .TP .B * Compress to Ogg/Vorbis, MP3, FLAC, Ogg/Speex, MPP/MP+(Musepack), M4A, wv (WavPack), Monkey's Audio (ape), Opus format(s), True Audio (tta), MP2 or AIFF (Audio Interchange File Format) all in one CD read .TP .B * Comment or ID3/ID3v2 tag .TP .B * Give an intelligible filename .TP .B * Calculate replaygain values for the individual file (or the album as a single unit) .TP .B * Delete the intermediate WAV file (or save it for later use) .TP .B * Repeat until finished .P Alternatively, .B abcde can also grab a CD and turn it into a single FLAC file with an embedded cuesheet which can be user later on as a source for other formats, and will be treated as if it was the original CD. In a way, .B abcde can take a compressed backup of your CD collection. .SH OPTIONS .TP .B \-1 Encode the whole CD in a single file. The resulting file uses the CD title for tagging. If the resulting format is a flac file with an embedded cuesheet, the file can be used as a source for creating other formats. Use "\-1 \-o flac \-a default,cue" for obtaining such a file. .TP .B \-a [actions] Comma-delimited list of actions to perform. Can be one or more of: cddb, cue, read, getalbumart, embedalbumart, normalize, encode, tag, move, replaygain, playlist, clean. Normalize and encode imply read. Tag implies cddb, read, encode. Move implies cddb, read, encode, tag. Replaygain implies cddb, read, encode, tag and move. Playlist implies cddb. embedalbumart implies getalbumart. The default is to do all actions except cue, normalize, replaygain, getalbumart, embedalbumart and playlist. .TP .B \-b Enable batch mode normalization. See the BATCHNORM configuration variable. .TP .B \-B Enable automatic embedding of album art with certain containers. As of abcde 2.8.2 supported containers are mp3 (using eyeD3), flac (using metaflac), m4a (using AtomicParsley), WavPack aka wv (using wvtag) and experimental support for ogg (using vorbiscomment). This command line option also calls the getalbumart function. Further details of album art embedding using the embedalbumart function can be found in the abcde FAQ document packaged with abcde. .TP .B \-c [filename] Specifies an additional configuration file to parse. Configuration options in this file override those in \fI/etc/abcde.conf\fR or \fI$HOME/.abcde.conf\fR. .TP .B \-C [discid] Allows you to resume a session for .I discid when you no longer have the CD available (\fBabcde\fR will automatically resume if you still have the CD in the drive). You must have already finished at least the "read" action during the previous session. .TP .B \-d [devicename | filename] CD\-ROM block device that contains audio tracks to be read. Alternatively, a single-track flac file with embedded cuesheet. .TP .B \-D Capture debugging information (you'll want to redirect this \- try 'abcde \-D 2>logfile') .TP .B \-e Erase information about encoded tracks from the internal status file, to enable other encodings if the wav files have been kept. .TP .B \-f Force the removal of the temporary ABCDETEMPDIR directory, even when we have not finished. For example, one can read and encode several formats, including \'.ogg\', and later on execute a \'move\' action with only one of the given formats. On a normal situation it would erase the rest of those encoded formats. In this case, \fBabcde\fR will refuse to execute such command, except if \-f is used. .TP .B \-g Enable lame's \-\-nogap option. See the NOGAP variable. WARNING: lame's \-\-nogap disables the Xing mp3 tag. This tag is required for mp3 players to correctly display track lengths when playing variable-bit-rate mp3 files. .TP .B \-G Download album art using the getalbumart function. This is best done with CDDBMETHOD including musicbrainz and requires the installation of glyrc. ImageMagick is an optional but highly recommended package. Further details of getalbumart can be found in the abcde FAQ document packaged with abcde. .TP .B \-h Get help information. .TP .B \-j [number] Start [number] encoder processes at once. Useful for SMP systems. Overrides the MAXPROCS configuration variable. Set it to "0" when using \fBdistmp3\fR to avoid local encoding processes. .TP .B \-k Keep the wav files after encoding. .TP .B \-l Use the low-diskspace algorithm. See the LOWDISK configuration variable. .TP .B \-L Use a local CDDB repository. See CDDBLOCALDIR variable. .TP .B \-m Create DOS-style playlists, modifying the resulting one by adding CRLF line endings. Some hardware players insist on having those to work. .TP .B \-n Do not query CDDB database. Create and use a template. Edit the template to provide song names, artist(s), ... .TP .B \-N Non interactive mode. Do not ask anything from the user. Just go ahead. .TP .B \-o [filetype][:filetypeoptions] Select output type. Can be "vorbis" (or "ogg"), "mp3", "flac", "spx", "mpc", "m4a", "wav", "wv", "ape", "opus", "mka" or "aiff". Specify a comma-delimited list of output types to obtain all specified types. See the OUTPUTTYPE configuration variable. One can pass options to the encoder for a specific filetype on the command line separating them with a colon. The options must be escaped with double-quotes. .TP .B \-p Pads track numbers with 0\'s. .TP .B \-P Use Unix PIPES to read and encode in one step (USEPIPES). This disables multiple encodings, since the WAV audio file is never stored in the disc. For more detail on this option see the FAQ document in the source tarball. .TP .B \-r [hosts...] Remote encode on this comma-delimited list of machines using \fBdistmp3\fR. See the REMOTEHOSTS configuration variable. .TP .B \-s [fields...] List, separated by commas, the fields to be shown in the CDDB parsed entries. Right now it only uses "year" and "genre". .TP .B \-S [speed] Set the speed of the CD drive. Needs CDSPEED and CDSPEEDOPTS set properly and both the program and device must support the capability. .TP .B \-t [number] Start the numbering of the tracks at a given number. It only affects the filenames and the playlist. Internal (tag) numbering remains the same. .TP .B \-T [number] Same as \-t but changes also the internal (tag) numbering. Keep in mind that the default TRACK tag for MP3 is $T/$TRACKS so it is changed to simply $T. .TP .B \-U Set CDDBPROTO to version 5, so that we retrieve ISO-8859-15 encoded CDDB information, and we tag and add comments with Latin1 encoding. .TP .B \-v Show the version and exit .TP .B \-V Be more verbose. On slow networks the CDDB requests might give the sensation nothing is happening. Add this more than once to make things even more verbose. .TP .B \-x Eject the CD when all tracks have been read. See the EJECTCD configuration variable. .TP .B \-X [cue2discid] Use an alternative "cue2discid" implementation. The name of the binary must be exactly that. \fBabcde\fR comes with an implementation in python under the examples directory. The special keyword "builtin" forces the usage of the internal (default) implementation in shell script. .TP .B \-w [comment] Add a comment to the tracks ripped from the CD. If you wish to use parentheses, these will need to be escaped. i.e. you have to write "\\(" instead of "(". .TP .B \-W [number] Concatenate CD\'s. It uses the number provided to define a comment "CD #" and to modify the numbering of the tracks, starting with "#01". For Ogg/Vorbis and FLAC files, it also defines a DISCNUMBER tag. .TP .B \-z DEBUG mode: it will rip, using \fBcdparanoia\fR, the very first second of each track and proceed with the actions requested very quickly, also providing some "hidden" information about what happens on the background. CAUTION: IT WILL ERASE ANY EXISTING RIPS WITHOUT WARNING! .TP .B [tracks] A list of tracks you want \fBabcde\fR to process. If this isn't specified, \fBabcde\fR will process the entire CD. Accepts ranges of track numbers - "abcde 1-5 7 9" will process tracks 1, 2, 3, 4, 5, 7, and 9. .SH OUTPUT Each track is, by default, placed in a separate file named after the track in a subdirectory named after the artist under the current directory. This can be modified using the OUTPUTFORMAT and VAOUTPUTFORMAT variables in your \fIabcde.conf\fR. Each file is given an extension identifying its compression format, 'vorbis' for '.ogg', '.mp3', '.flac', '.spx', '.mpc', '.wav', '.wv', \(aq.ape', '.opus', '.mka' or 'aiff'. .SH CONFIGURATION \fBabcde\fR sources two configuration files on startup - \fI/etc/abcde.conf\fR and \fI$HOME/.abcde.conf\fR, in that order. .PP The configuration options stated in those files can be overridden by providing the appropriate flags at runtime. .PP The configuration variables have to be set as follows: .TP .B VARIABLE=value Except when "value" needs to be quoted or otherwise interpreted. If other variables within "value" are to be expanded upon reading the configuration file, then double quotes should be used. If they are only supposed to be expanded upon use (for example OUTPUTFORMAT) then single quotes must be used. .TP All shell escaping/quoting rules apply. .TP Here is a list of options \fBabcde\fR recognizes: .TP .B CDDBMETHOD Specifies the methods we want to use to retrieve the track information. Three values are recognized: "cddb", "musicbrainz" and "cdtext". List all the methods desired in a comma delimited list and \fBabcde\fR will attempt them all, returning a list of all search results. The "cddb" value needs the CDDBURL and HELLOINFO variables described below. The "musicbrainz" value uses the Perl helper script \fBabcde-musicbrainz-tool\fR to establish a conversation with the Musicbrainz server for information retrieval. "cdtext" needs "icedax" or "cdda2wav" to be installed. .TP .B CDDBURL Specifies a server to use for CDDB lookups. .TP .B CDDBPROTO Specifies the protocol version used for the CDDB retrieval of results. Version 6 retrieves CDDB entries in UTF-8 format. .TP .B HELLOINFO Specifies the Hello information to send to the CDDB server. The CDDB protocol requires you to send a valid username and hostname each time you connect. The format of this is username@hostname. .TP .B CDDBLOCALDIR Specifies a directory where we store a local CDDB repository. The entries must be standard CDDB entries, with the filename being the DISCID value. Other CD playing and ripping programs (like Grip) store the entries under \fI~/.cddb\fR and we can make use of those entries. .TP .B CDDBLOCALRECURSIVE Specifies if the CDDBLOCALDIR has to be searched recursively trying to find a match for the CDDB entry. If a match is found and selected, and CDDBCOPYLOCAL is selected, it will be copied to the root of the CDDBLOCALDIR if CDDBLOCALPOLICY is "modified" or "new". The default "y" is needed for the local CDDB search to work. .TP .B CDDBLOCALPOLICY Defines when a CDDB entry should be stored in the defined CDDBLOCALDIR. The possible policies are: "net" for a CDDB entry which has been received from the net (overwriting any possible local CDDB entry); "new" for a CDDB entry which was received from the net, but will request confirmation to overwrite a local CDDB entry found in the root of the CDDBLOCALDIR directory; "modified" for a CDDB entry found in the local repository but which has been modified by the user; and "always" which forces the CDDB entry to be stored back in the root of the CDDBLOCALDIR no matter where it was found, and no matter it was not edited. This last option will always overwrite the one found in the root of the local repository (if any). STILL NOT WORKING!! .TP .B CDDBCOPYLOCAL Store local copies of the CDDB entries under the $CDDBLOCALDIR directory. .TP .B CDDBUSELOCAL Actually use the stored copies of the CDDB entries. Can be overridden using the "\-L" flag (if is CDDBUSELOCAL in "n"). If an entry is found, we always give the choice of retrieving a CDDB entry from the internet. .TP .B SHOWCDDBFIELDS Coma-separated list of fields we want to parse during the CDDB parsing. Defaults to "year,genre". .TP .B OGGENCODERSYNTAX Specifies the style of encoder to use for the Ogg/Vorbis encoder. Valid options are \'oggenc\' (default for Ogg/Vorbis) and \'vorbize\'. This affects the default location of the binary, the variable to pick encoder command-line options from, and where the options are given. .TP .B MP3ENCODERSYNTAX Specifies the style of encoder to use for the MP3 encoder. Valid options are \'lame\' (default for MP3), \'gogo\', \'bladeenc\', \'l3enc\' and \'mp3enc\'. Affects the same way as explained above for Ogg/Vorbis. .TP .B FLACENCODERSYNTAX Specifies the style of encoder to use for the FLAC encoder. At this point only \'flac\' is available for FLAC encoding. .TP .B MP2ENCODERSYNTAX Specifies the style of encoder to use for the MPEG-1 Audio Layer II (MP2) encoder. At this point both \'twolame\' and \'ffmpeg\' are available for MP2 encoding. .TP .B SPEEXENCODERSYNTAX Specifies the style of encoder to use for Speex encoder. At this point only \'speexenc\' is available for Ogg/Speex encoding. .TP .B MPCENCODERSYNTAX Specifies the style of encoder to use for MPP/MP+ (Musepack) encoder. At this point we only have \'mpcenc\' available, from musepack.net. .TP .B AACENCODERSYNTAX Specifies the style of encoder to use for M4A (AAC) encoder. We support \'fdkaac\' as \'default\' as well as FFmpeg or avconv, neroAacEnc, qaac and fhgaacenc. If qaac, refalac or FFmpeg / avconv are used it is also possible to generate Apple Lossless Audio Codec (alac) files. Note that qaac, refalac and fhgaacenc are Windows applications which require Wine to be installed. .TP .B TTAENCODERSYNTAX Specifies the style of encoder to use for True Audio (tts) encoding. We support \'tta\' as default but the older \'ttaenc\' can be used as well. .TP .B WVENCODERSYNTAX Specifies the style of encoder to use for WavPack. We support \'wavpack\' as \'default\' but \'ffmpeg'\ is the other option (Note that this is for FFmpeg only as avconv does not have a native WavPack encoder). .TP .B APENCODERSYNTAX Specifies the style of encoder to use for Monkey's Audio (ape). We support \'mac\', Monkey's Audio Console, as \'default\'. .TP .B OPUSENCODERSYNTAX Specifies the style of encoder to use for the Opus encoder. At this point only \'opusenc\' is available for Opus encoding. .TP .B MKAENCODERSYNTAX Specifies the style of encoder to use for the Matroska or mka container. At this point only \'ffmpeg\' is available to utilise the mka container. Safe audio codecs for mka include Vorbis, MP2, MP3, LC-AAC, HE-AAC, WMAv1, WMAv2, AC3, eAC3 and Opus. See the FAQ document for more information. .TP .B AIFFENCODERSYNTAX Specifies the style of encoder to use for Audio Interchange File Format (AIFF). At this point only \'ffmpeg\' is available to utilise the AIFF container. .TP .B NORMALIZERSYNTAX Specifies the style of normalizer to use. Valid options are \'default\' and \'normalize'\ (and both run \'normalize-audio\'), since we only support it, ATM. .TP .B CDROMREADERSYNTAX Specifies the style of cdrom reader to use. Valid options are \'cdparanoia\', \'libcdio'\, \'debug\' and \'flac\'. It is used for querying the CDROM and obtain a list of valid tracks and DATA tracks. The special \'flac\' case is u sed to "rip" CD tracks from a single-track flac file. .TP .B CUEREADERSYNTAX Specifies the syntax of the program we use to read the CD CUE sheet. Right now we only support \'mkcue\', but in the future other readers might be used. .TP .B KEEPWAVS It defaults to no, so if you want to keep those wavs ripped from your CD, set it to "y". You can use the "\-k" switch in the command line. The default behaviour with KEEPWAVS set is to keep the temporary directory and the wav files even you have requested the "clean" action. .TP .B PADTRACKS If set to "y", it adds 0's to the file numbers to complete a two-number holder. Useful when encoding tracks 1-9. .TP .B INTERACTIVE Set to "n" if you want to perform automatic rips, without user intervention. .TP .B NICE VALUES Define the values for priorities (nice values) for the different CPU-hungry processes: encoding (ENCNICE), CDROM read (READNICE) and distributed encoder with \fBdistmp3\fR (DISTMP3NICE). .TP .B PATHNAMES The following configuration file options specify the pathnames of their respective utilities: LAME, GOGO, BLADEENC, L3ENC, XINGMP3ENC, MP3ENC, VORBIZE, OGGENC, FLAC, SPEEXENC, MPCENC, WAVEPACK, APENC, OPUSENC, ID3, EYED3, METAFLAC, CDPARANOIA, CD_PARANOIA, CDDA2WAV, PIRD, CDDAFS, CDDISCID, CDDBTOOL, EJECT, MD5SUM, DISTMP3, VORBISCOMMENT, NORMALIZE, CDSPEED, MP3GAIN, VORBISGAIN, MPCGAIN, MKCUE, MKTOC, CUE2DISCID (see option "\-X"), DIFF, HTTPGET, GLYRC, IDENTIFY, DISPLAYCMD, CONVERT, QAAC, WINE, FHGAACENC, ATOMICPARSLEY, FFMPEG, TWOLAME, MID3V2, TTA and TTAENC. .TP .B COMMAND-LINE OPTIONS If you wish to specify command-line options to any of the programs \fBabcde\fR uses, set the following configuration file options: LAMEOPTS, GOGOOPTS, AIFFENCOPTS, BLADEENCOPTS, L3ENCOPTS, XINGMP3ENCOPTS, MP3ENCOPTS, VORBIZEOPTS, WAVEPACKENCOPTS, APENCOPTS, OGGENCOPTS, FLACOPTS, SPEEXENCOPTS, MPCENCOPTS, FAACENCOPTS, NEROAACENCOPTS, FDKAACENCOPTS, OPUSENCOPTS, ID3OPTS, EYED3OPTS, MP3GAINOPTS, CDPARANOIAOPTS, CDDA2WAVOPTS, PIRDOPTS, CDDAFSOPTS, CDDBTOOLOPTS, EJECTOPTS, DISTMP3OPTS, NORMALIZEOPTS, CDSPEEDOPTS, MKCUEOPTS, VORBISCOMMMENTOPTS, METAFLACOPTS, DIFFOPTS, FLACGAINOPTS, VORBISGAINOPTS, HTTPGETOPTS, GLYRCOPTS, IDENTIFYOPTS, CONVERTOPTS, DISPLAYCMDOPTS, QAACENCOPTS, FHGAACENCOPTS, ATOMICPARSLEYOPTS, FFMPEGENCOPTS, DAGRABOPTS, TWOLAMENCOPTS and TTAENCOPTS. .TP .B CDSPEEDVALUE Set the value of the CDROM speed. The default is to read the disc as fast as the reading program and the system permits. The steps are defined as 150kB/s (1x). .TP .B ACTIONS The default actions to be performed when reading a disc. .TP .B CDROM If set, it points to the CD-Rom device which has to be used for audio extraction. Abcde tries to guess the right device, but it may fail. The special \'flac\' option is defined to extract tracks from a single-track flac file. .TP .B CDPARANOIACDROMBUS Defined as "d" when using \fBcdparanoia\fR with an IDE bus and as "g" when using \fBcdparanoia\fR with the ide-scsi emulation layer. .TP .B OUTPUTDIR Specifies the directory to place completed tracks/playlists in. .TP .B WAVOUTPUTDIR Specifies the temporary directory to store .wav files in. Abcde may use up to 700MB of temporary space for each session (although it is rare to use over 100MB for a machine that can encode music as fast as it can read it). .TP .B OUTPUTTYPE Specifies the encoding format to output, as well as the default extension and encoder. Defaults to "vorbis". Valid settings are "vorbis" (or "ogg") (Ogg/Vorbis), "mp3" (MPEG-1 Audio Layer III), "flac" (Free Lossless Audio Codec), "mp2" (MPEG-1 Audio Layer III), "spx" (Ogg/Speex), "mpc" (MPP/MP+ (Musepack), "m4a" (AAC or ALAC),"wv" (WavPack"), "wav" (Microsoft Waveform), "opus" (Opus Interactive Audio Codec), "tta" (True Audio), "mka" (Matroska) or "aiff" (Audio Interchange File Format). Values like "vorbis,mp3" encode the tracks in both Ogg/Vorbis and MP3 formats. For example: .br OUTPUTTYPE=vorbis,flac .br For each value in OUTPUTTYPE, \fBabcde\fR expands a different process for encoding, tagging and moving, so you can use the format placeholder, OUTPUT, to create different subdirectories to hold the different types. The variable OUTPUT will be 'vorbis', 'mp3', 'flac', 'spx', 'mpc', 'm4a', mp2, 'wv', 'ape', 'tta', 'wav', 'mka' and/or 'aiff' depending on the OUTPUTTYPE you define. For example .br OUTPUTFORMAT='${OUTPUT}/${ARTISTFILE}/${ALBUMFILE}/${TRACKNUM}._${TRACKFILE}' .TP .B OUTPUTFORMAT Specifies the format for completed Ogg/Vorbis, MP3, FLAC, Ogg/Speex, MPP/MP+ (Musepack) or M4A filenames. Variables are included using standard shell syntax. Allowed variables are GENRE, ALBUMFILE, ARTISTFILE, TRACKFILE, TRACKNUM, and YEAR. Default is \'${ARTISTFILE}-${ALBUMFILE}/${TRACKNUM}-${TRACKFILE}\'. Make sure to use single quotes around this variable. TRACKNUM is automatically zero-padded, when the number of encoded tracks is higher than 9. When lower, you can force with '\-p' in the command line. .TP .B VAOUTPUTFORMAT Just like OUTPUTFORMAT but for Various Artists discs. The default is \(aqVarious-${ALBUMFILE}/${TRACKNUM}.${ARTISTFILE}-${TRACKFILE}' .TP .B ONETRACKOUTPUTFORMAT Just like OUTPUTFORMAT but for single-track rips (see option "\-1"). The default is '${ARTISTFILE}-${ALBUMFILE}/${ALBUMFILE}' .TP .B VAONETRACKOUTPUTFORMAT Just like ONETRACKOUTPUTFORMAT but for Various Artists discs. The default is 'Various-${ALBUMFILE}/${ALBUMFILE}' .TP .B MAXPROCS Defines how many encoders to run at once. This makes for huge speedups on SMP systems. You should run one encoder per CPU at once for maximum efficiency, although more doesn't hurt very much. Set it "0" when using mp3dist to avoid getting encoding processes in the local host. .TP .B LOWDISK If set to y, conserves disk space by encoding tracks immediately after reading them. This is substantially slower than normal operation but requires several hundred MB less space to complete the encoding of an entire CD. Use only if your system is low on space and cannot encode as quickly as it can read. Note that this option may also help when reading a CD with errors. This is because on a scratchy disk reading is quite timing sensitive and this option reduces the background load on the system which allows the ripping program more precise control. .TP .B BATCHNORM If set to y, enables batch mode normalization, which preserves relative volume differences between tracks of an album. Also enables nogap encoding when using the \'lame\' encoder. .TP .B NOGAP Activate the lame's \-\-nogap option, that allows files found in CDs with no silence between songs (such as live concerts) to be encoded without noticeable gaps. WARNING: lame's \-\-nogap disables the Xing mp3 tag. This tag is required for mp3 players to correctly display track lengths when playing variable-bit-rate mp3 files. .TP .B PLAYLISTFORMAT Specifies the format for completed playlist filenames. Works like the OUTPUTFORMAT configuration variable. Default is \'${ARTISTFILE}_\-_${ALBUMFILE}.m3u\'. Make sure to use single quotes around this variable. .TP .B PLAYLISTDATAPREFIX Specifies a prefix for filenames within a playlist. Useful for http playlists, etc. .TP .B DOSPLAYLIST If set, the resulting playlist will have CR-LF line endings, needed by some hardware-based players. .TP .B COMMENT Specifies a comment to embed in the ID3 or Ogg comment field of each finished track. Can be up to 28 characters long. Supports the same syntax as OUTPUTFORMAT. Does not currently support ID3v2. .TP .B REMOTEHOSTS Specifies a comma-delimited list of systems to use for remote encoding using \fBdistmp3\fR. Equivalent to \-r. .TP .B mungefilename mungefilename() is an \fBabcde\fR shell function that can be overridden via \fIabcde.conf\fR. It takes CDDB data as $1 and outputs the resulting filename on stdout. It defaults to deleting any preceding dots to filename, replacing spaces with an underscore and eating characters which variously Windows and Linux do not permit. .br If you modify this function, it is probably a good idea to keep the forward slash munging (UNIX cannot store a file with a '/' char in it) as well as the control character munging (NULs can't be in a filename either, and newlines and such in filenames are typically not desirable). .br New to abcde 2.7.3 are the user definable functions mungetrackname, mungeartistname and mungealbumname which default to mungefilename. These permit finer-grained control of track name, artist name and album name for the ultra-fastidious. .TP .B mungegenre mungegenre () is a shell function used to modify the $GENRE variable. As a default action, it takes $GENRE as $1 and outputs the resulting value to stdout converting all UPPERCASE characters to lowercase. .TP .B pre_read pre_read () is a shell function which is executed before the CDROM is read for the first time, during \fBabcde\fR execution. It can be used to close the CDROM tray, to set its speed (via "setcd" or via "eject", if available) and other preparation actions. The default function is empty. .TP .B post_read post_read () is a shell function which is executed after the CDROM is read (and, if applies, before the CDROM is ejected). It can be used to read a TOC from the CDROM, or to try to read the DATA areas from the CD (if any exist). The default function is empty. .TP .B post_encode post_encode () is a shell function which is executed after the encoding process. It can be used to move completed files to another location, run any sort of testing on the completed files or embed album art if the built in embedding provided by abcde's embedalbumart function is not to your taste. The default function is empty. .TP .B EJECTCD If set to "y", \fBabcde\fR will call \fBeject\fR(1) to eject the cdrom from the drive after all tracks have been read. It has no effect when CDROM is set to a flac file. .TP .B EXTRAVERBOSE If set to "1", some operations which are usually now shown to the end user are visible, such as CDDB queries. Useful for initial debug and if your network/CDDB server is slow. Set to "2" or more for even more verbose output. .SH EXAMPLES Possible ways one can call \fBabcde\fR: .TP .B abcde Will work in most systems .TP .B abcde \-d /dev/cdrom2 If the CDROM you are reading from is not the standard \fI/dev/cdrom\fR (in GNU/Linux systems) .TP .B abcde \-o vorbis,flac Will create both Ogg/Vorbis and Ogg/FLAC files. .TP .B abcde \-o vorbis:"-b 192" Will pass "\-b 192" to the Ogg/Vorbis encoder, without having to modify the config file .TP .B abcde \-o mp3,flac,m4a,wv,ogg -B abcde will create mp3, flac, m4a, wv and ogg files and also select suitable album art, download and embed the album art into all 5 sets of tracks. .TP .B abcde \-W 1 For double+ CD settings: will create the 1st CD starting with the track number 101, and will add a comment "CD 1" to the tracks, the second starting with 201 and so on. .TP .B abcde \-d singletrack.flac -o vorbis:"-q 6" Will extract the files contained in singletrack FLAC file using the embedded cuesheet and then encode the output files to Ogg/Vorbis with a quality setting of 6. .SH BACKEND TOOLS \fBabcde\fR requires the following backend tools to work: .TP .B * An Ogg/Vorbis, MP3, FLAC, Ogg/Speex, MPP/MP+(Musepack), M4A encoder or Opus encoder (oggenc, vorbize, lame, gogo, bladeenc, l3enc, mp3enc, flac, speexenc, mpcenc, fdkaac, neroAacEnc, faac, wavpack, opusenc). .TP .B * An audio CD reading utility (cdparanoia, icedax, cdda2wav, libcdio (cd-paranoia), pird, dagrab). To read CD-TEXT information, icedax or cdda2wav will be needed. .TP .B * cd-discid, a CDDB DiscID reading program. .TP .B * An HTTP retrieval program: wget, fetch (FreeBSD) or curl (Mac OS X, among others). Alternatively, abcde-musicbrainz-tool (which depends on Perl and some Musicbrainz libraries) can be used to retrieve CDDB information about the CD. .TP .B * (for MP3s) id3 or eyeD3, id3 v1 and v2 tagging programs. .TP .B * For Monkey's Audio (ape) tagging Robert Muth's 'apetag' is required. .TP .B * To retrieve album art a glyrc package is required and optionally the ImageMagick package should be installed. .TP .B * (optional) distmp3, a client/server for distributed mp3 encoding. .TP .B * (optional) normalize-audio, a WAV file volume normalizer. .TP .B * (optional) a replaygain file volume modifier (vorbisgain, metaflac, mp3gain, mpcgain, wvgain), .TP .B * (optional) mkcue, a CD cuesheet extractor. .SH "SEE ALSO" .BR cdparanoia (1), .BR cd-paranoia (1) .BR icedax (1), .BR cdda2wav (1), .BR twolame (1), .BR mid3v2 (1), .BR pird (1), .BR dagrab (1), .BR normalize-audio (1), .BR oggenc (1), .BR vorbize (1), .BR flac (1), .BR speexenc (1), .BR mpcenc (1), .BR faac (1), .BR fdkaac (1), .BR identify (1), .BR display (1), .BR convert (1), .BR wavpack (1), .BR wvgain (1), .BR wvtag (1), .BR id3 (1), .BR eyeD3 (1), .BR wget (1), .BR fetch (1), .BR cd-discid (1), .BR distmp3 (1), .BR distmp3host (1), .BR curl (1), .BR mkcue (1), .BR vorbisgain (1), .BR mp3gain (1) .SH DATA FORMATS The CDDB metadata format is used a lot by abcde, both for lookups and internally. It's documented online at http://ftp.freedb.org/pub/freedb/latest/DBFORMAT .SH AUTHORS Robert Woodcock , Jesus Climent , Colin Tuckley , Steve McIntyre <93sam@debian.org>, Andrew Strong and contributions from many others. abcde-2.9.3/abcde.conf000066400000000000000000000517661342626142700145160ustar00rootroot00000000000000# System defaults for abcde version 2.8.2 # Nothing in this file is uncommented by default. # # If you wish to override these system-wide settings, create your own # .abcde.conf file in your home directory. # CDDB options # Choose whether you want to use "cddb", "musicbrainz" and/or # "cdtext". Default is "musicbrainz", but all can be specified in a # comma delimited list to be tried sequentially. All the results will # be displayed ready for user choice. #CDDBMETHOD=musicbrainz # If you wish to use a different CDDB server, edit this line. # If you just wanted to use a proxy server, just set your http_proxy # environment variable - wget will use it correctly. #CDDBURL="http://freedb.freedb.org/~cddb/cddb.cgi" # The CDDB protocol level. # Right now 5 is latin1 output and 6 is UTF8 encoding. #CDDBPROTO=6 # The CDDB protocol requires hello information, including a valid username # and hostname. If you feel paranoid about giving away such info, edit this # line - the format is username@hostname. #HELLOINFO="`whoami`@`hostname`" # This controls the email address CDDB changes are submitted to. #CDDBSUBMIT=freedb-submit@freedb.org # The following options control whether or not fetched CDDB entries # are cached locally in $CDDBLOCALDIR #CDDBCOPYLOCAL="n" #CDDBLOCALDIR="$HOME/.cddb" #CDDBLOCALRECURSIVE="y" # If NOSUBMIT is set to y, then abcde will never prompt asking if you # wish to submit your edited cddb file. #NOSUBMIT=n # If NOCDDBQUERY is set to y, then abcde will never even try to access # the CDDB server; running abcde will automatically drop you into a # blank cddb file to edit at your leisure. This is the same as the # -n option. NOCDDBQUERY=y implies NOSUBMIT=y. #NOCDDBQUERY=n # Select here if you want to use the locally stored CDDB entries. # This is useful if you do a lot of editing to those CDDB entries. # Also, other tools like Grip store CDDB entries under $HOME/.cddb, # so they can be reused when ripping CDs. (If this is set to "y" make # sure that CDDBLOCALRECURSIVE is also set to "y".) #CDDBUSELOCAL="n" # List, separated with a comma, the fields we want the parsing function to # output. Defaults to YEAR and GENRE, for a complete list of fields provided by # CDDB. # The fields are not case sensitive. Actually, "y,g" will work as fine as "Y,G" # or "YEAR, GENRE" #SHOWCDDBFIELDS=year,genre # Specify the style of encoder to use here - # oggenc, vorbize - for OGGENCODERSYNTAX # lame, gogo, bladeenc, l3enc, xingmp3enc, mp3enc - for MP3ENCODERSYNTAX # flac - the only supported for FLACENCODERSYNTAX at the moment # speexenc - the only encoder for SPEEXENCODERSYNTAX # mpcenc - encoder for MPCENCODERSYNTAX # wavpack, ffmpeg - encoder for WVENCODERSYNTAX # mac - for APENCODERSYNTAX # fdkaac, ffmpeg, neroAacEnc, faac, qaac, fhgaacenc - for AACENCODERSYNTAX # opusenc - for OPUSENCODERSYNTAX # twolame, ffmpeg - for MP2ENCODERSYNTAX # tta, ttaenc - for TTAENCODERSYNTAX # ffmpeg - for AIFFENCODERSYNTAX # default is a valid option for oggenc, lame, flac, speexenc, mpcenc, wavpack, # fdkaac, opus, twolame and tta. Currently this affects the default location of the # binary, the variable to pick encoder command-line options from, and where # the options are given. #MP3ENCODERSYNTAX=default #OGGENCODERSYNTAX=default #FLACENCODERSYNTAX=default #SPEEXENCODERSYNTAX=default #MKAENCODERSYNTAX=default #MPCENCODERSYNTAX=default #WVENCODERSYNTAX=default #APENCODERSYNTAX=default #AACENCODERSYNTAX=default #OPUSENCODERSYNTAX=default #MP2ENCODERSYNTAX=default #TTAENCODERSYNTAX=default #AIFFENCODERSYNTAX=default # Specify the syntax of the normalize binary here - so far only 'normalize' # is supported. #NORMALIZERSYNTAX=default # CD reader program to use - currently recognized options are 'cdparanoia', # 'libcdio' (cd-paranoia),'icedax', 'cdda2wav', 'dagrab', 'pird', # 'cddafs' (Mac OS X only) and 'flac'. #CDROMREADERSYNTAX=cdparanoia # CUE reader syntax for the CUE reader program to use. # abcde supports 2 CUE modes: 'mkcue' and 'abcde.mkcue' so you can set the # MKCUE variable accordingly. The 'abcde.mkcue' uses an internal # implementation, without the need of an external program. #CUEREADERSYNTAX=default # Specify the program to convert a CUE sheet back to a CD disc ID for CDDB queries. # Select between '/path/to/cue2discid' (provided as an example) or # 'abcde.cue2discid', implemented internaly. #CUE2DISCID=abcde.cue2discid # Keep the wav files after encoding. Set it to "y" and remove "clean" from # the list of default actions, since we purge the temp directory as default. #KEEPWAVS=n # Track padding: force abcde to pad tracks using 0, so every song uses a two # digit entry. If set to "y", even a single song encoding outputs a file like # 01.my_song.ext #PADTRACKS=n # Define if you want abcde to be non-interactive. # Keep in mind that there is no way to deactivate it right now in the command # line, so setting this option makes abcde to be always non-interactive. #INTERACTIVE=n # Specify 'nice'ness of the encoder, the CD reader and the distmp3 proc. # This is a relative 'nice'ness (that is, if the parent process is at a # nice level of 12, and the ENCNICE is set to 3, then the encoder will # run with an absolute nice value of 15. Note also, that setting these # to be empty will result in some default niceness increase (4 in tcsh # and 10 using the bsdutils' nice). #ENCNICE=10 #READNICE=10 #DISTMP3NICE=10 # Paths of programs to use # Encoders: #LAME=lame #GOGO=gogo #BLADEENC=bladeenc #L3ENC=l3enc #XINGMP3ENC=xingmp3enc #MP3ENC=mp3enc #VORBIZE=vorbize #OGGENC=oggenc #FLAC=flac #SPEEXENC=speexenc #MPCENC=mpcenc #WVENC=wavpack #APENC=mac #FAAC=faac #NEROAACENC=neroAacEnc #FDKAAC=fdkaac #OPUSENC=opusenc #TWOLAME=twolame # Note that if you use avconv rather than FFmpeg give the # path to avconv here (e.g. FFMPEG=/usr/bin/avconv): # FFMPEG=ffmpeg #TTA=tta #TTAENC=ttaenc # The path for qaac, refalac and fhgaacenc can be problematic as abcde # cannot cope with the 'standard' Wine location with spaces. For example: # "$HOME/.wine/drive_c/Program\ Files/qaac/qaac.exe" is problematic. Try instead: # "$HOME/.wine/drive_c/qaac/qaac.exe" # Installation instructions for qaac, refalac and fhgaacenc here: # http://www.andrews-corner.org/linux/qaac.html # http://www.andrews-corner.org/linux/fhgaacenc.html # (Hint: Use QAAC=refalac to use the Open Source alac encoder...) #QAAC=qaac #FHGAACENC=fhgaacenc # Taggers, rippers, replaygain etc: #ID3=id3 #ID3V2=id3v2 #MID3V2=mid3v2 #EYED3=eyeD3 #CDPARANOIA=cdparanoia #CD_PARANOIA=cd-paranoia #CDDA2WAV=icedax #PIRD=pird #CDDAFS=cp #CDDISCID=cd-discid #CDDBTOOL=cddb-tool #EJECT=eject #MD5SUM=md5sum #DISTMP3=distmp3 #VORBISCOMMENT=vorbiscomment #METAFLAC=metaflac #NORMALIZE=normalize-audio #CDSPEED=eject #VORBISGAIN=vorbisgain #MKCUE=mkcue #MKTOC=cdrdao #DIFF=diff #WVGAIN=wvgain #WVTAG=wvtag #APETAG=apetag #GLYRC=glyrc #IDENTIFY=identify #CONVERT=convert #DISPLAYCMD=display #WINE=wine # Options to call programs with: # If HTTPGET is modified, the HTTPGETOPTS options should also be defined # accordingly. If HTTPGET is changed, the default options will be set, # if HTTPGETOPTS is empty or not defined. #HTTPGET=wget # for fetch (FreeBSD): HTTPGETOPTS="-q -o -" # for wget: HTTPGETOPTS="-q -nv -O -" # for curl (MacOSX): HTTPGETOPTS="-f -s" #HTTPGETOPTS="-q -O -" # MP3: # For the best LAME encoder options have a look at: # # A good option is '-V 0' which gives Variable Bitrate Rate (VBR) recording # with a target bitrate of ~245 Kbps and a bitrate range of 220...260 Kbps. #LAMEOPTS= #GOGOOPTS= # Bladeenc still works with abcde in 2015, and the last release of bladeenc # was in 2001! Settings that will produce a great encode are: '-br 192' #BLADEENCOPTS= # L3enc still works with abcde in 2015, pretty amazing when you realise # that the last release of l3enc was in 1997! Settings that will produce # a great encode are: '-br 256000 -hq -crc' #L3ENCOPTS= #XINGMP3ENCOPTS= # And mp3enc also still works with abcde in 2015 with the last release # of mp3enc in 1998! Settings that will produce a great encode, albeit # a slow one, are: '-v -br 256000 -qual 9 -no-is -bw 16500' #MP3ENCOPTS= # Ogg: #VORBIZEOPTS= #OGGENCOPTS= # FLAC: # The flac option is a workaround for an error where flac fails # to encode with error 'floating point exception'. This is flac # error in get_console_width(), corrected in flac 1.3.1 #FLACOPTS="--silent" # Options passed to MetaFlac for ReplayGain tags: #FLACGAINOPTS="--add-replay-gain" # Speex: #SPEEXENCOPTS= # MPP/MP+ (Musepack): # For the encoder options look at 'mpcenc --longhelp', consider # setting '--extreme' for a good quality encode. #MPCENCOPTS= # WavPack: # Look at 'wavpack --help' for detailed options, consider using '-hx3' # for a good quality encode #WAVENCOPTS= # For Wavpack replay gain we set both the default of 'track gain' # as well as this option for 'album gain'. Better media players # such as vlc can select either or neither. #WVGAINOPTS='-a' # Monkey's Audio (ape) # Without this set mac chokes unfortunately. Choices # are from 1000 to 5000. #APENCOPTS='-c4000' #AIFF # These options needed by FFmpeg for tagging and selection of id3v2 version: # 1. '-write_id3v2 1' allows id3v2 tagging while '-write_id3v2 0' disables tagging # 2. '-id3v2_version 4' gives version id3v2.4 while '3' gives id3v2.3 #AIFFENCOPTS="-write_id3v2 1 -id3v2_version 4" # M4A/AAC # There are now 6 AAC encoders available to abcde, the default being # fdkaacenc. Note that the old AACENCOPTS has been rendered obsolete by # the following options, new to abcde 2.7: # 1. fdkaac: see 'fdkaac --help' and consider using # '--profile 2 --bitrate-mode 5 --afterburner 1' # for a good quality encode. #FDKAACENCOPTS='--bitrate 192k' # 2. FFmpeg: Use the following to use the FFmpeg native encoder, adding # -strict -2 if you have an older FFmpeg: # FFMPEGENCOPTS="-c:a aac -b:a 192k" # 3. neroAacEnc: see 'neroAacEnc -help' and # consider using '-q 0.65' for a good quality encode. #NEROAACENCOPTS= # 4. faac: see 'faac --long-help' and consider # using '-q 250' for a good quality encode. #FAACENCOPTS= # 5. qaac: simply run 'wine qaac.exe' to see all options and # consider using '--tvbr 100' for a good quality # encode or '--alac' for Apple Lossless Audio Codec #QAACENCOPTS= # 6. fhgaacenc: simply run 'wine fhgaacenc.exe' to see all options. # consider using '--vbr 4' for a decent quality encode. #FHGAACENCOPTS= # True Audio # This is a lossless format so no options of any note available: #TTAENCOPTS= # OPUS # For the encoder options look at: 'opusenc -h' #OPUSENCOPTS= # MP2 # Currently uses either twolame or ffmpeg, for twolame options look at: # 'twolame --help',a highly recommended setting is "--bitrate 320". #TWOLAMENCOPTS= # FFmpeg or avconv can be used for several audio codecs, as well as being # the default encoder for the Matroska container mka:: # 1. Encoding to WavPack (FFmpeg only: avconv does not have a native encoder). # Consider setting the following with a compression_level between 0-8: # FFMPEGENCOPTS="-c:a wavpack -compression_level 6" # 2. Encoding to ALAC (both FFmpeg and avconv have a native encoder). # Consider using the following for either FFmpeg and avconv: # FFMPEGENCOPTS="-c:a alac" # 3. Encoding to mp2 # Consider using the following for either FFmpeg and avconv: # FFMPEGENCOPTS="-c:a mp2 -b:a 320k" #FFMPEGENCOPTS= # mp3 tagging: # There are three ways to tag MP3 files: # 1. id3v1 (with id3) # 2. id3v2.3 (with id3v2) # 3. id3v2.4 (with eyeD3) This is the default # Use ID3TAGV to select one of the older formats: #ID3TAGV=id3v2.4 #ID3OPTS= #ID3V2OPTS= #EYED3OPTS="--set-encoding=utf16-LE" # Other options: # The variable CDPARANOIOPTS is also used by GNU's cd-paranoia, # so use this when setting CDROMREADERSYNTX=libcdio. #CDPARANOIAOPTS= #CDDA2WAVOPTS= #PIRDOPTS="-p" # Options for the CD ripper dagrab can be seen by running 'dagrab -h'. # A good option to experiment with is the 'sectors per request' setting # which by default is '-n 8'. #DAGRABOPTS= #CDDAFSOPTS="-f" #CDDBTOOLOPTS= #EJECTOPTS= #DISTMP3OPTS= #NORMALIZEOPTS= #CDSPEEDOPTS="-x" #CDSPEEDVALUE="" #MKCUEOPTS="" #MKTOCOPTS="" #DIFFOPTS="" #VORBISCOMMENTOPTS="-R" #METAFLACOPTS="--no-utf8-convert" # Bear in mind that the AtomicParsley option '--overWrite' is already # used in abcde... #ATOMICPARSLEYOPTS= # Actions to take # Comma-separated list of one or more of the following: # cddb,cue,read,normalize,encode,tag,move,replaygain,playlist,getalbumart,embedalbumart,clean,default # encode implies read # normalize implies read # tag implies cddb,read,encode # move implies cddb,read,encode,tag # replaygain implies cddb,read,encode,tag,move # playlist implies cddb # embedalbumart implies getalbumart # An action can be added to the "default" action by specifying it along with # "default", without having to repeat the default ones: # ACTIONS=default,playlist # The default action list (referenced as "default") is defined in the following # comment: #ACTIONS=cddb,read,encode,tag,move,clean # CD device you want to read from # It can be defined as a singletrack flac file, but since it might change from # file to file it makes little sense to define it here. #CDROM=/dev/cdrom # If we are using the IDE bus, we need CDPARANOIACDROMBUS defined as "d" # If we are using the ide-scsi emulation layer, we need to define a "g" #CDPARANOIACDROMBUS="d" # If you'd like to make a default location that overrides the current # directory for putting mp3's, uncomment this. #OUTPUTDIR=`pwd` # Or if you'd just like to put the temporary .wav files somewhere else # you can specify that here #WAVOUTPUTDIR=`pwd` # OUTPUTTYPE can be any of a number of formats, either a single format # (e.g. "ogg") or a combination of them separated with "," # (e.g. "flac,mp3"). Currently recognised and supported are: # "flac", "m4a", "mp3, "mpc", "ogg", "opus", "mka", "spx", "vorbis", "wav", "wv", "ape", "aiff" #OUTPUTTYPE=ogg # Output filename format - change this to reflect your inner desire to # organize things differently than everyone else :) # You have the following variables at your disposal: # OUTPUT, GENRE, ALBUMFILE, ARTISTFILE, TRACKFILE, TRACKNUM and YEAR. # Make sure to single-quote this variable. abcde will automatically create # the directory portion of this filename. # NOTICE: OUTPUTTYPE has been deprecated in the OUTPUTFORMAT string. # Since multiple-output was integrated we always append the file type # to the files. Remove it from your user defined string if you are getting # files like ".ogg.ogg". #OUTPUTFORMAT='${ARTISTFILE}-${ALBUMFILE}/${TRACKNUM}.${TRACKFILE}' # Like OUTPUTFORMAT but for Various Artists discs. #VAOUTPUTFORMAT='Various-${ALBUMFILE}/${TRACKNUM}.${ARTISTFILE}-${TRACKFILE}' # Like OUTPUTFORMAT and VAOUTPUTFORMAT but for the ONEFILE rips. #ONETRACKOUTPUTFORMAT=$OUTPUTFORMAT #VAONETRACKOUTPUTFORMAT=$VAOUTPUTFORMAT # Define how many encoders to run at once. This makes for huge speedups # on SMP systems. Defaults to 1. Equivalent to -j. #MAXPROCS=2 # Support for systems with low disk space: # n: Default parallelization (read entire CD in while encoding) # y: No parallelization (rip, encode, rip, encode...) #LOWDISK=n # If set to y, enables batch mode normalization, which preserves relative # volume differences between tracks of an album. #BATCHNORM=n # Enables nogap encoding when using the 'lame' encoder. #NOGAP=y # Set the playlist file location format. Uses the same variables and format # as OUTPUTFORMAT. If the playlist is specified to be in a subdirectory, it # will be created for you and the playlist will reference files from that # subdirectory. #PLAYLISTFORMAT='${ARTISTFILE}-${ALBUMFILE}.${OUTPUT}.m3u' # If you want to prefix every filename in a playlist with an arbitrary # string (such as 'http://you/yourstuff/'), use this option #PLAYLISTDATAPREFIX='' #Like PLAYLIST{FORMAT,DATAPREFIX} but for Various Artists discs: #VAPLAYLISTFORMAT='${ARTISTFILE}-${ALBUMFILE}.${OUTPUT}.m3u' #VAPLAYLISTDATAPREFIX='' #This will give the playlist CR-LF line-endings, if set to "y". #(some hardware players insist on CR-LF line-endings) #DOSPLAYLIST=n # album art download options (see glyrc's help for details with more detailed # examples here: https://github.com/sahib/glyr/wiki/Commandline-arguments). # For example use '--formats jpg;jpeg' to only search for JPEG images # These options: '--from ' and '--lang ' might also be useful #GLYRCOPTS= #ALBUMARTFILE="cover.jpg" #ALBUMARTTYPE="JPEG" # Options for ImageMagick commands used by album art processing when available # For example: CONVERTOPTS="-colorspace RGB -resize 600x600>" # to make the image RGB and fit inside 600x600 while keeping the aspect ratio #IDENTIFYOPTS= #CONVERTOPTS= #DISPLAYCMDOPTS="-resize 512x512 -title abcde_album_art" # By default convert is only called when the image type is different from # ALBUMARTTYPE, use ALBUMARTALWAYSCONVERT="y" to always call convert #ALBUMARTALWAYSCONVERT="n" # Custom filename munging: # By default, abcde will do the following to CDDB data to get a useful filename: # 1. Delete any dots preceding the title (first sed command) # 2. Replace all spaces with an underscore (second sed command). Simply remove # this if you prefer spaces. # 3. Delete a grab bag of characters which variously Windows and Linux do not permit # (tr command). Remove any of these from the list if you wish to actually use them. # #mungefilename () #{ # echo "$@" | sed -e 's/^\.*//' -e 's/ /_/g' | tr -d ":><|*/\"'?[:cntrl:]" #} # # More examples for custom filename munging: # # VARIANT 1: (works anywhere style) # # Translate everything to lowercase # replace ALL chars that may cause trouble for Linux, Windows and DOS # with '_' (underscore); remove double underscores; remove leading and # trailing underscores; recode to flat ASCII. WARNING! You'll likely # need to install "recode" on your system as an extra package to use # this. # #mungefilename () #{ # echo "$@" | tr [A-Z] [a-z] | \ # sed "s/[- ,.:\'\/!@#\?\$%\^&()]/_/g" | \ # sed 's/_[_]*/_/g' | \ # sed 's/^_*//' | \ # sed 's/_*$//' | \ # recode -f iso8859-1..flat #} # # VARIANT 2: (legible style) # # Accept all chars, EXCEPT '/' (obvious) or ":" (because eyeD3 cannot # cope with ":" in pathnames): replace them with " " (space). # Additionally, replace contiguous spaces with one space; strip # leading spaces; strip trailing spaces and recode to flat filenames. # # mungefilename () # { # echo "$@" | sed "s/[:\/]/ /g" | \ # sed 's/ [ ]*/ /g' | \ # sed 's/^ *//' | \ # sed 's/ *$//' | \ # recode -f iso8859-1..flat # } # # Custom filename munging specific to track names: # By default this function will call the mungefilename function. #mungetrackname () #{ # mungefilename $@ #} # # Custom filename munging specific to artist names: # By default this function will call the mungefilename function. #mungeartistname () #{ # mungefilename $@ #} # # Custom filename munging specific to album names: # By default this function will call the mungefilename function. #mungealbumname () #{ # mungefilename $@ #} # Custom genre munging: # By default we just transform uppercase to lowercase. Not much of a fancy # function, with not much use, but one can disable it or just turn the first # Uppercase. #mungegenre () #{ # echo $CDGENRE | tr "[:upper:]" "[:lower:]" #} # Custom pre-read function # By default it does nothing. # You can set some things to get abcde function in better ways: # * Close the CD tray using eject -t (if available in eject and supported by # your CD device. # * Set the CD speed. You can also use the built-in options, but you can also # set it here. In Debian, eject -x and cdset -x do the job. # KEEP IN MIND that executables included in pre_read must be in your $PATH or # you have to define them with full /path/to/binary # Uncomment and substitute the ":" with your commands. #pre_read () #{ #: #} # Custom post-read function # By default it does nothing. # You can set some things to get abcde function in better ways: # * Store a copy of the CD TOC. # KEEP IN MIND that executables included in post_read must be in your $PATH or # you have to define them with full /path/to/binary # Uncomment and substitute the ":" with your commands. #post_read () #{ #: #} # post_encode # By default it does nothing. # You can set some things to get abcde function in better ways: # * Move the resulting directory over the network # * Compare results with a previously made run, for tests # KEEP IN MIND that executables included in post_encode must be in your $PATH or # you have to define them with full /path/to/binary # Uncomment and substitute the ":" with your commands. #post_encode () #{ #: #} # If you'd like to have abcde eject the cdrom after all the tracks have been # read, uncomment the following line. #EJECTCD=y # To encode on the remote machines foo, bar, baz, quux, and qiix, as well as # on the local machine (requires distmp3 to be installed on local machine and # distmp3host to be installed and running on all remote machines - see README) #REMOTEHOSTS=foo,bar,baz,quux,qiix # Set to 1,2, etc. to obtain some information about actions happening in the background # Useful if you have a slow network or CDDB servers seem unresponsive. #EXTRAVERBOSE=0 abcde-2.9.3/cddb-tool000077500000000000000000000174041342626142700143750ustar00rootroot00000000000000#!/bin/bash # Copyright (C) 1999 Nathaniel Smith # Copyright (C) 1999, 2000, 2001 Robert Woodcock # Copyright (C) 2003, 2005 Jesus Climent # Copyright (c) 2012- Steve McIntyre <93sam@@debian.org> # This code is hereby licensed for public consumption under either the # GNU GPL v2 or greater, or Larry Wall's Artistic License - your choice. # # 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # TODO: # - Add more error checking # KNOWN BUGS: # - Not much error checking, esp. of arguments # - Submitted via: line is created by template, when it really should be in send. # Oh well. VERSION=0.4.7 NAME=cddb-tool #return codes BAD_SYNTAX_ERR=10 # invalid CDDB file NO_TMP_ERR=11 # can't create a temp file NO_MATCH_ERR=12 # try submitting one LOOKUP_ERR=13 # problem connecting to cddb server EMPTY_QUERY_RESPONSE=14 # query response = "", (probably no net connection) # assume a reasonable default if $HTTPGET is undefined if [ "$HTTPGET" = "" ]; then if [ X"$(uname)" = X"FreeBSD" ] ; then HTTPGET=fetch HTTPGETOPTS=${HTTPGETOPTS:="-q -o -"} elif [ X"$(uname)" = X"NetBSD" ] ; then HTTPGET=ftp HTTPGETOPTS=${HTTPGETOPTS:="-a -V -o - "} elif [ X"$(uname)" = X"Darwin" ] ; then HTTPGET=curl HTTPGETOPTS=${HTTPGETOPTS:="-f -s"} else HTTPGET=wget HTTPGETOPTS=${HTTPGETOPTS:="-q -nv -e timestamping=off -O -"} fi fi HTTPGET="$HTTPGET $HTTPGETOPTS" usage() { cat << EOF $NAME version $VERSION usage: one of: $0 parse file $0 template disc-id tracks $0 send file address $0 read server proto user host disc-id genre $0 query server proto user host disc-id tracks $0 stat serverurl user host proto $0 help EOF } help() { cat << EOF $NAME version $VERSION A toolbox for doing cddb related stuff Usage: $0 command [command_options] Commands: parse file Get data out of a cddb file - dumps to stdout in a form source'able by the shell send file address Mails a CDDB file to a specified address, using correct format. Category should be one of blues, classical, country, data, folk, jazz, newage, reggae, rock, soundtrack, or misc. template disc-id tracks Generates a template (empty) cddb file to stdout. The command line should be essentially the output of cd-discid. query server proto user host disc-id tracks Looks up disc on server (should be of form "http://host/~cddb/cddb.cgi") remainder of command line is in the same form as that returned by the cd-discid program. read server proto user host disc-id genre CDDB file is dumped to stdout. File will contain an extra #CATEGORY= line, which leaves it a valid CDDB file but which will be recognized by parse and send commands. Uses wget, so if you need to use a proxy then just configure wget to do so. user and host will be used for identifying ourselves to the CDDB server. stat serverurl user host proto Check server status with given protocol. This can be used to check if the server supports given protocol. Most common values for proto should be 5 and 3. With 3 you will not get DYEAR and DGENRE fields in response. help Display this. EOF } f_seq () { i=$1 while [ $i -ne `expr $2 + 1` ] do echo $i i=`expr $i + 1` done } new_checkexec () { if [ ! "$@" = "" ]; then # Cut off any command-line option we added in X=$(echo $@ | cut -d' ' -f2) if [ "$(which $X)" = "" ]; then return 1 elif [ ! -x $(which $X) ]; then return 2 fi fi return 0 } COMMAND=$1 shift case $COMMAND in parse) # takes 1 argument, a filename, and dumps out a sh parseable version CDDBFILE="$1" set -e # names chosen to match usage in abcde code DISCID=$(grep -a ^DISCID= "$CDDBFILE" | cut -f2 -d= | tr -d \[:cntrl:\]) DARTISTALBUM="$(grep -a ^DTITLE= "$CDDBFILE" | cut -f2- -d= | tr -d \\n | sed 's- / -~-g' | tr -d \[:cntrl:\])" DARTIST="$(echo "$DARTISTALBUM" | cut -f1 -d~ | sed 's,\\,\\\\,g;s,\([\"\$\`]\),\\\1,g' | tr -d \[:cntrl:\])" DALBUM="$(echo "$DARTISTALBUM" | cut -f2 -d~ | sed 's,\\,\\\\,g;s,\([\"\$\`]\),\\\1,g' | tr -d \[:cntrl:\])" CDDBGENRE="$(grep -a '^#CATEGORY=' "$CDDBFILE" | cut -f2- -d= | tr -d \[:cntrl:\])" if grep -a "^DYEAR" "$CDDBFILE" 2>&1 > /dev/null ; then CDYEAR=$(grep -a "^DYEAR" "$CDDBFILE" | cut -f2- -d= | tr -d \[:cntrl:\]) elif grep -a YEAR "$CDDBFILE" 2>&1 > /dev/null ; then CDYEAR=$(grep -a "YEAR" "$CDDBFILE" | grep -a -v "DYEAR" | awk 'BEGIN{FS="YEAR:"}{print $2}' | awk '{print $1}') else CDYEAR="" fi CDGENRE=$(grep -a '^DGENRE=' "$CDDBFILE" | cut -f2- -d= | tr -d \[:cntrl:\]) set +e echo DISCID="\"$DISCID\"" echo DALBUM="\"$DALBUM\"" echo DARTIST="\"$DARTIST\"" echo CDDBGENRE="\"$CDDBGENRE\"" echo CDYEAR="\"$CDYEAR\"" echo CDGENRE="\"$CDGENRE\"" NUMTRACKS=$(grep -a -E '^TTITLE[0-9]+=' "$CDDBFILE" | wc -l) CURRTRACK=0 while [ "$CURRTRACK" -lt $NUMTRACKS ]; do CURRTRACKM1=$CURRTRACK # Track minus 1 (cddb numbers from 0) CURRTRACK=$(expr $CURRTRACK + 1) echo -n "TRACK${CURRTRACK}=\"" grep -a ^TTITLE${CURRTRACKM1}= "$CDDBFILE" | cut -f2 -d= | sed 's,\\,\\\\,g;s,\([\"\$\`]\),\\\1,g' | tr -d \[:cntrl:\] echo \" done ;; template) DISCID="$@" DISCNUM=$1 echo '# xmcd CD database file' echo '#' echo '# Track frame offsets:' NUMTRACKS=$2 for x in $(f_seq 3 $(expr $NUMTRACKS + 2)) do printf "#\t$(echo "$DISCID" | cut -f$x -d' ')\n" done x=$(expr $x + 1) LENGTH=$(echo "$DISCID" | cut -f$x -d' ') echo "#" echo "# Disc length: $LENGTH seconds" echo "#" echo "# Submitted via: $NAME $VERSION" echo "#" echo "#blues,classical,country,data,folk,jazz,newage,reggae,rock,soundtrack,misc" echo "#CATEGORY=misc" echo DISCID="$DISCNUM" echo "DTITLE=Unknown Artist / Unknown Album" echo "DYEAR=" echo "DGENRE=" # TTITLE0 -- TTITLEn for x in $(f_seq 1 $NUMTRACKS) do echo "TTITLE$(expr $x - 1)=Track $x" done echo "EXTD=" # EXTT0 -- EXTTn for x in $(f_seq 1 $NUMTRACKS) do echo "EXTT$(expr $x - 1)=" done echo "PLAYORDER=" ;; send) # cddb-tool send filename email@address FILE="$1" ADDRESS="$2" DISCID=$(grep -a ^DISCID= "$FILE" | cut -f2 -d= | tr -d \[:cntrl:\]) CDDBGENRE=$(grep -a '^#CATEGORY=' "$FILE" | cut -f2- -d= | tr -d \[:cntrl:\]) # Use bsd-mailx by preference if we can, as it allows addition # of extra headers. Otherwise, try to force UTF-8 via environment if new_checkexec bsd-mailx; then grep -a -v "^#CATEGORY=" "$FILE" | iconv -t utf-8 | bsd-mailx -a "Content-Type: text/plain; charset=utf-8" -s "cddb $CDDBGENRE $DISCID" "$ADDRESS" else # Find the first UTF-8 locale on the system, if any UTF_LOCALE=$(locale -a | awk '/UTF-8/ { print $1; exit}') if [ "$UTF_LOCALE"x != ""x ] ; then export LC_ALL=$UTF_LOCALE fi grep -a -v "^#CATEGORY=" "$FILE" | iconv -t utf-8 | mail -s "cddb $CDDBGENRE $DISCID" "$ADDRESS" fi ;; query) # cddb-tool query serverurl proto user host discid... SERVER="$1" PROTO="$2" USER="$3" HOST="$4" HELLOINFO="$USER+$HOST+$NAME+$VERSION" shift 4 TRACKINFO="$@" TRACKINFOPLUS=$(echo $TRACKINFO | tr ' ' '+') RESULTS=$($HTTPGET "$SERVER?cmd=cddb+query+$TRACKINFOPLUS&hello=$HELLOINFO&proto=$PROTO") || exit $LOOKUP_ERR echo "$RESULTS" | tr '\r' '\n' | tr -s '\n' | sed 's/^ //g' ;; read) # cddb-tool read serverurl proto user host genre discnumber SERVER="$1" PROTO="$2" USER="$3" HOST="$4" CATEGORY="$5" DISCID="$6" HELLOINFO="$USER+$HOST+$NAME+$VERSION" $HTTPGET $CDDBDATA "$SERVER?cmd=cddb+read+$CATEGORY+$DISCID&hello=$HELLOINFO&proto=$PROTO" 2>/dev/null ;; stat) # cddb-tool stat serverurl user host proto SERVER="$1" USER="$2" HOST="$3" PROTO="$4" HELLOINFO="$USER+$HOST+$NAME+$VERSION" $HTTPGET $CDDBDATA "$SERVER?cmd=stat&hello=$HELLOINFO&proto=$PROTO" 2>/dev/null ;; help) # help help ;; *) # usage usage ;; esac abcde-2.9.3/cddb-tool.1000066400000000000000000000045261342626142700145320ustar00rootroot00000000000000.TH CDDB-TOOL 1 .SH NAME cddb-tool \- Get CDDB information .SH SYNOPSIS .B cddb-tool parse .I file [-i|-d|-a|-t] [num|-c|-p] .B cddb-tool template disc-id tracks .B cddb-tool send .I [file] address .B cddb-tool query .I server user host disc-id tracks .B cddb-tool read .I server user host disc-id genre .B cddb-tool help .SH DESCRIPTION cddb-tool is a backend tool for abcde. It is passed information from cd-discid and uses it look up the CD title, artist, and track information on the cddb database (http://freedb.freedb.org) on the internet. .SH COMMANDS .B parse .I [file] option Get data out of a cddb file (use "-" for stdin). Options (use one and only one): .RS .TP .B id prints disc id .TP .B album prints album title .TP .B track num prints title of track num .TP .B artist prints artist .TP .B category prints category .TP .B cddbgenre synonym for category .TP .B all parse file and dumps to stdout in a form sourceable by the shell .RE .B send .I [file] address Mails file file (or stdin of no file specified) to specified address, using correct format. Category should be one of blues, classical, country, data, folk, jazz, newage, reggae, rock, soundtrack, misc. .B template .I [disc-id] [tracks] Generates a template (empty) cddb file to stdout. The command line should be essentially the output of cd-discid. .B query .I [server] [user] [host] [disc-id] [tracks] Looks up disc on server (should be of form "http://host/cddb/cddb.cgi") remainder of command line is in the same form as that returned by the cd-discid program. Uses wget, so if you need to use a proxy then just configure wget to do so. user and host will be used for identifying ourselves to the CDDB server. Outputs response code and entries with matching CDDB entries, if successful, from the CDDB server. .B read .I [server] [user] [host] [disc-id] [genre] Dumps CDDB entry to stdout. File will contain an extra #CATEGORY= line, which leaves it a valid CDDB file but which will be recognized by parse and send commands. Uses wget, so if you need to use a proxy then just configure wget to do so. user and host will be used for identifying ourselves to the CDDB server. .B help Prints usage information. .SH AUTHOR Nathaniel Smith , maintained as part of abcde by Robert Woodcock . Manual page compiled from help information by Robert Woodcock. abcde-2.9.3/changelog000066400000000000000000002251421342626142700144520ustar00rootroot00000000000000abcde 2.9.3 * Replace non-portable sed code for generating offset list with some simple awk instead. Should now work on FreeBSD again. * Deal with bizarre cdda2wav behaviour when doing cdtext lookup - it writes the track information to *stdin*. Closes Issue #89: https://abcde.einval.com/bugzilla/show_bug.cgi?id=89 * Add a warning in abcde.conf about mayb needing to install recode before using it in mungefilename() -- Steve McIntyre <93sam@debian.org> Tue, 05 Feb 2018 09:55:12 +0000 abcde 2.9.2 * Fix up lookup code to deal with spaces etc. in directory names * Cope with "stub" releases in Musicbrainz * Always call glyrc with LC_ALL=C. Thanks to Andreas Vögele for the report and the suggested fix. Closes Issue 83: https://abcde.einval.com/bugzilla/show_bug.cgi?id=50 * Add a link to the CDDB data format in the abcde man page. Closes Issue 81: https://abcde.einval.com/bugzilla/show_bug.cgi?id=81 * More fixups of track number padding. Thanks to John Straw for the patch. -- Steve McIntyre <93sam@debian.org> Thu, 02 Aug 2018 23:07:12 +0800 abcde 2.9.1 * Merged Debian packaging files updates * Fixups in the new Musicbrainz code: + Cope with not finding an entry for a CD! + Fix (again!) dealing with CDs with no release events -- Steve McIntyre <93sam@debian.org> Fri, 09 Mar 2018 23:01:04 +0000 abcde 2.9 * Add some documentation for the aged CD ripper dagrab. Thanks to Teika Kazura for the notification and suggested documentation. This closes Issue 50: https://abcde.einval.com/bugzilla/show_bug.cgi?id=50 * Work by Matthias Andree to address the issue where abcde fails with accented characters from CD-TEXT. The issue and partial fix applied here documented in Issue 53: https://abcde.einval.com/bugzilla/show_bug.cgi?id=53 and also in the abcde mailing list: https://lists.einval.com/pipermail/abcde-users/2017-January/000232.html * Allow for embedding of album art downloaded by the getalbumart function. Currently this is available for flac (using metaflac), mp3 (using eyed3), m4a (using AtomicParsley) and WavPack aka wv (using wvtag). This can be invoked in 3 ways: 1. Use the commandline '-B' option (this will also call getalbumart) 2. Use the commandline '-a embedalbumart' option to add to list of actions 3. Use 'embedalbumart' in the 'ACTIONS' list in ~/.abcde.conf Still needs more development but it is perfectly usable at the moment! * Use md5 rather than md5sum under macOS. Thanks to JCount for the bug report and also the fix. This solves Issue 59: https://abcde.einval.com/bugzilla/show_bug.cgi?id=59 * Support added for encoding with Audio Interchange File Format (AIFF). Thanks to Massimo Villa for the feature request. FFmpeg is required for the encoding, the container and suffix are 'aiff'. * Allow selection of either cddb or musicbrainz from the command line: -Q Select CDDBMETHOD from the command line. Choice is cddb or musicbrainz. Command line letters are fast running out but the 'Q' option quite neatly stands for 'Query'! * Allow for embedding with do_embedalbumart() for single track encodes when OUTPUTFORMAT and ONETRACKOUTPUTFORMAT are different. Thanks to Ashley Gittins for the bug report. This closes Issue 63: https://abcde.einval.com/bugzilla/show_bug.cgi?id=63 * Experimental support for embedding albumart with ogg files. The slightly tortuous technique drawn from 2 sources: 1. https://github.com/biapy/howto.biapy.com/blob/master/various/mussync-tools 2. https://github.com/acabal/scripts/blob/master/ogg-cover-art Testing is strongly encouraged, perhaps the simplest way to test is with: abcde -o ogg -B Or the appropriate settings in an ~/.abcde.conf file. * Massive rework of CD lookup code so support multiple sources better. Thanks to Gabriel Rosenkoetter for his initial idea in this area, and to Tomasz GoliÅ„ski on irc for initial inspiration on how this should work better. There are now 3 different options for CD lookup: cddb, musicbrainz and cdtext. They can all be listed in a comma-separated list for CDDBMETHOD and the code will now call all of them in the sequence listed. All the results will be combined into one list at the end for the user to select, just like would have previously worked for one source only. Closes Issue 42: https://abcde.einval.com/bugzilla/show_bug.cgi?id=42 * Fix Musicbrainz ID calculation in makeids() Apply fix suggested by petecollins24@gmail.com; add PREGAP to LEADOUT to correct Musicbrainz ID calculation. Hopefully closes Issue 54: https://abcde.einval.com/bugzilla/show_bug.cgi?id=54 * Fix abcde.mkcue() when handling the --wholedisk option. Thanks to Nino Burini for the patch. Closes Issue 47 and maybe also 45: https://abcde.einval.com/bugzilla/show_bug.cgi?id=47 https://abcde.einval.com/bugzilla/show_bug.cgi?id=45 * Add more comprehensive examples for filename munging in the example config file. Closes Issue 49: https://abcde.einval.com/bugzilla/show_bug.cgi?id=49 * Add a more better fix for the year lookup problem in abcde-musicbrainz-tool Thanks to Tom Samstag for the patch. Closes Issue 57: https://abcde.einval.com/bugzilla/show_bug.cgi?id=57 * Redirect stderr on "which" calls to clear up error noise on some systems. Closes Issue 56: https://abcde.einval.com/bugzilla/show_bug.cgi?id=56 * Add Irix support, based on a patch by abcde@canavan.de. Closes Issue 29: https://abcde.einval.com/bugzilla/show_bug.cgi?id=29 * Rework abcde-musicbrainz-tool to work with WebService::MusicBrainz 1.x Thanks to Nicolas Guillaumin for the patch. Closes Issue 60: https://abcde.einval.com/bugzilla/show_bug.cgi?id=60 Also added a specific dependency on version 1.0.4 or newer, so abcde-musicbrainz-tool will abort if the version found is too old. Since tweaked to deal with multi-artist albums and tracks more completely. * Add resume support in do_getalbumart() * Fix getopts setup for "P". Thanks to Alan W. Kerr for reporting this. * Major set of code cleanups to fix up lots of warnings found with shellcheck, and a few other style issues: + Lots of quoting fixes + Use $( instead of ` + Stop using -o and -a syntax with if [ - use || or && instead + Wrap and shorten some very long lines * Wrap some output messages so they fit on a standard width console * Factor out repeated code and make page() more useful * Add version check before resuming from an old ripping run -- Steve McIntyre <93sam@debian.org> Thu, 08 Mar 2018 00:14:56 +0000 abcde 2.8.1. * Fix silly error introduced in abcde-musicbrainz-tool when fixing bug 30. Thanks to Thomas Klausner for the bug/patch. Closes Issue 52: https://abcde.einval.com/bugzilla/show_bug.cgi?id=52 -- Steve McIntyre <93sam@debian.org> Wed, 18 Jan 2017 11:02:38 +0000 abcde 2.8 * Make fdkaac the default for m4a encoding. Faac can still be selected for m4a encding via ~/.abcde.conf file but best not to :). * Split user-definable mungefilename function into mungetrackname, mungeartistname, and mungealbumname, each of which default to mungefilename Thanks to Gerald Turner for the patch and enhancement request. This closes Issue 39: https://abcde.einval.com/bugzilla/show_bug.cgi?id=39 * FAQs: Clarify the exit from multi-result CDDB search. * Fix to allow multiple output formats when aac fallback is triggered. Thanks to Birk Bremer for the bug report. This closes Issue 35: https://abcde.einval.com/bugzilla/show_bug.cgi?id=35 * Fix for some erroneous error and status logging. Thanks to Christian Wasem for the bug report and fix. This closes Issue 32: https://abcde.einval.com/bugzilla/show_bug.cgi?id=32 * Add support for trying multiple CD lookup services in order. Thanks to Gabriel Rosenkoetter for the patch. Closes Issue 42: https://abcde.einval.com/bugzilla/show_bug.cgi?id=42 * Add Recommends on glyrc and imagemagick in Debian packaging. Closes Debian Bug #827626 * Fix up handling of the first few sectors when reading from a whole-CD flac file or using cdparanoia in one-track mode. Thanks to Matthias König for the patch. Closes Issue 44: https://abcde.einval.com/bugzilla/show_bug.cgi?id=44 * Tweak the fix in musicbrainz for handling sketchy returned data some more. Hopefully closes Issue 30: https://abcde.einval.com/bugzilla/show_bug.cgi?id=30 * Re-enable some commented out cdparanoia/debug code in do_discid. Closes Issue 14: https://abcde.einval.com/bugzilla/show_bug.cgi?id=14 * Add "-a" to lots of grep calls in case of "binary" looking data, e.g. non-ascii text in track titles! Closes Issue 24: https://abcde.einval.com/bugzilla/show_bug.cgi?id=24 * Add "-L" to default curl options, to follow redirects if needed Closes Issue 40: https://abcde.einval.com/bugzilla/show_bug.cgi?id=40 Thanks to Gabriel Rosenkoetter for the patch. * Switch default from "cddb" to "musicbrainz" for track lookup Closes Debian Bug #842178 -- Steve McIntyre <93sam@debian.org> Sat, 14 Jan 2017 00:53:48 +0000 abcde 2.7.2 * When using musicbrainz, don't assume that there will be release events attached to a particular CD release. Bug fix for the addition of year information support in 2.7.1. Thanks to Ed Oehler and Alan W. Kerr for debugging help. * Support for output to the Matroska container (mka). Encoder is FFmpeg (or avconv). Typical conf file syntax would be: MKAENCODERSYNTAX=ffmpeg FFMPEG=ffmpeg FFMPEGENCOPTS="-c:a ac3 -b:a 448k" OUTPUTTYPE="mka" Thanks to Shantiq and Fakeoutdoorsman of the Ubuntu Forums for the idea. * Add id3tag mp3 tagger as this is the tagger available to OpenBSD users. Thanks to Christopher Zimmermann for the notification and patch. * Allow for cddb response 500. Thanks again to Von Welch for the bug report and patch. This closes Issue 26: http://abcde.einval.com/bugzilla/show_bug.cgi?id=26 * Fix for 'expansion of $REDIR' bug on MacOSX. Thanks to Von Welch for the bug report. This closes Issue 22: http://abcde.einval.com/bugzilla/show_bug.cgi?id=22 * Makefile adjusted to allow the sample abcde.conf file to be installed by default to /etc rather than $(prefix)/etc. Thanks to Volker Schmidt from archlinux for the bug report: https://bugs.archlinux.org/task/46671 * Allow getalbumart to correctly place cover image when single track is selected. Thanks to Nino Burini for the bug report and also the fix. This closes Issue 25: http://abcde.einval.com/bugzilla/show_bug.cgi?id=25 -- Andrew Strong Wed, 6 Apr 2016 08:47:56 +0000 abcde 2.7.1 * Rebuild of the abcde Makefile. Thanks to Reuben Thomas and Steve McIntyre as well as ReaperX7, bobzilla, 55020, GazL and dugan from the Slackware Forums. This closes Issue 4: http://abcde.einval.com/bugzilla/show_bug.cgi?id=4 * Fix incorrect use of 'break'. Thanks to Reuben Thomas for the bug report and fix which closes Issue 6: http://abcde.einval.com/bugzilla/show_bug.cgi?id=6 * Make older versions of id3 happy when 'Genre' field is empty. Thanks to Martin Husemann for the fix which closes Issue 8: http://abcde.einval.com/bugzilla/show_bug.cgi?id=8 * Add YEAR and GENRE variables to do_getalbumart(). Thanks to Johannes Gernemann for this patch which closes issue 9: http://abcde.einval.com/bugzilla/show_bug.cgi?id=9 * Support added for encoding to True Audio using tta while still supporting the older ttaenc. Tagging is with mid3v2. * Support added for encoding to MPEG-1 Audio Layer II (mp2) with either twolame or FFmpeg / avconv. Tagging with mid3v2. * Encoding to WavPack with FFmpeg. Some slight changes to WavPack syntax with backward compatibility built in for abcde 2.7. * Encoding to m4a container with FFmpeg or avconv. This allows for alac encoding with FFmpeg's reverse engineered alac encoder. * AAC encoding with fhgaacenc via Wine. Tagging is provided by AtomicParsley which has been added back to abcde :). This allows encoding with HE-AAC v2, unavailable with qaac. * Support added for AAC encoding with qaac via Wine. This also allows for Apple Lossless Audio Coding (alac) using either qaac or refalac. This closes Issue 142, thanks to Bernd Fischer-Krellenberg for the enhancement request. * Grab year information too when using musicbrainz. Thanks to Marco Hoppstaedter for the patch. Closes issue 10: http://abcde.einval.com/bugzilla/show_bug.cgi?id=10 -- Andrew Strong Sun, 4 Oct 2015 09:31:07 +0000 abcde 2.7 * Rewrite of abcde's mungefilename function. Thanks to Andreas Kusalananda Kahari for this and also thanks to Andrew Willis for the report which triggered the rewrite. Thanks also to shughes for an earlier report. This closes Issues 72 and 135. * TRACKTOTAL now written to flac and ogg files. Thanks to monkth for the notification. This resolves Issue 76. * Support added for the downloading of album art. A huge thank you to Johannes Gernemann who came forward with the technique used and also the original patch. An equally huge thanks to Richard who extended and greatly enhanced the original patch. Detailed documentation added to the abcde FAQ document although the sane defaults in place will guarantee a good experience even for those who do not read documentation! This closes Issue 33. * Support added for ripping with the GNU Compact Disc Input and Control library (libcdio) as requested by both gentoo and NixOS. The utility used is cd-paranoia and can best be called from a conf file as follows: CDROMREADERSYNTAX=libcdio CD_PARANOIA=cd-paranoia CDPARANOIAOPTS="--never-skip=40 --verbose" with the CD_PARANOIA variable giving the correct path to cd-paranoia. I believe that cd-paranoia uses the same options as cdparanoia but if I am proven incorrect this will need to be rectified... * Fix for encoding with bladeenc and usepipes. * Fix for broken ripping with dagrab. Closes Issue 140. * Fix for diskutil selecting wrong disk on OS X. Thanks to Richard for this fix which closes Issue 139. * Added some error checking and documentation for the abcde-musicbrainz-tool. Thanks yet again to Matthias Andree for this work! Closes issue 138. * New variables for m4a/aac encoding options to be manipulated in a users ~/.abcde.conf file: 1. FAACENCOPTS for faac encoding options 2. NEROAACENCOPTS for neroAacEnc options 3. FDKAACENCOPTS for fdkaacenc options Note that these options replace the now obsolete AACENCOPTS. * Check added for neroAacTag when encoding with neroAacEnc. * Several additions to usepipes with the following encoders being added: 1. mp3enc: mp3 2. speexenc: Speex 3. mpcenc: Musepack SV8 4. wavpack: WavPack 5. faac: aac 6. neroAacEnc: aac 7. fdkaac: aac The cd ripper cdda2wav (icedax) has also been added. * Ripping and encoding with 'usepipes' fixed. This fix closes Issue 46. * Suggested encoding options for mp3enc added to the sample abcde.conf. Last release of mp3enc in 1998 but it still works flawlessly with a modern abcde! * Suggested encoding options for l3enc added to the sample abcde.conf. Congratulations to abcde which in 2015 still works with l3enc which saw its final release in 1997! * Fix for -o option use with options and multiple outputs. This allows for commandline options such as the following: abcde -o 'flac:-8,mp3:-b 320' Thanks to Matthias Andree for yet another quality patch! This closes Issue 136. * Support added for ReplayGain with WavPack encoding. * Fix for MusePack to allow the use of the SV8 ReplayGain application 'mpcgain'. * Monkey's Audio (ape) encoding added. Tagging is with Robert Muth's apetag. Thanks to Shantiq for testing. * Simplify Opus tagging.This closes Issue 133. * Allow 'clean' when OUTPUTTYPE=wav, broken for some time. Thanks to Roger rogerx.ossgmail.com for showing the problem and demonstrating the fix. This closes Issue 94. * Clarification that CDDBLOCALRECURSIVE=y is required for local CDDB search. Thanks to Reuben Thomas for the notification. This partially resolves Issue 121. * AtomicParsley removed from debian/control, WavPack added. * Details of abcde's handling of faac compiled with and without mp4v2 added as a new entry to FAQs. * Fix to allow display of the 'date' meta tag generated by eyeD3 in vlc, Audacious and friends. Thanks to Reuben Thomas. This closes Issue 126. * Fix for flac floating point error. Thanks to rwvtveer for the patch which closes Issue 113. * Formalised 3 methods of mp3 tagging using ID3TAGV: 1.id3v2.4 using eyeD3 (set in abcde as the default) 2.id3v2.3 using id3v2 3.id3v1 using id3 Thanks to Adriaan for this patch which fixes issue 101. * Support for WavPack added. Closes issue 123. * Fix for mp3 encoding with different versions of eyeD3. Thanks to Matthias Andree for this patch. * Major AAC encoding cleanup, including addition of the fdkaac encoder. Thanks to Doug Mcmahon for assistance with this. -- Andrew Strong Thu, 18 Jun 2015 12:27:52 +0000 abcde 2.6 * Fix finding $CDROM on OS X. Thanks to niederstrasser for the patch. Closes issue 71. * USEID3 and USEID3V2 variables are unused now, so remove them. Thanks to vskytta for the patch. Closes issue 73. * Clean up movement to eyeD3, remove id3v2 remnants. Thanks to vskytta for the patch. Closes issue 74. * Fix infinite loop if cddb fails. Thanks to Dominic Hargreaves for the patch. Closes: #687038 in Debian * Switch from Musepack SV7 to SV8. Thanks to Andrew Strong for the patch. * Allow aac encoding with neroAacEnc. Thanks to atheren for the patch. Closes issue 8. * Allow opus encoding with opusenc. Thanks to Tomasz Golinski for the patch. Closes issue 70. * Fix typo: s/CUEWAVEFILE/CUEWAVFILE/ so that abcde.mkcue should now produce working cue files. Closes issue 78. * Remove no-op -q option. Closes issue 106. Thanks to vskytta for the patch. * Fix issue 112: perl encoding pragma deprecation. Thanks to Alex Corrie for the patch. * Fix option parsing for multiple output formats. Thanks to matthias.andree@gmx.de for the patch. Closes issue 115. * Fix eyeD3 tagging for cddb entries without year. Thanks to vskytta for the patch. Closes issue 107 * Add mention of CD-TEXT support in the man page. Closes issue 102. * Make Y/N prompting more consistent. Closes issue 95 * Remove the no-op -B option. Closes: #426531 in Debian * Document the need to escape parentheses in tag comments. Closes: #256941 in Debian. * Concatenate option steps on -t/-T option. Thanks to Charles Steinkuehler for the patch. Closes: #391294 in Debian * Try to use bsd-mailx where possible to force UTF-8 for cddb-tool mail submissions. If not possible, attempt to force UTF-8 via the environment and fall back to mail instead. Closes: #756289 in Debian, issue 111. -- Steve McIntyre <93sam@debian.org> Sun, 26 Oct 2014 13:17:24 -0700 abcde 2.5.4 * Update GPL/FSF headers to match current versions. Thanks to vskytta for the patch. (Closes issue 69). * Fix the command line for ID3SYNTAX=eyed3. Thanks to neil.gm.richards for the patch. Closes issue 50. * Switch to eyed3 by default for MP3 tagging, as it looks to do UTF-8 tagging better. Closes issue 22 (hopefully) -- Steve McIntyre <93sam@debian.org> Tue, 18 Sep 2012 12:42:11 +0100 abcde 2.5.3 * Sort options alphabetically (Closes issue 58). Thanks to vskytta for the patch. * Add Recommends: mailx in the Debian packaging for Debian/Ubuntu users. Closes: #607147 * Fix encoding call for m4a. (Closes issue 31). Closes: #449045 * Fix do_musicbrainz() for the case where there are no matches. * When using Musicbrainz, checksum and only output unique matches for an album. Closes: #669143 * Add Recommends: atomicparsley in the Debian packaging for Debian/Ubuntu users. LP: #535527 * Remove documentation of the old "-R" option for recursive searching of local CDDB data, it's now enabled always. (Closes issue 57). * Fix use of awk (sub instead of substr) when generating CRLF line endings. (Closes issue 59). * Make sure that ABCDETEMPDIR is quoted so we can deal with spaces in file and directory names. Closes issue 64. Thanks to richard.security.consultant for the patch, adapted slightly. * Tweak do_cdtext() so it works on OS X too. Closes issue 65. Thanks to richard.security.consultant for the patch. * Change cddb-tool to use bash to make sure that echo -n works. Closes issue 67. * Fixes for lots of spelling mistakes from vskytta. Closes issue 68. * For safety across different systems, avoid using "sed -i". Closes issue 66. -- Steve McIntyre <93sam@debian.org> Sat, 16 Jun 2012 15:12:11 +0100 abcde 2.5.2 [ Steve McIntyre ] * Re-fix speex tagging. (Closes issue 19). Thanks to vskytta for pointing out the problem - patch not applied properly in 2.5.1 * Quickly re-release as 2.5.2 -- Steve McIntyre <93sam@debian.org> Sun, 29 Apr 2012 17:17:14 +0100 abcde 2.5.1 [ Steve McIntyre ] * Several patches for improved Musicbrainz support from Martin Michlmayr: + add musicbrainz support for FLAC files with embedded cue files. Closes: #669139 + Don't submit to CDDB server when using musicbrainz Closes: #669140 + Don't tag CDDB string with musicbrainz id Closes: #669141 * Fix speex tagging. (Closes issue 19). Thanks to vskytta for the patch. * Fix aac tagging. (Closes issue 7). Thanks to Andrew Strong for forwarding the patch. * Add ATOMICPARSLEY=AtomicParsley (Closes issue 37). * On OS X, switch from disktool to diskutil. (Closes issue 43). * Updates for CD device detection: + Look for /dev/sr0, in case /dev/cdrom doesn't exist. (Closes issue 52). + Add suggested diskutil code to auto-detect the CD on OS X. (Closes issue 45). * Check that we have $CDDBTOOL before we start. (Closes issue 27). * Change the meaning of EXTRAVERBOSE; previously, it was a y/n option to make things more verbose. Add extra levels of verbosity (0, 1, 2 so far) and a new vvecho() function for callers to use. * With EXTRAVERBOSE==2 or more, make run_command() print out each command as it's run. (Closes issue 39). * If we don't find any CDDB or Musicbrainz information for the CD, try to extract CD-Text information to populate the cddbinfo template. (Closes issue 41). * Try to give more helpful error messages when we can't parse the command line, and exit rather than carry on. (Closes issue 51). [ Colin Tuckley ] * replace deprecated egrep with grep -E (Closes issue 24). Thanks to vskytta for the patch. * remove -o 0 options from make install (Closes issue 17). Thanks to vskytta for the patch. * clean up indentation on older changelog entries * remove tarball target from Makefile since dir structure has changed now that we use subversion. * improve presentation of options/defaults when asking a question (closes issue 9) -- Steve McIntyre <93sam@debian.org> Wed, 25 Apr 2012 12:35:00 +0100 abcde 2.5.0 * Bumped to 2.5.0 * Add support for Musicbrainz using a perl helper script. Closes: #665970 * Tweak man page. Thanks to Mats Erik Andersson for the patch. Closes: #627237 * Make the -q option work again. Thanks to A Mennucc for the patch. Closes: #562522 -- Steve McIntyre <93sam@debian.org> Fri, 13 Apr 2012 22:29:45 +0100 abcde 2.4.2 * Bumped to 2.4.2 * Fix Cue file always references "dummy.wav" bug patch from Chris Chiappa (Closes: #459928). * Whitespace cleanup, replace single perl instance with sed (Charles Steinkuehler) * Fix leadin/leadout computation for cue files broken bug Patch from Martin Michlmayr (Closes: #582175). -- Colin Tuckley Sat, 29 May 2010 09:43:01 +0100 abcde 2.4.1 * Bumped to 2.4.1 * In manpage note a 2nd use for LOWDISK (or '-l' switch) it's faster and better on scratchy disks (Closes: #426343). * Add configurable options for replaygain tools. * Fix syntax error in tagged speex command (Closes: #554406) Ubuntu patch by Michael Helmling. * Fix mp3 tagging fails for single author albums (Closes: #554030) -- Colin Tuckley Sun, 14 Feb 2010 13:09:47 +0000 abcde 2.4.0 * Bumped to 2.4 * Corrected REDIR redirection, this time with ifs instead of variable substitution, which did not work (Closes: #527191). * Added TPE2 for Various artists definition (Closes: #521669). * Incorporate syntax error fix patch from Andrew Ruder. * Fix formatting for track number tagging. * Replace dependency on cdda2wav with icedax since the former has been superseded. -- Colin Tuckley Fri, 16 Oct 2009 19:33:33 +0100 abcde 2.3.99.8 * Remove svn Revision tag from version. * Correct homepage URL in README (Closes: #526165). * Fix typos (Closes: #435605, #435606). * Fix misspelling of comma in script and manpage (Closes: #435603). * Fix Writable temp directories not owned/writeable (Closes: #143552). * Fix broken range code, patch from Charles Steinkuehler (Closes: #389981). * Remove unneeded escapes in cddb-tool URLs. Add support for freedb2 (Closes: #391110). another patch from Charles Steinkuehler. * Fix Endless loop possible when mp3gain asks clipping question bug (Closes: #411579). * Update Vcs-Svn: tag in debian/control. * Add a recommends for vorbis-tools (Closes: #392843). * Update standards version to 3.8.2 (no changes required). * Fix debian/preinst not to ignore errors. -- Colin Tuckley Sun, 02 Aug 2009 13:32:30 +0100 abcde 2.3.99.7 [ Jesus Climent ] * The "It took me a long time to get this release out" release. * abcde.1: remove -M in favour of "-a cue" (Closes: #382614, #396505). * Added a check for a DOCUE already set in the command line (Closes: #385663). * Added -q as a quality option. * PREGAP was not set in some situations (Closes: #390170). * Added -nv to wget for "no verbose" output, to avoid wget complaining it cannot be quiet and verbose at the same time if "verbose = on" is set in ~/.wgetrc (Closes: #388715). * Added XS-Vcs-Svn: field to control file. * Added some hints if we are using Debian for what packages need to be installed if their binaries are not found. * Spelling mistakes corrected (thanks to Ville Skytta). * Unset GREP_OPTIONS to avoid things like printing number in the beginning of the line (Closes: #383771). * Default answer to erase a playlist was not working (thanks to Charles Steinkuehler) (Closes: #395108). * Corrected man page wrapping. Thanks to Edward J. Shornock (Closes: #399289). * Adds DISCNUMBER to Ogg/Vorbis and FLAC when using -W. * Minor typos (Closes: #458995). * Added AtomicParley for AAC encoding. Thanks to Bill Adams. * Added by Marc Staveley: - post_encode hook. - track comments if null and present in CDDB. * Corrected copyright information (Closes: #516535). [ Colin Tuckley ] * Added new uploader (Closes: #529695). * Fix Lintian warning for make-clean-error. * Fix FSF address in debian/copyright. * Fix binary-arch-rules-but-pkg-is-arch-indep lintian warning. * Add homepage: field to debian/control * Update standards version to 3.8.0 * Remove debian/conffiles (it is not needed). * Fix syntax error in abcde (missing fi). -- Colin Tuckley Sat, 25 Jul 2009 09:50:42 +0100 abcde 2.3.99.6 * Default to UNICODE (UTF8) tags and comments (Closes: #282332). - Added CDDBPROTO option in config file (Closes: #349951) * Added a missing "INDEX 01" entry for CUE sheet creation. * Avoid completing the encoding of files if we aborted previously. * Embed the CUE sheet if we have a cuesheet file and we have a single FLAC file, even if we are not tagging. This way we can use the file as a source even if it is not tagged/named properly. * Fails to quote filenames properly (Closes: #355296) * Introduced VA/ONETRACKOUTPUTFORMAT. * Added a missing check for AACENCODER. * Updated config file with some new AAC bits. * Updated FSF address. * Corrected NetBSD options for ftp (Thanks to Marius). * The final 2.4 will have "cuefile" as an action instead of as a flag. * Create the cuefile when extracting from a FLAC file. * Small bugs (Charles Steinkuehler): - Added missing quotes (Closes: #375710) - toolame is included in Debian as default MP3 encoder - Use IFS to preserve spaces when adding metadata to a cuefile * Small documentation changes: - abcde.1 (Closes: #364978) * The following entries have in common that both add an internal cue2discid function. I will evaluate which one is more accurate and decide which one to use. Right now they are not conflicting: - Added internal mkcue and cue2discid functions (Charles Steinkuehler) and add a check for internal abcde. to make sure we are using the correct version (not sure if needed ;) - Added an internal implementation of cue2discid, so there is no need for an external program to do the conversion. Thanks to Michael (sorry, his mail does not have a surname). * cue2discid is now an internal function, so no need for including the python script in the path (Closes: #378407) * cddb-tool.1 typo (Thanks to A. Costa) (Closes: #351775) * abcde.1 typo (Thanks to David L. Anselmi) (Closes: #364978) * Set proper nice values to not separate encoding and reading in the pipes situation, while having a high priority process running in the system. Also, set proper nice values to tagging tasks. Reading should remain as the default higher priority task in the abcde flow (Closes: #359156) * Standards bumped to 3.7.2.1, no changes needed. -- Jesus Climent Sat, 5 Aug 2006 05:26:56 +0300 abcde 2.3.99.5 * Repaired multiple CDDB entries when recursive search is active. * Patch from A. Costa to clean some typos (Closes: #351774). -- Jesus Climent Thu, 07 Feb 2006 23:48:00 +0200 abcde 2.3.99.4 * Repaired multiple output encoding (Closes: #351362). * Added missing space on a [] test statement. * Added "default" action, so that one can add things on top of what we do regularly, without having to list everything: "-a default,playlist" works. * Restored all the > /dev/null instead of using grep -q, since it is not portable. * Added Solaris OS entry, in case we need to define things for it. -- Jesus Climent Thu, 05 Feb 2006 15:24:00 +0200 abcde 2.3.99.3 * The "Mao es nuestro indiscutible lider" release. * Check the CDROMREADER options we have in Debian which we depend on. Thanks to Jose Carlos Garcia Sogo for finding the error. * New recursive option for local CDDB repositories, to cope with other players saving the entries. * Brand new CD backup procedure: rip a CD into a single FLAC trac with an embedded cuesheet using "-1 -M -o flac" and proceed to rip your tracks from the obtained file using "-d file.flac -o ". It needs cue2discid script from the examples directory to work. OH! If you manage to get it working with bash, we can get rid of the python dependency... * Initial steps to make abcde working with musicbrainz, although it is not ready yet. * Added a missing $ in a variable (Closes: #345629). * Added -p to the mkdir's for $ABCDETEMPDIR (Closes: #345630). * Added iconv + converted to utf-8 the charset of a ready-to-send CDDB entry (Closes: #345708). * Added AAC (Mpeg4) support. * Small cd-discid update. -- Jesus Climent Thu, 19 Jan 2006 23:27:40 +0200 abcde 2.3.99.2 * Missing bits in the 2.3.99.1 changelog: - Man page: added information about -z (Debug option). - Corrected config file with the BATCHNORM/NOGAP split (Closes: #337622). - Uses /bin/bash for the time being... We need to get some substitution functions/operations for the bashisms we have: Closes: #337139. * Config bits with corrected typos * Adding musicbrainz support. First bits. * Reworked comparison for numerical answer when selecting a CDDB output. * TODO updated -- Jesus Climent Mon, 12 Dec 2005 23:46:58 +0200 abcde 2.3.99.1 * Both -z and -C unset EJECTCD to avoid ejecting the CD when a) we are debuging and b) we are not using the CD. * If we are not reading the CD, set "loud" to see all the output messages (that is, in most of the cases, the first encoding). * Added -f to force some events that otherwise would erase files from our current run. In the standard configuration ("OUTPUT=vorbis") the following actions will need a "-f" to force the last one: abcde -a read,encode -o ogg,flac abcde -a tag,move,clean During the second run abcde should complain that it is trying to erase the working directory while the it has not performed any action on the FLAC files, which we encoded previously. * Convert the old cdparanoia-audio-tracks file into a status entry to avoid eating files from previous rounds using an early version (Closes: #341050) -- Jesus Climent Tue, 29 Nov 2005 23:27:20 +0200 abcde 2.3.99 * Added diff choice to CDDB entries ("1,4"). * Added SHOWCDDBFIELDS to allow the user to show YEAR and GENRE in the parsed CDDB output. * Suggests mkcue, and erase old cdgrab info since sarge is out. * Changed cdparanoia-audio-tracks to use the status file to save the data. * Added the possibility of using a singletrack flac file with an embedded cuesheet as a source of tracks. * Added -z for easy and quick debug. * BATCH has been split into two options: BATCHNORM which allows, by using -b, to use the -a normalize in all the files at once, and NOGAP, that by using -g, introduces the lame's --nogap extension. * Added replygain using the appropriate tags with Ogg/Vorbis and Ogg/FLAC. * Replaygain is an action, not a flag, since it can be performed individually in the chain of events. * debian/{rules,control}: - Changed the target directory from tmp to abcde, to accommodate to compat mode 4. - Bump standards to 3.6.2.1. No changes needed. * Added "decho" as a DEBUG output for some specific debug variables. * Added USEPIPES file, with information about how to add Unix pipes support. * Added one more checking for PIPES*_* unset variables (which means support is not added to abcde). * Added toolame as an optional MP3 encoder. -- Jesus Climent Sat, 8 Oct 2005 17:05:32 +0300 abcde 2.3.4 * Some patches from Tom Spindler - Added some quoting to the md5sum checkings, since the variables could be null. - NetBSD bits to use ftp instead on anything else to fetch stuff. * do_playlist needs to convert the OUTPUT to the CONTAINERS to avoid ending with playlists pointing to .vorbis files (Closes: #326487). -- Jesus Climent Sat, 3 Sep 2005 16:50:07 +0300 abcde 2.3.3 * Rips done in a single track were getting tagged as Various. Corrected. * Possibly eliminated some bashisms from using a variable as a variable (Closes: #324399). Thanks to A Costa. -- Jesus Climent Fri, 26 Aug 2005 01:36:35 +0300 abcde 2.3.2 * Too fast... I forgot to make the tarball and change the version strings in several places. Fixed. -- Jesus Climent Fri, 19 Aug 2005 00:44:37 +0300 abcde 2.3.1 * The new "I knew there were going to be bugs" upstream release! * MKCUE needs to be passed some $CDROM as an option, or otherwise it will not read the CDROM, in case is not /dev/cdrom. * Also, make the CUEREADER a bit more general, since we might be using other CUE extractors. -- Jesus Climent Thu, 18 Aug 2005 23:44:20 +0300 abcde 2.3.0 * New upstream release! * Defining the tracknumber now resets the first track if given a number different than 1 (that is: abcde -T 1 2-10 creates songs 1 to 9). * Modified the FAQ to reflect the changes on Marillat's repo (Closes: #315724). * Should be "space" safe: works properly when the working directory contains a space (Closes: #147493). * Repared the CD query for the discid code. When failing to read a disc, actually report that there might be no disc in the drive. * Right now, walk over the different encoders we Depends: on in Debian and use the one available: if a user has a FLAC encoder, abcde will no install vorbis-tools, so it will fail to run out of the box (Closes: #321216) * Added CUE support. Still experimental... * Added FLAC on Ogg. Still not activated, since we cannot get comments added as a post-process action. * Applied patches from Fedora Core (Credit goes to Nils Philippsen ) * Added a post_read() function to be executed before ejecting the CD. * Typos reported by A Costa corrected (Closes: #311463) * Problem with abcde being run in a directory with files containing only numbers solved (Closes: #313628). * vorbiscomment uses now "-R" (Closes: #303566). * "-t" and "-T" use the first track as a starter for the track list. (Closes: #305749). * Added CDPARANOIACDROMBUS option to define -d in case of using IDE and SCSI in case of using ide-scsi emulation layer (Closes: #290768). * Define metaflac in abcde.conf (Closes: #303555) * Added the default "-f" option to the configuration file, to represent the actual default option. -- Jesus Climent Thu, 11 Aug 2005 00:47:27 +0300 abcde 2.2.6 * Double quotation added to solve parsing * as a wildcard (Closes: #302904). Thanks to Christian Grigis for the patch. Also (Closes: #268088). -- Jesus Climent Sun, 3 Apr 2005 18:18:03 +0000 abcde 2.2.5 * CDPARANOIAOUTPUT missed some quotes. * Removed some useless lines. * If BATCH is used with ONETRACK, disable BATCH. * Small typos with CDROM comparisons. * Logic for CDROM variable improved. * Version bumped to 2.2.5 and targeted to Sarge. -- Jesus Climent Sat, 2 Apr 2005 21:05:18 +0300 abcde 2.2.4 * Changed the way we call flac, to adapt to the new times: --import-vc-from= to --import-tags-from. * DOSPLAYLIST was not included in the list of options. * Options passed to the encoder by using <-o ogg:"-b 192"> are now supported. One can modify the way abcde encodes just for the current CD. * Unfortunately I forgot to add the starting number for tags in Ogg. For MP3 is a bit more difficult, since it needs changing the X/YY code. * Also, the order of the tags in metaflac is important for the utf8 names. Thanks to Frederik Juul Christiani (Closes: #297482) * Added CDROMID in the .conf file, for reader programs that need it (Closes: #297005) * Added a check for cdparanoia when encountering data-only CDs. -- Jesus Climent Tue, 1 Mar 2005 15:14:24 +0200 abcde 2.2.3 * debian/control - suggest normalize-audio, since it changed its name (Closes: #287674). * Use the default while erasing an existing playlist (Closes: #288835). * Does not destroy track information when a track contains "=" in the name (Closes: #290709). -- Jesus Climent Sat, 22 Jan 2005 15:35:46 +0200 abcde 2.2.2 * Quotes missing when evaluating a value (Closes: #284018). -- Jesus Climent Fri, 3 Dec 2004 09:20:18 +0200 abcde 2.2.1 * Spotted and solved a problem with the way the data tracks were detected (Closes: #282647). -- Jesus Climent Wed, 24 Nov 2004 22:47:54 +0200 abcde 2.2.0 * New release! Let's see if abcde 2.2 gets into Sarge. * Added support for MPP/MP+(Musepack) encoding. Although I am trying to get 2.2 for Debian Sarge release, mpc seems safe enough to introduce. See corecodec.org for code. * Some POSIX shell corrections (making the code more portable). Thanks to Guillem Jover for pointing the problem out. * CDYEAR is also passed to do_move(), so one can use it for sorting the directories. * Small MacOS X fix, allowing directories with "()" to work. Thanks to Evan Jones. - On the MacOS X, I still do not know if abcde works correctly. If does not, please, drop a note. Or else. * DOSPLAYLIST also changes "/" with "\". * DATA tracks are now excluded from the ripping process using internally the cdparanoia "-Q" query option. If using another ripper, it does not work (at least there is no support for them in abcde) (Closes: #112692, #117412). * New "0" choice for "None of the above" has been introduced. If selected, a template is created and the user encouraged to edit it (Closes: #147683). * New options for when the PLAYLIST already exists: erase, append or keep. * Bug fixes along the code: - abcde.1 corrections and additions - abcde corrections and code reorganization. abcde now exits earlier if some of the options are incompatible. Also the actions are set as variables earlier, so we use less calls to external tools. - abcde.conf additions * The GENRE is munged now in its own mungegenre function, so that no more upper-to-lowercase is done (forced) except if the default is used. * Examples added to the tarball and /usr/share/doc/abcde/examples with two scripts to make abcde kind-of-a ripper daemon. * Changed to experimental to have an stable 2.1.x version in Sarge. * Add CDDB information to Ogg/Vorbis and FLAC files (Closes: #265358). * Added INTERACTIVE option. Set it to "n" and there you go, without user interaction. * Changes normalize to normalize-audio (Closes: #267053) * Copes with wav files being erased by the ripping tool. * Small patch to support ()'s in the path under MacOSX. Thanks to Evan Jones for noticing and sending the patch. * Added -w for COMMENT seed. Used to give a comment to a given CD. * Option "-t " added to modify the numbering from a starting point (Closes: #95828). Geez! That is low bug number... * Added -T to modify also the tag entries on the songs. Currently available for FLAC and Ogg/Vorbis. * Removes trailing spaces (Closes: #280382). * TRACKNAME now combines multi-lines from long CDDB entries. * debian/rules: - s/dh_installmanpages/dh_installman/ -- Jesus Climent Sun, 7 Nov 2004 03:11:22 +0200 abcde 2.1.21 * Changed normalize with normalize-audio (Closes: #267053). -- Jesus Climent Fri, 20 Aug 2004 13:16:46 +0000 abcde 2.1.20 * The "Let's have a good abcde in Sarge" release. * The mungefile() function changes * with + by default to avoid creating directories with the start expanded to the files found in the current directory. abcde2.2 will most likelly contain a better workaround. * Correct default OUTPUTFORMAT in man page (Closes: #250649) -- Jesus Climent Fri, 30 Jul 2004 10:16:46 +0300 abcde 2.1.19 * Encoding the whole CD in one file is now possible. Use "-1" as a flag (Closes: #126267). -- Jesus Climent Fri, 9 Apr 2004 17:04:58 +0000 abcde 2.1.18 * Do not release in a hurry. The eject program is not needed if CDSPEEDVALUE is not set and no EJECT action is performed (Closes: #242506) -- Jesus Climent Thu, 8 Apr 2004 05:18:49 +0000 abcde 2.1.17 * Dud! Those missing quotes are going to kill me. Quotes restored and (Closes: #242508). -- Jesus Climent Wed, 7 Apr 2004 06:30:31 +0000 abcde 2.1.16 * New setting for the CD speed. Some drives have a higher failure ratio when spinning at high speed. * Added a pre-read function for preparations. Uses include closing the CD tray (Closes: #137548). * Added COMMENT part in OggFlac metadata. * Documentation update: README, abcde.1 * Do not tag GENRE and DATE in Ogg/Vorbis if CDDB does not provide them (Closes: #235531). * Solved bug with batch encoding, thanks to Travis McKay. * When *DATAPREFIX was set, the playlist creation was made without newline. * Added >&2 redirection to visualize the "Erase playlist" question (Closes: #241221). * Added the option "-m" to modify the resulting playlist, to contain CRLF at the end of every line, letting some hardware players which insist with DOS-style files to use them. Also, added DOSPLAYLIST as a config option. * When using a selected, localy cached CDDB entry, we forgot to show the selection when asking the user for editing the choice. Now we show it. * Improved the logic in the order of events when using a local CDDB repo. -- Jesus Climent Tue, 6 Apr 2004 05:29:38 +0000 abcde 2.1.15 * EDITOR is called now evaluating the variable, so it works with full path and arguments. * Patch for making md5sum a variable (since some systems use a different name). * Correction by "huf" . The test code in line 376 needed some quotes. * The PADDING code and some CDDB funcions were *really* messy. Now it looks cleaner, works faster and some not needed network operations are no longer performed when we are working with local CDDB repositories. * Added "-V" for extra verbosity (on slow networks the user might be waiting and wondering is something is happening). * Solved a bug with the non-interactive code. -- Jesus Climent Mon, 16 Feb 2004 00:13:12 +0000 abcde 2.1.14 * Missing quotes restored (Closes: #228648). -- Jesus Climent Tue, 20 Jan 2004 06:43:04 +0000 abcde 2.1.13 * Solved the problem with re-runs of multiple choices not showing all the choices (Closes: #228405) (this was a quick one) * We now show the selected CDDB entry on a second run, instead of all of them (not that one should stop abcde, but just in case). This way consecutive interrupted runs obtain the same results. -- Jesus Climent Sun, 18 Jan 2004 22:42:15 +0000 abcde 2.1.12 * Check if normalizer is found in the PATH (Closes: #228014) * Added (commented) bits to check if the CD being processed is the CD on the tray, so that if differs we do not eject it. * Store locally the CDDB information, under $HOME/.cddb since it is being used by Grip (at least). PATH is user defined (Closes: #88048) * If you are using cdda2wav and SCSI drives, you can set CDROMID for the SCSI drive, since it differs from the cd-discid CDROM parameter (Closes: #121987). * MacOSX keeps on failing because the OS mounts the CD before we finish ripping it... or something else. Please, test test test the code, and report your findings. Pretty please. I have not been able to make it work with the reports I have received. -- Jesus Climent Fri, 16 Jan 2004 12:06:07 +0000 abcde 2.1.11 * Urgent fixes for the FreeBSD and MacOSX bits. When using cdda2wav, the CDROM variable must be modified depending on the device interface. By now we will not try to be very smart. * Added a test for HTTPGETOPTS since it cannot be empty for the default HTTPGET options. * Quick release to fix a problem with the CDROM detection code. (Closes: #226647) * Cleaned a bashism. Thanks to Klaus Ethgen (Closes: #226782). * Rewrote some parts of the cdda2wav code. Since I do not have a machine where cdda2wav works, I cannot test the code. The modifications have been done following user reports. If you use cdda2wav and abcde does not work for you, please, contact me and we will try to sort things out. Thanks. -- Jesus Climent Thu, 8 Jan 2004 21:36:23 +0000 abcde 2.1.10 * INLINETAG and STARTTRACKNUMBER flags added. * CDROM checking is now done with a bit more wiselly (Closes: #219768) * HTTPGET is only requested is "cddb" action is performed. * Workout the possibility of cdparanoia erasing our wav files (Closes: #172694) * The default answer for editing CDDB data is now "y" if the disk is unknown. If not, the default is "n". Requested by Ricky Buchanan. * Now we do not erase silently any previous $PLAYLISTFILE left behind by a previous CD ripping (Closes: #220753) * Write info file with cdda2wav (Closes: #187702). I do not use cdda2wav myself (me is cd-paranoid) so if anyone using cdda2wav has a problem with this, please, report. * CDROM comes in 1,0,0 kind of format for cdda2wav ripper. Corrected with a quick patch. Kudos go to Mikhail Manuilov for noticing. * Merged bits to make abcde work under MacOSX. Thanks to Evan Jones. * Merged bits to avoid FreeDB people anger and to cut down the "abcde." part of the discid. Now you can set the "-C" command with the directory name. Kudos go to Bart Samwel. * Added some info bits to the config file about normalize, requested by Ricky Buchanan. * Added some testing for the wav file before normalizing, to check that the file is actually there. -- Jesus Climent Mon, 5 Jan 2004 14:43:59 +0000 abcde 2.1.9 * The "First snow in Finland" release. * One head was missing a "-n" * Not use relative links when PLAYLISTDATAPREFIX is set (Closes: #165368) * Stupid use of $OUTPUTTYPE in flac tagging (Closes: #218625) -- Jesus Climent Sun, 2 Nov 2003 09:05:17 +0000 abcde 2.1.8 * Small typo corrected (Closes: #217149) * KEEPWAVS now sets the "clean" action to "no", so the wavs are kept. (Closes: #216551) * Quick release fixing a couple of bugs introduced by the padding patch (Closes: #215962) * Control: Build-Depends-Indep: moved to Build-Depends:, as per http://www.debian.org/doc/debian-policy/ch-relationships.html#s-sourcebinarydeps (Closes: #214200) -- Jesus Climent Thu, 23 Oct 2003 09:49:01 +0000 abcde 2.1.7 * The "Engineer" release. Yeah! I graduated! * Patch applied to solve the track submission interface issues. Kudos to Marc HE Brockschmidt, again (Closes: #126289) * Small bug related with DISTMP3NICE solved. Kudos to Wilbert Alberts. (Closes: #213756) * Padding now creates the list with padded numbers. Test patch. This should solve the problem with delayed tagging a single file. -- Jesus Climent Fri, 13 Oct 2003 09:50:09 +0000 abcde 2.1.6 * Removed a nasty bug where even if the encode failed, the track was marked as successfully encoded (Closes: #208391) * Various Artists has now its own PLAYLIST format (Closes: #137432) * metaflac path corrected (Closes: #206110) * Hopefully this version repairs the comment part for Ogg/Vorbis files. * If nothing breaks, 2.2 will be released as soon as the KNOWNBUG is solved. * Removed all the inline tagging since it breaks the action chain, except in Ogg/Speex. Need to check if "vorbiscomment" can be used for it. (Closes: #206311) * Added DISTMP3NICE variable, to nice the distmp3 program (Closes: #208398) -- Jesus Climent Thu, 4 Sep 2003 10:53:09 +0000 abcde 2.1.5 * Small fixes and patches. + GENRE can be used for OUTPUTFORMAT and PLAYLISTFORMAT + id3v2 should work now with -c for comments (Closes: #199949) + small bug with batch encoding + Variables are exported before the CDDB functions are called, so they should use the right variables for the HTTPGET command. + Tagging also use TRACKS and CDGENRE for MP3 files (kudos to Dirk Ruediger) + FLAC encoding now uses dismp3 to encode remotely (kudos to Taylor and Kevin Cramer). HANDLE WITH CARE ;) Also FLAC now uses CDGENRE and CDYEAR for tagging. * tail/head change: -1 has been deprecated. Noted by Stephan Kulow. * Ogg/Speex support added, for speech encoding (Closes #204635) * Documentation update (Closes: #198825) * Patch for "=" in the name applied (Closes: #197199) -- Jesus Climent Thu, 14 Aug 2003 16:45:29 +0000 abcde 2.1.4 * Small bug fixes: + COMMENT should work now. + Aesthetic padding on the total amount of tracks. + CDROM typo + CDROM is now checked after reading the user defined entries. * Remove trailing args from $EDITOR when checking -x: Closes #179222. -- Jesus Climent Sun, 18 May 2003 18:47:36 +0000 abcde 2.1.3 * Makefile was missing cddb-tool.1. * Introduced dagrab as CD ripping utility. * cddb-tool seq calls converted to functions. No more distro dependencies. * WGET* variables converted to HTTPGET* variables. FreeBSD can safelly use fetch. * More FreeBSD specific bits: CDROM and EJECT changes. * Typo in abcde.conf * Added CDDBPROTO for specifying the protocol level of the cddb query. * CDDB protocol upgraded to 5. CDYEAR and CDGENRE are now used for CD tagging. * COMMENT is now used for inline tagging with oggenc (my mistake it was missing): Closes: #191475. -- Jesus Climent Sat, 10 May 2003 07:49:22 +0000 abcde 2.1.2 * Documentation updates: Closes: #186230. * Usual set of bug fixes and corrections. * Default behaviour of VAOUTPUTFORMAT output changed to avoid multiple directories for a same album. I think the format is more logical, and you can always split the files once they are created. * Padding track wavs with 0 so if you want to burn those wavs just cdrecord *.wav will do it. Use "-p" to force it when encoding a small (<9) number of files (Closes: #111627). * Added "KEEPWAVS" as a variable to keep those wavs. Default is "no". Can use also "-k" in the command line. (Closes: #160372). This probably should be changed with an option to move the wav files to another directory instead of just keep de abcde. directory. * Added documentation comments about OUTPUTTYPE (Closes: #184963). * abcde.conf cleanup: (Closes: #186230, #187400). -- Jesus Climent Tue, 25 Mar 2003 16:39:25 +0200 abcde 2.1.1 * New release. -- Jesus Climent Mon, 17 Mar 2003 08:52:01 +0200 abcde 2.1.0-3 * Since abcde does not depend on eject, an execution test ([-x]) was added, but that means abcde needs a test for eject in the patch if -x is passed: Closes: #184151. * Merged some more bits from Marc 'HE' Brockschmidt: Closes: #126289. * A bit of more info in abcde.conf: Closes: #184963. * cddb-tool version updated to 0.4.2 -- Jesus Climent Fri, 14 Mar 2003 18:00:03 +0000 abcde 2.1.0-2 * Old version string left behind. Updated. * Few more doc update bits. * Patches from Marc 'HE' Brockschmidt: Closes: #149499. * Small patch from Norbert Preining to support multiple output in the output directory. * cddb-tool parses CDYEAR with the help of awk: Closes: #114848. * cddb-tool does not globe "*" characters anymore: Closes: #157448. -- Jesus Climent Fri, 7 Mar 2003 abcde 2.1.0 * The infamous "Works for me(TM)" and "Time to release" release. + We preppend track number now: Closes: #128966. + Itegrate flac: Closes: #126311. + Multi-format encode: Closes: #148934. + Gapless lame encoding: Closes: #172696. + CDROM documented: Closes: #182403. * Applied OpenBSD patches to make the script more portable. Thanks to Han Boetes. * Documentation fixes: closes: #100844, #136741. * NetBSD patches applied: - EXPERIMENTAL Normalize and Batch support. - EXPERIMENTAL FLAC support. * EXPERIMENTAL multiple output support: + multiple output and error checking + multiple lists support * Default output file changed to have the $track_number in the beginning. * abcde takeover. -- Jesus Climent Fri, 28 Feb 2003 abcde 2.0.3 * The Fixed-Yet?-How-About-Now?-What-About-Now?-Now? Release * SMP fixed, mad props to Steve Madsen, closes: #69828, #111806 * Minor code cleanups thanks to Adam Heath * Multiple inexact match results are generated in a safe manner thanks to Nick Martin, closes: #126025 * Removed cddb-tool template generation bashism, thanks to Greg Norris, closes: #126327 * Windows can't handle double quotes in filenames either. The default mungefilename now removes them, closes: #127643 * Using -C with WAVOUTPUTDIR fixed, closes: #127728 * Resuming various artists discs fixed, closes: #127731 -- Robert Woodcock Sun, 27 Jan 2002 abcde 2.0.2 * The One-More-Time-With-Feeling Release * Bladeenc really works this time. Honest. closes: #121988 -- Robert Woodcock Mon, 3 Dec 2001 abcde 2.0.1 * The I-Don't-Listen-To-Sssca Release * Example abcde.conf fixes, closes: #111580 * So much for bladeenc's l3enc compatibility, closes: #110863 * CDDB submit fixes (to enable CDDB submitting, put UNINTENTIONALLY_ANGER_THE_FREEDB_PEOPLE=y in your abcde.conf), closes: #111478, #111500 * Minor mungefilename() cleanup * Small manpage fix * Works with oggenc when POSIXLY_CORRECT is defined, thanks to Juhapekka Tolvanen * Quote remote locations when calling distmp3 * Allow remote encoding of oggs * Only remove wav files if the encoding succeeded * No-local-encoding via -j 0 fixed, thanks to Hans-Joachim Baader * CD read errors are trapped/resumed cleanly now thanks to Pete, closes: #111618 * devfs device check fix, thanks to Clint Adams * Check for seq command - some BSD's have jot instead and abcde can't use that yet * Various Artists playlist generation fixed, thanks to William Lash -- Robert Woodcock Tue, 6 Nov 2001 abcde 2.0 * The Psychiatrist-Says-I'm-Stable-Again Release * Renamed to 2.0 * Minor documentation updates -- Robert Woodcock Wed, 15 Aug 2001 abcde 1.9.10 * The Waiter-There's-A-Proof-In-My-Pudding Release * Fixed some quoting issues preventing abcde from using a temp directory containing spaces, closes: #89682 * Now purges encodetracklocation notes from the status file when resuming. * -a playlist now implies -a cddb * Manpage and default config file updates, closes: #78726, #100841, #100845 * Applied checkstatus patch by Itai Zukerman, fixes certain track number status checking situations, closes: #93395 * Check to see if things run through run_command return a nonzero error code and present the command and error code to the user later, closes: #93485 * Devfs fixup - If /dev/cdrom doesn't exist, try /dev/cdroms/cdrom0, closes: #101933 * If a background process returned an error, log it. If it was an encode process, abandon that encode location and don't wait for the encode process to finish. Display the commandlines that resulted in error exits with their exit codes before aborting. * do_tag handles vorbis commenting failures idempotently * -n works again * Resumes encoding if all files have ripped, closes: #101843 * do_cddbedit code checks to see if it's already been run -- Robert Woodcock Wed, 1 Aug 2001 abcde 1.9.9 * The Not-Quite-Last-In-The-Development-Series Release * I broke ID3v1 comments in 1.9.8, it's fixed now, thanks to Christian Beyerlein for noticing this -- Robert Woodcock Tue, 13 Mar 2001 abcde 1.9.8 * The Groundshaking Release * Now defaults to using FreeDB instead of Gracenote. Pricks. * New VAOUTPUTFORMAT variable for those who like their various artists discs named in a different format * Accommodates the fact that OpenBSD xargs does not eat whitespace, thanks to Marcus Daniel for discovering this * New scheduler for distmp3, thanks to David Bergeron * xingmp3enc support, thanks to Brian Gannon * Stripped down cddb-tool a little bit so that abcde no longer requires mktemp * New -C option to let people continue where they left off if they no longer have the CD handy * ID3COMMENT is now COMMENT * Ogg commenting is now done separately so resuming doesn't break it * More documentation updates -- Robert Woodcock Sat, 10 Mar 2001 abcde 1.9.7 * The Overcast Partial Eclipse Release * Supports ID3v2 * Various Artists heuristics patch by Kevin Everets * New -c option to specify an extra configuration file * Does not try to check if a tagger exists unless OUTPUTTYPE=mp3 * cddb-tool template output fixes * Yet more documentation updates * Avoids id3v2's -c option for now * Adds support for another Various Artists format, "Artist: Title", thanks to Wolfgang Borgert * Fixed typo that was breaking remote encoding support * Hitting control-c while there's nothing in the foreground no longer causes abcde to delete all its work upon exit -- Robert Woodcock Sun, 7 Jan 2001 abcde 1.9.6 * The Squishy Release * Updated getopts call to remove obsoleted options * More documentation fixes, closes: #77957 * Single inexact match spurious question fix * Fixed encoder trigger timing when using -l, closes: #77854 -- Robert Woodcock Sun, 26 Nov 2000 abcde 1.9.5 * The "Run Towards Trick Or Treaters With Scissors" Release * Some documentation updates * mungefilename quoting fix * Implemented -a, which replaces -p, -P, and a number of other things -- Robert Woodcock Mon, 30 Oct 2000 abcde 1.9.4 * The "Run With Scissors" Release * Various Artists support by Kevin Everets * Specifying track numbers on the command line should work again, bash was getting a wee bit confuzzled with the way I had things before. * A couple more error output changes and miscellaneous fixes * OUTPUTDIR works again -- Robert Woodcock Thu, 28 Sep 2000 abcde 1.9.3 * The ugh Release * Brown Paper Bag fix for mp3enc users * Recreated the rest of the variable environment in do_playlist, fixes TRACKNUM availability for real this time, closes: #72535 -- Robert Woodcock Tue, 26 Sep 2000 abcde 1.9.2 * The "Very Long Changelog Entries Can Become Addicting" Release. * Switched default output type to ogg, default encoder to oggenc * Since 1.9.x prompts for CDDB edits by default there is now a -N switch for non-interactivity. * Handles cddb entries with random sprinklings of CR's and LF's * You can now specify niceness for the reader and encoders, thanks to Kevin Everets * -j 0 will now disable local encoding, thanks to Antonio Fiol * Vorbize should actually work now, thanks to Kevin Everets and James LewisMoss * Oggenc/Vorbize commenting support * Made TRACKNUM available for playlist generation * Fleshed out the TODO list a bit more * mungefilename() now translates ':' to ' -' by default. Rationale: You can't put ':' on a FAT filesystem. It also wreaks havoc with Samba. -- Robert Woodcock Mon, 25 Sep 2000 abcde 1.9.1 * The "Don't Fraun" Release. * Fixed a half-dozen minor buglets * A little less debug output, a lot more normal output * Resuming operation works better now * Patched up offline usage again * Broke OUTPUTFORMAT - if you plan on ever using Ogg support, and you've overridden the OUTPUTFORMAT default, change the ".mp3" to ".${OUTPUTTYPE}" * Beginnings of Ogg Vorbis support (vorbize and oggenc) - warning: completely untested -- Robert Woodcock Thu, 17 Aug 2000 abcde 1.9 * The "" Release. * Completely redone tmpfile handling, abcde can now continue where you left off. closes: #42970, #50883, #66668 * Restructured program execution scheduling around central status file * Moved cddb-tool interactivity to abcde, 'cddb-tool get' no longer exists, it is now 'cddb-tool query' and 'cddb-tool read'. * Removed -e, -v, and -V, since abcde will now prompt you if you want to edit or otherwise muck with the data after you have a chance to see it. -- Robert Woodcock Thu, 22 Jun 2000 abcde 1.1.1 * The "That wasn't chicken" release. * Remote distributed encoding had a bad bug in 1.1 - work to be done remotely was duplicated locally (everything still turned out ok - there was just no speedup). Fixed that. * Restructured encode_and_tag function. -- Robert Woodcock Sun, 07 May 2000 abcde 1.1 * The "We heard Mr. Garrison say them a couple of times" Release. * New -r and REMOTEHOSTS option to use distmp3 to encode to multiple hosts at once. * Command-line track range specification (f.e. "abcde 1-12" (Thanks: Vincent Ho) * Now displays minutes/seconds for each track while displaying track titles at the start -- Robert Woodcock Tue, 18 Apr 2000 abcde 1.0.6 * The "Inspected by #17" Release. * New EJECTCD option to eject the CD after all tracks are read (thanks: Hrafnkell F Hlodversson) -- Robert Woodcock Sun, 2 Apr 2000 abcde 1.0.5 * The "...So we can both watch X-Files..." Release. * Quoting fix for setups without space->underscore filename munging * README file URL fixes/updates -- Robert Woodcock Thu, 16 Mar 2000 abcde 1.0.4 * CDPARANOIAOPTS and CDDA2WAVOPTS should work now. -- Robert Woodcock Sun, 20 Feb 2000 abcde 1.0.3 * The "This Space Intentionally Left Blank" Release * Support for reverse and dashed Various Artists discs * More elegant way of passing backtick data * Replaced all `foo` commands with $(foo) * Custom filename munging, closes: #38448 -- Robert Woodcock Wed, 9 Feb 2000 abcde 1.0.2 * Now eats backticks in CDDB input (thanks to Steve Beattie) * mp3enc support (thanks to Richard Jelinek and Chris Ruvolo), closes: #56189 * cddb-tool more gracefully handles no net connection for those with local caching name servers * Fixed HELLOINFO documentation bug, closes: #56189 -- Robert Woodcock Wed, 26 Jan 2000 abcde 1.0.1 * The "s/ever/ Three Days/" Release * Now properly handles double-quotes in Artist and Album data (thanks to Clint Adams), closes: #54888 -- Robert Woodcock Thu, 13 Jan 2000 abcde 1.0 * The "But a 1.0 is Forever" Release * Backed out cddb-tool quoting change, closes: #54005 * Now strips carriage returns from CDDB data, closes: #53815 * Added ID3COMMENT config option -- Robert Woodcock Mon, 10 Jan 2000 abcde 0.8.9 * The "Get it Before the World Implodes" Release * Added -D (debugging option, outputs debugging information to stderr). Very useful for submitting bug reports, hint hint hint :) Just do 'abcde -D 2>logfile' and include logfile in your bug report. * Now uses id3's new -T option to embed track numbers in ID3 tags. * Fixed cddb-tool output for FreeDB submissions, closes: #51986. Thanks to Clint Adams for spotting the problem * New -v switch for Various Artist CD's (thanks to Magenta Hari Nezumi) closes: #43581 * Fixed minor cddb-tool manpage buglet * Fixed cddb-tool output for shell quoting, thanks to Philipp Meier. closes: #52469 -- Robert Woodcock Fri, 31 Dec 1999 abcde 0.8.8 * Added gogo explainations to manpages and example config file * Added code by Stuart Ballard to intelligently use relative paths for playlist files * Added PLAYLISTDATAPREFIX config option for those who wish to prefix their playlist data with things like URL's * Fixed bug added in 0.8 where the multiple inexact match choice selection would be hidden to the user (cddb-tool wasn't sending all user output to stderr as it should). -- Robert Woodcock Sun, 28 Nov 1999 abcde 0.8.7 * Removed parallelization of silent encoder processes -- Robert Woodcock Tue, 16 Nov 1999 abcde 0.8.6 * Removed bashisms (again :) -- Robert Woodcock Sun, 14 Nov 1999 abcde 0.8.5 * Fixed some output issues regarding background encoding that cropped up in 0.8.3 -- Robert Woodcock Sun, 7 Nov 1999 abcde 0.8.4 * New name. A Better CD Encoder. cdgrab was already taken - the original cdgrab name belongs to a CDDA reading program for DOS dating back to 1993. It's still in use and active development, so I'm changing the name of cdgrab instead. See this URL for a description of the original cdgrab: http://www.scn.rain.com/pub/cdrom/cdgrab.txt Your old /etc/cdgrab.conf and/or ~/.cdgrab.conf can simply be renamed to /etc/abcde.conf and ~/.abcde.conf. The program name is now 'abcde'. -- Robert Woodcock Tue, 2 Nov 1999 cdgrab 0.8.3 * cdgrab 0.7 through 0.8.2 would leave around cdgrab.xxxxxx tempfiles with -j. Fixed that. * Fixed quoting issues regarding spaces in output files -- Robert Woodcock Thu, 28 Oct 1999 cdgrab 0.8.2 * Supports the 'gogo' mp3 encoder * cddb-tool escapes double quotes when sourcing its temp files * Added cddb-tool manpage -- Robert Woodcock Sun, 10 Oct 1999 cdgrab 0.8.1 * Cleared up some bashisms from the patches merged in 0.8 -- Robert Woodcock Sun, 19 Sep 1999 cdgrab 0.8 * Fixed a bug where if multiple tracks (but not the entire CD) was specificed explicitly, cdgrab would loop forever after the first track * Now uses Debian's sensible-editor wrapper if available * Merged in patches from Nathaniel J Smith that puts cddb lookup functionality in a separate script, cddb-tool * Adds WAVOUTPUTDIR environment variable for those running out of space in OUTPUTDIR. -- Robert Woodcock Thu, 26 Aug 1999 cdgrab 0.7.7 * Yet another quick fix to finish what 0.7.6 started - cdgrab should now handle multiple inexact matches as well. (Thanks again to Robert Macaulay) -- Robert Woodcock Thu, 12 Aug 1999 cdgrab 0.7.6 * Another quick bugfix release - hopefully this will handle inexact matches properly now. (Thank you Robert Macaulay :) -- Robert Woodcock Mon, 9 Aug 1999 cdgrab 0.7.5 * Quick bugfix release - with any luck I can start on 0.8 soon :) * **** YOU WILL NEED TO EDIT CDGRAB.CONF **** if you use lame as /usr/bin/lamer. The default program name is now 'lame' as of lame v3.0. If you don't want to touch your lame installation, put the following in your cdgrab.conf: "LAME=lamer" * Omits -w from cdparanoia commands * Depends on cdparanoia-bin or cdparanoia now - this accommodates the recent cdparanoia package namechange. * Fixed a stealth-whitespace typo at line 495. Thanks go to Gregory T. Norris for tracking this down. -- Robert Woodcock Tue, 13 Jul 1999 cdgrab 0.7.4 * Now only uses the first match from a CDDB datafile for the track information, this works around a cddb glitch some of you may have hit last month * Default config file now gets version number from program. * added 'debug' option to CDROMREADERSYNTAX to get cdparanoia to only rip the first 5 seconds of a track. This is very useful to those debugging cdgrab, makes things go much faster. This will also prevent me releasing another 0.7.2 :) * Now puts options last on the encoder command line if you are using bladeenc or l3enc, this should allow the proper use of these encoders with additional commandline options (thanks to Justin Hugh Daly for pointing this out) * m3u PLAYLIST SUPPORT! Check out the new -p and -P options! -- Robert Woodcock Mon, 7 Jun 1999 cdgrab 0.7.3 * Fixes wget calling method * -l/LOWDISK documented * Fixes the lowdisk #2 option so it exits cleanly * Lets you enter track info for CDs without CDDB matches now -- Robert Woodcock Sun, 23 May 1999 cdgrab 0.7.2 * Woops, left some debugging code in 0.7.1 - if you have truckloads of 80kb mp3's, try this :) -- Robert Woodcock Sun, 16 May 1999 cdgrab 0.7.1 * LOWDISK/-l option added for those who don't have the disk space to run a parallelized session. * MAXPROCS added to config file * CDDB handling revisited - cdgrab should now properly handle CD's with multiple or inexact CDDB entries. -- Robert Woodcock Fri, 14 May 1999 cdgrab 0.7 * Parallelizes ripping and encoding - this may take substantially more disk space temporarily (up to 500MB or so depending on how fast your CPU is compared to your cdrom drive) but cdgrab will be done with your CD much more quickly. * Allows for SMP optimizations (multiple encoders running at once) with the new -j option * Output fix for TOC printing * cd-discid split off into it's own package -- Robert Woodcock Fri, 7 May 1999 cdgrab 0.6.2 * Fixes encoder and cdrom reader option-passing bug -- Robert Woodcock Sun, 4 Apr 1999 cdgrab 0.6.1 * Adds the -H option (don't create .inf files) when calling cdda2wav * Removed a bashism from the usage function -- Robert Woodcock Mon, 29 Mar 1999 cdgrab 0.6 * Tacks a .wav extension to the wave data temporary file to make bladeenc happy. * Munges /'s to _'s now instead of eating them * Adds command-line option configuration options for backend programs * Properly zero-pads the TRACKNUM variable -- Robert Woodcock Sun, 28 Mar 1999 cdgrab 0.5 * Added support for inexact or multiple CDDB matches * Properly bombs out if CDDB can't come up with a match (without CDDB, you might as well use cdparanoia -B) -- Robert Woodcock Thu, 18 Mar 1999 cdgrab 0.4 * Added ALBUMFILE, fixed manpage reference to it * Deletes editor backups from 'cdgrab -e' automagically (I wish mutt did this :) * Bombs out if there's no CD in the drive * Bombs out if any necessary external programs don't exist * Encourages people to use brackets for OUTPUTFORMAT variables to handle formats like Artist/TrackName_Number.mp3 -- Robert Woodcock Tue, 16 Mar 1999 cdgrab 0.3 * Fixed one thinko in user preferences loading and another in the tagger * New option syntax - if you used to specify a cdrom device through the command line, use 'cdgrab -d device' now to get the same result. * Allows you to edit CDDB response data before using it (-e) * Added support for getting a user-specified selection of tracks * Added support for user-specified output file formats -- Robert Woodcock Wed, 10 Mar 1999 cdgrab 0.2 * Initial release -- Robert Woodcock Sun, 21 Feb 1999 abcde-2.9.3/debian/000077500000000000000000000000001342626142700140145ustar00rootroot00000000000000abcde-2.9.3/debian/changelog000066400000000000000000002414401342626142700156730ustar00rootroot00000000000000abcde (2.9.3-1) unstable; urgency=medium * New upstream version with fixes since the 2.9.2 release: + Replace non-portable sed code for generating offset list with some simple awk instead. Should now work on FreeBSD again. + Deal with bizarre cdda2wav behaviour when doing cdtext lookup - it writes the track information to *stdin*. Closes Issue #89: https://abcde.einval.com/bugzilla/show_bug.cgi?id=89 + Add a warning in abcde.conf about mayb needing to install recode before using it in mungefilename() * Update Standards-Version -- Steve McIntyre <93sam@debian.org> Tue, 05 Feb 2019 09:57:06 +0000 abcde (2.9.2-1) unstable; urgency=medium * New upstream version with fixes since the 2.9.1 release: + Fix up lookup code to deal with spaces etc. in directory names + Cope with "stub" releases in Musicbrainz + Always call glyrc with LC_ALL=C. Thanks to Andreas Vögele for the report and the suggested fix. Closes Issue 83: https://abcde.einval.com/bugzilla/show_bug.cgi?id=50 + Add a link to the CDDB data format in the abcde man page. Closes Issue 81: https://abcde.einval.com/bugzilla/show_bug.cgi?id=81 + More fixups of track number padding. Thanks to John Straw for the patch. * Updates also fix various Debian bugs. Closes: #905124, #893892, #898046 * Add a Depends on sensible-utils -- Steve McIntyre <93sam@debian.org> Thu, 02 Aug 2018 23:34:06 +0800 abcde (2.9.1-1) unstable; urgency=medium * New upstream version with fixes since the 2.9 release: + Fixups in the new Musicbrainz code: - Cope with not finding an entry for a CD! (Closes: #892480) - Fix (again!) dealing with CDs with no release events -- Steve McIntyre <93sam@debian.org> Fri, 09 Mar 2018 23:25:03 +0000 abcde (2.9-1) unstable; urgency=medium * New upstream version with various improvements and bugfixes: + Add some documentation for the aged CD ripper dagrab. Thanks to Teika Kazura for the notification and suggested documentation. This closes Issue 50: https://abcde.einval.com/bugzilla/show_bug.cgi?id=50 + Work by Matthias Andree to address the issue where abcde fails with accented characters from CD-TEXT. The issue and partial fix applied here documented in Issue 53: https://abcde.einval.com/bugzilla/show_bug.cgi?id=53 and also in the abcde mailing list: https://lists.einval.com/pipermail/abcde-users/2017-January/000232.html + Allow for embedding of album art downloaded by the getalbumart function. Currently this is available for flac (using metaflac), mp3 (using eyed3), m4a (using AtomicParsley) and WavPack aka wv (using wvtag). This can be invoked in 3 ways: 1. Use the commandline '-B' option (this will also call getalbumart) 2. Use the commandline '-a embedalbumart' option to add to list of actions 3. Use 'embedalbumart' in the 'ACTIONS' list in ~/.abcde.conf Still needs more development but it is perfectly usable at the moment! + Use md5 rather than md5sum under macOS. Thanks to JCount for the bug report and also the fix. This solves Issue 59: https://abcde.einval.com/bugzilla/show_bug.cgi?id=59 + Support added for encoding with Audio Interchange File Format (AIFF). Thanks to Massimo Villa for the feature request. FFmpeg is required for the encoding, the container and suffix are 'aiff'. + Allow selection of either cddb or musicbrainz from the command line: -Q Select CDDBMETHOD from the command line. Choice is cddb or musicbrainz. + Command line letters are fast running out but the 'Q' option quite neatly stands for 'Query'! + Allow for embedding with do_embedalbumart() for single track encodes when OUTPUTFORMAT and ONETRACKOUTPUTFORMAT are different. Thanks to Ashley Gittins for the bug report. This closes Issue 63: https://abcde.einval.com/bugzilla/show_bug.cgi?id=63 + Experimental support for embedding albumart with ogg files. The slightly tortuous technique drawn from 2 sources: 1. https://github.com/biapy/howto.biapy.com/blob/master/various/mussync-tools 2. https://github.com/acabal/scripts/blob/master/ogg-cover-art Testing is strongly encouraged, perhaps the simplest way to test is with: abcde -o ogg -B Or the appropriate settings in an ~/.abcde.conf file. + Massive rework of CD lookup code so support multiple sources better. Thanks to Gabriel Rosenkoetter for his initial idea in this area, and to Tomasz GoliÅ„ski on irc for initial inspiration on how this should work better. There are now 3 different options for CD lookup: cddb, musicbrainz and cdtext. They can all be listed in a comma-separated list for CDDBMETHOD and the code will now call all of them in the sequence listed. All the results will be combined into one list at the end for the user to select, just like would have previously worked for one source only. Closes Issue 42: https://abcde.einval.com/bugzilla/show_bug.cgi?id=42 Closes: #842180 + Fix Musicbrainz ID calculation in makeids() Apply fix suggested by petecollins24@gmail.com; add PREGAP to LEADOUT to correct Musicbrainz ID calculation. Hopefully closes Issue 54: https://abcde.einval.com/bugzilla/show_bug.cgi?id=54 Closes: #892071 + Fix abcde.mkcue() when handling the --wholedisk option. Thanks to Nino Burini for the patch. Closes Issue 47 and maybe also 45: https://abcde.einval.com/bugzilla/show_bug.cgi?id=47 https://abcde.einval.com/bugzilla/show_bug.cgi?id=45 + Add more comprehensive examples for filename munging in the example config file. Closes Issue 49: https://abcde.einval.com/bugzilla/show_bug.cgi?id=49 + Add a more better fix for the year lookup problem in abcde-musicbrainz-tool Thanks to Tom Samstag for the patch. Closes Issue 57: https://abcde.einval.com/bugzilla/show_bug.cgi?id=57 + Redirect stderr on "which" calls to clear up error noise on some systems. Closes Issue 56: https://abcde.einval.com/bugzilla/show_bug.cgi?id=56 + Add Irix support, based on a patch by abcde@canavan.de. Closes Issue 29: https://abcde.einval.com/bugzilla/show_bug.cgi?id=29 + Rework abcde-musicbrainz-tool to work with WebService::MusicBrainz 1.x Thanks to Nicolas Guillaumin for the patch. Closes Issue 60: https://abcde.einval.com/bugzilla/show_bug.cgi?id=60 Also added a specific dependency on version 1.0.4 or newer, so abcde-musicbrainz-tool will abort if the version found is too old. Since tweaked to deal with multi-artist albums and tracks more completely. + Add resume support in do_getalbumart() + Fix getopts setup for "P". Thanks to Alan W. Kerr for reporting this. + Major set of code cleanups to fix up lots of warnings found with shellcheck, and a few other style issues: - Lots of quoting fixes - Use $( instead of ` - Stop using -o and -a syntax with if [ - use || or && instead - Wrap and shorten some very long lines + Wrap some output messages so they fit on a standard width console + Factor out repeated code and make page() more useful + Add version check before resuming from an old ripping run * Fix up wrong years in old changelog entries. Closes: #852745 * New MusicBrainz code fixes lots of things. Closes: #864006 * Move the Recommends on musicbrainz perl modules to Depends now that MusicBrainz is the default CD lookup method. * Add a version to the Depends on libwebservice-musicbrainz-perl - we now need 1.0.4 or newer. * Various minor packaging updates: + Update Standards-Version to 4.1.3 + Update debhelper version + Switch to source format 3.0 (quilt) + Update the long description to update the list of output formats -- Steve McIntyre <93sam@debian.org> Thu, 08 Mar 2018 14:06:40 +0000 abcde (2.8.1-1) unstable; urgency=medium * New upstream version with one last-minute bugfix: +Fix silly error introduced in abcde-musicbrainz-tool when fixing bug 30. Thanks to Thomas Klausner for the bug/patch. Closes Issue 52: https://abcde.einval.com/bugzilla/show_bug.cgi?id=52 -- Steve McIntyre <93sam@debian.org> Wed, 18 Jan 2017 14:06:40 +0000 abcde (2.8-1) unstable; urgency=medium * New upstream version with various improvements and bugfixes: + Make fdkaac the default for m4a encoding. Faac can still be selected for m4a encding via ~/.abcde.conf file but best not to :). + Split user-definable mungefilename function into mungetrackname, mungeartistname, and mungealbumname, each of which default to mungefilename Thanks to Gerald Turner for the patch and enhancement request. This closes Issue 39: https://abcde.einval.com/bugzilla/show_bug.cgi?id=39 + FAQs: Clarify the exit from multi-result CDDB search. + Fix to allow multiple output formats when aac fallback is triggered. Thanks to Birk Bremer for the bug report. This closes Issue 35: https://abcde.einval.com/bugzilla/show_bug.cgi?id=35 + Fix for some erroneous error and status logging. Thanks to Christian Wasem for the bug report and fix. This closes Issue 32: https://abcde.einval.com/bugzilla/show_bug.cgi?id=32 + Add support for trying multiple CD lookup services in order. Thanks to Gabriel Rosenkoetter for the patch. Closes Issue 42: https://abcde.einval.com/bugzilla/show_bug.cgi?id=42 + Add Recommends on glyrc and imagemagick in Debian packaging. Closes: #827626 + Fix up handling of the first few sectors when reading from a whole-CD flac file or using cdparanoia in one-track mode. Thanks to Matthias König for the patch. Closes Issue 44: https://abcde.einval.com/bugzilla/show_bug.cgi?id=44 + Tweak the fix in musicbrainz for handling sketchy returned data some more. Hopefully closes Issue 30: https://abcde.einval.com/bugzilla/show_bug.cgi?id=30 + Re-enable some commented out cdparanoia/debug code in do_discid. Closes Issue 14: https://abcde.einval.com/bugzilla/show_bug.cgi?id=14 + Add "-a" to lots of grep calls in case of "binary" looking data, e.g. non-ascii text in track titles! Closes Issue 24: https://abcde.einval.com/bugzilla/show_bug.cgi?id=24 + Add "-L" to default curl options, to follow redirects if needed Closes Issue 40: https://abcde.einval.com/bugzilla/show_bug.cgi?id=40 Thanks to Gabriel Rosenkoetter for the patch. + Switch default from "cddb" to "musicbrainz" for track lookup Closes: #842178 * Update debhelper compat level to 10, and tweak debian/rules to fix debhelper warnings. -- Steve McIntyre <93sam@debian.org> Sat, 14 Jan 2017 17:16:20 +0000 abcde (2.7.2-1) unstable; urgency=medium * New upstream version with various improvements and bugfixes: + When using musicbrainz, don't assume that there will be release events attached to a particular CD release. Bug fix for the addition of year information support in 2.7.1. Thanks to Ed Oehler and Alan W. Kerr for debugging help. + Support for output to the Matroska container (mka). Encoder is FFmpeg (or avconv). Thanks to Shantiq and Fakeoutdoorsman of the Ubuntu Forums for the idea. + Add id3tag mp3 tagger as this is the tagger available to OpenBSD users. Thanks to Christopher Zimmermann for the notification and patch. + Allow for cddb response 500. Thanks again to Von Welch for the bug report and patch. This closes Issue 26: https://abcde.einval.com/bugzilla/show_bug.cgi?id=26 + Fix for 'expansion of $REDIR' bug on MacOSX. Thanks to Von Welch for the bug report. This closes Issue 22: https://abcde.einval.com/bugzilla/show_bug.cgi?id=22 + Makefile adjusted to allow the sample abcde.conf file to be installed by default to /etc rather than $(prefix)/etc. Thanks to Volker Schmidt from archlinux for the bug report: https://bugs.archlinux.org/task/46671 + Allow getalbumart to correctly place cover image when single track is selected. Thanks to Nino Burini for the bug report and also the fix. This closes Issue 25: https://abcde.einval.com/bugzilla/show_bug.cgi?id=25 * Update the Homepage URL. Closes: #767810 * Replace various http URLs with https -- Steve McIntyre <93sam@debian.org> Wed, 13 Apr 2016 23:23:19 +0100 abcde (2.7.1-1) unstable; urgency=medium * New upstream version, with lots of improvements and bugfixes: + Rebuild of the abcde Makefile. Thanks to Reuben Thomas and Steve McIntyre as well as ReaperX7, bobzilla, 55020, GazL and dugan from the Slackware Forums. This closes Issue 4: http://abcde.einval.com/bugzilla/show_bug.cgi?id=4 + Fix incorrect use of 'break'. Thanks to Reuben Thomas for the bug report and fix which closes Issue 6: http://abcde.einval.com/bugzilla/show_bug.cgi?id=6 + Make older versions of id3 happy when 'Genre' field is empty. Thanks to Martin Husemann for the fix which closes Issue 8: http://abcde.einval.com/bugzilla/show_bug.cgi?id=8 + Add YEAR and GENRE variables to do_getalbumart(). Thanks to Johannes Gernemann for this patch which closes issue 9: http://abcde.einval.com/bugzilla/show_bug.cgi?id=9 + Support added for encoding to True Audio using tta while still supporting the older ttaenc. Tagging is with mid3v2. + Support added for encoding to MPEG-1 Audio Layer II (mp2) with either twolame or FFmpeg / avconv. Tagging with mid3v2. + Encoding to WavPack with FFmpeg. Some slight changes to WavPack syntax with backward compatibility built in for abcde 2.7. + Encoding to m4a container with FFmpeg or avconv. This allows for alac encoding with FFmpeg's reverse engineered alac encoder. + AAC encoding with fhgaacenc via Wine. Tagging is provided by AtomicParsley which has been added back to abcde :). This allows encoding with HE-AAC v2, unavailable with qaac. + Support added for AAC encoding with qaac via Wine. This also allows for Apple Lossless Audio Coding (alac) using either qaac or refalac. This closes Issue 142, thanks to Bernd Fischer-Krellenberg for the enhancement request. + Grab year information too when using musicbrainz. Thanks to Marco Hoppstaedter for the patch. Closes issue 10: http://abcde.einval.com/bugzilla/show_bug.cgi?id=10 * Update debian/watch to match the new upstream home. -- Steve McIntyre <93sam@debian.org> Mon, 02 Nov 2015 18:29:19 +0000 abcde (2.7-1) unstable; urgency=medium * Remove Jesus and Colin from Maintainer and Uploaders fields, as they've moved on. Thanks to both for their efforts! * Update the Vcs- fields to point to current upstream. * Clarify the old "public domain" mention in the license, now removed upstream. * Remove TODO file, removed upstream * New upstream version, with lots of improvements and bugfixes: + Rewrite of abcde's mungefilename function. Thanks to Andreas Kusalananda Kahari for this and also thanks to Andrew Willis for the report which triggered the rewrite. Thanks also to shughes for an earlier report. This closes Issues 72 and 135. + TRACKTOTAL now written to flac and ogg files. Thanks to monkth for the notification. This resolves Issue 76. + Support added for the downloading of album art. A huge thank you to Johannes Gernemann who came forward with the technique used and also the original patch. An equally huge thanks to Richard who extended and greatly enhanced the original patch. Detailed documentation added to the abcde FAQ document although the sane defaults in place will guarantee a good experience even for those who do not read documentation! This closes Issue 33. + Support added for ripping with the GNU Compact Disc Input and Control library (libcdio) as requested by both gentoo and NixOS. The utility used is cd-paranoia and can best be called from a conf file as follows: CDROMREADERSYNTAX=libcdio CD_PARANOIA=cd-paranoia CDPARANOIAOPTS="--never-skip=40 --verbose" with the CD_PARANOIA variable giving the correct path to cd-paranoia. I believe that cd-paranoia uses the same options as cdparanoia but if I am proven incorrect this will need to be rectified... + Fix for encoding with bladeenc and usepipes. + Fix for broken ripping with dagrab. Closes Issue 140. + Fix for diskutil selecting wrong disk on OS X. Thanks to Richard for this fix which closes Issue 139. + Added some error checking and documentation for the abcde-musicbrainz-tool. Thanks yet again to Matthias Andree for this work! Closes issue 138. + New variables for m4a/aac encoding options to be manipulated in a users ~/.abcde.conf file: 1. FAACENCOPTS for faac encoding options 2. NEROAACENCOPTS for neroAacEnc options 3. FDKAACENCOPTS for fdkaacenc options Note that these options replace the now obsolete AACENCOPTS. + Check added for neroAacTag when encoding with neroAacEnc. + Several additions to usepipes with the following encoders being added: 1. mp3enc: mp3 2. speexenc: Speex 3. mpcenc: Musepack SV8 4. wavpack: WavPack 5. faac: aac 6. neroAacEnc: aac 7. fdkaac: aac The cd ripper cdda2wav (icedax) has also been added. + Ripping and encoding with 'usepipes' fixed. This fix closes Issue 46. + Suggested encoding options for mp3enc added to the sample abcde.conf. Last release of mp3enc in 1998 but it still works flawlessly with a modern abcde! + Suggested encoding options for l3enc added to the sample abcde.conf. Congratulations to abcde which in 2015 still works with l3enc which saw its final release in 1997! + Fix for -o option use with options and multiple outputs. This allows for commandline options such as the following: abcde -o 'flac:-8,mp3:-b 320' Thanks to Matthias Andree for yet another quality patch! This closes Issue 136. + Support added for ReplayGain with WavPack encoding. + Fix for MusePack to allow the use of the SV8 ReplayGain application 'mpcgain'. + Monkey's Audio (ape) encoding added. Tagging is with Robert Muth's apetag. Thanks to Shantiq for testing. + Simplify Opus tagging.This closes Issue 133. + Allow 'clean' when OUTPUTTYPE=wav, broken for some time. Thanks to Roger rogerx.ossgmail.com for showing the problem and demonstrating the fix. This closes Issue 94. + Clarification that CDDBLOCALRECURSIVE=y is required for local CDDB search. Thanks to Reuben Thomas for the notification. This partially resolves Issue 121. + AtomicParsley removed from debian/control, WavPack added. + Details of abcde's handling of faac compiled with and without mp4v2 added as a new entry to FAQs. + Fix to allow display of the 'date' meta tag generated by eyeD3 in vlc, Audacious and friends. Thanks to Reuben Thomas. This closes Issue 126. + Fix for flac floating point error. Thanks to rwvtveer for the patch which closes Issue 113. + Formalised 3 methods of mp3 tagging using ID3TAGV: 1.id3v2.4 using eyeD3 (set in abcde as the default) 2.id3v2.3 using id3v2 3.id3v1 using id3 Thanks to Adriaan for this patch which fixes issue 101. + Support for WavPack added. Closes issue 123. + Fix for mp3 encoding with different versions of eyeD3. Thanks to Matthias Andree for this patch. + Major AAC encoding cleanup, including addition of the fdkaac encoder. Thanks to Doug Mcmahon for assistance with this. -- Steve McIntyre <93sam@debian.org> Fri, 19 Jun 2015 13:18:14 +0200 abcde (2.6-2) unstable; urgency=medium * Thanks to Andreas/Samuel for the previous upload attempting to fix eyeD3 support, but it still seems buggy. :-( * Instead, merge the upstream change that auto-detects the version/syntax of eyeD3 on the system and uses the right set of options. Closes: #776908 -- Steve McIntyre <93sam@debian.org> Tue, 17 Feb 2015 23:36:34 +0930 abcde (2.6-1.1) unstable; urgency=medium * Non-maintainer upload. * Invoke eyeD3 with --set-encoding/--set-text-frame instead of --encoding/--text-frame since Debian's version of eyeD3 is pre 0.7. Also version the Suggests on eyed3 (<< 0.7~). (Patches by Samuel Thibault) Closes: #772778 -- Andreas Metzler Sun, 11 Jan 2015 17:52:39 +0100 abcde (2.6-1) unstable; urgency=medium * New upstream release with lots of bug fixes: + Fix finding $CDROM on OS X. Thanks to niederstrasser for the patch. Closes issue 71. + USEID3 and USEID3V2 variables are unused now, so remove them. Thanks to vskytta for the patch. Closes issue 73. + Clean up movement to eyeD3, remove id3v2 remnants. Thanks to vskytta for the patch. Closes issue 74. + Fix infinite loop if cddb fails. Thanks to Dominic Hargreaves for the patch. Closes: #687038 in Debian + Switch from Musepack SV7 to SV8. Thanks to Andrew Strong for the patch. + Allow aac encoding with neroAacEnc. Thanks to atheren for the patch. Closes issue 8. + Allow opus encoding with opusenc. Thanks to Tomasz Golinski for the patch. Closes issue 70. + Fix typo: s/CUEWAVEFILE/CUEWAVFILE/ so that abcde.mkcue should now produce working cue files. Closes issue 78. + Remove no-op -q option. Closes issue 106. Thanks to vskytta for the patch. + Fix issue 112: perl encoding pragma deprecation. Thanks to Alex Corrie for the patch. + Fix option parsing for multiple output formats. Thanks to matthias.andree@gmx.de for the patch. Closes issue 115. + Fix eyeD3 tagging for cddb entries without year. Thanks to vskytta for the patch. Closes issue 107 + Add mention of CD-TEXT support in the man page. Closes issue 102. + Make Y/N prompting more consistent. Closes issue 95 + Remove the no-op -B option. Closes: #426531 in Debian + Document the need to escape parentheses in tag comments. Closes: #256941 in Debian. + Concatenate option steps on -t/-T option. Thanks to Charles Steinkuehler for the patch. Closes: #391294 in Debian + Try to use bsd-mailx where possible to force UTF-8 for cddb-tool mail submissions. If not possible, attempt to force UTF-8 via the environment and fall back to mail instead. Closes: #756289 in Debian, issue 111. * Update Standards-Version -- Steve McIntyre <93sam@debian.org> Sun, 26 Oct 2014 13:33:50 -0700 abcde (2.5.4-1) unstable; urgency=low * New upstream release with bug fixes. + Update GPL/FSF headers to match current versions. Thanks to vskytta for the patch. (Closes issue 69). + Fix the command line for ID3SYNTAX=eyed3. Thanks to neil.gm.richards for the patch. Closes issue 50. + Switch to eyed3 by default for MP3 tagging, as it looks to do UTF-8 tagging better. Closes issue 22 (hopefully) * Remove the "A " from the beginning of the description to fix a lintian warning -- Steve McIntyre <93sam@debian.org> Tue, 18 Sep 2012 13:22:28 +0100 abcde (2.5.3-1) unstable; urgency=low * New upstream release with lots of bug fixes. + Sort options alphabetically (Closes issue 58). Thanks to vskytta for the patch. + Add Recommends: mailx in the Debian packaging for Debian/Ubuntu users. Closes: #607147 + Fix encoding call for m4a. (Closes issue 31). Closes: #449045 + Fix do_musicbrainz() for the case where there are no matches. + When using Musicbrainz, checksum and only output unique matches for an album. Closes: #669143 + Add Recommends: atomicparsley in the Debian packaging for Debian/Ubuntu users. LP: #535527 + Remove documentation of the old "-R" option for recursive searching of local CDDB data, it's now enabled always. (Closes issue 57). + Fix use of awk (sub instead of substr) when generating CRLF line endings. (Closes issue 59). + Make sure that ABCDETEMPDIR is quoted so we can deal with spaces in file and directory names. Closes issue 64. Thanks to richard.security.consultant for the patch, adapted slightly. + Tweak do_cdtext() so it works on OS X too. Closes issue 65. Thanks to richard.security.consultant for the patch. + Change cddb-tool to use bash to make sure that echo -n works. Closes issue 67. + Fixes for lots of spelling mistakes from vskytta. Closes issue 68. + For safety across different systems, avoid using "sed -i". Closes issue 66. -- Steve McIntyre <93sam@debian.org> Sat, 16 Jun 2012 15:12:11 +0100 abcde (2.5.2-1) unstable; urgency=low * New upstream release, fixing a silly bug in the 2.5.1 release: + Re-fix speex tagging. (Closes issue 19). Thanks to vskytta for pointing out the problem - patch not applied properly in 2.5.1 -- Steve McIntyre <93sam@debian.org> Sun, 29 Apr 2012 17:28:22 +0100 abcde (2.5.1-1) unstable; urgency=low * New upstream release, fixing lots of bugs: + Several patches for improved Musicbrainz support from Martin Michlmayr: - add musicbrainz support for FLAC files with embedded cue files. Closes: #669139 - Don't submit to CDDB server when using musicbrainz Closes: #669140 - Don't tag CDDB string with musicbrainz id Closes: #669141 + Fix speex tagging. (Closes issue 19). Thanks to vskytta for the patch. + Fix aac tagging. (Closes issue 7). Thanks to Andrew Strong for forwarding the patch. + Add ATOMICPARSLEY=AtomicParsley (Closes issue 37). + On OS X, switch from disktool to diskutil. (Closes issue 43). + Updates for CD device detection: - Look for /dev/sr0, in case /dev/cdrom doesn't exist. (Closes issue 52). - Add suggested diskutil code to auto-detect the CD on OS X. (Closes issue 45). + Check that we have $CDDBTOOL before we start. (Closes issue 27). + Change the meaning of EXTRAVERBOSE; previously, it was a y/n option to make things more verbose. Add extra levels of verbosity (0, 1, 2 so far) and a new vvecho() function for callers to use. + With EXTRAVERBOSE==2 or more, make run_command() print out each command as it's run. (Closes issue 39). + If we don't find any CDDB or Musicbrainz information for the CD, try to extract CD-Text information to populate the cddbinfo template. (Closes issue 41). Closes: #449206. + Try to give more helpful error messages when we can't parse the command line, and exit rather than carry on. (Closes issue 51). + replace deprecated egrep with grep -E (Closes issue 24). Thanks to vskytta for the patch. + remove -o 0 options from make install (Closes issue 17). Thanks to vskytta for the patch. + clean up indentation on older changelog entries + remove tarball target from Makefile since dir structure has changed now that we use subversion. + improve presentation of options/defaults when asking a question (closes issue 9) -- Steve McIntyre <93sam@debian.org> Thu, 25 Apr 2012 13:04:57 +0100 abcde (2.5.0-1) unstable; urgency=low * New upstream release, fixing several bugs: + Add support for Musicbrainz using a perl helper script. Closes: #665970 + Tweak man page. Thanks to Mats Erik Andersson for the patch. Closes: #627237 + Make the -q option work again. Thanks to A Mennucc for the patch. Closes: #562522 * Remove the Suggests: python-musicbrainz; it's never been used and this patch makes it totally obsolete. Closes: #657003 * Add Steve McIntyre to Uploaders * Update debhelper build-dep. * Add build-arch and build-indep rules * Update Standards-Version to 3.9.3 -- Steve McIntyre <93sam@debian.org> Fri, 13 Apr 2012 22:29:45 +0100 abcde (2.4.2-1) unstable; urgency=low * Bumped to 2.4.2 * Update standards version to 3.8.4 (no changes required). * Fix Cue file always references "dummy.wav" bug patch from Chris Chiappa (Closes: #459928). * Fix leadin/leadout computation for cue files broken bug Patch from Martin Michlmayr (Closes: #582175). -- Colin Tuckley Sat, 29 May 2010 09:43:54 +0100 abcde (2.4.1-1) unstable; urgency=low * Bumped to 2.4.1 * In manpage note a 2nd use for LOWDISK (or '-l' switch) it's faster and better on scratchy disks (Closes: #426343). * Add configurable options for replaygain tools (Closes: #426544). * Fix syntax error in tagged speex command (Closes: #554406) Ubuntu patch by Michael Helmling. * Fix mp3 tagging fails (for single author albums) (Closes: #554030) patch from Christof Douma. -- Colin Tuckley Sun, 14 Feb 2010 13:07:34 +0000 abcde (2.4.0-1) unstable; urgency=low [ Jesus Climent ] * Bumped to 2.4.0 * Corrected REDIR redirection, this time with ifs instead of variable substitution, which did not work (Closes: #527191). * Added TPE2 for Various artists definition (Closes: #521669). [ Colin Tuckley ] * Incorporate syntax error fix patch from Andrew Ruder. * Fix formatting for track number tagging (Closes: #520367, #435665). * Replace dependency on cdda2wav with icedax since the former has been superseded (Closes: #447397). * Update standards version to 3.8.3 (no changes required). -- Colin Tuckley Fri, 16 Oct 2009 21:05:41 +0100 abcde (2.3.99.8-1) unstable; urgency=low * Remove svn Revision tag from version. * Correct homepage URL in README (Closes: #526165). * Fix typos (Closes: #435605, #435606). * Fix misspelling of comma in script and manpage (Closes: #435603). * Fix Writable temp directories not owned/writeable (Closes: #143552). * Fix broken range code, patch from Charles Steinkuehler (Closes: #389981). * Remove unneeded escapes in cddb-tool URLs. Add support for freedb2 (Closes: #391110). another patch from Charles Steinkuehler. * Fix Endless loop possible when mp3gain asks clipping question bug (Closes: #411579). * Update Vcs-Svn: tag in debian/control. * Add a recommends for vorbis-tools (Closes: #392843). * Update standards version to 3.8.2 (no changes required). * Fix debian/preinst not to ignore errors. -- Colin Tuckley Sun, 02 Aug 2009 13:32:30 +0100 abcde (2.3.99.7-1) unstable; urgency=low [ Jesus Climent ] * The "It took me a long time to get this release out" release. * abcde.1: remove -M in favour of "-a cue" (Closes: #382614, #396505). * Added a check for a DOCUE already set in the command line (Closes: #385663). * Added -q as a quality option. * PREGAP was not set in some situations (Closes: #390170). * Corrected debian/changelog. * Added -nv to wget for "no verbose" output, to avoid wget complaining it cannot be quiet and verbose at the same time if "verbose = on" is set in ~/.wgetrc (Closes: #388715). * Added XS-Vcs-Svn: field to control file. * Added some hints if we are using Debian for what packages need to be installed if their binaries are not found. * Spelling mistakes corrected (thanks to Ville Skytta). * Unset GREP_OPTIONS to avoid things like printing number in the beginning of the line (Closes: #383771). * Default answer to erase a playlist was not working (thanks to Charles Steinkuehler) (Closes: #395108). * Corrected man page wrapping. Thanks to Edward J. Shornock (Closes: #399289). * Adds DISCNUMBER to Ogg/Vorbis and FLAC when using -W. * Minor typos (Closes: #458995). * Added AtomicParley for AAC encoding. Thanks to Bill Adams. * Added by Marc Staveley: - post_encode hook. - track comments if null and present in CDDB. * Corrected copyright information (Closes: #516535). [ Colin Tuckley ] * Added new uploader (Closes: #529695). * Fix Lintian warning for make-clean-error. * Fix FSF address in debian/copyright. * Fix binary-arch-rules-but-pkg-is-arch-indep lintian warning. * Add homepage: field to debian/control * Update standards version to 3.8.0 * Remove debian/conffiles (it is not needed). * Fix syntax error in abcde (missing fi). -- Colin Tuckley Sat, 25 Jul 2009 09:50:42 +0100 abcde (2.3.99.6-1) unstable; urgency=low * Default to UNICODE (UTF8) tags and comments (Closes: #282332). - Added CDDBPROTO option in config file (Closes: #349951) * Added a missing "INDEX 01" entry for CUE sheet creation. * Avoid completing the encoding of files if we aborted previously. * Embed the CUE sheet if we have a cuesheet file and we have a single FLAC file, even if we are not tagging. This way we can use the file as a source even if it is not tagged/named properly. * Fails to quote filenames properly (Closes: #355296) * Introduced VA/ONETRACKOUTPUTFORMAT. * Added a missing check for AACENCODER. * Updated config file with some new AAC bits. * Updated FSF address. * Corrected NetBSD options for ftp (Thanks to Marius). * The final 2.4 will have "cuefile" as an action instead of as a flag. * Create the cuefile when extracting from a FLAC file. * Small bugs (Charles Steinkuehler): - Added missing quotes (Closes: #375710) - toolame is included in Debian as default MP3 encoder - Use IFS to preserve spaces when adding metadata to a cuefile * Small documentation changes: - abcde.1 (Closes: #364978) * The following entries have in common that both add an internal cue2discid function. I will evaluate which one is more accurate and decide which one to use. Right now they are not conflicting: - Added internal mkcue and cue2discid functions (Charles Steinkuehler) and add a check for internal abcde. to make sure we are using the correct version (not sure if needed ;) - Added an internal implementation of cue2discid, so there is no need for an external program to do the conversion. Thanks to Michael (sorry, his mail does not have a surname). * cue2discid is now an internal function, so no need for including the python script in the path (Closes: #378407) * cddb-tool.1 typo (Thanks to A. Costa) (Closes: #351775) * abcde.1 typo (Thanks to David L. Anselmi) (Closes: #364978) * Set proper nice values to not separate encoding and reading in the pipes situation, while having a high priority process running in the system. Also, set proper nice values to tagging tasks. Reading should remain as the default higher priority task in the abcde flow (Closes: #359156) * Standards bumped to 3.7.2.1, no changes needed. -- Jesus Climent Sat, 5 Aug 2006 05:26:56 +0300 abcde (2.3.99.5-1) unstable; urgency=low * Repaired multiple CDDB entries when recursive search is active. * Patch from A. Costa to clean some typos (Closes: #351774). -- Jesus Climent Thu, 07 Feb 2006 23:48:00 +0200 abcde (2.3.99.4-1) unstable; urgency=low * Repaired multiple output encoding (Closes: #351362). * Added missing space on a [] test statement. * Added "default" action, so that one can add things on top of what we do regularly, without having to list everything: "-a default,playlist" works. * Restored all the > /dev/null instead of using grep -q, since it is not portable. * Added Solaris OS entry, in case we need to define things for it. -- Jesus Climent Thu, 05 Feb 2006 15:24:00 +0200 abcde (2.3.99.3-1) unstable; urgency=low * The "Mao es nuestro indiscutible lider" release. * Check the CDROMREADER options we have in Debian which we depend on. Thanks to Jose Carlos Garcia Sogo for finding the error. * New recursive option for local CDDB repositories, to cope with other players saving the entries. * Brand new CD backup procedure: rip a CD into a single FLAC trac with an embedded cuesheet using "-1 -M -o flac" and proceed to rip your tracks from the obtained file using "-d file.flac -o ". It needs cue2discid script from the examples directory to work. OH! If you manage to get it working with bash, we can get rid of the python dependency... * Initial steps to make abcde working with musicbrainz, although it is not ready yet. * Added a missing $ in a variable (Closes: #345629). * Added -p to the mkdir's for $ABCDETEMPDIR (Closes: #345630). * Added iconv + converted to utf-8 the charset of a ready-to-send CDDB entry (Closes: #345708). * Added AAC (Mpeg4) support. * Small cd-discid update. -- Jesus Climent Thu, 19 Jan 2006 23:27:40 +0200 abcde (2.3.99.2-1) unstable; urgency=low * Missing bits in the 2.3.99.1 changelog: - Man page: added information about -z (Debug option). - Corrected config file with the BATCHNORM/NOGAP split (Closes: #337622). - Uses /bin/bash for the time being... We need to get some substitution functions/operations for the bashisms we have: Closes: #337139. * Config bits with corrected typos * Adding musicbrainz support. First bits. * Reworked comparison for numerical answer when selecting a CDDB output. * TODO updated -- Jesus Climent Mon, 12 Dec 2005 23:46:58 +0200 abcde (2.3.99.1-1) unstable; urgency=low * Both -z and -C unset EJECTCD to avoid ejecting the CD when a) we are debuging and b) we are not using the CD. * If we are not reading the CD, set "loud" to see all the output messages (that is, in most of the cases, the first encoding). * Added -f to force some events that otherwise would erase files from our current run. In the standard configuration ("OUTPUT=vorbis") the following actions will need a "-f" to force the last one: abcde -a read,encode -o ogg,flac abcde -a tag,move,clean During the second run abcde should complain that it is trying to erase the working directory while the it has not performed any action on the FLAC files, which we encoded previously. * Convert the old cdparanoia-audio-tracks file into a status entry to avoid eating files from previous rounds using an early version (Closes: #341050) -- Jesus Climent Tue, 29 Nov 2005 23:27:20 +0200 abcde (2.3.99-1) unstable; urgency=low * Added diff choice to CDDB entries ("1,4"). * Added SHOWCDDBFIELDS to allow the user to show YEAR and GENRE in the parsed CDDB output. * Suggests mkcue, and erase old cdgrab info since sarge is out. * Changed cdparanoia-audio-tracks to use the status file to save the data. * Added the possibility of using a singletrack flac file with an embeded cuesheet as a source of tracks. * Added -z for easy and quick debug. * BATCH has been split into two options: BATCHNORM which allows, by using -b, to use the -a normalize in all the files at once, and NOGAP, that by using -g, introduces the lame's --nogap extension. * Added replygain using the appropriate tags with Ogg/Vorbis and Ogg/FLAC. * Replaygain is an action, not a flag, since it can be performed individually in the chain of events. * debian/{rules,control}: - Changed the target directory from tmp to abcde, to accommodate to compat mode 4. - Bump standards to 3.6.2.1. No changes needed. * Added "decho" as a DEBUG output for some specific debug variables. * Added USEPIPES file, with information about how to add Unix pipes support. * Added one more checking for PIPES*_* unset variables (which means support is not added to abcde). * Added toolame as an optional MP3 encoder. * Added a "-u" flag to set the FreeDB/whatever-cddb-server-you-use to use th 6th step of the protocol and request the entries in UTF-8, which hopefully will add the expected UTF-8 tags and comments. -- Jesus Climent Sat, 22 Oct 2005 22:53:37 +0300 abcde (2.3.4-1) unstable; urgency=low * Some patches from Tom Spindler - Added some quoting to the md5sum checkings, since the variables could be null. - NetBSD bits to use ftp instead on anything else to fetch stuff. * do_playlist needs to convert the OUTPUT to the CONTAINERS to avoid ending with playlists pointing to .vorbis files (Closes: #326487). -- Jesus Climent Sat, 3 Sep 2005 16:50:07 +0300 abcde (2.3.3-1) unstable; urgency=low * Rips done in a single track were getting tagged as Various. Corrected. * Possibly eliminated some bashisms from using a variable as a variable (Closes: #324399). Thanks to A Costa. -- Jesus Climent Fri, 26 Aug 2005 01:36:35 +0300 abcde (2.3.2-1) unstable; urgency=low * Too fast... I forgot to make the tarball and change the version strings in several places. Fixed. -- Jesus Climent Fri, 19 Aug 2005 00:44:37 +0300 abcde (2.3.1-1) unstable; urgency=low * The new "I knew there were going to be bugs" upstream release! * MKCUE needs to be passed some $CDROM as an option, or otherwise it will not read the CDROM, in case is not /dev/cdrom. * Also, make the CUEREADER a bit more general, since we might be using other CUE extractors. -- Jesus Climent Thu, 18 Aug 2005 23:44:20 +0300 abcde (2.3.0-1) unstable; urgency=low * New upstream release! * Defining the tracknumber now resets the first track if given a number different than 1 (that is: abcde -T 1 2-10 creates songs 1 to 9). * Modified the FAQ to reflect the changes on Marillat's repo (Closes: #315724). * Should be "space" safe: works properly when the working directory contains a space (Closes: #147493). * Repared the CD query for the discid code. When failing to read a disc, actually report that there might be no disc in the drive. * Right now, walk over the different encoders we Depends: on in Debian and use the one available: if a user has a FLAC encoder, abcde will no install vorbis-tools, so it will fail to run out of the box (Closes: #321216) * Added CUE support. Still experimental... * Added FLAC on Ogg. Still not activated, since we cannot get comments added as a post-process action. * Applied patches from Fedora Core (Credit goes to Nils Philippsen ) * Added a post_read() function to be executed before ejecting the CD. * Typos reported by A Costa corrected (Closes: #311463) * Problem with abcde being run in a directory with files containing only numbers solved (Closes: #313628). * vorbiscomment uses now "-R" (Closes: #303566). * "-t" and "-T" use the first track as a starter for the track list. (Closes: #305749). * Added CDPARANOIACDROMBUS option to define -d in case of using IDE and SCSI in case of using ide-scsi emulation layer (Closes: #290768). * Define metaflac in abcde.conf (Closes: #303555) * Added the default "-f" option to the configuration file, to represent the actual default option. -- Jesus Climent Thu, 11 Aug 2005 00:47:27 +0300 abcde (2.2.6-1) unstable; urgency=low * Double quotation added to solve parsing * as a wildcard (Closes: #302904). Thanks to Christian Grigis for the patch. Also (Closes: #268088). -- Jesus Climent Sun, 3 Apr 2005 18:18:03 +0000 abcde (2.2.5-1) unstable; urgency=low * CDPARANOIAOUTPUT missed some quotes. * Removed some useless lines. * If BATCH is used with ONETRACK, disable BATCH. * Small typos with CDROM comparisons. * Logic for CDROM variable improved. * Version bumped to 2.2.5 and targeted to Sarge. -- Jesus Climent Sat, 2 Apr 2005 21:05:18 +0300 abcde (2.2.4-1) unstable; urgency=low * Changed the way we call flac, to adapt to the new times: --import-vc-from= to --import-tags-from. * DOSPLAYLIST was not included in the list of options. * Options passed to the encoder by using <-o ogg:"-b 192"> are now supported. One can modify the way abcde encodes just for the current CD. * Unfortunatelly I forgot to add the starting number for tags in Ogg. For MP3 is a bit more difficult, since it needs changing the X/YY code. * Also, the order of the tags in metaflac is important for the utf8 names. Thanks to Frederik Juul Christiani (Closes: #297482) * Added CDROMID in the .conf file, for reader programs that need it (Closes: #297005) * Added a check for cdparanoia when encountering data-only CDs. -- Jesus Climent Tue, 1 Mar 2005 15:14:24 +0200 abcde (2.2.3-1) unstable; urgency=low * debian/control - suggest normalize-audio, since it changed its name (Closes: #287674). * Use the default while erasing an existing playlist (Closes: #288835). * Does not destroy track information when a track contains "=" in the name (Closes: #290709). -- Jesus Climent Sat, 22 Jan 2005 15:35:46 +0200 abcde (2.2.2-1) unstable; urgency=low * Quotes missing when evaluating a value (Closes: #284018). -- Jesus Climent Fri, 3 Dec 2004 09:20:18 +0200 abcde (2.2.1-1) unstable; urgency=low * Spotted and solved a problem with the way the data tracks were detected (Closes: #282647). -- Jesus Climent Wed, 24 Nov 2004 22:47:54 +0200 abcde (2.2.0-1) unstable; urgency=low * New release! Let's see if abcde 2.2 gets into Sarge. * debian/control - Bumped to 3.6.1.1. No changes needed. * Added support for MPP/MP+(Musepack) encoding. Although I am trying to get 2.2 for Debian Sarge release, mpc seems safe enough to introduce. See corecodec.org for code. * Some POSIX shell corrections (making the code more portable). Thanks to Guillem Jover for pointing the problem out. * CDYEAR is also passed to do_move(), so one can use it for sorting the directories. * Small MacOS X fix, allowing directories with "()" to work. Thanks to Evan Jones. - On the MacOS X, I still do not know if abcde works correctly. If does not, please, drop a note. Or else. * DOSPLAYLIST also changes "/" with "\". * DATA tracks are now excluded from the ripping process using internally the cdparanoia "-Q" query option. If using another ripper, it does not work (at least there is no support for them in abcde) (Closes: #112692, #117412). * New "0" choice for "None of the above" has been introduced. If selected, a template is created and the user encouraged to edit it (Closes: #147683). * New options for when the PLAYLIST already exists: erase, append or keep. * Bug fixes along the code: - abcde.1 corrections and additions - abcde corrections and code reorganization. abcde now exits earlier if some of the options are incompatible. Also the actions are set as variables earlier, so we use less calls to external tools. - abcde.conf additions * The GENRE is munged now in its own mungegenre function, so that no more upper-to-lowercase is done (forced) except if the default is used. * Examples added to the tarball and /usr/share/doc/abcde/examples with two scripts to make abcde kind-of-a ripper daemon. * Add CDDB information to Ogg/Vorbis and FLAC files (Closes: #265358). * Added INTERACTIVE option. Set it to "n" and there you go, without user interaction. * Changes normalize to normalize-audio (Closes: #267053) * Copes with wav files being erased by the ripping tool. * Small patch to support ()'s in the path under MacOSX. Thanks to Evan Jones for noticing and sending the patch. * Added "-w ". Used to give a comment to a given CD. * Added "-W ". Used to combine "-T #01 -w CD #". * Added "-t " to modify the numbering from a starting point (Closes: #95828). Geez! That is low bug number... * Added "-T " to modify also the tag entries on the songs. Currently available for FLAC and Ogg/Vorbis. * Removes trailing spaces (Closes: #280382). * TRACKNAME now combines multi-lines from long CDDB entries. * debian/rules: - s/dh_installmanpages/dh_installman/ -- Jesus Climent Wed, 10 Nov 2004 00:57:00 +0200 abcde (2.1.21-1) unstable; urgency=low * Changed normalize with normalize-audio (Closes: #267053). -- Jesus Climent Fri, 20 Aug 2004 13:16:46 +0000 abcde (2.1.20-1) unstable; urgency=low * The "Let's have a good abcde in Sarge" release. * The mungefile() function changes * with + by default to avoid creating directories with the start expanded to the files found in the current directory. abcde2.2 will most likelly contain a better workaround. * Correct default OUTPUTFORMAT in man page (Closes: #250649) -- Jesus Climent Fri, 30 Jul 2004 10:16:46 +0300 abcde (2.1.19-1) unstable; urgency=low * Encoding the whole CD in one file is now possible. Use "-1" as a flag (Closes: #126267). -- Jesus Climent Fri, 9 Apr 2004 17:04:58 +0000 abcde (2.1.18-1) unstable; urgency=low * Do not release in a hurry. The eject program is not needed if CDSPEEDVALUE is not set and no EJECT action is performed (Closes: #242506) -- Jesus Climent Thu, 8 Apr 2004 05:18:49 +0000 abcde (2.1.17-2) unstable; urgency=low * HUH! the version number in the abcde executable was wrong. -- Jesus Climent Wed, 7 Apr 2004 21:01:50 +0000 abcde (2.1.17-1) unstable; urgency=low * Dud! Those missing quotes are going to kill me. Quotes restored and (Closes: #242508). -- Jesus Climent Wed, 7 Apr 2004 06:30:31 +0000 abcde (2.1.16-1) unstable; urgency=low * New setting for the CD speed. Some drives have a higher failure ratio when spinning at high speed. * Added a pre-read function for preparations. Uses include closing the CD tray (Closes: #137548). * Added COMMENT part in OggFlac metadata. * Documentation update: README, abcde.1 * Do not tag GENRE and DATE in Ogg/Vorbis if CDDB does not provide them (Closes: #235531). * Solved bug with batch encoding, thanks to Travis McKay. * When *DATAPREFIX was set, the playlist creation was made without newline. * Added >&2 redirection to visualize the "Erase playlist" question (Closes: #241221). * Added the option "-m" to modify the resulting playlist, to contain CRLF at the end of every line, letting some hardware players which insist with DOS-style files to use them. Also, added DOSPLAYLIST as a config option. * When using a selected, localy cached CDDB entry, we forgot to show the selection when asking the user for editing the choice. Now we show it. * Improved the logic in the order of events when using a local CDDB repo. -- Jesus Climent Tue, 6 Apr 2004 05:29:38 +0000 abcde (2.1.15-1) unstable; urgency=low * EDITOR is called now evaluating the variable, so it works with full path and arguments. * Patch for making md5sum a variable (since some systems use a different name). * Correction by "huf" . The test code in line 376 needed some quotes. * The PADDING code and some CDDB funcions were *really* messy. Now it looks cleaner, works faster and some not needed network operations are no longer performed when we are working with local CDDB repositories. * Added "-V" for extra verbosity (on slow networks the user might be waiting and wondering is somethins is happening). * Solved a bug with the non-interactive code. -- Jesus Climent Mon, 16 Feb 2004 00:13:12 +0000 abcde (2.1.14-1) unstable; urgency=low * Missing quotes restored (Closes: #228648). -- Jesus Climent Tue, 20 Jan 2004 06:43:04 +0000 abcde (2.1.13-1) unstable; urgency=low * Solved the problem with re-runs of multiple choices not showing all the choices (Closes: #228405) (this was a quick one) * We now show the selected CDDB entry on a second run, instead of all of them (not that one should stop abcde, but just in case). This way consecutive interrupted runs obtain the same results. -- Jesus Climent Sun, 18 Jan 2004 22:42:15 +0000 abcde (2.1.12-1) unstable; urgency=low * Check if normalizer is found in the PATH (Closes: #228014) * Added (commented) bits to check if the CD being processed is the CD on the tray, so that if differs we do not eject it. * Store locally the CDDB information, under $HOME/.cddb since it is being used by Grip (at least). PATH is user defined (Closes: #88048) * If you are using cdda2wav and SCSI drives, you can set CDROMID for the SCSI drive, since it differs from the cd-discid CDROM parameter (Closes: #121987). * MacOSX keeps on failing because the OS mounts the CD before we finish ripping it... or something else. Please, test test test the code, and report your findings. Pretty please. I have not been able to make it work with the reports I have received. -- Jesus Climent Fri, 16 Jan 2004 12:06:07 +0000 abcde (2.1.11-1) unstable; urgency=low * Urgent fixes for the FreeBSD and MacOSX bits. When using cdda2wav, the CDROM variable must be modified depending on the device interface. By now we will not try to be very smart. * Added a test for HTTPGETOPTS since it cannot be empty for the default HTTPGET options. * Quick release to fix a problem with the CDROM detection code. (Closes: #226647) * Cleaned a bashism. Thanks to Klaus Ethgen (Closes: #226782). * Rewrote some parts of the cdda2wav code. Since I do not have a machine where cdda2wav works, I cannot test the code. The modifications have been done following user reports. If you use cdda2wav and abcde does not work for you, please, contact me and we will try to sort things out. Thanks. -- Jesus Climent Thu, 8 Jan 2004 21:36:23 +0000 abcde (2.1.10-1) unstable; urgency=low * INLINETAG and STARTTRACKNUMBER flags added. * CDROM checking is now done with a bit more wiselly (Closes: #219768) * HTTPGET is only requested is "cddb" action is performed. * Workout the possibility of cdparanoia erasing our wav files (Closes: #172694) * The default answer for editing CDDB data is now "y" if the disk is unknown. If not, the default is "n". Requested by Ricky Buchanan. * Now we do not erase silently any previous $PLAYLISTFILE left behind by a previous CD ripping (Closes: #220753) * Write info file with cdda2wav (Closes: #187702). I do not use cdda2wav myself (me is cd-paranoid) so if anyone using cdda2wav has a problem with this, please, report. * CDROM comes in 1,0,0 kind of format for cdda2wav ripper. Corrected with a quick patch. Kudos go to Mikhail Manuilov for noticing. * Merged bits to make abcde work under MacOSX. Thanks to Evan Jones. * Merged bits to avoid FreeDB people anger and to cut down the "abcde." part of the discid. Now you can set the "-C" command with the directory name. Kudos go to Bart Samwel. * Added some info bits to the config file about normalize, requested by Ricky Buchanan. * Added some testing for the wav file before normalizing, to check that the file is actually there. -- Jesus Climent Mon, 5 Jan 2004 14:43:59 +0000 abcde (2.1.9-1) unstable; urgency=low * The "First snow in Finland" release. * One head was missing a "-n". N-less heads should be cut already. * Not use relative links when PLAYLISTDATAPREFIX is set (Closes: #165368) * Stupid use of $OUTPUTTYPE in flac tagging (Closes: #218625) * Small typo in KEEPWAVS check (Closes: #216551) * "Dirty" hack provided by Ben Finney to get rid of the tags in Ogg/Speex encoding, when the user does not specify it as an action (lol! someone is using Ogg/Speex :) (Closes: #219070) * metaflac path was hardcoded. Now it must be in the path. * TAGGER, VORBISCOMMENT and METAFLAC information tools are now dependent upon "tag" action. There is no need to have them if we are not going to comment. * A bunch of small fixes, all along. -- Jesus Climent Wed, 5 Nov 2003 15:29:13 +0000 abcde (2.1.8-3) unstable; urgency=low * Small typo corrected (Closes: #217149) -- Jesus Climent Thu, 23 Oct 2003 09:49:01 +0000 abcde (2.1.8-2) unstable; urgency=low * KEEPWAVS now sets the "clean" action to "no", so the wavs are kept. (Closes: #216551) -- Jesus Climent Sun, 19 Oct 2003 16:25:53 +0000 abcde (2.1.8-1) unstable; urgency=low * Quick release fixing a couple of bugs introduced by the padding patch (Closes: #215962) -- Jesus Climent Thu, 16 Oct 2003 17:08:12 +0000 abcde (2.1.7-2) unstable; urgency=low * Control: Build-Depends-Indep: moved to Build-Depends:, as per http://www.debian.org/doc/debian-policy/ch-relationships.html#s-sourcebinarydeps (Closes: #214200) -- Jesus Climent Tue, 14 Oct 2003 12:21:13 +0000 abcde (2.1.7-1) unstable; urgency=low * The "Engineer" release. Yeah! I graduated! * Patch applied to solve the track submission interface issues. Kudos to Marc HE Brockschmidt, again (Closes: #126289) * Small bug related with DISTMP3NICE solved. Kudos to Wilbert Alberts. (Closes: #213756) * Padding now creates the list with padded numbers. Test patch. This should solve the problem with delayed tagging a single file. -- Jesus Climent Mon, 13 Oct 2003 20:32:16 +0000 abcde (2.1.6-1) unstable; urgency=low * Removed a nasty bug where even if the encode failed, the track was marked as successfully encoded (Closes: #208391) * Various Artists has now its own PLAYLIST format (Closes: #137432) * metaflac path corrected (Closes: #206110) * Hopefully this version repairs the comment part for Ogg/Vorbis files. * If nothing breaks, 2.2 will be released as soon as the KNOWNBUG is solved. * Removed all the inline tagging since it breaks the action chain, except in Ogg/Speex. Need to check if "vorbiscomment" can be used for it. (Closes: #206311) * Added DISTMP3NICE variable, to nice the distmp3 program (Closes: #208398) -- Jesus Climent Thu, 4 Sep 2003 10:53:09 +0000 abcde (2.1.5-1) unstable; urgency=low * Small fixes and patches. + GENRE can be used for OUTPUTFORMAT and PLAYLISTFORMAT + id3v2 should work now with -c for comments (Closes: #199949) + small bug with batch encoding + Variables are exported before the CDDB functions are called, so they should use the right variables for the HTTPGET command. + Tagging also use TRACKS and CDGENRE for MP3 files (kudos to Dirk Ruediger) + FLAC encoding now uses dismp3 to encode remotelly (kudos to Taylor and Kevin Cramer). HANDLE WITH CARE ;) Also FLAC now uses CDGENRE and CDYEAR for tagging. * Debian specific: + Standards to 3.6.0. No changes needed. + Changed Build-Depends to -Indep, since this is a POSIX shell script. * tail/head change: -1 has been deprecated. Noted by Stephan Kulow. * Ogg/Speex support added, for speech encoding (Closes #204635) * Documentation update (Closes: #198825) * Patch for "=" in the name applied (Closes: #197199) -- Jesus Climent Thu, 14 Aug 2003 16:45:29 +0000 abcde (2.1.4-1) unstable; urgency=low * Small bug fixes: + COMMENT should work now. + Aesthetic padding on the total amount of tracks. + CDROM typo + CDROM is now checked after reading the user defined entries. * Remove trailing args from $EDITOR when checking -x: Closes #179222. -- Jesus Climent Sun, 18 May 2003 18:47:36 +0000 abcde (2.1.3-1) unstable; urgency=low * Makefile was missing cddb-tool.1. * Introduced dagrab as CD ripping utility. * cddb-tool seq calls converted to functions. No more distro dependencies. * WGET* variables converted to HTTPGET* variables. FreeBSD can safelly use fetch. * More FreeBSD specific bits: CDROM and EJECT changes. * Typo in abcde.conf * Added CDDBPROTO for specifying the protocol level of the cddb query. * CDDB protocol upgraded to 5. CDYEAR and CDGENRE are now used for CD tagging. Patches from FreeBSD guys. * COMMENT is now used for inline tagging with oggenc (my mistake it was missing): Closes: #191475. -- Jesus Climent Sat, 10 May 2003 07:49:22 +0000 abcde (2.1.2-1) unstable; urgency=low * Documentation updates: Closes: #186230. * Usual set of bug fixes and corrections. * Default behaviour of VAOUTPUTFORMAT output changed to avoid multiple directories for a same album. I think the format is more logical, and you can always split the files once they are created. * Padding track wavs with 0 so if you want to burn those wavs just cdrecord *.wav will do it. Use "-p" to force it when encoding a small (<9) number of files (Closes: #111627). * Added "KEEPWAVS" as a variable to keep those wavs. Default is "no". Can use also "-k" in the command line. (Closes: #160372). This probably should be changed with an option to move the wav files to another directory instead of just keep de abcde. directory. * Added documentation comments about OUTPUTTYPE (Closes: #184963). * abcde.conf cleanup: (Closes: #186230, #187400). -- Jesus Climent Tue, 25 Mar 2003 16:39:25 +0200 abcde (2.1.1-1) unstable; urgency=low * New upstream release. -- Jesus Climent Mon, 17 Mar 2003 08:52:01 +0200 abcde (2.1.0-3) unstable; urgency=low * Since abcde does not depend on eject, an execution test ([-x]) was added, but that means abcde needs a test for eject in the patch if -x is passed: Closes: #184151. * Merged some more bits from Marc 'HE' Brockschmidt: Closes: #126289. * A bit of more info in abcde.conf: Closes: #184963. * cddb-tool version updated to 0.4.2 -- Jesus Climent Fri, 14 Mar 2003 18:00:03 +0000 abcde (2.1.0-2) unstable; urgency=low * Old version string left behind. Updated. * Few more doc update bits. * Patches from Marc 'HE' Brockschmidt: Closes: #149499. * Small patch from Norbert Preining to support multiple output in the output directory. * cddb-tool parses CDYEAR with the help of awk: Closes: #114848. * cddb-tool does not globe "*" characters anymore: Closes: #157448. -- Jesus Climent Fri, 7 Mar 2003 06:41:32 +0000 abcde (2.1.0-1) unstable; urgency=low * The "Time To Release" version. * We close: + We preppend track number now: Closes: #128966. + Itegrate flac: Closes: #126311. + Multi-format encode: Closes: #148934. + Gapless lame encoding: Closes: #172696. + CDROM documented: Closes: #182403. -- Jesus Climent Thu, 6 Mar 2003 14:45:51 +0000 abcde (2.0.4-0.3) unstable; urgency=low * Applied OpenBSD patches to make the script more portable. Thanks to Han Boetes. -- Jesus Climent Fri, 28 Feb 2003 11:27:15 +0200 abcde (2.0.4-0.2) unstable; urgency=low * There was a "echo" line producing a strange output on the cd_read procedure. -- Jesus Climent Fri, 28 Feb 2003 00:41:33 +0100 abcde (2.0.4-0.1) unstable; urgency=low * abcde takeover. * The infamous "Works for me(TM)" release. * Documentation fixes: closes: #100844, #136741. * NetBSD patches applied: - EXPERIMENTAL Normalize and Batch support. - EXPERIMENTAL FLAC support. * EXPERIMENTAL multiple output support: + multiple output and error checking + multiple lists support * Default output file changed to have the $track_number in the beginning. -- Jesus Climent Thu, 27 Feb 2003 19:19:18 +0200 abcde (2.0.3-1) unstable; urgency=low * The Fixed-Yet?-How-About-Now?-What-About-Now?-Now? Release * SMP fixed, mad props to Steve Madsen, closes: #69828, #111806 * Minor code cleanups thanks to Adam Heath * Multiple inexact match results are generated in a safe manner thanks to Nick Martin, closes: #126025 * Removed cddb-tool template generation bashism, thanks to Greg Norris, closes: #126327 * Windows can't handle double quotes in filenames either. The default mungefilename now removes them, closes: #127643 * Using -C with WAVOUTPUTDIR fixed, closes: #127728 * Resuming various artists discs fixed, closes: #127731 -- Robert Woodcock Sun, 27 Jan 2002 21:36:48 -0800 abcde (2.0.2-1) unstable; urgency=low * The One-More-Time-With-Feeling Release * Bladeenc really works this time. Honest. closes: #121988 -- Robert Woodcock Mon, 3 Dec 2001 19:32:12 -0800 abcde (2.0.1-1) unstable; urgency=low * The I-Don't-Listen-To-Sssca Release * Example abcde.conf fixes, closes: #111580 * So much for bladeenc's l3enc compatibility, closes: #110863 * CDDB submit fixes (to enable CDDB submitting, put UNINTENTIONALLY_ANGER_THE_FREEDB_PEOPLE=y in your abcde.conf), closes: #111478, #111500 * Minor mungefilename() cleanup * Small manpage fix * Works with oggenc when POSIXLY_CORRECT is defined, thanks to Juhapekka Tolvanen * Quote remote locations when calling distmp3 * Allow remote encoding of oggs * Only remove wav files if the encoding succeeded * No-local-encoding via -j 0 fixed, thanks to Hans-Joachim Baader * CD read errors are trapped/resumed cleanly now thanks to Pete, closes: #111618 * devfs device check fix, thanks to Clint Adams * Check for seq command - some BSD's have jot instead and abcde can't use that yet * Various Artists playlist generation fixed, thanks to William Lash -- Robert Woodcock Tue, 6 Nov 2001 18:34:25 -0800 abcde (2.0-1) unstable; urgency=low * The Psychiatrist-Says-I'm-Stable-Again Release * Renamed to 2.0 * Minor documentation updates -- Robert Woodcock Wed, 15 Aug 2001 15:26:54 -0700 abcde (1.9.10-1) unstable; urgency=low * The Waiter-There's-A-Proof-In-My-Pudding Release * Fixed some quoting issues preventing abcde from using a temp directory containing spaces, closes: #89682 * Now purges encodetracklocation notes from the status file when resuming. * -a playlist now implies -a cddb * Manpage and default config file updates, closes: #78726, #100841, #100845 * Applied checkstatus patch by Itai Zukerman, fixes certain track number status checking situations, closes: #93395 * Check to see if things run through run_command return a nonzero error code and present the command and error code to the user later, closes: #93485 * Devfs fixup - If /dev/cdrom doesn't exist, try /dev/cdroms/cdrom0, closes: #101933 * If a background process returned an error, log it. If it was an encode process, abandon that encode location and don't wait for the encode process to finish. Display the commandlines that resulted in error exits with their exit codes before aborting. * do_tag handles vorbis commenting failures idempotently * -n works again * Resumes encoding if all files have ripped, closes: #101843 * do_cddbedit code checks to see if it's already been run -- Robert Woodcock Wed, 1 Aug 2001 20:20:41 -0700 abcde (1.9.9-1) unstable; urgency=low * The Not-Quite-Last-In-The-Development-Series Release * I broke ID3v1 comments in 1.9.8, it's fixed now, thanks to Christian Beyerlein for noticing this, closes: #89519 -- Robert Woodcock Tue, 13 Mar 2001 07:53:10 -0800 abcde (1.9.8-1) unstable; urgency=low * The Groundshaking Release * Now defaults to using FreeDB instead of Gracenote. Pricks. * New VAOUTPUTFORMAT variable for those who like their various artists discs named in a different format * Accommodates the fact that OpenBSD xargs does not eat whitespace, thanks to Marcus Daniel for discovering this * New scheduler for distmp3, thanks to David Bergeron * xingmp3enc support, thanks to Brian Gannon * Stripped down cddb-tool a little bit so that abcde no longer requires mktemp * New -C option to let people continue where they left off if they no longer have the CD handy * ID3COMMENT is now COMMENT * Ogg commenting is now done separately so resuming doesn't break it * More documentation updates -- Robert Woodcock Sat, 10 Mar 2001 22:51:39 -0800 abcde (1.9.7-1) unstable; urgency=low * The Overcast Partial Eclipse Release * Supports ID3v2 * Various Artists heuristics patch by Kevin Everets * New -c option to specify an extra configuration file, closes: #76252 * Does not try to check if a tagger exists unless OUTPUTTYPE=mp3, closes: #78540 * cddb-tool template output fixes * Yet more documentation updates, closes #78632, #78726 * Avoids id3v2's -c option for now * Adds support for another Various Artists format, "Artist: Title", thanks to Wolfgang Borgert, closes: #78292 * Fixed typo that was breaking remote encoding support, closes: #81183 * Hitting control-c while there's nothing in the foreground no longer causes abcde to delete all its work upon exit -- Robert Woodcock Sun, 7 Jan 2001 21:17:32 -0800 abcde (1.9.6-1) unstable; urgency=low * The Squishy Release * Updated getopts call to remove obsoleted options * More documentation fixes, closes: #77957 * Single inexact match spurious question fix * Fixed encoder trigger timing when using -l, closes: #77854 -- Robert Woodcock Sun, 26 Nov 2000 18:37:18 -0800 abcde (1.9.5-1) unstable; urgency=low * The "Run Towards Trick Or Treaters With Scissors" Release * Some documentation updates, closes: #75707, #75927 * mungefilename quoting fix, closes: #75556 * Implemented -a, which replaces -p, -P, and a number of other things, closes: #75507 -- Robert Woodcock Wed, 25 Oct 2000 21:16:38 -0700 abcde (1.9.4-1) unstable; urgency=low * The "Run With Scissors" Release * Various Artists support by Kevin Everets * Specifying track numbers on the command line should work again, bash was getting a wee bit confuzzled with the way I had things before. * A couple more error output changes and miscellaneous fixes * OUTPUTDIR works again -- Robert Woodcock Thu, 28 Sep 2000 23:11:35 -0700 abcde (1.9.3-1) unstable; urgency=low * The ugh Release * Brown Paper Bag fix for mp3enc users * Recreated the rest of the variable environment in do_playlist, fixes TRACKNUM availability for real this time, closes: #72535 -- Robert Woodcock Tue, 26 Sep 2000 22:08:27 -0700 abcde (1.9.2-1) unstable; urgency=low * The "Very Long Changelog Entries Can Become Addicting" Release. * Switched default output type to ogg, default encoder to oggenc * Since 1.9.x prompts for CDDB edits by default there is now a -N switch for non-interactivity. * Handles cddb entries with random sprinklings of CR's and LF's * You can now specify niceness for the reader and encoders, thanks to Kevin Everets * -j 0 will now disable local encoding, thanks to Antonio Fiol * Vorbize should actually work now, thanks to Kevin Everets and James LewisMoss * Oggenc/Vorbize commenting support * Made TRACKNUM available for playlist generation * Fleshed out the TODO list a bit more * mungefilename() now translates ':' to ' -' by default. Rationale: You can't put ':' on a FAT filesystem. It also wreaks havoc with Samba. -- Robert Woodcock Mon, 25 Sep 2000 19:31:35 -0700 abcde (1.9.1-1) unstable; urgency=low * The "Don't Fraun" Release. * Fixed a half-dozen minor buglets * A little less debug output, a lot more normal output * Resuming operation works better now * Patched up offline usage again * Broke OUTPUTFORMAT - if you plan on ever using Ogg support, and you've overridden the OUTPUTFORMAT default, change the ".mp3" to ".${OUTPUTTYPE}" * Beginnings of Ogg Vorbis support (vorbize and oggenc) - warning: completely untested -- Robert Woodcock Thu, 17 Aug 2000 21:03:00 -0700 abcde (1.9-1) unstable; urgency=low * The "" Release. * Completely redone tmpfile handling, abcde can now continue where you left off. closes: #42970, #50883, #66668 * Restructured program execution scheduling around central status file * Moved cddb-tool interactivity to abcde, 'cddb-tool get' no longer exists, it is now 'cddb-tool query' and 'cddb-tool read'. * Removed -e, -v, and -V, since abcde will now prompt you if you want to edit or otherwise muck with the data after you have a chance to see it. -- Robert Woodcock Thu, 22 Jun 2000 18:13:01 -0700 abcde (1.1.1-1) unstable; urgency=low * The "That wasn't chicken" Release. * Remote distributed encoding had a bad bug in 1.1 - work to be done remotely was duplicated locally (everything still turned out ok - there was just no speedup). Fixed that. * Restructured encode_and_tag function. -- Robert Woodcock Sun, 7 May 2000 20:10:10 -0700 abcde (1.1-1) unstable; urgency=low * The "We heard Mr. Garrison say them a couple of times" Release. * New -r and REMOTEHOSTS option to use distmp3 to encode to multiple hosts at once. * Command-line track range specification (f.e. "abcde 1-12" (Thanks: Vincent Ho) * Now displays minutes/seconds for each track while displaying track titles at the start -- Robert Woodcock Tue, 18 Apr 2000 23:59:09 -0700 abcde (1.0.6-1) unstable; urgency=low * The "Inspected by #17" Release. * New EJECTCD option to eject the CD after all tracks are read (thanks: Hrafnkell F Hlodversson) -- Robert Woodcock Sun, 2 Apr 2000 23:23:44 -0700 abcde (1.0.5-1) unstable; urgency=low * The "...So we can both watch X-Files..." Release. * Quoting fix for setups without space->underscore filename munging * README file URL fixes/updates -- Robert Woodcock Thu, 16 Mar 2000 18:34:38 -0800 abcde (1.0.4-1) unstable; urgency=low * The "Plop, Plop, Fizz Fizz" Release * CDPARANOIAOPTS and CDDA2WAVOPTS should work now. -- Robert Woodcock Sun, 20 Feb 2000 18:44:08 -0800 abcde (1.0.3-1) unstable; urgency=low * The "This Space Intentionally Left Blank" Release * Support for reverse and dashed Various Artists discs * More elegant way of passing backtick data * Replaced all `foo` commands with $(foo) * Custom filename munging, closes: #38448 -- Robert Woodcock Wed, 9 Feb 2000 20:26:22 -0800 abcde (1.0.2-1) unstable; urgency=low * Now eats backticks in CDDB input (thanks to Steve Beattie) * mp3enc support (thanks to Richard Jelinek and Chris Ruvolo), closes: #56189 * cddb-tool more gracefully handles no net connection for those with local caching name servers * Fixed HELLOINFO documentation bug, closes: #56268 -- Robert Woodcock Wed, 26 Jan 2000 19:45:06 -0800 abcde (1.0.1-1) unstable; urgency=low * The "s/ever/ Three Days/" Release * Now properly handles double-quotes in Artist and Album data (thanks to Clint Adams), closes: #54888 -- Robert Woodcock Thu, 13 Jan 2000 23:34:24 -0800 abcde (1.0-1) unstable; urgency=low * The "But a 1.0 is Forever" Release * Backed out cddb-tool quoting change, closes: #54005 * Now strips carriage returns from CDDB data, closes: #53815 * Added ID3COMMENT config option -- Robert Woodcock Mon, 10 Jan 2000 20:48:24 -0800 abcde (0.8.9-1) unstable; urgency=low * The "Get it Before the World Implodes" Release * Added -D (debugging option, outputs debugging information to stderr). Very useful for submitting bug reports, hint hint hint :) Just do 'abcde -D 2>logfile' and include logfile in your bug report. * Now uses id3's new -T option to embed track numbers in ID3 tags. * Fixed cddb-tool output for FreeDB submissions, closes: #51986. Thanks to Clint Adams for spotting the problem * New -v switch for Various Artist CD's (thanks to Magenta Hari Nezumi) closes: #43581 * Fixed minor cddb-tool manpage buglet * Fixed cddb-tool output for shell quoting, thanks to Philipp Meier. closes: #52469 -- Robert Woodcock Fri, 31 Dec 1999 14:12:35 -0800 abcde (0.8.8-1) unstable; urgency=low * Added gogo explainations to manpages and example config file * Added code by Stuart Ballard to intelligently use relative paths for playlist files, closes #51351 * Added PLAYLISTDATAPREFIX config option for those who wish to prefix their playlist data with things like URL's * Fixed bug added in 0.8 where the multiple inexact match choice selection would be hidden to the user (cddb-tool wasn't sending all user output to stderr as it should), closes #51434, #50786 -- Robert Woodcock Sun, 28 Nov 1999 16:02:24 -0800 abcde (0.8.7-1) unstable; urgency=low * Removed some parallelization from encode_and_tag, closes: #50246 -- Robert Woodcock Tue, 16 Nov 1999 18:49:29 -0800 abcde (0.8.6-1) unstable; urgency=low * Removed remaining bashisms -- Robert Woodcock Sun, 14 Nov 1999 08:46:14 -0800 abcde (0.8.5-1) unstable; urgency=low * Fixed some background encoding issues that cropped up in 0.8.3. -- Robert Woodcock Sun, 7 Nov 1999 01:08:27 -0800 abcde (0.8.4-1) unstable; urgency=low * New name. cdgrab was already taken - the original cdgrab name belongs to a CDDA reading program for DOS dating back to 1993. It's still in use and active development, so I'm changing the name of cdgrab instead. See this URL for a description of the original cdgrab: http://www.scn.rain.com/pub/cdrom/cdgrab.txt Your old /etc/cdgrab.conf and/or ~/.cdgrab.conf can simply be renamed to /etc/abcde.conf and ~/.abcde.conf. The program name is now 'abcde'. -- Robert Woodcock Tue, 2 Nov 1999 22:28:19 -0800 cdgrab (0.8.3-1) unstable; urgency=low * 0.8.2 would leave around cdgrab.xxxxxx tempfiles with -j. Fixed that. * Fixed quoting issues regarding spaces in output files closes: #38449 -- Robert Woodcock Thu, 28 Oct 1999 20:08:22 -0700 cdgrab (0.8.2-1) unstable; urgency=low * Fixes a cddb-tool quoting issue - closes: #46979 * Adds support for gogo -- Robert Woodcock Sun, 10 Oct 1999 11:24:50 -0700 cdgrab (0.8.1-1) unstable; urgency=low * Clears up a few bashisms from the merged-in cddb-tool patches closes: #45512, #45514 * FHS compliance -- Robert Woodcock Sun, 19 Sep 1999 12:21:40 -0700 cdgrab (0.8-1) unstable; urgency=low * New Release - closes: #43579, #42997, #38325, #42971 * Removes dependency for now non-existent cdparanoia-bin package -- Robert Woodcock Thu, 26 Aug 1999 22:34:29 -0700 cdgrab (0.7.7-1) unstable; urgency=low * one-liner patch re-release :) -- Robert Woodcock Thu, 12 Aug 1999 07:29:50 -0700 cdgrab (0.7.6-1) unstable; urgency=low * New Release - closes: #42734 -- Robert Woodcock Mon, 9 Aug 1999 21:11:30 -0700 cdgrab (0.7.5-1) unstable; urgency=low * New Release - closes: #40179, #41086 -- Robert Woodcock Tue, 13 Jul 1999 19:20:53 -0700 cdgrab (0.7.4-1) unstable; urgency=low * New Release -- Robert Woodcock Mon, 7 Jun 1999 22:12:20 -0700 cdgrab (0.7.3-1) unstable; urgency=low * New Release -- Robert Woodcock Sun, 23 May 1999 22:24:43 -0700 cdgrab (0.7.2-1) unstable; urgency=low * New Release -- Robert Woodcock Sun, 16 May 1999 17:41:55 -0700 cdgrab (0.7.1-1) unstable; urgency=low * New release -- Robert Woodcock Fri, 14 May 1999 23:37:00 -0700 cdgrab (0.7-1) unstable; urgency=low * New release * cd-discid spun off into its own package, cdgrab is now Architecture: all -- Robert Woodcock Fri, 7 May 1999 20:44:06 -0700 cdgrab (0.6.2-1) unstable; urgency=low * New release, closes: bug #35379, bug #36272 -- Robert Woodcock Sun, 18 Apr 1999 15:09:43 -0700 cdgrab (0.6.1-1) unstable; urgency=low * New release, quick bashism bugfix - closes: bug #35245 -- Robert Woodcock Mon, 29 Mar 1999 19:19:04 -0800 cdgrab (0.6-1) unstable; urgency=low * New release - closes: bug #34454, #34736, #34823, #34824 -- Robert Woodcock Sun, 28 Mar 1999 18:26:54 -0800 cdgrab (0.5-1) unstable; urgency=low * New release -- Robert Woodcock Thu, 18 Mar 1999 23:39:02 -0800 cdgrab (0.4-1) unstable; urgency=low * New release - closes: bug #34566, #34577 -- Robert Woodcock Tue, 16 Mar 1999 00:10:20 -0800 cdgrab (0.3-1) unstable; urgency=low * New release - closes: bug #34101 -- Robert Woodcock Fri, 5 Mar 1999 18:13:30 -0800 cdgrab (0.2-1) unstable; urgency=low * Initial Release. -- Robert Woodcock Sun, 21 Feb 1999 18:50:34 -0800 abcde-2.9.3/debian/compat000066400000000000000000000000031342626142700152130ustar00rootroot0000000000000010 abcde-2.9.3/debian/control000066400000000000000000000026101342626142700154160ustar00rootroot00000000000000Source: abcde Section: sound Priority: optional Maintainer: Steve McIntyre <93sam@debian.org> Homepage: https://abcde.einval.com/ Standards-Version: 4.3.0 Build-Depends: debhelper (>= 10) Vcs-Browser: https://git.einval.com/cgi-bin/gitweb.cgi?p=abcde.git;a=summary Vcs-Git: https://git.einval.com/git/abcde.git Package: abcde Architecture: all Depends: ${misc:Depends}, cd-discid, wget, cdparanoia | icedax, vorbis-tools (>= 1.0beta4-1) | lame | flac | speex | musepack-tools | opus-tools, libmusicbrainz-discid-perl, libwebservice-musicbrainz-perl (>= 1.0.4-1.1), sensible-utils Recommends: vorbis-tools, libdigest-sha-perl, bsd-mailx, glyrc, imagemagick Suggests: eject, distmp3, id3 (>= 0.12), id3v2, eyed3 (<< 0.7~), normalize-audio, vorbisgain, mkcue, mp3gain, atomicparsley Description: A Better CD Encoder frontend program to cdparanoia, wget, cd-discid, id3, and your favorite Ogg/Vorbis, MP3, FLAC, Ogg/Speex, M4A, Opus, WavPack, Monkey's Audio (ape), MPP/MP+(Musepack) and/or AIFF format encoder (defaults to oggenc). Grabs an entire CD and converts each track to the specified formats and then comments or tags each file, with one command. . With abcde you can encode several formats with one single command, using a single CD read operation. It also allows you to read and encode while not on the internet, and later query a CDDB or Musicbrainz server to lookup metadata and tag your files. abcde-2.9.3/debian/copyright000066400000000000000000000023621342626142700157520ustar00rootroot00000000000000The software was originally developed by Robert Woodcock . It was also debianized by Robert Woodcock on Sun, 21 Feb 1999 18:50:34 -0800. It is available at: https://abcde.einval.com/wiki/ Copyright: Copyright (c) 1998-2001 Robert Woodcock Copyright (c) 2003-2009 Jesus Climent Copyright (c) 2009-2012 Colin Tuckley Copyright (c) 2012- Steve McIntyre Copyright (c) 2015- Andrew Strong and many other contributors This code is hereby licensed for public consumption under either the GNU GPL v2 or greater, or Larry Wall's Artistic license - your choice. 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. An earlier abcde copyright included the text: Copyright for this work is to expire January 1, 2010, after which it shall be public domain. However, later versions (2.6 onwards) have been developed solely using the GPL. Earlier versions are still available in various places if you'd rather have the public domain code. See /usr/share/common-licenses/GPL-2 abcde-2.9.3/debian/dirs000066400000000000000000000000141342626142700146730ustar00rootroot00000000000000etc usr/bin abcde-2.9.3/debian/docs000066400000000000000000000000251342626142700146640ustar00rootroot00000000000000README changelog FAQ abcde-2.9.3/debian/preinst000066400000000000000000000006701342626142700154260ustar00rootroot00000000000000#!/bin/sh -e # If: # * this isn't an upgrade (a fresh install) # * and /etc/cdgrab.conf exists # * and /etc/abcde.conf doesn't # copy /etc/cdgrab.conf to /etc/abcde.conf if [ "$1" != "install" ] then exit 0 fi if [ "$2" != "" ] then exit 0 fi if [ -f /etc/abcde.conf ] then exit 0 fi if [ -r /etc/cdgrab.conf ] then echo Copying old /etc/cdgrab.conf to /etc/abcde.conf... cp -a /etc/cdgrab.conf /etc/abcde.conf exit 0 fi #DEBHELPER# abcde-2.9.3/debian/rules000077500000000000000000000033511342626142700150760ustar00rootroot00000000000000#!/usr/bin/make -f # Made with the aid of dh_make, by Craig Small # Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess. # Some lines taken from debmake, by Cristoph Lameter. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 build: build-arch build-indep build-arch: build-stamp build-indep: build-stamp build-stamp: dh_testdir # Add here commands to compile the package. $(MAKE) touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp install-stamp # Add here commands to clean up after the build process. [ ! -f Makefile ] || $(MAKE) clean dh_clean install: install-stamp install-stamp: build-stamp dh_testdir dh_testroot dh_prep dh_installdirs # Add here commands to install the package into debian/abcde. $(MAKE) install DESTDIR=`pwd`/debian/abcde prefix=/usr sysconfdir=/etc docdir=/usr/share/doc/abcde rm -f `pwd`/debian/abcde/usr/share/doc/abcde/COPYING* install -d `pwd`/debian/abcde/usr/share/doc/abcde/examples install -m 644 examples/* `pwd`/debian/abcde/usr/share/doc/abcde/examples touch install-stamp # Build architecture-independent files here. binary-indep: build install # dh_testversion dh_testdir dh_testroot dh_installdocs dh_installexamples dh_installmenu dh_installman dh_installchangelogs dh_link dh_strip dh_compress dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol # dh_makeshlibs dh_md5sums dh_builddeb # Build architecture-dependent files here. binary-arch: build install # We have nothing to do by default. source diff: @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary abcde-2.9.3/debian/source/000077500000000000000000000000001342626142700153145ustar00rootroot00000000000000abcde-2.9.3/debian/source/format000066400000000000000000000000141342626142700165220ustar00rootroot000000000000003.0 (quilt) abcde-2.9.3/debian/source/lintian-overrides000066400000000000000000000002361342626142700206760ustar00rootroot00000000000000abcde source: description-synopsis-starts-with-article # The description is an expansion of the package name, which just # happens to begin with an "article" abcde-2.9.3/debian/watch000066400000000000000000000001031342626142700150370ustar00rootroot00000000000000version=3 https://abcde.einval.com/download/abcde-([0-9.]+).tar.gz abcde-2.9.3/examples/000077500000000000000000000000001342626142700144105ustar00rootroot00000000000000abcde-2.9.3/examples/abcde.init000066400000000000000000000012571342626142700163400ustar00rootroot00000000000000#!/bin/sh ########## # The first argument tells what to do. ########## RUNNING=`ps -ef|grep [a]bcded|awk '{ print $2 }'` state=$1 case $state in start) if [ -n "$RUNNING" ]; then echo "abcde daemon already running." exit 0 fi echo "Starting abcde daemon" abcded & echo "Done." ;; stop) if [ -n "$RUNNING" ]; then /bin/kill -9 $RUNNING > /dev/null if [ $? = 0 ]; then echo "abcde daemon killed" fi fi ;; restart) $0 stop $0 start ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 esac abcde-2.9.3/examples/abcde.py000066400000000000000000000162401342626142700160230ustar00rootroot00000000000000#!/usr/bin/env python # Copyright (c) 2007 Jesus Climent # This code is hereby licensed for public consumption under either the # GNU GPL v2 or greater, or Larry Wall's Artistic license - your choice. # # 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., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # import those needed modules. import os import re import sys import time import getopt import string import select __version__ = "1.0" """ abcde.py - A Better CD Encoder - python release Copyright (C) 2007 Jesus Climent """ help = """This is abcde version """ + __version__ + """ usage: abcde.py [options] [tracks] Options: -1 Encode the whole CD in a single file -a Actions to perform: cddb,read,normalize,encode,tag,move,replaygain,playlist,clean -b Enable batch normalization -c Specify a configuration file (overrides system and user config files) -C Specify discid to resume from (only needed if you no longer have the cd) -d Specify CDROM device to grab (flac uses a single-track flac file) -D Debugging mode (equivalent to sh -x abcde) -e Erase encoded track information from status file -f Force operations that otherwise are considered harmful. Read "man abcde" -g Use "lame --nogap" for MP3 encoding. Disables low disk and pipes flags -h This help information #-i Tag files while encoding, when possible (local only) -NWY- -j <#> Number of encoder processes to run at once (localhost) -k Keep the wav tracks for later use -l Use low disk space algorithm -L Use local CDDB storage directory -n No lookup. Don't query CDDB, just create and use template -N Noninteractive. Never prompt for anything -m Modify playlist to include CRLF endings, to comply with some players WARNING: Deprecated. Use \"cue\" action -o Output file type(s) (vorbis,mp3,flac,spx,mpc,wav,m4a). Defaults to vorbis -p Pad track numbers with 0's (if less than 10 tracks) -P Use UNIX pipes to read+encode without wav files -q Set quality level (high,medium,low) -r Also encode on these remote hosts -R Use local CDDB in recursive mode -s Show dielfs from the CDDB info (year,genre) -S <#> Set the CD speed -t <#> Start the track numbering at a given number -T <#> Same as -t but modifies tag numbering -U Do NOT use UNICODE (UTF8) tags and comments -v Show version number and exit -V Be a bit more verbose about what is happening behind the scenes -x Eject CD after all tracks are read -w Add a comment to the CD tracks -W <#> Concatenate CDs: -T #01 -w "CD #" -z Use debug CDROMREADERSYNTAX option (needs cdparanoia) Tracks is a space-delimited list of tracks to grab. Ranges specified with hyphens are allowed (i.e., 1-5). """ def usage (): print help def addstatus(status,file): try: file = open(file, "w") except: log("error","file",file,"cannot be read") return -1 def log(status,logstring): if re.compile("info").match(status): status = "[INFO]" pass elif re.compile("warning").match(status): status = "[WARNING]" pass elif re.compile("error").match(status): returncode = 1 status = "[ERROR] %s\n" sys.stderr.write(status % logstring) sys.exit(1) else: return 1 def f_seq_row (min,max): try: seq = range(min,max) return seq except: log(error,"syntax error while processing track numbers") return -1 def f_seq_line (min,max): try: seq = range(min,max) return seq except: log(error,"syntax error while processing track numbers") return -1 #usage() # get_first and get_last can be substituted by range[0] and range[:-1] # checkstatus(string) # Returns "0" if the string was found, returns 1 if it wasn't # Puts the blurb content, if available, on stdout. # Otherwise, returns "". def checkstatus (string, file): patern = re.compile("^"+string+"(=.*)?$") try: file = open(file, "r") except: log("error","file "+file+" cannot be read") return -1 blurb = [] while 1: line = file.readline() if line == "": break blurb.append(re.search(patern,line).string) print blurb if blurb[-1]: return 0 else: return 1 # which(program) # checks where we can find a program in the path def which(program): for path in string.split(os.environ["PATH"], ":"): if os.path.exists(os.path.join(path, program)): return os.path.join(path, program) def main(): try: opts, args = getopt.getopt(sys.argv[1:], "1a:bc:C:d:DefghjklLnNmopPqrRsStTUvVxwWz") except: log("error","unknown error") sys.stderr.write(usage % sys.argv[0]) sys.exit(1) try: #abcde.setup() for opt, optarg in opts: print opt, optarg if opt == "-1": o_onetrack = "y" if opt == "-a": o_actions = optarg if opt == "-b": o_batchnormalize = "y" if opt == "-B": o_nobatchreplygain = "y" if opt == "-c": o_configfile = str(optarg) try: if not re.compile("\.\/").search(o_configfile): o_configfile = os.environ.get("PWD", "./") + "/" + o_configfile os.path.exists(o_configfile) except: log("error",o_configfile+" cannot be read") if opt == "-C": if re.compile("abcde\.").match(optarg): o_discid = optarg else: o_discid = "abcde." + optarg if opt == "-d": o_cdrom = optarg if opt == "-D": o_debug = "y" if opt == "-h": usage() sys.exit(1) if opt == "-e": o_eraseencodedstatus = "y" # if opt == "-E": o_encoding if opt == "-f": o_force = "y" if opt == "-g": o_nogap = "y" if opt == "-j": o_maxprocs = optarg if opt == "-k": o_keepwavs = "y" if opt == "-l": o_lowdisk = "y" if opt == "-L": o_localcddb = "y" if opt == "-n": o_cddbavailable = "n" if opt == "-m": o_dosplaylist = "y" if opt == "-M": o_docue = "y" if opt == "-N": o_interactive = "n" if opt == "-o": o_outputtypes = optarg if opt == "-p": o_padtracks = "y" if opt == "-P": o_usepipes = "y" if opt == "-q": o_qualitylevel = optarg #if opt == "-r": o_remotehosts = optarg if opt == "-R": o_localcddbrecursive = "y" if opt == "-s": o_showcddbfields = "y" if opt == "-S": o_cdspeed = optarg if opt == "-t": o_starttracknumber = optarg if opt == "-T": o_starttracknumber = optarg o_starttracknumbertag = "y" if opt == "-U": o_cddbproto = 5 if opt == "-v": print "This is abcde v", __version__ print "Usage: abcde.py [options] [tracks]" print "abcde -h for extra help" sys.exit(0) if opt == "-V": o_verbose = "y" if opt == "-x": o_eject = "y" # if opt == "-X": o_cue2discid = optarg if opt == "-w": o_comment = optarg if opt == "-W": if re.compile("^\d+$").search(optarg) o_starttracknumber = optarg + "01" o_starttracknumbertag = "y" o_comment = "CD" + optarg else: log("error","opt -W must be an integer") sys.exit(1) except: #log("error","arguments were not correct") pass #try: ## checkstatus("test", "/tmp/status") # pass #except: # sys.exit(1) # ------------------------------- if __name__ == "__main__": main() # b:is_python # vim:tabstop=4: abcde-2.9.3/examples/abcded000066400000000000000000000010041342626142700155300ustar00rootroot00000000000000#!/bin/sh # The first version of this script used a very linux-dependent aproach. # Modified to use cdparanoia and check for audio files on the CD #NOTE! Change the CDROM variable to point to your device. #CDROM=/proc/ide/hdh DELAY=10 DO_RIP="/usr/bin/abcde -x -b -N" CDPARANOIA="cdparanoia -Q 2>&1 | grep 'audio only'" while true; do # CAPACITY=`cat $CDROM/capacity` # if [ $CAPACITY -gt 0 ]; then # $RIP # fi sleep $DELAY GO=$CDPARANOIA RET=$? if [ $RET = "0" ] ; then DO_RIP fi done abcde-2.9.3/examples/autorip.sh000066400000000000000000000173521342626142700164370ustar00rootroot00000000000000#!/bin/bash # TODO: # Add paranoia. # Fix logger messages. # Add periodic/startup file/directory checks. # Auto check of cd drive perms. echo "Autorip 0.1.3 started." # Set script local variables # FREEMIN # The minimum free space to have on the local TMP directory. FREEMIN="750" # TIMEOUT # The timeout, in seconds (approx), for the cd-tray to be sucked back # in if it's not in already, this isn't exact, as a cycle is a bit more # then a second, but it comes out to about 3 hours. TIMEOUT=21600 # CDROM # The cd-rom device to be used. CDROM="/dev/cdroms/cdrom1" # BASE # The folder to be used for all of the actions BASE="`pwd`" # DONE # The destination of the encoded files. DONE="$BASE/done" # TMP # Defaukt temporary directory. TMP="$BASE/tmp" # REMTEMP # Remote temporary directory. (currently unused) REMTEMP="$BASE/remtmp" # LOCTEMP # Local temporary directory. LOCTEMP="$BASE/tmp" # LOGDEST # The syslog facility to use for logging purposes. LOGDEST="local3" # Oher variables (Do not set) # LASTSTART - Last CD in the drive that was encoded. # LASTDONE - Last CD that was finished encoding. # TIME - Approximately how many seconds have passed without having a cd in the drive. # CURRCD - This variable obtains the discid of whatever's in the cd drive. # REENC - The disc-id of an already encoded disc put into the drive. # PROCESS - A short feild of the DISCID that's used for keeping track of running encodes. # PROCDIR - The working directory of a process. # DISCNAME - A process local variable that's just the name of the finished disc. # DONELOCK - A timer for waiting for an add to the DB. Wait no more than 60 seconds. LASTSTART="" TIME=0 REENC=0 # Reset the status of running. echo 0 > "$BASE/lib/stop" rm -r "$TMP" mkdir "$TMP" main () { getcurcd # If the cd in the drive is currently being encoded, don't try to encode it. # Just sleep for 120 seconds and try again later. if [ "$CURCD" != "" ] && [ "$CURCD" = "$LASTSTART" ] then sleep 120 TIME=0 return 0 # If the CD isn't the same as the last one started, and cdparanoia is running # Assume shit has hit the fan and kill it to end the current process. # The process will die on it's own. elif [ "$CURCD" != "$LASTSTART" ] && [ "$(ps --no-heading -C cdparanoia)" != "" ] then logger -p $LOGDEST.info "Error ($LASTSTART): Disc removed while encoding!" killall -KILL cdparanoia # Reset the last start, because it wasn't. LASTSTART="" sleep 10 return 0 # If there's nothing in the drive, and there's no timeout yet, increase. # If something was in the drive, the function would return without encoding it. elif [ $TIME -lt $TIMEOUT ] && [ "$CURCD" = "" ] then TIME=$(($TIME+15)) sleep 15 return 0 # If the cd has been sticking out for the timeout period (which is approx three hours). # Suck it back in. This could be used to send a message to the domain, or cause beeping. elif [ $TIME -ge $TIMEOUT ] then timeout TIME=0 return 0 fi # Eject the CD if the last CD processed is sucked (or put) back in. # If there is a cd in the drive # Do not encode the last CD to go through the encoding process. # This would cause the same CD to be re-re-rencoded if left in the drive # for too long. if [ "$CURCD" != "" ] && [ "$CURCD" != "$(< "$BASE/lib/LASTDONE")" ] &! [ -d "$TMP/$(echo $CURCD | cut -f 1 -d \ )" ] then # If the cd in the drive was already encoded, set reenc to the disc-id. If the user puts the # disc back in the drive, it will re-encode. If it's different, REENC won't matter. if [ "`grep "$CURCD" $BASE/lib/done.db`" = "" ] || [ "$REENC" = "$CURCD" ] then until [ "$(($(stat -f "$TMP" --format=%a)*4096/1024/1024))" -gt "$FREEMIN" ] do sleep 120 done LASTSTART=$CURCD cdenc & REENC=$CURCD else eject $CDROM beep -r 3 REENC="$CURCD" return 0 fi fi } getcurcd() { # Check for a cd. If cd-discid exits successfully, then set the variable. # If it exits with a 0 (backwards, I know), then blank it. if $(cd-discid $CDROM > /dev/null 2>&1) then CURCD=$(cd-discid $CDROM 2>&1) else CURCD="" fi return 0 } timeout() { eject -t $CDROM && getcurcd # If the cd was the last done, assume we timed out. if [ "$CURCD" = "$(< "$BASE/lib/LASTDONE")" ] then logger -p $LOGDEST.error "CD Left (or put back) in drive." eject $CDROM beep -r 4 return 0 fi return 0 } # CD Encoder function. The workhorse. # Note: Only call when CD is in drive, else exit. cdenc () { # Check to make sure the cd wasn't changed or removed. if [ "$(cd-discid $CDROM 2>&1)" != "$CURCD" ] then return 0 fi # Set this process's id. local PROCESS="$(echo $CURCD | cut -f 1 -d \ )" local THISDISC="$CURCD" local PROCDIR="$TMP/$PROCESS" local DONELOCK=0 # Make a work folder rm -fr "$PROCDIR" mkdir "$PROCDIR" cd "$PROCDIR" # Okay, abcde has a bug where it tries to rip data cd's. But the version that fixes it itself has # even more. So instead of trying to install the new version, which doesn't work, we use a command # similar to the one ABCDE uses to determine the number of valid tracks (since it assumes the data # track always occurs at the end, which in some game CD's it doesn't) and pass it to the command # line. Yes, it really is one line. local VALIDTRACKS="$(cdparanoia -d $CDROM -Q 2>&1 | egrep '^[[:space:]]+[[:digit:]]' | awk '{print $1}' | tr -d "." | tr '\n' ' ')" # Do it. Do it. logger -p $LOGDEST.info "Info ($PROCESS): Starting encoding." abcde -Nx -d $CDROM $VALIDTRACKS > /dev/null 2>&1 # If the disc is unknown, give a warning and unique folder name. if [ -d "$PROCDIR/Unknown Artist - Unknown Album/" ] then logger -p $LOGDEST.warn "Warning ($PROCESS): Processed successfully, but info unknown." mv "$PROCDIR/Unknown Artist - Unknown Album" "$PROCDIR/Unknown Disc - ID $PROCESS" fi # If more than one folder is left, or the abcde.process folder is left over, # or if there's nothing in the directory, something has gone WRONG. if [ $(ls -1 "$PROCDIR" | wc -l) -gt 1 ] || [ "$(ls -1 "$PROCDIR")" = "abcde.$PROCESS" ] || [ "$(ls -1 "$PROCDIR")" = "" ] then logger -p $LOGDEST.error "Error ($PROCESS): More than one folder or something very bad happened." rm -r "$PROCDIR" return 0 fi # Note: Don't declare discname until process is finished. Now is fine. local DISCNAME=`ls -1 "$PROCDIR"` # Put the current disc's ID into a file in the disc's folder, JIC echo "$THISDISC" > "$PROCDIR/$DISCNAME/disc_id" logger -p $LOGDEST.info "Info ($PROCESS): Encoding of "$DISCNAME" completed successfully." # Wait for the done database to be ready... until ! [ -f "$BASE/lib/done.lock" ] || [ $DONELOCK -ge 60 ] do sleep 10 DONELOCK=$(($DONELOCK+10)) done # Then add this disc to it. if [ "`grep "$CURCD" $BASE/lib/done.db`" = "" ] then touch "$BASE/lib/done.lock" cat "$BASE/lib/done.db" "$PROCDIR/$DISCNAME/disc_id" > "$BASE/lib/done.new" mv "$BASE/lib/done.new" "$BASE/lib/done.db" rm "$BASE/lib/done.lock" else logger -p $LOGDEST.notice "Not adding $PROCESS to done.db" fi # Move the process's completed directory into the done folder. if ! [ -d "$DONE/$DISCNAME" ] then mv -f "$PROCDIR/$DISCNAME" "$DONE/" elif [ -d "$DONE/$DISCNAME" ] then rm -r "$DONE/$DISCNAME" mv -f "$PROCDIR/$DISCNAME" "$DONE/" fi # A file must be used here because the variable is lost when the function exits sometimes. echo "$THISDISC" > "$BASE/lib/LASTDONE" # If I was the last disc started, and I'm done, clear the laststart variable so the last disc # encoded can be re-encoded if they really want to. if [ "$THISDISC" = "$LASTSTART" ] then LASTSTART="" fi # Remove the process temp directory and call it a day. rm -r "$PROCDIR" } until [[ $(< "$BASE/lib/stop") == 1 ]] do main done abcde-2.9.3/examples/cue2discid000077500000000000000000000043321342626142700163560ustar00rootroot00000000000000#!/usr/bin/python """Outputs a long-form cddb discid given a cue file as input""" import fileinput import re import sys if sys.version_info > (3,): long = int FRAMES_PER_SECOND = 75 SAMPLES_PER_SECOND = 44100 SAMPLES_PER_FRAME = SAMPLES_PER_SECOND // FRAMES_PER_SECOND pregap = 0 currentTrackFrame = 0 pregapRegex = re.compile(r'PREGAP (?P\d+):(?P\d\d):(?P\d\d)') startTrackRegex = re.compile(r'INDEX 01 (?P\d+):(?P\d\d):(?P\d\d)') leadInRegex = re.compile(r'REM FLAC__lead-in (?P\d+)') leadOutRegex = re.compile(r'REM FLAC__lead-out 170 (?P\d+)') raw_framelist = list() leadInFrame = 0 leadOutFrame_raw = 0 numTracks = 0 def cddb_sum(trackseconds): def digits(number): tmp = number while tmp: yield tmp % 10 tmp = tmp // 10 return sum(digits(trackseconds)) for line in fileinput.input(): pregapMatch = pregapRegex.search(line) if pregapMatch: pregap = (int((pregapMatch.group('min')) * 60) + int(pregapMatch.group('sec'))) * FRAMES_PER_SECOND + int(pregapMatch.group('frame')) continue startTrackMatch = startTrackRegex.search(line) if startTrackMatch: numTracks += 1 currentTrackFrame = ((int(startTrackMatch.group('min')) * 60) + int(startTrackMatch.group('sec'))) * FRAMES_PER_SECOND + int(startTrackMatch.group('frame')) raw_framelist.append(currentTrackFrame) continue leadInMatch = leadInRegex.search(line) if leadInMatch: leadInFrame = long(leadInMatch.group('sample')) // SAMPLES_PER_FRAME continue leadOutMatch = leadOutRegex.search(line) if leadOutMatch: leadOutFrame_raw = long(leadOutMatch.group('sample')) // SAMPLES_PER_FRAME continue leadOutFrame = leadOutFrame_raw + leadInFrame framelist = [i + leadInFrame + pregap for i in raw_framelist] secondslist = [i//FRAMES_PER_SECOND for i in framelist] n = long(sum(map(cddb_sum, secondslist))) t = int(leadOutFrame/FRAMES_PER_SECOND - framelist[0]/FRAMES_PER_SECOND) print("%08x %s %s %s" % ((((n % 0xff) << 24) | (t << 8) | numTracks), numTracks, " ".join([str(i) for i in framelist]), int(leadOutFrame/FRAMES_PER_SECOND))) abcde-2.9.3/examples/musicbrainz-get-tracks000077500000000000000000000071631342626142700207350ustar00rootroot00000000000000#!/usr/bin/python # Copyright 2005 Decklin Foster, licensed under the same terms as abcde. import sys import getopt import musicbrainz import musicbrainz.queries as mq DEF_CD_DEV = '/dev/cdrom' def get_toc_discid(mb, dev): mb.SetDevice(dev) try: mb.Query(mq.MBQ_GetCDTOC) return mb.GetResultData(mq.MBE_TOCGetCDIndexId) except musicbrainz.MusicBrainzError: print >>sys.stderr, "error: could not read TOC from disc" sys.exit(1) def lookup_discid(mb, id): mb.QueryWithArgs(mq.MBQ_GetCDInfoFromCDIndexId, [id]) def fake_cddb(mb): matches = mb.GetResultInt(mq.MBE_GetNumAlbums) if matches == 0: print >>sys.stderr, "error: could not find an entry for this disc" sys.exit(1) if matches > 1: print >>sys.stderr, "warning: multiple matches, using first" mb.Select1(mq.MBS_SelectAlbum, 1) album = mb.GetResultData(mq.MBE_AlbumGetAlbumName) n = mb.GetResultInt(mq.MBE_AlbumGetNumTracks) artistid = mb.GetIDFromURL(mb.GetResultData(mq.MBE_AlbumGetAlbumArtistId)) if artistid == mq.MBI_VARIOUS_ARTIST_ID: artist = 'Various Artists' else: try: artist = mb.GetResultData1(mq.MBE_AlbumGetArtistName, 1) except musicbrainz.MusicBrainzError: artist = 'Unknown Artist' if args: tracks = map(int, args) else: tracks = range(1, n+1) trackinfo = [] for i in tracks: if artistid == mq.MBI_VARIOUS_ARTIST_ID: try: tartist = mb.GetResultData1(mq.MBE_AlbumGetArtistName, i) except musicbrainz.MusicBrainzError: tartist = 'Unknown Artist' else: tartist = None try: ttitle = mb.GetResultData1(mq.MBE_AlbumGetTrackName, i) except musicbrainz.MusicBrainzError: tartist = 'Unknown Track' try: tlength = mb.GetResultInt1(mq.MBE_AlbumGetTrackDuration, i) except musicbrainz.MusicBrainzError: tlength = 0 trackinfo.append((tartist, ttitle, tlength)) print "# fake CD database file generated by musicbrainz-get-tracks 0.1" print "#" print "# Track frame offsets:" # Assume standard pregap total_len = 2000 for t in trackinfo: tartist, ttitle, tlength = t print "# %d" % (total_len / (1000.0/75.0)) total_len += tlength print "#" print "# Disc length: %d seconds" % (total_len / 1000) print "#" print "# Revision: 0" print "# Processed by: MusicBrainz" print "# Submitted by: MusicBrainz" print "DISCID=%s" % id print "DTITLE=%s / %s" % (artist, album) for i in range(0, len(trackinfo)): tartist, ttitle, tlength = trackinfo[i] if tartist: print "TTITLE%d=%s / %s" % (i, tartist, ttitle) else: print "TTITLE%d=%s" % (i, ttitle) print "EXTD=" for i in range(0, len(trackinfo)): print "EXTD%d=" % i print "PLAYORDER=" print "." if __name__ == "__main__": shortopts = 'nd:i:' longopts = ['no-lookup', 'device=', 'id='] mb = musicbrainz.mb() mb.SetDepth(2) opts, args = getopt.getopt(sys.argv[1:], shortopts, longopts) id = None lookup = True if opts: for opt, arg in opts: if opt in ('--no-lookup', '-n'): lookup = False if opt in ('--device', '-d'): id = get_toc_discid(mb, arg) if opt in ('--id', '-i'): id = arg if not id: id = get_toc_discid(mb, DEF_CD_DEV) if lookup: lookup_discid(mb, id) fake_cddb(mb) else: print id abcde-2.9.3/interfaces.txt000066400000000000000000000063271342626142700154660ustar00rootroot00000000000000abcde interfaces ================ abcde uses a lot of files as it runs in order to keep track of current status and to store the various bits of data it's using, like cddb lookups and results, user choices, encoding etc. Here is (the start of!) a quick guide to what each file is used for. Each file lives in $ABCDETEMPDIR at runtime, which is the per-disc working directory that abcde uses. Once the "clean" operation has happened, they all go away. CD lookups ---------- cddbchoices - concatenation of all the lookups with some status information. Displayed to the user once all the lookups are complete, as the list of results to choose from. cddbread.X - generic-ish results from a disc lookup, for match number X. Based on the format used by *cddb*, but the musicbrainz and cdtext lookup methods have been written to (roughly) output this format as an interface so the rest of the abcde code doesn't need massive adaptation to new formats. Match number 0 is special - it's a blank template file ready for the user to edit in case there's no correct match. datasource.X- text label for the source of the data in cddbread.X, e.g. "cddb" or "Musicbrainz". Generated by the data lookup methods, then used later if we care where the data came from. cddbquery.X - Summary of a single disc lookup result. Based on the complicated format used by *cddb*, but without the result code. Generated by the data lookup methods, then used later to fabricate a composite cddbquery file. cddbquery - result code and summary of a disc lookup. Based on the format used by *cddb*, and faked up by the other lookup methods. A single successful match will look like: 200 $genre $discid $artist / $album Multiple successful matches will show up as 210 Found exact matches, list follows (until terminating `.') $genre1 $discid $artist1 / $album1 $genre2 $discid $artist2 / $album2 . Other response codes are possible, 999 is special and used internally by abcde to denote a local cddb data cache cue-.txt - cue file generated from the track data on the disc cddbdiscid - raw data showing the cddb discid and the track info numbers used to calculate it mbdiscid - raw data showing a musicbrainz discid and the track info numbers used to calculate it status - log file of all the operations carried out thus far. Format is important - things are looked up here regularly to work out what's happened and what should be done next. See usage of the checkstatus() function to look for things. Files specific to lookups using *cddb*, in the data-cddb subdir: * cddbstat - status from a cddb server, downloaded as a check that the server is working correctly (ish!) Files specific to lookups using *musicbrainz*: * asin.X -\ details about musicbrainz-specific information for * mbid.X -/ match number X. specific to lookups using *cdtext*, in the data-cdtext subdir: * cd-text - the raw CD-Text information as returned by icedax/cdda2wav ... More to follow...?