From d35747a40c7dea12de95f78a4f283a45ef687597 Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Mon, 23 Feb 2004 23:41:20 +0000 Subject: [PATCH] import from SF CVS git-svn-id: https://svn.musicpd.org/mpd/trunk@1 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- AUTHORS | 5 + COPYING | 340 ++ ChangeLog | 142 + INSTALL | 99 + Makefile.am | 4 + README | 19 + TODO | 3 + UPGRADING | 30 + autogen.sh | 65 + configure.in | 272 + doc/COMMANDS | 163 + doc/Makefile.am | 4 + doc/mpd.1 | 213 + doc/mpdconf.example | 30 + makedist.sh | 5 + src/Makefile.am | 15 + src/audio.c | 199 + src/audio.h | 50 + src/audiofile_decode.c | 138 + src/audiofile_decode.h | 32 + src/buffer2array.c | 114 + src/buffer2array.h | 26 + src/charConv.c | 99 + src/charConv.h | 28 + src/command.c | 617 +++ src/command.h | 37 + src/conf.c | 221 + src/conf.h | 61 + src/decode.c | 456 ++ src/decode.h | 50 + src/directory.c | 841 +++ src/directory.h | 57 + src/flac_decode.c | 292 ++ src/flac_decode.h | 28 + src/interface.c | 624 +++ src/interface.h | 38 + src/libid3tag/CHANGES | 75 + src/libid3tag/COPYING | 340 ++ src/libid3tag/COPYRIGHT | 21 + src/libid3tag/CREDITS | 28 + src/libid3tag/INSTALL | 183 + src/libid3tag/Makefile.am | 123 + src/libid3tag/README | 102 + src/libid3tag/TODO | 12 + src/libid3tag/VERSION | 6 + src/libid3tag/compat.gperf | 297 ++ src/libid3tag/compat.h | 41 + src/libid3tag/config.h.in | 77 + src/libid3tag/configure.ac | 205 + src/libid3tag/crc.c | 137 + src/libid3tag/crc.h | 29 + src/libid3tag/debug.c | 222 + src/libid3tag/debug.h | 35 + src/libid3tag/field.c | 875 ++++ src/libid3tag/field.h | 36 + src/libid3tag/file.c | 673 +++ src/libid3tag/file.h | 25 + src/libid3tag/frame.c | 626 +++ src/libid3tag/frame.h | 36 + src/libid3tag/frametype.gperf | 363 ++ src/libid3tag/frametype.h | 42 + src/libid3tag/genre.c | 151 + src/libid3tag/genre.dat.in | 180 + src/libid3tag/genre.dat.sed | 54 + src/libid3tag/genre.h | 27 + src/libid3tag/global.h | 53 + src/libid3tag/id3tag.h | 363 ++ src/libid3tag/latin1.c | 217 + src/libid3tag/latin1.h | 45 + src/libid3tag/libid3tag.list.in | 21 + src/libid3tag/parse.c | 196 + src/libid3tag/parse.h | 34 + src/libid3tag/render.c | 200 + src/libid3tag/render.h | 40 + src/libid3tag/tag.c | 909 ++++ src/libid3tag/tag.h | 30 + src/libid3tag/ucs4.c | 224 + src/libid3tag/ucs4.h | 41 + src/libid3tag/utf16.c | 286 + src/libid3tag/utf16.h | 51 + src/libid3tag/utf8.c | 365 ++ src/libid3tag/utf8.h | 42 + src/libid3tag/util.c | 147 + src/libid3tag/util.h | 35 + src/libid3tag/version.c | 45 + src/libid3tag/version.h | 25 + src/libmad/CHANGES | 321 ++ src/libmad/COPYING | 340 ++ src/libmad/COPYRIGHT | 21 + src/libmad/CREDITS | 100 + src/libmad/D.dat | 607 +++ src/libmad/INSTALL | 183 + src/libmad/Makefile.am | 140 + src/libmad/README | 241 + src/libmad/TODO | 70 + src/libmad/VERSION | 7 + src/libmad/bit.c | 237 + src/libmad/bit.h | 47 + src/libmad/config.h.in | 129 + src/libmad/configure.ac | 432 ++ src/libmad/decoder.c | 582 ++ src/libmad/decoder.h | 91 + src/libmad/fixed.c | 81 + src/libmad/fixed.h | 484 ++ src/libmad/frame.c | 502 ++ src/libmad/frame.h | 118 + src/libmad/global.h | 58 + src/libmad/huffman.c | 3098 +++++++++++ src/libmad/huffman.h | 66 + src/libmad/imdct_l_arm.S | 1000 ++++ src/libmad/imdct_s.dat | 62 + src/libmad/layer12.c | 510 ++ src/libmad/layer12.h | 31 + src/libmad/layer3.c | 2502 +++++++++ src/libmad/layer3.h | 30 + src/libmad/libmad.list.in | 21 + src/libmad/mad.h.sed | 36 + src/libmad/minimad.c | 222 + src/libmad/qc_table.dat | 77 + src/libmad/rq_table.dat | 8747 +++++++++++++++++++++++++++++++ src/libmad/sf_table.dat | 106 + src/libmad/stream.c | 160 + src/libmad/stream.h | 107 + src/libmad/synth.c | 857 +++ src/libmad/synth.h | 69 + src/libmad/timer.c | 485 ++ src/libmad/timer.h | 100 + src/libmad/version.c | 91 + src/libmad/version.h | 47 + src/list.c | 436 ++ src/list.h | 99 + src/listen.c | 186 + src/listen.h | 28 + src/log.c | 39 + src/log.h | 45 + src/ls.c | 286 + src/ls.h | 43 + src/main.c | 461 ++ src/mp3_decode.c | 512 ++ src/mp3_decode.h | 33 + src/mpd_types.h | 23 + src/myfprintf.c | 70 + src/myfprintf.h | 28 + src/ogg_decode.c | 121 + src/ogg_decode.h | 28 + src/path.c | 173 + src/path.h | 50 + src/pcm_utils.c | 119 + src/pcm_utils.h | 16 + src/permission.c | 122 + src/permission.h | 17 + src/player.c | 397 ++ src/player.h | 126 + src/playerData.c | 124 + src/playerData.h | 58 + src/playlist.c | 1236 +++++ src/playlist.h | 96 + src/sig_handlers.c | 90 + src/sig_handlers.h | 34 + src/song.c | 231 + src/song.h | 61 + src/stats.c | 47 + src/stats.h | 37 + src/tables.c | 210 + src/tables.h | 43 + src/tag.c | 368 ++ src/tag.h | 56 + src/utils.c | 39 + src/utils.h | 28 + src/volume.c | 416 ++ src/volume.h | 38 + 171 files changed, 43692 insertions(+) create mode 100644 AUTHORS create mode 100644 COPYING create mode 100644 ChangeLog create mode 100644 INSTALL create mode 100644 Makefile.am create mode 100644 README create mode 100644 TODO create mode 100644 UPGRADING create mode 100755 autogen.sh create mode 100644 configure.in create mode 100644 doc/COMMANDS create mode 100644 doc/Makefile.am create mode 100644 doc/mpd.1 create mode 100644 doc/mpdconf.example create mode 100644 makedist.sh create mode 100644 src/Makefile.am create mode 100644 src/audio.c create mode 100644 src/audio.h create mode 100644 src/audiofile_decode.c create mode 100644 src/audiofile_decode.h create mode 100644 src/buffer2array.c create mode 100644 src/buffer2array.h create mode 100644 src/charConv.c create mode 100644 src/charConv.h create mode 100644 src/command.c create mode 100644 src/command.h create mode 100644 src/conf.c create mode 100644 src/conf.h create mode 100644 src/decode.c create mode 100644 src/decode.h create mode 100644 src/directory.c create mode 100644 src/directory.h create mode 100644 src/flac_decode.c create mode 100644 src/flac_decode.h create mode 100644 src/interface.c create mode 100644 src/interface.h create mode 100644 src/libid3tag/CHANGES create mode 100644 src/libid3tag/COPYING create mode 100644 src/libid3tag/COPYRIGHT create mode 100644 src/libid3tag/CREDITS create mode 100644 src/libid3tag/INSTALL create mode 100644 src/libid3tag/Makefile.am create mode 100644 src/libid3tag/README create mode 100644 src/libid3tag/TODO create mode 100644 src/libid3tag/VERSION create mode 100644 src/libid3tag/compat.gperf create mode 100644 src/libid3tag/compat.h create mode 100644 src/libid3tag/config.h.in create mode 100644 src/libid3tag/configure.ac create mode 100644 src/libid3tag/crc.c create mode 100644 src/libid3tag/crc.h create mode 100644 src/libid3tag/debug.c create mode 100644 src/libid3tag/debug.h create mode 100644 src/libid3tag/field.c create mode 100644 src/libid3tag/field.h create mode 100644 src/libid3tag/file.c create mode 100644 src/libid3tag/file.h create mode 100644 src/libid3tag/frame.c create mode 100644 src/libid3tag/frame.h create mode 100644 src/libid3tag/frametype.gperf create mode 100644 src/libid3tag/frametype.h create mode 100644 src/libid3tag/genre.c create mode 100644 src/libid3tag/genre.dat.in create mode 100644 src/libid3tag/genre.dat.sed create mode 100644 src/libid3tag/genre.h create mode 100644 src/libid3tag/global.h create mode 100644 src/libid3tag/id3tag.h create mode 100644 src/libid3tag/latin1.c create mode 100644 src/libid3tag/latin1.h create mode 100644 src/libid3tag/libid3tag.list.in create mode 100644 src/libid3tag/parse.c create mode 100644 src/libid3tag/parse.h create mode 100644 src/libid3tag/render.c create mode 100644 src/libid3tag/render.h create mode 100644 src/libid3tag/tag.c create mode 100644 src/libid3tag/tag.h create mode 100644 src/libid3tag/ucs4.c create mode 100644 src/libid3tag/ucs4.h create mode 100644 src/libid3tag/utf16.c create mode 100644 src/libid3tag/utf16.h create mode 100644 src/libid3tag/utf8.c create mode 100644 src/libid3tag/utf8.h create mode 100644 src/libid3tag/util.c create mode 100644 src/libid3tag/util.h create mode 100644 src/libid3tag/version.c create mode 100644 src/libid3tag/version.h create mode 100644 src/libmad/CHANGES create mode 100644 src/libmad/COPYING create mode 100644 src/libmad/COPYRIGHT create mode 100644 src/libmad/CREDITS create mode 100644 src/libmad/D.dat create mode 100644 src/libmad/INSTALL create mode 100644 src/libmad/Makefile.am create mode 100644 src/libmad/README create mode 100644 src/libmad/TODO create mode 100644 src/libmad/VERSION create mode 100644 src/libmad/bit.c create mode 100644 src/libmad/bit.h create mode 100644 src/libmad/config.h.in create mode 100644 src/libmad/configure.ac create mode 100644 src/libmad/decoder.c create mode 100644 src/libmad/decoder.h create mode 100644 src/libmad/fixed.c create mode 100644 src/libmad/fixed.h create mode 100644 src/libmad/frame.c create mode 100644 src/libmad/frame.h create mode 100644 src/libmad/global.h create mode 100644 src/libmad/huffman.c create mode 100644 src/libmad/huffman.h create mode 100644 src/libmad/imdct_l_arm.S create mode 100644 src/libmad/imdct_s.dat create mode 100644 src/libmad/layer12.c create mode 100644 src/libmad/layer12.h create mode 100644 src/libmad/layer3.c create mode 100644 src/libmad/layer3.h create mode 100644 src/libmad/libmad.list.in create mode 100644 src/libmad/mad.h.sed create mode 100644 src/libmad/minimad.c create mode 100644 src/libmad/qc_table.dat create mode 100644 src/libmad/rq_table.dat create mode 100644 src/libmad/sf_table.dat create mode 100644 src/libmad/stream.c create mode 100644 src/libmad/stream.h create mode 100644 src/libmad/synth.c create mode 100644 src/libmad/synth.h create mode 100644 src/libmad/timer.c create mode 100644 src/libmad/timer.h create mode 100644 src/libmad/version.c create mode 100644 src/libmad/version.h create mode 100644 src/list.c create mode 100644 src/list.h create mode 100644 src/listen.c create mode 100644 src/listen.h create mode 100644 src/log.c create mode 100644 src/log.h create mode 100644 src/ls.c create mode 100644 src/ls.h create mode 100644 src/main.c create mode 100644 src/mp3_decode.c create mode 100644 src/mp3_decode.h create mode 100644 src/mpd_types.h create mode 100644 src/myfprintf.c create mode 100644 src/myfprintf.h create mode 100644 src/ogg_decode.c create mode 100644 src/ogg_decode.h create mode 100644 src/path.c create mode 100644 src/path.h create mode 100644 src/pcm_utils.c create mode 100644 src/pcm_utils.h create mode 100644 src/permission.c create mode 100644 src/permission.h create mode 100644 src/player.c create mode 100644 src/player.h create mode 100644 src/playerData.c create mode 100644 src/playerData.h create mode 100644 src/playlist.c create mode 100644 src/playlist.h create mode 100644 src/sig_handlers.c create mode 100644 src/sig_handlers.h create mode 100644 src/song.c create mode 100644 src/song.h create mode 100644 src/stats.c create mode 100644 src/stats.h create mode 100644 src/tables.c create mode 100644 src/tables.h create mode 100644 src/tag.c create mode 100644 src/tag.h create mode 100644 src/utils.c create mode 100644 src/utils.h create mode 100644 src/volume.c create mode 100644 src/volume.h diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 000000000..270ae1da7 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,5 @@ +Developer -> Warren Dukes +Developer -> tw-nym +wave File Support -> normalperson +setuid patch -> Nagilum +'next' and 'previous' patch -> Niklas Hofer diff --git a/COPYING b/COPYING new file mode 100644 index 000000000..d60c31a97 --- /dev/null +++ b/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 Library General +Public License instead of this License. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 000000000..4f7d516d8 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,142 @@ +ver 0.9.4 (2004/1/21) +1) Fix a bug where updated tag info wasn't being detected +2) Set the default audio write size to 1024 bytes (should decrease cpu load a bit on some machines). +3) Make audio write size configurable via "audio_write_size" config option +4) Tweak output buffer size for connections by detecting the kernel output buffer size. + +ver 0.9.3 (2003/10/31) +1) Store total time/length of songs in db and display in *info commands +2) Display instantaneous bitrate in status command +3) Add Wave Support using libaudiofile (Patch from normalperson) +4) Command code cleanup (Patch from tw-nym) +5) Optimize listing of playlists (10-100x faster) +6) Optimize interface output (write in 4kB chunks instead of on every '\n') +7) Fix bug that prevented rm command from working +8) Fix bug where deleting current song skips the next song +9) Use iconv to convert vorbis comments from UTF-8 to Latin1 + +ver 0.9.2 (2003/10/6) +1) Fix FreeBSD Compilation Problems +2) Fix bug in move command +3) Add mixer_control options to configure which mixer control/device mpd controls +4) Randomize on play -1 +5) Fix a bug in toggling repeat off and at the end of the playlist + +ver 0.9.1 (2003/9/30) +1) Fix a statement in the middle of declarations in listen.c, causes error for +gcc 2.7 + +ver 0.9.0 (2003/9/30) +1) Random play mode +2) Alsa Mixer Support +3) Save and Restore "state" +4) Default config file locations (.mpdconf and /etc/mpd.conf) +5) Make db file locations configurable +6) Move songs around in the playlist +7) Gapless playback +8) Use Xing tags for mp3's +9) Remove stop_on_error +10) Seeking support +11) Playlists can be loaded and deleted from subdirectories +12) Complete rewrite of player layer (fork()'s only once, opens and closes +audio device as needed). +13) Eliminate use and dependence of SIGIO +14) IPv6 support +15) Solaris compilations fixes +16) Support for different log levels +17) Timestamps for log entries +18) "user" config parameter for setuid (patch from Nagilum) +19) Other misc features and bug fixes + +ver 0.8.7 (2003/9/3) +1) Fix a memory leak. When closing a interface, was called close() on the fd +instead of calling fclose() on the fp that was opened with fdopen(). + +ver 0.8.6 (2003/8/25) +1) Fix a memory leak when a buffered existed, and a connection was unexpectedly closed, and i wasn't free'ing the buffer apropriatly. + +ver 0.8.5 (2003/8/17) +1) Fix a bug where an extra end of line is returned when attempting to play a +non existing file. This causes parsing errors for clients. + +ver 0.8.4 (2003/8/13) +1) Fix a bug where garbage is returned with errors in "list" command + +ver 0.8.3 (2003/8/12) +1) Fix a compilation error on older linux systems +2) Fix a bug in searching by title +3) Add "list" command +4) Add config options for specifying libao driver/plugin and options +5) Add config option to specify which address to bind to +6) Add support for loading and saving absolute pathnames in saved playlists +7) Playlist no longer creates duplicate entries for song data (more me +efficient) +8) Songs deleted from the db are now removed for the playlist as well + +ver 0.8.2 (2003/7/22) +1) Increased the connection que for listen() from 0 to 5 +2) Cleanup configure makefiles so that mpd uses MPD_LIBS and MPD_CFLAGS +rather than LIBS and CFLAGS +3) Put a cap on the number of commands per command list +4) Put a cap on the maximum number of buffered output lines +5) Get rid of TIME_WAIT/EADDRINUSE socket problem +6) Use asynchronious IO (i.e. trigger SIGIO instead so we can sleep in +select() calls longer) + +ver 0.8.1 (2003/7/11) +1) FreeBSD fixes +2) Fix for rare segfault when updating +3) Fix bug where client was being hungup on when done playing current song +4) Fix bug when playing flac's where it incorrectly reports an error +5) Make stop playlist on error configurable +6) Configure checks for installed libmad and libid3tag and uses those if found +7) Use buffer->finished in *_decode's instead of depending on catching signals + +ver 0.8.0 (2003/7/6) +1) Flac support +2) Make playlist max length configurable +3) New backward compatible status (backward compatible for 0.8.0 on) +4) listall command now can take a directory as an argument +5) Buffer rewritten to use shared memory instead of sockets +6) Playlist adding done using db +7) Add sort to list, and use binary search for finding +8) New "stats" command +9) Command list (for faster adding of large batches of files) +10) Add buffered chunks before play +11) Useful error reporting to clients (part of status command) +12) Use libid3tag for reading id3 tags (more stable) +13) Non-blocking output to clients +14) Fix bug when removing items from directory +15) Fix bug when playing mono mp3's +16) Fix bug when attempting to delete files when using samba +17) Lots of other bug fixes I can't remember + +ver 0.7.0 (2003/6/20) +1) use mad instead of mpg123 for mp3 decoding +2) volume support +3) repeate playlist support +4) use autoconf/automake (i.e. "configure") +5) configurable max connections + +ver 0.6.2 (2003/6/11) +1) Buffer support for ogg +2) new config file options: "connection_timeout" and "mpg123_ignore_junk" +3) new commands: "next", "previous", and "listall" +Thanks to Niklas Hofer for "next" and "previous" patches! +4) Search by filename +5) bug fix for pause when playing mp3's + +ver 0.6.1 (2003/5/29) +1) Add conf file support +2) Fix a bug when doing mp3stop (do wait3(NULL,WNOHANG|WUNTRACED,NULL)) +3) Fix a bug when fork'ing, fflush file buffers before forking so the +child doesn't print the same stuff in the buffer. + +ver 0.6.0 (2003/5/25) +1) Add ogg vorbis support +2) Fix two bugs relating to tables, one for search by title, and one where we +freed the tables before directories, causing a segfault +3) The info command has been removed. + +ver 0.5.0-0.5.2 +Initial release(s). Support for MP3 via mpg123 diff --git a/INSTALL b/INSTALL new file mode 100644 index 000000000..75d8fc7d9 --- /dev/null +++ b/INSTALL @@ -0,0 +1,99 @@ + Music Player Daemon (MPD) - INSTALL + +Requirements +------------ + +libao - http://www.vorbis.com/download_unix.psp +(This comes with most/all distributions. Make sure you have both +the ao libs and development packages for your distribution installed. +For Red Hat 8.0, the necessary packages are: libao and libao-devel) + +zlib - http://www.gzip.org/zlib +(This comes with all distributions. Make sure you have bot the zlib libs +and development packages for your distribution installed. For Red hat, +the necessary packages are: zlib and zlib-devel) + +Optional +-------- + +Ogg Vorbis - http://www.xiph.org/ogg/vorbis/ +(This comes with most/all distributions. Make sure you have both the +ogg and vorbis libs as well as the development packages for your +distribution installed. For Red Hat 8.0, the necessary packages are: +libogg, libogg-devel, libvorbis, and libvorbis-devel). + +Flac - http://flac.sf.net +For Flac support, you need Flac 1.1.0 or greater. + +Download +-------- + +Get the latest release from of MPD from http://www.musicpd.org + +Compile +------- + +1) unzip and untar the archive + +$ tar zxvf mpd-x.x.x.tar.gz + +2) change to directory created + +$ cd mpd-x.x.x + +3) Run configure script (this will determine what dependencies you have) + +$ ./configure + +4) Compile + +$ make + +Install (Optional) +------- + +(as root) +$ make install + +Run +--- + +1) run mpd: +: port number daemon listens on (if running as a user, this should be + greater than 1024) +: directory containing mp3's +: directory where playlists will be stored (and .mpddb will + be placed) +: log file for mpd +: error log file for mpd + +$ mpd + +example where mpd executable is in mpd-x.x.x directory: +$ mpd-x.x.x/mpd 2100 mp3 playlists mpd.log mpd.err + +Note: The first time you run mpd, it will "explore" your mp3 directory for +mp3's. + +Also, mpd can alternatively use config file. In this case, +run mpd like this: + +$ mpd + +(if no config file is specified, mpd's looks for ~/.mpdconf then /etc/mpd.conf) + +an example would be: + +$ mpd playlists/.mpdconf + +A sample config file is included with the source of MPD, mpdconf.example . + +Using MPD +--------- + +You can download a web interface (phpMp) to MPD at +http://www.musicpd.org . + +Also, several other clients can be found for MPD at http://www.musicpd.org . + +MPD can be interfaced directly using telnet (see COMMANDS, if you are brave). diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 000000000..8d69a9af3 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,4 @@ +SUBDIRS = src doc +docdir = $(prefix)/share/doc/$(PACKAGE) +doc_DATA = README UPGRADING +EXTRA_DIST = COPYING $(doc_DATA) diff --git a/README b/README new file mode 100644 index 000000000..188a2fa80 --- /dev/null +++ b/README @@ -0,0 +1,19 @@ + + Music Player Daemon (MPD) + http://www.musicpd.org + +A daemon for playing music (mp3, ogg vorbis, and flac). Music is played +through the server's audio device. The daemon stores info about all available +music, and this info can be easily searched and retrieved. Player control, info +retrieval, and playlist management can all be managed remotely. + +To install MPD, see INSTALL. + +MPD includes 2 libraries in the source. libid3tag and libmad are released under +the GPL and copyrighted by Robert Leslie (http://www.underbit.com/products/mad). + +MPD is released under the GNU Public License. +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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +For the full license, see COPYING. diff --git a/TODO b/TODO new file mode 100644 index 000000000..2022a8a8b --- /dev/null +++ b/TODO @@ -0,0 +1,3 @@ +1) 24-bit pcm-tools (this may just wait since almost no one uses it) +2) put software mixer settings in state file +3) finish modifying man page, commands, and example config file diff --git a/UPGRADING b/UPGRADING new file mode 100644 index 000000000..78ede45ee --- /dev/null +++ b/UPGRADING @@ -0,0 +1,30 @@ + Music Player Daemon (MPD) - UPGRADING + +Upgrading to 0.9.3 +------------------ + +Wave support was added, so to have your wave files added, update the db (mpc +update). + +Also, song lengths are now stored in the db. To get this stuff +added to the db, you will need to recreate the db from scratch. To do this, +run mpd with the "--create-db" commandline option. + +Upgrading to 0.9.0 +------------------ + +The "stop_on_error" config parameter was removed, so be sure to remove this +parameter from your config file. + +Upgrading to 0.8.x +------------------ + +If you have FLACs, then to have them added to your list of available music, +just use "update". + +Upgrading from 0.5.x to 0.6.x +----------------------------- +If you have not compiled MPD with "make ogg", then nothing is needed. + +If you compiled with "make ogg", just use "update" (available via the phpMp +interface) to add your OGGs to MPD's list of available music. diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 000000000..112365ae2 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,65 @@ +#!/bin/sh +# +echo "Generating build information using aclocal, automake and autoconf" +echo "This may take a while ..." + +# Touch the timestamps on all the files since CVS messes them up +#touch Makefile.am configure.in +#touch libid3tag/Makefile.am libid3tag/configure.ac +#touch libmad/Makefile.am libmad/configure.ac + +#rm -f configure +#rm -f libid3tag/configure +#rm -f libmad/configure +#rm -f config.cache +#rm -f config.status +#rm -f libid3tag/config.status +#rm -f libmad/config.status +#rm -rf autom4te*.cache +#rm -rf libid3tag/autom4te*.cache +#rm -rf libmad/autom4te*.cache +#rm -f aclocal.m4 +#rm -f libid3tag/aclocal.m4 +#rm -f libmad/aclocal.m4 + +# Regenerate configuration files +libtoolize -f -c + +for i in -1.8 -1.7 -1.6 ''; do + if [ -z $ACLOCAL ]; then + which aclocal$i + if [ "$?" = "0" ]; then + ACLOCAL=aclocal$i + fi + fi + if [ -z $AUTOMAKE ]; then + which automake$i + if [ "$?" = "0" ]; then + AUTOMAKE=automake$i + fi + fi +done + +if [ -d /usr/local/share/aclocal ]; then + $ACLOCAL -I /usr/local/share/aclocal +else + $ACLOCAL +fi +$AUTOMAKE --foreign --add-missing -c +autoconf + +cd src/libid3tag +$ACLOCAL +$AUTOMAKE --foreign --add-missing -c +autoconf +cd ../.. + +cd src/libmad +$ACLOCAL +$AUTOMAKE --foreign --add-missing -c +autoconf +cd ../.. + +# Run configure for this platform +./configure $* + diff --git a/configure.in b/configure.in new file mode 100644 index 000000000..e49a922b9 --- /dev/null +++ b/configure.in @@ -0,0 +1,272 @@ +AC_INIT(src/main.c) +AM_INIT_AUTOMAKE(mpd, 0.10.0) + +AC_PROG_CC +AC_PROG_INSTALL +AC_PROG_LIBTOOL + +dnl MAD wants this stuff +AC_SUBST(CCAS) +AC_SUBST(CCASFLAGS) + +AC_SUBST(MAD_SUBDIR) +AC_SUBST(MAD_LIB) +AC_SUBST(ID3_SUBDIR) +AC_SUBST(ID3_LIB) +AC_SUBST(MPD_LIBS) +AC_SUBST(MPD_CFLAGS) + +MPD_CFLAGS="-Wall" +MPD_LIBS="" + +AC_ARG_ENABLE(iconv,[ --disable-iconv disable iconv support],,enable_iconv=yes) +AC_ARG_ENABLE(ipv6,[ --disable-ipv6 disable IPv6 support],,enable_ipv6=yes) +AC_ARG_ENABLE(ogg,[ --disable-ogg disable ogg support],,enable_ogg=yes) +AC_ARG_ENABLE(flac,[ --disable-flac disable flac support],,enable_flac=yes) +AC_ARG_ENABLE(mp3,[ --disable-mp3 disable mp3 support],,enable_mp3=yes) +AC_ARG_ENABLE(audiofile,[ --disable-audiofile disable audiofile support, disables wave support],,enable_audiofile=yes) +AC_ARG_ENABLE(mpd_mad,[ --enable-mpd-mad use mpd libmad],use_mpd_mad=yes,) +AC_ARG_ENABLE(id3,[ --disable-id3 disable id3 support],,enable_id3=yes) +AC_ARG_ENABLE(mpd_id3tag,[ --enable-mpd-id3tag use mpd libid3tag],use_mpd_id3tag=yes,) + +AC_ARG_WITH(id3tag,[ --with-id3tag=PFX Prefix where libid3tag is installed (optional)], id3tag_prefix="$withval", id3tag_prefix="") +AC_ARG_WITH(id3tag-libraries,[ --with-id3tag-libraries=DIR Directory where libid3tag library is installed (optional)], id3tag_libraries="$withval", id3tag_libraries="") +AC_ARG_WITH(id3tag-includes,[ --with-id3tag-includes=DIR Directory where libid3tag header files are installed (optional)], id3tag_includes="$withval", id3tag_includes="") + +AC_ARG_WITH(mad,[ --with-mad=PFX Prefix where libmad is installed (optional)], mad_prefix="$withval", mad_prefix="") +AC_ARG_WITH(mad-libraries,[ --with-mad-libraries=DIR Directory where libmad library is installed (optional)], mad_libraries="$withval", mad_libraries="") +AC_ARG_WITH(mad-includes,[ --with-mad-includes=DIR Directory where mad header files are installed (optional)], mad_includes="$withval", mad_includes="") + +AC_C_BIGENDIAN + +AC_CHECK_SIZEOF(short) +AC_CHECK_SIZEOF(int) +AC_CHECK_SIZEOF(long) +AC_CHECK_SIZEOF(long long) + +AC_CHECK_LIB(socket,socket,MPD_LIBS="$MPD_LIBS -lsocket",) +AC_CHECK_LIB(nsl,gethostbyname,MPD_LIBS="$MPD_LIBS -lnsl",) + +AC_CHECK_HEADER(langinfo.h,MPD_CFLAGS="$MPD_CFLAGS -DHAVE_LANGINFO",) +AC_CHECK_HEADER(locale.h,MPD_CFLAGS="$MPD_CFLAGS -DHAVE_LOCALE",) + +if test x$enable_iconv = xyes; then + AC_CHECK_HEADER(iconv.h,MPD_CFLAGS="$MPD_CFLAGS -DHAVE_ICONV",enable_iconv=no) + if test x$enable_iconv = xyes; then + AC_CHECK_LIB(iconv,iconv,MPD_LIBS="$MPD_LIBS -liconv",) + fi +fi + +if test x$enable_ipv6 = xyes; then + AC_MSG_CHECKING(for ipv6) + AC_EGREP_CPP([AP_maGiC_VALUE], + [ +#include +#include +#include +#ifdef PF_INET6 +#ifdef AF_INET6 +AP_maGiC_VALUE +#endif +#endif + ], + MPD_CFLAGS="$MPD_CFLAGS -DHAVE_IPV6" + AC_MSG_RESULT([yes]), + AC_MSG_RESULT([no]) +) +fi + +XIPH_PATH_AO(MPD_LIBS="$MPD_LIBS $AO_LIBS" MPD_CFLAGS="$MPD_CFLAGS $AO_CFLAGS",AC_MSG_ERROR(Must have libao installed!!!)) +AC_CHECK_HEADER(sys/soundcard.h,,[MPD_CFLAGS="$MPD_CFLAGS -DNO_OSS_MIXER";AC_MSG_WARN(Soundcard headers not found -- disabling mixer)]) + +AC_MSG_CHECKING(for alsa) +AC_EGREP_CPP([AP_maGiC_VALUE], +[ +#include +#if defined(SND_LIB_MAJOR) && defined(SND_LIB_MINOR) +#if SND_LIB_MAJOR>0 || (SND_LIB_MAJOR==0 && SND_LIB_MINOR>=6) +AP_maGiC_VALUE +#endif +#endif +], +MPD_CFLAGS="$MPD_CFLAGS -DHAVE_ALSA" +MPD_LIBS="$MPD_LIBS -lasound" +AC_MSG_RESULT([yes]), +AC_MSG_RESULT([no]) +) + +ID3_SUBDIR="" + +if test x$enable_id3 = xyes; then + if test x$use_mpd_id3tag = xyes; then + ID3_SUBDIR="libid3tag" + else + if test "x$id3tag_libraries" != "x" ; then + ID3TAG_LIBS="-L$id3tag_libraries" + elif test "x$id3tag_prefix" != "x" ; then + ID3TAG_LIBS="-L$id3tag_prefix/lib" + elif test "x$prefix" != "xNONE"; then + ID3TAG_LIBS="-L$libdir" + fi + + ID3TAG_LIBS="$ID3TAG_LIBS -lid3tag -lz" + + if test "x$id3tag_includes" != "x" ; then + ID3TAG_CFLAGS="-I$id3tag_includes" + elif test "x$id3tag_prefix" != "x" ; then + ID3TAG_CFLAGS="-I$id3tag_prefix/lib" + elif test "x$prefix" != "xNONE"; then + ID3TAG_CFLAGS="-I$libdir" + fi + + ID3TAG_CFLAGS="$ID3TAG_CFLAGS" + + oldcflags=$CFLAGS + CFLAGS="$CFLAGS $ID3TAG_CFLAGS $ID3TAG_LIBS" + AC_CHECK_LIB(id3tag,id3_file_open,[ID3_LIB="$ID3TAG_LIBS"; + MPD_CFLAGS="$MPD_CFLAGS $ID3TAG_CFLAGS"; + use_libid3tag=yes], + [use_libid3tag=no;use_mpd_id3tag=yes]) + CFLAGS=$oldcflags + fi + if test x$use_mpd_id3tag = xyes; then + MPD_CFLAGS="$MPD_CFLAGS -DUSE_MPD_ID3TAG" + ID3_LIB="libid3tag/libid3tag.la" + ID3_SUBDIR="libid3tag" + AC_CONFIG_SUBDIRS(src/libid3tag) + fi + MPD_CFLAGS="$MPD_CFLAGS -DHAVE_ID3TAG" +fi + +MAD_SUBDIR="" + +if test x$enable_mp3 = xyes; then + if test x$use_mpd_mad = xyes; then + MAD_SUBDIR="libmad" + else + if test "x$mad_libraries" != "x" ; then + MAD_LIBS="-L$mad_libraries" + elif test "x$mad_prefix" != "x" ; then + MAD_LIBS="-L$mad_prefix/lib" + elif test "x$prefix" != "xNONE"; then + MAD_LIBS="-L$libdir" + fi + + MAD_LIBS="$MAD_LIBS -lmad" + + if test "x$mad_includes" != "x" ; then + MAD_CFLAGS="-I$mad_includes" + elif test "x$mad_prefix" != "x" ; then + MAD_CFLAGS="-I$mad_prefix/lib" + elif test "x$prefix" != "xNONE"; then + MAD_CFLAGS="-I$libdir" + fi + + AC_CHECK_LIB(mad,mad_stream_init,[MAD_LIB="$MAD_LIBS"; + MPD_CFLAGS="$MPD_CFLAGS $MAD_CFLAGS";use_libmad=yes], + [use_libmad=no;use_mpd_mad=yes]) + fi + if test x$use_mpd_mad = xyes; then + MPD_CFLAGS="$MPD_CFLAGS -DUSE_MPD_MAD" + MAD_LIB="libmad/libmad.la" + MAD_SUBDIR="libmad" + AC_CONFIG_SUBDIRS(src/libmad) + fi + MPD_CFLAGS="$MPD_CFLAGS -DHAVE_MAD" +fi + +if test x$enable_ogg = xyes; then + XIPH_PATH_OGG(MPD_LIBS="$MPD_LIBS $OGG_LIBS" MPD_CFLAGS="$MPD_CFLAGS $OGG_CFLAGS",enable_ogg=no) +fi + +if test x$enable_ogg = xyes; then + enable_vorbistest=no + XIPH_PATH_VORBIS(,enable_ogg=no) + if test x$enable_ogg = xyes; then + +dnl +dnl Vorbis Test +dnl vorbistest in XIPH_PATH_OGG is broken on my debian system +dnl so here i used my own hacked up version till i get vorbis-dev gets +dnl upgraded in debian (hopefully when 1.0.1 comes out) +dnl + + AC_MSG_CHECKING(that Vorbis is usable) + + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $VORBIS_CFLAGS $OGG_CFLAGS" + LIBS="$LIBS $VORBIS_LIBS $VORBISENC_LIBS $OGG_LIBS" + + AC_TRY_RUN([ +#include +#include +#include +#include +#include + +int main () +{ + vorbis_block vb; + vorbis_dsp_state vd; + vorbis_info vi; + + vorbis_info_init (&vi); + vorbis_encode_init (&vi, 2, 44100, -1, 128, -1); + /*vorbis_analysis_init (&vd, &vi); + vorbis_block_init (&vd, &vb);*/ + /* this function was added in 1.0rc3, so this is what we're testing for */ + /*vorbis_bitrate_addblock (&vb);*/ + + return 0; +} + +], AC_MSG_RESULT(yes), AC_MSG_RESULT(no) enable_ogg=no,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi +dnl +dnl End of Vorbis Test +dnl + if test x$enable_ogg = xyes; then + MPD_LIBS="$MPD_LIBS $VORBIS_LIBS $VORBISFILE_LIBS" + MPD_CFLAGS="$MPD_CFLAGS $VORBIS_CFLAGS $VORBISFILE_CFLAGS" + fi +fi + +if test x$enable_ogg = xyes; then + MPD_CFLAGS="$MPD_CFLAGS -DHAVE_OGG" +fi + +if test x$enable_flac = xyes; then + oldmpdcflags="$MPD_CFLAGS" + oldmpdlibs="$MPD_LIBS" + AM_PATH_LIBFLAC(MPD_LIBS="$MPD_LIBS $LIBFLAC_LIBS" MPD_CFLAGS="$MPD_CFLAGS $LIBFLAC_CFLAGS",enable_flac=no) +fi + +if test x$enable_flac = xyes; then + oldcflags="$CFLAGS" + oldlibs="$LIBS" + CFLAGS="$CFLAGS $MPD_CFLAGS" + LIBS="$LIBS $MPD_LIBS" + AC_CHECK_LIB(FLAC, FLAC__metadata_object_vorbiscomment_find_entry_from, + ,[enable_flac=no;AC_MSG_WARN(You need FLAC 1.1 -- disabling flac support)]) + if test x$enable_flac = xno; then + MPD_CFLAGS="$oldmpdcflags" + MPD_LIBS="$oldmpdlibs" + fi + CFLAGS="$oldcflags" + LIBS="$oldlibs" +fi + + +if test x$enable_flac = xyes; then + MPD_CFLAGS="$MPD_CFLAGS -DHAVE_FLAC" +fi + +if test x$enable_audiofile = xyes; then + AM_PATH_AUDIOFILE(0.1.7, MPD_LIBS="$MPD_LIBS -laudiofile" MPD_CFLAGS="$MPD_CFLAGS -DHAVE_AUDIOFILE", + [enable_audiofile=no;AC_MSG_WARN(You need audiofile -- disabling audiofile support)]) +fi + +AC_OUTPUT(doc/Makefile src/Makefile Makefile ) diff --git a/doc/COMMANDS b/doc/COMMANDS new file mode 100644 index 000000000..4bcc9899f --- /dev/null +++ b/doc/COMMANDS @@ -0,0 +1,163 @@ + Music Player Daemon - Commands + +This document is intended for client developers, not end users. + +Format: +------- + +If arguments contain spaces, they should be surrounded by double quotation +marks, ". + +command ... + explanation: w/ arg1 and arg2 + +Command Completion: +------------------- + +A command returns "OK\n" on completion or "ACK some error\n" on failure. +These denote the end of command execution. + +Commands: +--------- + +add + add the file _file_ to the playlist + +clear + clears the current playlist + +clearerror + clear the current error message in status + (this is also accomplished by any command that starts playback) + +close + close the connection with the MPD + +delete + delete _song_ from playlist + +find + finds songs in the db that are exactly _what_ + _type_ should be "album", "artist", or "title" + _what_ is what to find + +kill + kill MPD + +list + list all tags of _type_ + _type_ should be "album" or "artist" + _arg1_ is an optional parameter when type is album, this specifies + to list albums by a artist, where artist is specified with + arg1 + +listall + lists all songs and directories in _directory_ (recursively) + _directory_ is optional + +load + loads the playlist _name_.m3u from the playlist directory + +ls + list files in _directory_. _directory_ is optional. + NOTE: us this only for debugging, not meant to be used by a client. + instead use 'lsinfo' + +lsinfo + list contents of _directory_, from the db. _directory_ is optional + +move + move song at _from_ to _to_ in the playlist + +next + plays next song in playlist + +pause + pause/resume playing + +play + begin playing playlist at song number _song_, _song_ is optional + +playlist + displays the current playlist + NOTE: do not use this, instead use 'playlistinfo' + +playlistinfo + displays information about the current playlist + +previous + plays previous song in playlist + +random + set random state to _state_, _state_ should be 0 or 1 + +repeat + set repeat state to _state_, _state_ should be 0 or 1 + +rm + removes the playlist .m3u from the playlist directory + +save + saves the current playlist to _name_.m3u in the playlist directory + +search + same as "find" but searches for any song that contain _what_ + search is not case sensitive + +seek + seeks to the position _time_ (in seconds) of entry _song_ in the + playlist + +shuffle + shuffles the current playlist + +stats + display stats + artists: number of artists + albums: number of albums + songs: number of songs + uptime: daemon uptime in seconds + db_update: last db update in UNIX time + playtime: time length of music played + songs_played: total number of songs played + +status + reports current status of player, and volume level. + volume: (0-100). + repeat: (0 or 1) + playlist: (31-bit unsigned integer, the playlist version number) + playlistlength: (integer, the length of the playlist) + state: ("play", "stop", or "pause") + song: (current song playing/paused, playlist song number) + time: :