splay-0.9.5.2/0000777000175000017500000000000007275344603006574 5splay-0.9.5.2/Makefile.in0000644000175000017500000002306407275344602010561 # Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : AWK = @AWK@ CC = @CC@ CXX = @CXX@ LN_S = @LN_S@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ VERSION = @VERSION@ XSPLAY = @XSPLAY@ SUBDIRS = libs apps EXTRA_DIST = README.LIB TODO ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = DIST_COMMON = README AUTHORS COPYING COPYING.LIB ChangeLog INSTALL \ Makefile.am Makefile.in NEWS TODO aclocal.m4 configure configure.in \ install-sh missing mkinstalldirs DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP_ENV = --best all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status $(ACLOCAL_M4): configure.in cd $(srcdir) && $(ACLOCAL) config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. @SET_MAKE@ all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive \ check-recursive installcheck-recursive info-recursive dvi-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ rev="$$subdir $$rev"; \ test "$$subdir" = "." && dot_seen=yes; \ done; \ test "$$dot_seen" = "no" && rev=". $$rev"; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist -rm -rf $(distdir) GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz mkdir $(distdir)/=build mkdir $(distdir)/=inst dc_install_base=`cd $(distdir)/=inst && pwd`; \ cd $(distdir)/=build \ && ../configure --srcdir=.. --prefix=$$dc_install_base \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) dist -rm -rf $(distdir) @banner="$(distdir).tar.gz is ready for distribution"; \ dashes=`echo "$$banner" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ echo "$$dashes" dist: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) dist-all: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) distdir: $(DISTFILES) -rm -rf $(distdir) mkdir $(distdir) -chmod 777 $(distdir) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done for subdir in $(SUBDIRS); do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ chmod 777 $(distdir)/$$subdir; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ || exit 1; \ fi; \ done info-am: info: info-recursive dvi-am: dvi: dvi-recursive check-am: all-am check: check-recursive installcheck-am: installcheck: installcheck-recursive install-exec-am: install-exec: install-exec-recursive install-data-am: install-data: install-data-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-recursive uninstall-am: uninstall: uninstall-recursive all-am: Makefile all-redirect: all-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: installdirs-recursive installdirs-am: mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-tags mostlyclean-generic mostlyclean: mostlyclean-recursive clean-am: clean-tags clean-generic mostlyclean-am clean: clean-recursive distclean-am: distclean-tags distclean-generic clean-am distclean: distclean-recursive -rm -f config.status maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \ distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-recursive -rm -f config.status .PHONY: install-data-recursive uninstall-data-recursive \ install-exec-recursive uninstall-exec-recursive installdirs-recursive \ uninstalldirs-recursive all-recursive check-recursive \ installcheck-recursive info-recursive dvi-recursive \ mostlyclean-recursive distclean-recursive clean-recursive \ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ install-exec install-data-am install-data install-am install \ uninstall-am uninstall all-redirect all-am all installdirs-am \ installdirs mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: splay-0.9.5.2/README0000644000175000017500000000123407242756407007373 This program have NO WARRANTY. You can use this program under GPL. You can use these libraries under Library GPL. This is a library to play mpeg files, and a program using the library. The program splay can play normal files and http:// URI:s. Current version have * Support MPEG-1 layer 1,2 and 3 * Support MPEG-2 layer 3 (I don't know how to work in other layers) * Support 'force to mono' * Support half frequency in MPEG-Audio * Support list file * Support http:// in filename and list file * Support buffer (Thread) * Support selecting frame (X-interface) * Support description of MPEG-Audio To install, See INSTALL Bug report Mikael.Hedin@irf.se splay-0.9.5.2/AUTHORS0000644000175000017500000000023507235656077007567 Written by: jwj95@eve.kaist.ac.kr jwj95@nownuri.net Woo-jae Jung Now maintained by Mikael.Hedin@irf.se but I don't know much about MPEG encoding though... splay-0.9.5.2/COPYING0000644000175000017500000004307607235656077007564 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. splay-0.9.5.2/COPYING.LIB0000644000175000017500000006126107235656077010165 GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, 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 library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete 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 distribute a copy of this License along with the Library. 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 Library or any portion of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, 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 Library, 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 Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you 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. If distribution of 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 satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. 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. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library 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. 9. 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 Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library 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. 11. 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 Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library 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 Library. 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. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library 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. 13. The Free Software Foundation may publish revised and/or new versions of the Library 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 Library 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 Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, 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 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. 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 LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. 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 library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! splay-0.9.5.2/ChangeLog0000644000175000017500000000416707275344575010302 2001-05-06 Mikael Hedin * Release 0.9.5.2 (thanks Kenan Esau ) * libs/mpegsound.h: Added #include 2001-03-19 Mikael Hedin * Release 0.9.5.1 (thanks for the report, XX) * apps/splay.cc: Forgot to #include 2001-03-17 Mikael Hedin * Release 0.9.5. * apps/splay.cc: Added option "-k num" to skip frames at the beginning. * libs/fileplayer.cc: Added option to start att specified frame. 2001-03-03 Mikael Hedin * apps/splay.cc: Added a char** with genre names to print instead of the numbers. * I think this will become version 1.0. And then I'm done with this program:) 2001-02-20 Mikael Hedin * Release 0.9.3. * Fixed make files to build xsplay if qt is available. * libs/fileplayer.cc (playing): Fixed frameinfo to display correct time independent on encoding frequency etc. 2001-02-15 Mikael Hedin * Removed wav support. * Release 0.9.2. * libs/mpegtoraw.cc: Added patch from Rob McMullen to skip ID3 headers. Otherwise some ID3 headers with syncs in them confused splay. Don't know it this is a bug in splay or the ID3 tag of the specific files, but this fixes the problem. * Fixed two items on the TODO list: * Display frame info with -f * Try to open /dev/sound/dsp if /dev/dsp fails (for devfs) 2001-01-30 Mikael Hedin * Bumped version to 0.9.1 * New automake system that I understand. Goes with a reorder of the directory structure. * Added TODO file 2000-12-21 Mikael Hedin * src/splay/splay.cc: Added function to skip to next song by Control-c (ie SIGINT) vhen playing several songs. * Removed internal Id3 handling, and added use of libid3. * Changed -vv to show id3-info,and -vvv the technical info. * New maintaioner as above. ===Older entries below Sat Aug 2 * Optimize MPEG-2 in mpeglayer3.cc * Restructured split splay and xsplay src/functions -> src/common removing some functions (e.g. Setthreadstore() ...) splay-0.9.5.2/INSTALL0000644000175000017500000001722707235656077007561 Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. splay-0.9.5.2/Makefile.am0000644000175000017500000000006107235656077010550 SUBDIRS = libs apps EXTRA_DIST = README.LIB TODOsplay-0.9.5.2/NEWS0000644000175000017500000000044207254731604007205 * -k starts at frame num ++++++ * xsplay builds if qt is available +++++ * splay -f displays information on frame and time (played and remaining). * SIGINT (eg. Control-c) skips to next song. Two SIGINTs quits. * Handles id3 tags version 1 and 2 with id3lib. * New maintainer splay-0.9.5.2/TODO0000644000175000017500000000000007250047775007171 splay-0.9.5.2/aclocal.m40000644000175000017500000000672307275344236010362 dnl aclocal.m4 generated automatically by aclocal 1.4 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A dnl PARTICULAR PURPOSE. # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. # But this isn't really a big deal. # serial 1 dnl Usage: dnl AM_INIT_AUTOMAKE(package,version, [no-define]) AC_DEFUN(AM_INIT_AUTOMAKE, [AC_REQUIRE([AC_PROG_INSTALL]) PACKAGE=[$1] AC_SUBST(PACKAGE) VERSION=[$2] AC_SUBST(VERSION) dnl test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi ifelse([$3],, AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) AC_REQUIRE([AM_SANITY_CHECK]) AC_REQUIRE([AC_ARG_PROGRAM]) dnl FIXME This is truly gross. missing_dir=`cd $ac_aux_dir && pwd` AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) AC_REQUIRE([AC_PROG_MAKE_SET])]) # # Check to make sure that the build environment is sane. # AC_DEFUN(AM_SANITY_CHECK, [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftestfile # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` if test "[$]*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi if test "[$]*" != "X $srcdir/configure conftestfile" \ && test "[$]*" != "X conftestfile $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "[$]2" = conftestfile ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi rm -f conftest* AC_MSG_RESULT(yes)]) dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) dnl The program must properly implement --version. AC_DEFUN(AM_MISSING_PROG, [AC_MSG_CHECKING(for working $2) # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if ($2 --version) < /dev/null > /dev/null 2>&1; then $1=$2 AC_MSG_RESULT(found) else $1="$3/missing $2" AC_MSG_RESULT(missing) fi AC_SUBST($1)]) splay-0.9.5.2/configure0000755000175000017500000021513707275344237010433 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Defaults: ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: # Initialize some variables set by options. # The variables have the same names as the options, with # dashes changed to underlines. build=NONE cache_file=./config.cache exec_prefix=NONE host=NONE no_create= nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= target=NONE verbose= x_includes=NONE x_libraries=NONE bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. ac_max_here_lines=12 ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi case "$ac_option" in -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) ac_optarg= ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case "$ac_option" in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir="$ac_optarg" ;; -build | --build | --buil | --bui | --bu) ac_prev=build ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build="$ac_optarg" ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file="$ac_optarg" ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir="$ac_optarg" ;; -disable-* | --disable-*) ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` eval "enable_${ac_feature}=no" ;; -enable-* | --enable-*) ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "enable_${ac_feature}='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix="$ac_optarg" ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he) # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat << EOF Usage: configure [options] [host] Options: [defaults in brackets after descriptions] Configuration: --cache-file=FILE cache test results in FILE --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [same as prefix] --bindir=DIR user executables in DIR [EPREFIX/bin] --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] --libexecdir=DIR program executables in DIR [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data in DIR [PREFIX/share] --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data in DIR [PREFIX/com] --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] --libdir=DIR object code libraries in DIR [EPREFIX/lib] --includedir=DIR C header files in DIR [PREFIX/include] --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] --infodir=DIR info documentation in DIR [PREFIX/info] --mandir=DIR man documentation in DIR [PREFIX/man] --srcdir=DIR find the sources in DIR [configure dir or ..] --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names EOF cat << EOF Host type: --build=BUILD configure for building on BUILD [BUILD=HOST] --host=HOST configure for HOST [guessed] --target=TARGET configure for TARGET [TARGET=HOST] Features and packages: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR EOF if test -n "$ac_help"; then echo "--enable and --with options recognized:$ac_help" fi exit 0 ;; -host | --host | --hos | --ho) ac_prev=host ;; -host=* | --host=* | --hos=* | --ho=*) host="$ac_optarg" ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir="$ac_optarg" ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir="$ac_optarg" ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir="$ac_optarg" ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir="$ac_optarg" ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir="$ac_optarg" ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir="$ac_optarg" ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir="$ac_optarg" ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix="$ac_optarg" ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix="$ac_optarg" ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix="$ac_optarg" ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name="$ac_optarg" ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir="$ac_optarg" ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir="$ac_optarg" ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site="$ac_optarg" ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir="$ac_optarg" ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir="$ac_optarg" ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target="$ac_optarg" ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers) echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "with_${ac_package}='$ac_optarg'" ;; -without-* | --without-*) ac_package=`echo $ac_option|sed -e 's/-*without-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` eval "with_${ac_package}=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes="$ac_optarg" ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries="$ac_optarg" ;; -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } ;; *) if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then echo "configure: warning: $ac_option: invalid host type" 1>&2 fi if test "x$nonopt" != xNONE; then { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } fi nonopt="$ac_option" ;; esac done if test -n "$ac_prev"; then { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } fi trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 6 checking for... messages and results # 5 compiler messages saved in config.log if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>./config.log echo "\ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. " 1>&5 # Strip out --no-create and --no-recursion so they do not pile up. # Also quote any args containing shell metacharacters. ac_configure_args= for ac_arg do case "$ac_arg" in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_arg" ;; esac done # NLS nuisances. # Only set these to C if already set. These must not be set unconditionally # because not all systems understand e.g. LANG=C (notably SCO). # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! # Non-C LC_CTYPE values break the ctype check. if test "${LANG+set}" = set; then LANG=C; export LANG; fi if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo > confdefs.h # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. ac_unique_file=apps/splay.cc # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } else { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } fi fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then echo "loading site script $ac_site_file" . "$ac_site_file" fi done if test -r "$cache_file"; then echo "loading cache $cache_file" . $cache_file else echo "creating cache $cache_file" > $cache_file fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross ac_exeext= ac_objext=o if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break fi done if test -z "$ac_aux_dir"; then { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 echo "configure:556: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done IFS="$ac_save_IFS" fi if test "${ac_cv_path_install+set}" = set; then INSTALL="$ac_cv_path_install" else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL="$ac_install_sh" fi fi echo "$ac_t""$INSTALL" 1>&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 echo "configure:609: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi if test "$*" != "X $srcdir/configure conftestfile" \ && test "$*" != "X conftestfile $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { echo "configure: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" 1>&2; exit 1; } fi test "$2" = conftestfile ) then # Ok. : else { echo "configure: error: newly created file is older than distributed files! Check your system clock" 1>&2; exit 1; } fi rm -f conftest* echo "$ac_t""yes" 1>&6 if test "$program_transform_name" = s,x,x,; then program_transform_name= else # Double any \ or $. echo might interpret backslashes. cat <<\EOF_SED > conftestsed s,\\,\\\\,g; s,\$,$$,g EOF_SED program_transform_name="`echo $program_transform_name|sed -f conftestsed`" rm -f conftestsed fi test "$program_prefix" != NONE && program_transform_name="s,^,${program_prefix},; $program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" # sed with no file args requires a program. test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 echo "configure:666: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftestmake <<\EOF all: @echo 'ac_maketemp="${MAKE}"' EOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftestmake fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$ac_t""yes" 1>&6 SET_MAKE= else echo "$ac_t""no" 1>&6 SET_MAKE="MAKE=${MAKE-make}" fi PACKAGE=splay VERSION=0.9.5.2 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } fi cat >> confdefs.h <> confdefs.h <&6 echo "configure:712: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (aclocal --version) < /dev/null > /dev/null 2>&1; then ACLOCAL=aclocal echo "$ac_t""found" 1>&6 else ACLOCAL="$missing_dir/missing aclocal" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 echo "configure:725: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (autoconf --version) < /dev/null > /dev/null 2>&1; then AUTOCONF=autoconf echo "$ac_t""found" 1>&6 else AUTOCONF="$missing_dir/missing autoconf" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 echo "configure:738: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (automake --version) < /dev/null > /dev/null 2>&1; then AUTOMAKE=automake echo "$ac_t""found" 1>&6 else AUTOMAKE="$missing_dir/missing automake" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 echo "configure:751: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (autoheader --version) < /dev/null > /dev/null 2>&1; then AUTOHEADER=autoheader echo "$ac_t""found" 1>&6 else AUTOHEADER="$missing_dir/missing autoheader" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 echo "configure:764: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (makeinfo --version) < /dev/null > /dev/null 2>&1; then MAKEINFO=makeinfo echo "$ac_t""found" 1>&6 else MAKEINFO="$missing_dir/missing makeinfo" echo "$ac_t""missing" 1>&6 fi for ac_prog in mawk gawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:784: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_AWK="$ac_prog" break fi done IFS="$ac_save_ifs" fi fi AWK="$ac_cv_prog_AWK" if test -n "$AWK"; then echo "$ac_t""$AWK" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$AWK" && break done # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:816: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:846: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" break fi done IFS="$ac_save_ifs" if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# -gt 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift set dummy "$ac_dir/$ac_word" "$@" shift ac_cv_prog_CC="$@" fi fi fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then case "`uname -s`" in *win32* | *WIN32*) # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:897: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="cl" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi ;; esac fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 echo "configure:929: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF #line 940 "configure" #include "confdefs.h" main(){return(0);} EOF if { (eval echo configure:945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_cc_cross=no else ac_cv_prog_cc_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_works=no fi rm -fr conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 echo "configure:971: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 echo "configure:976: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no fi fi echo "$ac_t""$ac_cv_prog_gcc" 1>&6 if test $ac_cv_prog_gcc = yes; then GCC=yes else GCC= fi ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 echo "configure:1004: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then ac_cv_prog_cc_g=yes else ac_cv_prog_cc_g=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 if test "$ac_test_CFLAGS" = set; then CFLAGS="$ac_save_CFLAGS" elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1040: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CXX="$ac_prog" break fi done IFS="$ac_save_ifs" fi fi CXX="$ac_cv_prog_CXX" if test -n "$CXX"; then echo "$ac_t""$CXX" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$CXX" && break done test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 echo "configure:1072: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext << EOF #line 1083 "configure" #include "confdefs.h" int main(){return(0);} EOF if { (eval echo configure:1088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_cxx_cross=no else ac_cv_prog_cxx_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cxx_works=no fi rm -fr conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6 if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 echo "configure:1114: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 echo "configure:1119: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.C <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no fi fi echo "$ac_t""$ac_cv_prog_gxx" 1>&6 if test $ac_cv_prog_gxx = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS="${CXXFLAGS+set}" ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 echo "configure:1147: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.cc if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then ac_cv_prog_cxx_g=yes else ac_cv_prog_cxx_g=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS="$ac_save_CXXFLAGS" elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 echo "configure:1190: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done IFS="$ac_save_IFS" fi if test "${ac_cv_path_install+set}" = set; then INSTALL="$ac_cv_path_install" else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL="$ac_install_sh" fi fi echo "$ac_t""$INSTALL" 1>&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 echo "configure:1243: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftestdata if ln -s X conftestdata 2>/dev/null then rm -f conftestdata ac_cv_prog_LN_S="ln -s" else ac_cv_prog_LN_S=ln fi fi LN_S="$ac_cv_prog_LN_S" if test "$ac_cv_prog_LN_S" = "ln -s"; then echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1266: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_RANLIB="ranlib" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" fi fi RANLIB="$ac_cv_prog_RANLIB" if test -n "$RANLIB"; then echo "$ac_t""$RANLIB" 1>&6 else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking for ID3Tag_New in -lid3""... $ac_c" 1>&6 echo "configure:1295: checking for ID3Tag_New in -lid3" >&5 ac_lib_var=`echo id3'_'ID3Tag_New | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lid3 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo id3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 fi echo $ac_n "checking for cos in -lm""... $ac_c" 1>&6 echo "configure:1342: checking for cos in -lm" >&5 ac_lib_var=`echo m'_'cos | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 fi echo $ac_n "checking for main in -lpthread""... $ac_c" 1>&6 echo "configure:1389: checking for main in -lpthread" >&5 ac_lib_var=`echo pthread'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 INCLUDEPTHREAD=1 else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking for main in -lqt""... $ac_c" 1>&6 echo "configure:1425: checking for main in -lqt" >&5 ac_lib_var=`echo qt'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lqt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 XSPLAY=xsplay else echo "$ac_t""no" 1>&6 fi if test "$INCLUDEPTHREAD" = 1; then LIBS="$LIBS -lpthread" cat >> confdefs.h <<\EOF #define PTHREADEDMPEG 1 EOF cat >> confdefs.h <<\EOF #define _REENTRANT 1 EOF echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 echo "configure:1472: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # This must be in double quotes, not single quotes, because CPP may get # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1493: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1510: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1527: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP=/lib/cpp fi rm -f conftest* fi rm -f conftest* fi rm -f conftest* ac_cv_prog_CPP="$CPP" fi CPP="$ac_cv_prog_CPP" else ac_cv_prog_CPP="$CPP" fi echo "$ac_t""$CPP" 1>&6 for ac_hdr in pthread.h pthread/mit/pthread.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:1555: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1565: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 echo "configure:1594: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1607: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* ac_cv_header_stdc=yes else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "memchr" >/dev/null 2>&1; then : else rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "free" >/dev/null 2>&1; then : else rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF if { (eval echo configure:1674: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_header_stdc=no fi rm -fr conftest* fi fi fi echo "$ac_t""$ac_cv_header_stdc" 1>&6 if test $ac_cv_header_stdc = yes; then cat >> confdefs.h <<\EOF #define STDC_HEADERS 1 EOF fi echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 echo "configure:1698: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #ifndef WEXITSTATUS #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED #define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main() { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF if { (eval echo configure:1719: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_sys_wait_h=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6 if test $ac_cv_header_sys_wait_h = yes; then cat >> confdefs.h <<\EOF #define HAVE_SYS_WAIT_H 1 EOF fi for ac_hdr in fcntl.h malloc.h sys/ioctl.h unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:1743: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1753: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done echo $ac_n "checking for working const""... $ac_c" 1>&6 echo "configure:1781: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } ; return 0; } EOF if { (eval echo configure:1835: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_c_const=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_c_const" 1>&6 if test $ac_cv_c_const = no; then cat >> confdefs.h <<\EOF #define const EOF fi echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 echo "configure:1856: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include int main() { #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif ; return 0; } EOF if { (eval echo configure:1874: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include int main() { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } EOF if { (eval echo configure:1889: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_c_bigendian=no fi rm -f conftest* else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* if test $ac_cv_c_bigendian = unknown; then if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_c_bigendian=yes fi rm -fr conftest* fi fi fi echo "$ac_t""$ac_cv_c_bigendian" 1>&6 if test $ac_cv_c_bigendian = yes; then cat >> confdefs.h <<\EOF #define WORDS_BIGENDIAN 1 EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 echo "configure:1946: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS #include #include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_pid_t=yes else rm -rf conftest* ac_cv_type_pid_t=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_type_pid_t" 1>&6 if test $ac_cv_type_pid_t = no; then cat >> confdefs.h <<\EOF #define pid_t int EOF fi if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 echo "configure:1981: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "$ac_pattern" >/dev/null 2>&1; then rm -rf conftest* ac_cv_prog_gcc_traditional=yes else rm -rf conftest* ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "$ac_pattern" >/dev/null 2>&1; then rm -rf conftest* ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6 if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 echo "configure:2027: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #ifdef signal #undef signal #endif #ifdef __cplusplus extern "C" void (*signal (int, void (*)(int)))(int); #else void (*signal ()) (); #endif int main() { int i; ; return 0; } EOF if { (eval echo configure:2049: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_type_signal=int fi rm -f conftest* fi echo "$ac_t""$ac_cv_type_signal" 1>&6 cat >> confdefs.h <&6 echo "configure:2070: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:2098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Any assignment to VPATH causes Sun make to only execute # the first set of double-colon rules, so remove it if not needed. # If there is a colon in the path, we need to keep it. if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' fi trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. cat > conftest.defs <<\EOF s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g s%\[%\\&%g s%\]%\\&%g s%\$%$$%g EOF DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` rm -f conftest.defs # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} echo creating $CONFIG_STATUS rm -f $CONFIG_STATUS cat > $CONFIG_STATUS </dev/null | sed 1q`: # # $0 $ac_configure_args # # Compiler output produced by configure, useful for debugging # configure, is in ./config.log if it exists. ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" for ac_option do case "\$ac_option" in -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; *) echo "\$ac_cs_usage"; exit 1 ;; esac done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "apps/Makefile Makefile libs/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF $ac_vpsub $extrasub s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g s%@exec_prefix@%$exec_prefix%g s%@prefix@%$prefix%g s%@program_transform_name@%$program_transform_name%g s%@bindir@%$bindir%g s%@sbindir@%$sbindir%g s%@libexecdir@%$libexecdir%g s%@datadir@%$datadir%g s%@sysconfdir@%$sysconfdir%g s%@sharedstatedir@%$sharedstatedir%g s%@localstatedir@%$localstatedir%g s%@libdir@%$libdir%g s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@PACKAGE@%$PACKAGE%g s%@VERSION@%$VERSION%g s%@ACLOCAL@%$ACLOCAL%g s%@AUTOCONF@%$AUTOCONF%g s%@AUTOMAKE@%$AUTOMAKE%g s%@AUTOHEADER@%$AUTOHEADER%g s%@MAKEINFO@%$MAKEINFO%g s%@SET_MAKE@%$SET_MAKE%g s%@XSPLAY@%$XSPLAY%g s%@AWK@%$AWK%g s%@CC@%$CC%g s%@CXX@%$CXX%g s%@LN_S@%$LN_S%g s%@RANLIB@%$RANLIB%g s%@CPP@%$CPP%g CEOF EOF cat >> $CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. ac_more_lines=: ac_sed_cmds="" while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file else sed "${ac_end}q" conftest.subs > conftest.s$ac_file fi if test ! -s conftest.s$ac_file; then ac_more_lines=false rm -f conftest.s$ac_file else if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f conftest.s$ac_file" else ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" fi ac_file=`expr $ac_file + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_cmds` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` else ac_dir_suffix= ac_dots= fi case "$ac_given_srcdir" in .) srcdir=. if test -z "$ac_dots"; then top_srcdir=. else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; *) # Relative path. srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" top_srcdir="$ac_dots$ac_given_srcdir" ;; esac case "$ac_given_INSTALL" in [/$]*) INSTALL="$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." case "$ac_file" in *Makefile*) ac_comsub="1i\\ # $configure_input" ;; *) ac_comsub= ;; esac ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g s%@INSTALL@%$INSTALL%g " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done rm -f conftest.s* EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF exit 0 EOF chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 splay-0.9.5.2/configure.in0000644000175000017500000000167207275343552011031 dnl Process this file with autoconf to produce a configure script. AC_INIT(apps/splay.cc) AM_INIT_AUTOMAKE(splay, 0.9.5.2) AC_SUBST(XSPLAY) dnl Checks for programs. AC_PROG_AWK AC_PROG_CC AC_PROG_CXX AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_RANLIB dnl Checks for libraries. AC_CHECK_LIB(id3, ID3Tag_New) AC_CHECK_LIB(m, cos) AC_CHECK_LIB(pthread,main,INCLUDEPTHREAD=1) AC_CHECK_LIB(qt, main,XSPLAY=xsplay) if test "$INCLUDEPTHREAD" = 1; then LIBS="$LIBS -lpthread" AC_DEFINE(PTHREADEDMPEG) AC_DEFINE(_REENTRANT) AC_CHECK_HEADERS(pthread.h pthread/mit/pthread.h) fi dnl Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h malloc.h sys/ioctl.h unistd.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_BIGENDIAN AC_TYPE_PID_T dnl Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_TYPE_SIGNAL AC_CHECK_FUNCS(socket strdup strstr) AC_OUTPUT(apps/Makefile Makefile libs/Makefile) splay-0.9.5.2/install-sh0000755000175000017500000001273607235656077010534 #!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 splay-0.9.5.2/missing0000755000175000017500000001421307235656077010117 #! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997 Free Software Foundation, Inc. # Franc,ois Pinard , 1996. # 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, 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. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing - GNU libit 0.0" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequirements for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 splay-0.9.5.2/mkinstalldirs0000755000175000017500000000132707235656077011330 #! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id: mkinstalldirs,v 1.1.1.1 2001/01/31 00:28:47 micce Exp $ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here splay-0.9.5.2/README.LIB0000644000175000017500000000233507242756407010003 mpegsound README.LIB(International) MPEG player library This library have NO WARRANTY. You can use this under Library GPL. This library uses part from vplay, maplay 1.2 for linux, maplay 1.2+ for Win95. This is a library which can make programs play MPEG-1/2 audio files easily. CAUTION The current implementation was tested with little endian architecture. Bigendian is implemented, but not tested. Hackers... please help me! What's the difference? For example; unsigned char a[4]={0x11,0x22,0x33,0x44}; unsigned int *b=(unsigned int *)&a; Little endian (Intel) : 0x44332211 Big endian : 0x11223344 The classes 'mpegtoraw' and 'bitwindow' are endian dependent. OTHER ENDIAN PROBLEM Some machines can access integer type variables when they are aligned at 4-bytes. If endian problem is solved. It cause serious problem. I have exploited the linear properties of 2 and 3 dimensional arrays. like for example; int a[4][4]; a[1][0]==a[0][4] is true. Of course, It may occur boundary problem. But it may make player faster! PROBLEM? Please send me bug report or patches.(Please comment where is changed) to: Mikael.Hedin@irf.se THANKS FOR this document. Tommy Thorn splay-0.9.5.2/libs/0000777000175000017500000000000007275344603007525 5splay-0.9.5.2/libs/Makefile.in0000644000175000017500000001723407275344603011515 # Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : AWK = @AWK@ CC = @CC@ CXX = @CXX@ LN_S = @LN_S@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ VERSION = @VERSION@ XSPLAY = @XSPLAY@ noinst_LIBRARIES = libmpeg.a libmpeg_a_SOURCES = soundinputstream.cc fileinput.cc httpinput.cc soundplayer.cc rawplayer.cc rawtofile.cc mpegtable.cc filter.cc filter_2.cc mpegtoraw.cc mpeglayer1.cc mpeglayer2.cc mpeglayer3.cc bitwindow.cc huffmantable.cc fileplayer.cc mpegsound.h mpegsound_locals.h mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) DEFS = @DEFS@ -I. -I$(srcdir) CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ libmpeg_a_LIBADD = libmpeg_a_OBJECTS = soundinputstream.o fileinput.o httpinput.o \ soundplayer.o rawplayer.o rawtofile.o mpegtable.o filter.o filter_2.o \ mpegtoraw.o mpeglayer1.o mpeglayer2.o mpeglayer3.o bitwindow.o \ huffmantable.o fileplayer.o AR = ar CXXFLAGS = @CXXFLAGS@ CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP_ENV = --best SOURCES = $(libmpeg_a_SOURCES) OBJECTS = $(libmpeg_a_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .cc .o .s $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps libs/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-noinstLIBRARIES: clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) distclean-noinstLIBRARIES: maintainer-clean-noinstLIBRARIES: .c.o: $(COMPILE) -c $< .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core clean-compile: distclean-compile: -rm -f *.tab.c maintainer-clean-compile: libmpeg.a: $(libmpeg_a_OBJECTS) $(libmpeg_a_DEPENDENCIES) -rm -f libmpeg.a $(AR) cru libmpeg.a $(libmpeg_a_OBJECTS) $(libmpeg_a_LIBADD) $(RANLIB) libmpeg.a .cc.o: $(CXXCOMPILE) -c $< tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = libs distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done bitwindow.o: bitwindow.cc mpegsound.h fileinput.o: fileinput.cc mpegsound.h fileplayer.o: fileplayer.cc mpegsound.h filter.o: filter.cc mpegsound.h filter_2.o: filter_2.cc mpegsound.h httpinput.o: httpinput.cc mpegsound.h huffmantable.o: huffmantable.cc mpegsound.h mpeglayer1.o: mpeglayer1.cc mpegsound.h mpeglayer2.o: mpeglayer2.cc mpegsound.h mpeglayer3.o: mpeglayer3.cc mpegsound.h mpegsound_locals.h mpegtable.o: mpegtable.cc mpegsound.h mpegtoraw.o: mpegtoraw.cc mpegsound.h mpegsound_locals.h rawplayer.o: rawplayer.cc mpegsound.h rawtofile.o: rawtofile.cc mpegsound.h soundinputstream.o: soundinputstream.cc mpegsound.h soundplayer.o: soundplayer.cc mpegsound.h info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-exec: install-exec-am install-data-am: install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall: uninstall-am all-am: Makefile $(LIBRARIES) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ mostlyclean-tags mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ mostlyclean-am clean: clean-am distclean-am: distclean-noinstLIBRARIES distclean-compile \ distclean-tags distclean-generic clean-am distclean: distclean-am maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ maintainer-clean-compile maintainer-clean-tags \ maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile tags mostlyclean-tags distclean-tags \ clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ check-am installcheck-am installcheck install-exec-am install-exec \ install-data-am install-data install-am install uninstall-am uninstall \ all-redirect all-am all installdirs mostlyclean-generic \ distclean-generic clean-generic maintainer-clean-generic clean \ mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: splay-0.9.5.2/libs/Makefile.am0000644000175000017500000000047407242756413011502 noinst_LIBRARIES = libmpeg.a libmpeg_a_SOURCES = soundinputstream.cc fileinput.cc httpinput.cc \ soundplayer.cc rawplayer.cc rawtofile.cc \ mpegtable.cc filter.cc filter_2.cc \ mpegtoraw.cc mpeglayer1.cc mpeglayer2.cc \ mpeglayer3.cc bitwindow.cc huffmantable.cc \ fileplayer.cc mpegsound.h mpegsound_locals.h splay-0.9.5.2/libs/soundinputstream.cc0000644000175000017500000000154707242756414013404 /* MPEG Sound library (C) 1997 by Woo-jae Jung */ // Soundinputstream.cc // Abstractclass of inputstreams #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "mpegsound.h" Soundinputstream::Soundinputstream() { __errorcode=SOUND_ERROR_OK; }; Soundinputstream::~Soundinputstream() { // Nothing... }; /********************/ /* File & Http open */ /********************/ Soundinputstream *Soundinputstream::hopen(char *filename,int *errorcode) { Soundinputstream *st; if(filename==NULL)st=new Soundinputstreamfromfile; else if(strstr(filename,"://"))st=new Soundinputstreamfromhttp; else st=new Soundinputstreamfromfile; if(st==NULL) { *errorcode=SOUND_ERROR_MEMORYNOTENOUGH; return NULL; } if(!st->open(filename)) { *errorcode=st->geterrorcode(); delete st; return NULL; } return st; } splay-0.9.5.2/libs/fileinput.cc0000644000175000017500000000266307242756414011757 /* MPEG Sound library (C) 1997 by Woo-jae Jung */ // Binput.cc // Inputstream from file #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "mpegsound.h" /************************/ /* Input bitstrem class */ /************************/ Soundinputstreamfromfile::~Soundinputstreamfromfile() { if(fp)fclose(fp); } bool Soundinputstreamfromfile::open(char *filename) { struct stat buf; if(filename==NULL) { fp=stdin; size=0; return true; } else if((fp=fopen(filename,"r"))==NULL) { seterrorcode(SOUND_ERROR_FILEOPENFAIL); return false; } stat(filename,&buf); size=buf.st_size; return true; } int Soundinputstreamfromfile::getbytedirect(void) { int c; if((c=getc(fp))<0) seterrorcode(SOUND_ERROR_FILEREADFAIL); return c; } bool Soundinputstreamfromfile::_readbuffer(char *buffer,int size) { if(fread(buffer,size,1,fp)!=1) { seterrorcode(SOUND_ERROR_FILEREADFAIL); return false; } return true; } bool Soundinputstreamfromfile::eof(void) { return feof(fp); }; int Soundinputstreamfromfile::getblock(char *buffer,int size) { return fread(buffer,1,size,fp); } int Soundinputstreamfromfile::getsize(void) { return size; } void Soundinputstreamfromfile::setposition(int pos) { if(fp==stdin)return; fseek(fp,pos,SEEK_SET); } int Soundinputstreamfromfile::getposition(void) { if(fp==stdin)return 0; return ftell(fp); } splay-0.9.5.2/libs/httpinput.cc0000644000175000017500000001361407242756414012015 /* MPEG Sound library (C) 1997 by Woo-jae Jung */ // Httpinputstream.cc // Inputstream for http // It's from mpg123 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "mpegsound.h" #include #include #include #include #include #include #include #include #include #ifndef INADDR_NONE #define INADDR_NONE 0xffffffff #endif static const char *httpstr="http://"; bool Soundinputstreamfromhttp::writestring(int fd, char *string) { int result,bytes=strlen(string); while(bytes) { if((result=write(fd,string,bytes))<0 && errno!=EINTR) { seterrorcode(SOUND_ERROR_HTTPWRITEFAIL); return false; } else if(result==0) { seterrorcode(SOUND_ERROR_HTTPWRITEFAIL); return false; } string += result; bytes -= result; } return true; } bool Soundinputstreamfromhttp::readstring(char *string,int maxlen,FILE *f) { char *result; do{ result=fgets(string,maxlen,f); }while(!result && errno==EINTR); if(!result) { seterrorcode(SOUND_ERROR_FILEREADFAIL); return false; } return true; } static char *strndup(char *src,int num) { char *dst; if(!(dst=(char *)malloc(num+1)))return NULL; dst[num]='\0'; return strncpy(dst, src, num); } static char *url2hostport(char *url,char **hname, unsigned long *hip,unsigned int *port) { char *cptr; struct hostent *myhostent; struct in_addr myaddr; int isip=1; if(!(strncmp(url,httpstr,7)))url+=7; cptr=url; while(*cptr && *cptr!=':' && *cptr!='/') { if((*cptr<'0' || *cptr>'9') && *cptr!='.')isip=0; cptr++; } if(!(*hname=strndup(url,cptr-url))) { *hname=NULL; return NULL; } if(!isip) { if (!(myhostent=gethostbyname(*hname)))return NULL; memcpy(&myaddr,myhostent->h_addr,sizeof(myaddr)); *hip=myaddr.s_addr; } else if((*hip=inet_addr(*hname))==INADDR_NONE)return NULL; if(!*cptr || *cptr=='/') { *port=80; return cptr; } *port=atoi(++cptr); while(*cptr && *cptr!='/')cptr++; return cptr; } char *proxyurl=NULL; unsigned long proxyip=0; unsigned int proxyport; FILE *Soundinputstreamfromhttp::http_open(char *url) { char *purl=NULL,*host,*request,*sptr; char agent[50]; int linelength; unsigned long myip; unsigned int myport; int sock; int relocate=0,numrelocs=0; struct sockaddr_in server; FILE *myfile; if(!proxyip) { if(!proxyurl) if(!(proxyurl=getenv("MP3_HTTP_PROXY"))) if(!(proxyurl=getenv("http_proxy"))) proxyurl = getenv("HTTP_PROXY"); if (proxyurl && proxyurl[0] && strcmp(proxyurl, "none")) { if (!(url2hostport(proxyurl, &host, &proxyip, &proxyport))) { seterrorcode(SOUND_ERROR_UNKNOWNPROXY); return NULL; } if(host)free(host); } else proxyip = INADDR_NONE; } if((linelength=strlen(url)+100)<1024) linelength=1024; if(!(request=(char *)malloc(linelength)) || !(purl=(char *)malloc(1024))) { seterrorcode(SOUND_ERROR_MEMORYNOTENOUGH); return NULL; } strncpy(purl,url,1023); purl[1023]='\0'; do{ strcpy(request,"GET "); if(proxyip!=INADDR_NONE) { if(strncmp(url,httpstr,7)) strcat(request,httpstr); strcat(request,purl); myport=proxyport; myip=proxyip; } else { if(!(sptr=url2hostport(purl,&host,&myip,&myport))) { seterrorcode(SOUND_ERROR_UNKNOWNHOST); return NULL; } if (host) free (host); strcat (request, sptr); } sprintf (agent, " HTTP/1.0\r\nUser-Agent: %s/%s\r\n\r\n", "Splay","0.6"); strcat (request, agent); server.sin_family = AF_INET; server.sin_port = htons(myport); server.sin_addr.s_addr = myip; if((sock=socket(PF_INET,SOCK_STREAM,6))<0) { seterrorcode(SOUND_ERROR_SOCKET); return NULL; } if(connect(sock,(struct sockaddr *)&server,sizeof(server))) { seterrorcode(SOUND_ERROR_CONNECT); return NULL; } if(!writestring(sock,request))return NULL; if(!(myfile=fdopen(sock, "rb"))) { seterrorcode(SOUND_ERROR_FDOPEN); return NULL; }; relocate=false; purl[0]='\0'; if(!readstring(request,linelength-1,myfile))return NULL; if((sptr=strchr(request,' '))) { switch(sptr[1]) { case '3':relocate=true; case '2':break; default: seterrorcode(SOUND_ERROR_HTTPFAIL); return NULL; } } do{ if(!readstring(request,linelength-1,myfile))return NULL; if(!strncmp(request,"Location:",9)) strncpy (purl,request+10,1023); }while(request[0]!='\r' && request[0]!='n'); }while(relocate && purl[0] && numrelocs++<5); if(relocate) { seterrorcode(SOUND_ERROR_TOOMANYRELOC); return NULL; } free(purl); free(request); return myfile; } Soundinputstreamfromhttp::Soundinputstreamfromhttp() { fp=NULL; } Soundinputstreamfromhttp::~Soundinputstreamfromhttp() { if(fp)fclose(fp); } bool Soundinputstreamfromhttp::open(char *url) { if((fp=http_open(url))==NULL) { seterrorcode(SOUND_ERROR_FILEOPENFAIL); return false; } return true; } int Soundinputstreamfromhttp::getbytedirect(void) { int c; if((c=getc(fp))<0) { seterrorcode(SOUND_ERROR_FILEREADFAIL); return -1; } return c; } bool Soundinputstreamfromhttp::_readbuffer(char *buffer,int size) { if(fread(buffer,size,1,fp)!=1) { seterrorcode(SOUND_ERROR_FILEREADFAIL); return false; } return true; } bool Soundinputstreamfromhttp::eof(void) { return feof(fp); }; int Soundinputstreamfromhttp::getblock(char *buffer,int size) { int l; l=fread(buffer,1,size,fp); if(l==0)seterrorcode(SOUND_ERROR_FILEREADFAIL); return l; } int Soundinputstreamfromhttp::getsize(void) { return 0; } void Soundinputstreamfromhttp::setposition(int) { } int Soundinputstreamfromhttp::getposition(void) { return 0; } splay-0.9.5.2/libs/soundplayer.cc0000644000175000017500000000111107242756414012310 /* MPEG Sound library (C) 1997 by Jung woo-jae */ // Soundplayer.cc // Superclass of Rawplayer and Rawtofile // It's used for set player of Mpegtoraw #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "mpegsound.h" /*********************/ /* Soundplayer class */ /*********************/ Soundplayer::~Soundplayer() { // Nothing... } void Soundplayer::abort(void) { // Nothing.... } int Soundplayer::getprocessed(void) { return 0; } bool Soundplayer::resetsoundtype(void) { return true; } int Soundplayer::getblocksize(void) { return 1024; // Default value } splay-0.9.5.2/libs/rawplayer.cc0000644000175000017500000000656207242756414011770 /* MPEG Sound library (C) 1997 by Jung woo-jae */ // Rawplayer.cc // Playing raw data with sound type. // It's for only Linux #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "mpegsound.h" /* IOCTL */ #ifdef SOUND_VERSION #define IOCTL(a,b,c) ioctl(a,b,&c) #else #define IOCTL(a,b,c) (c = ioctl(a,b,c) ) #endif char *Rawplayer::defaultdevice="/dev/dsp"; /* Volume */ int Rawplayer::setvolume(int volume) { int handle; int r; handle=open("/dev/mixer",O_RDWR); if(volume>100)volume=100; if(volume>=0) { r=(volume<<8) | volume; ioctl(handle,MIXER_WRITE(SOUND_MIXER_VOLUME),&r); } ioctl(handle,MIXER_READ(SOUND_MIXER_VOLUME),&r); close(handle); return (r&0xFF); } /*******************/ /* Rawplayer class */ /*******************/ // Rawplayer class Rawplayer::~Rawplayer() { close(audiohandle); } bool Rawplayer::initialize(char *filename) { int flag; rawbuffersize=0; quota=0; if((audiohandle=open(filename,O_WRONLY|O_NDELAY,0))==-1) return seterrorcode(SOUND_ERROR_DEVOPENFAIL); if((flag=fcntl(audiohandle,F_GETFL,0))<0) return seterrorcode(SOUND_ERROR_DEVOPENFAIL); flag&=~O_NDELAY; if(fcntl(audiohandle,F_SETFL,flag)<0) return seterrorcode(SOUND_ERROR_DEVOPENFAIL); IOCTL(audiohandle,SNDCTL_DSP_GETBLKSIZE,audiobuffersize); if(audiobuffersize<4 || audiobuffersize>65536) return seterrorcode(SOUND_ERROR_DEVBADBUFFERSIZE); return true; } void Rawplayer::abort(void) { int a; IOCTL(audiohandle,SNDCTL_DSP_RESET,a); } int Rawplayer::getprocessed(void) { audio_buf_info info; int r; IOCTL(audiohandle,SNDCTL_DSP_GETOSPACE,info); r=(info.fragstotal-info.fragments)*info.fragsize; return r; } bool Rawplayer::setsoundtype(int stereo,int samplesize,int speed) { rawstereo=stereo; rawsamplesize=samplesize; rawspeed=speed; forcetomono=forceto8=false; return resetsoundtype(); } bool Rawplayer::resetsoundtype(void) { int tmp; if(ioctl(audiohandle,SNDCTL_DSP_SYNC,NULL)<0) return seterrorcode(SOUND_ERROR_DEVCTRLERROR); #ifdef SOUND_VERSION if(ioctl(audiohandle,SNDCTL_DSP_STEREO,&rawstereo)<0) #else if(rawstereo!=ioctl(audiohandle,SNDCTL_DSP_STEREO,rawstereo)) #endif { rawstereo=MODE_MONO; forcetomono=true; } tmp=rawsamplesize; IOCTL(audiohandle,SNDCTL_DSP_SAMPLESIZE,tmp); if(tmp!=rawsamplesize) if(rawsamplesize==16) { rawsamplesize=8; IOCTL(audiohandle,SNDCTL_DSP_SAMPLESIZE,rawsamplesize); if(rawsamplesize!=8) return seterrorcode(SOUND_ERROR_DEVCTRLERROR); forceto8=true; } if(IOCTL(audiohandle,SNDCTL_DSP_SPEED,rawspeed)<0) return seterrorcode(SOUND_ERROR_DEVCTRLERROR); return true; } bool Rawplayer::putblock(void *buffer,int size) { int modifiedsize=size; if(forcetomono || forceto8) { register unsigned char modify=0; register unsigned char *source,*dest; int increment=0,c; source=dest=(unsigned char *)buffer; if(forcetomono)increment++; if(forceto8)increment++,source++; c=modifiedsize=size>>increment; increment<<=1; while(c--) { *(dest++)=(*source)+modify; source+=increment; } } if(quota) while(getprocessed()>quota)usleep(3); write(audiohandle,buffer,modifiedsize); return true; } int Rawplayer::getblocksize(void) { return audiobuffersize; } splay-0.9.5.2/libs/rawtofile.cc0000644000175000017500000000133607242756414011750 /* MPEG Sound library (C) 1997 by Jung woo-jae */ // Rawtofile.cc // Output raw data to file. #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "mpegsound.h" // Rawplayer class Rawtofile::~Rawtofile() { close(filehandle); } bool Rawtofile::initialize(char *filename) { if(filename==NULL)filehandle=1; else if((filehandle=creat(filename,0644))==-1) return seterrorcode(SOUND_ERROR_DEVOPENFAIL); return true; } bool Rawtofile::setsoundtype(int stereo,int samplesize,int speed) { rawstereo=stereo; rawsamplesize=samplesize; rawspeed=speed; return true; } bool Rawtofile::putblock(void *buffer,int size) { return (write(filehandle,buffer,size)==size); }; splay-0.9.5.2/libs/mpegtable.cc0000644000175000017500000002260307242756414011714 /* MPEG Sound library (C) 1997 by Jung woo-jae */ // Mpegtable.cc // It has tables for MPEG layer 1, 2 and a part of layer 3 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "mpegsound.h" // For header const int Mpegtoraw::frequencies[2][3]= { {44100,48000,32000}, // MPEG 1 {22050,24000,16000} // MPEG 2 }; const int Mpegtoraw::bitrate[2][3][15]= { // MPEG 1 {{0,32,64,96,128,160,192,224,256,288,320,352,384,416,448}, {0,32,48,56,64,80,96,112,128,160,192,224,256,320,384}, {0,32,40,48,56,64,80,96,112,128,160,192,224,256,320}}, // MPEG 2 {{0,32,48,56,64,80,96,112,128,144,160,176,192,224,256}, {0,8,16,24,32,40,48,56,64,80,96,112,128,144,160}, {0,8,16,24,32,40,48,56,64,80,96,112,128,144,160}} }; // Mpeg general table const REAL Mpegtoraw::scalefactorstable[64] = { 2.00000000000000, 1.58740105196820, 1.25992104989487, 1.00000000000000, 0.79370052598410, 0.62996052494744, 0.50000000000000, 0.39685026299205, 0.31498026247372, 0.25000000000000, 0.19842513149602, 0.15749013123686, 0.12500000000000, 0.09921256574801, 0.07874506561843, 0.06250000000000, 0.04960628287401, 0.03937253280921, 0.03125000000000, 0.02480314143700, 0.01968626640461, 0.01562500000000, 0.01240157071850, 0.00984313320230, 0.00781250000000, 0.00620078535925, 0.00492156660115, 0.00390625000000, 0.00310039267963, 0.00246078330058, 0.00195312500000, 0.00155019633981, 0.00123039165029, 0.00097656250000, 0.00077509816991, 0.00061519582514, 0.00048828125000, 0.00038754908495, 0.00030759791257, 0.00024414062500, 0.00019377454248, 0.00015379895629, 0.00012207031250, 0.00009688727124, 0.00007689947814, 0.00006103515625, 0.00004844363562, 0.00003844973907, 0.00003051757813, 0.00002422181781, 0.00001922486954, 0.00001525878906, 0.00001211090890, 0.00000961243477, 0.00000762939453, 0.00000605545445, 0.00000480621738, 0.00000381469727, 0.00000302772723, 0.00000240310869, 0.00000190734863, 0.00000151386361, 0.00000120155435, 0.00000000000000 }; const REAL Mpegtoraw::filter[512]= { 0.000000000, -0.000442505, 0.003250122, -0.007003784, 0.031082153, -0.078628540, 0.100311279, -0.572036743, 1.144989014, 0.572036743, 0.100311279, 0.078628540, 0.031082153, 0.007003784, 0.003250122, 0.000442505, -0.000015259, -0.000473022, 0.003326416, -0.007919312, 0.030517578, -0.084182739, 0.090927124, -0.600219727, 1.144287109, 0.543823242, 0.108856201, 0.073059082, 0.031478882, 0.006118774, 0.003173828, 0.000396729, -0.000015259, -0.000534058, 0.003387451, -0.008865356, 0.029785156, -0.089706421, 0.080688477, -0.628295898, 1.142211914, 0.515609741, 0.116577148, 0.067520142, 0.031738281, 0.005294800, 0.003082275, 0.000366211, -0.000015259, -0.000579834, 0.003433228, -0.009841919, 0.028884888, -0.095169067, 0.069595337, -0.656219482, 1.138763428, 0.487472534, 0.123474121, 0.061996460, 0.031845093, 0.004486084, 0.002990723, 0.000320435, -0.000015259, -0.000625610, 0.003463745, -0.010848999, 0.027801514, -0.100540161, 0.057617188, -0.683914185, 1.133926392, 0.459472656, 0.129577637, 0.056533813, 0.031814575, 0.003723145, 0.002899170, 0.000289917, -0.000015259, -0.000686646, 0.003479004, -0.011886597, 0.026535034, -0.105819702, 0.044784546, -0.711318970, 1.127746582, 0.431655884, 0.134887695, 0.051132202, 0.031661987, 0.003005981, 0.002792358, 0.000259399, -0.000015259, -0.000747681, 0.003479004, -0.012939453, 0.025085449, -0.110946655, 0.031082153, -0.738372803, 1.120223999, 0.404083252, 0.139450073, 0.045837402, 0.031387329, 0.002334595, 0.002685547, 0.000244141, -0.000030518, -0.000808716, 0.003463745, -0.014022827, 0.023422241, -0.115921021, 0.016510010, -0.765029907, 1.111373901, 0.376800537, 0.143264771, 0.040634155, 0.031005859, 0.001693726, 0.002578735, 0.000213623, -0.000030518, -0.000885010, 0.003417969, -0.015121460, 0.021575928, -0.120697021, 0.001068115, -0.791213989, 1.101211548, 0.349868774, 0.146362305, 0.035552979, 0.030532837, 0.001098633, 0.002456665, 0.000198364, -0.000030518, -0.000961304, 0.003372192, -0.016235352, 0.019531250, -0.125259399, -0.015228271, -0.816864014, 1.089782715, 0.323318481, 0.148773193, 0.030609131, 0.029937744, 0.000549316, 0.002349854, 0.000167847, -0.000030518, -0.001037598, 0.003280640, -0.017349243, 0.017257690, -0.129562378, -0.032379150, -0.841949463, 1.077117920, 0.297210693, 0.150497437, 0.025817871, 0.029281616, 0.000030518, 0.002243042, 0.000152588, -0.000045776, -0.001113892, 0.003173828, -0.018463135, 0.014801025, -0.133590698, -0.050354004, -0.866363525, 1.063217163, 0.271591187, 0.151596069, 0.021179199, 0.028533936, -0.000442505, 0.002120972, 0.000137329, -0.000045776, -0.001205444, 0.003051758, -0.019577026, 0.012115479, -0.137298584, -0.069168091, -0.890090942, 1.048156738, 0.246505737, 0.152069092, 0.016708374, 0.027725220, -0.000869751, 0.002014160, 0.000122070, -0.000061035, -0.001296997, 0.002883911, -0.020690918, 0.009231567, -0.140670776, -0.088775635, -0.913055420, 1.031936646, 0.221984863, 0.151962280, 0.012420654, 0.026840210, -0.001266479, 0.001907349, 0.000106812, -0.000061035, -0.001388550, 0.002700806, -0.021789551, 0.006134033, -0.143676758, -0.109161377, -0.935195923, 1.014617920, 0.198059082, 0.151306152, 0.008316040, 0.025909424, -0.001617432, 0.001785278, 0.000106812, -0.000076294, -0.001480103, 0.002487183, -0.022857666, 0.002822876, -0.146255493, -0.130310059, -0.956481934, 0.996246338, 0.174789429, 0.150115967, 0.004394531, 0.024932861, -0.001937866, 0.001693726, 0.000091553, -0.000076294, -0.001586914, 0.002227783, -0.023910522, -0.000686646, -0.148422241, -0.152206421, -0.976852417, 0.976852417, 0.152206421, 0.148422241, 0.000686646, 0.023910522, -0.002227783, 0.001586914, 0.000076294, -0.000091553, -0.001693726, 0.001937866, -0.024932861, -0.004394531, -0.150115967, -0.174789429, -0.996246338, 0.956481934, 0.130310059, 0.146255493, -0.002822876, 0.022857666, -0.002487183, 0.001480103, 0.000076294, -0.000106812, -0.001785278, 0.001617432, -0.025909424, -0.008316040, -0.151306152, -0.198059082, -1.014617920, 0.935195923, 0.109161377, 0.143676758, -0.006134033, 0.021789551, -0.002700806, 0.001388550, 0.000061035, -0.000106812, -0.001907349, 0.001266479, -0.026840210, -0.012420654, -0.151962280, -0.221984863, -1.031936646, 0.913055420, 0.088775635, 0.140670776, -0.009231567, 0.020690918, -0.002883911, 0.001296997, 0.000061035, -0.000122070, -0.002014160, 0.000869751, -0.027725220, -0.016708374, -0.152069092, -0.246505737, -1.048156738, 0.890090942, 0.069168091, 0.137298584, -0.012115479, 0.019577026, -0.003051758, 0.001205444, 0.000045776, -0.000137329, -0.002120972, 0.000442505, -0.028533936, -0.021179199, -0.151596069, -0.271591187, -1.063217163, 0.866363525, 0.050354004, 0.133590698, -0.014801025, 0.018463135, -0.003173828, 0.001113892, 0.000045776, -0.000152588, -0.002243042, -0.000030518, -0.029281616, -0.025817871, -0.150497437, -0.297210693, -1.077117920, 0.841949463, 0.032379150, 0.129562378, -0.017257690, 0.017349243, -0.003280640, 0.001037598, 0.000030518, -0.000167847, -0.002349854, -0.000549316, -0.029937744, -0.030609131, -0.148773193, -0.323318481, -1.089782715, 0.816864014, 0.015228271, 0.125259399, -0.019531250, 0.016235352, -0.003372192, 0.000961304, 0.000030518, -0.000198364, -0.002456665, -0.001098633, -0.030532837, -0.035552979, -0.146362305, -0.349868774, -1.101211548, 0.791213989, -0.001068115, 0.120697021, -0.021575928, 0.015121460, -0.003417969, 0.000885010, 0.000030518, -0.000213623, -0.002578735, -0.001693726, -0.031005859, -0.040634155, -0.143264771, -0.376800537, -1.111373901, 0.765029907, -0.016510010, 0.115921021, -0.023422241, 0.014022827, -0.003463745, 0.000808716, 0.000030518, -0.000244141, -0.002685547, -0.002334595, -0.031387329, -0.045837402, -0.139450073, -0.404083252, -1.120223999, 0.738372803, -0.031082153, 0.110946655, -0.025085449, 0.012939453, -0.003479004, 0.000747681, 0.000015259, -0.000259399, -0.002792358, -0.003005981, -0.031661987, -0.051132202, -0.134887695, -0.431655884, -1.127746582, 0.711318970, -0.044784546, 0.105819702, -0.026535034, 0.011886597, -0.003479004, 0.000686646, 0.000015259, -0.000289917, -0.002899170, -0.003723145, -0.031814575, -0.056533813, -0.129577637, -0.459472656, -1.133926392, 0.683914185, -0.057617188, 0.100540161, -0.027801514, 0.010848999, -0.003463745, 0.000625610, 0.000015259, -0.000320435, -0.002990723, -0.004486084, -0.031845093, -0.061996460, -0.123474121, -0.487472534, -1.138763428, 0.656219482, -0.069595337, 0.095169067, -0.028884888, 0.009841919, -0.003433228, 0.000579834, 0.000015259, -0.000366211, -0.003082275, -0.005294800, -0.031738281, -0.067520142, -0.116577148, -0.515609741, -1.142211914, 0.628295898, -0.080688477, 0.089706421, -0.029785156, 0.008865356, -0.003387451, 0.000534058, 0.000015259, -0.000396729, -0.003173828, -0.006118774, -0.031478882, -0.073059082, -0.108856201, -0.543823242, -1.144287109, 0.600219727, -0.090927124, 0.084182739, -0.030517578, 0.007919312, -0.003326416, 0.000473022, 0.000015259 }; REAL Mpegtoraw::hcos_64[16], Mpegtoraw::hcos_32[ 8], Mpegtoraw::hcos_16[ 4], Mpegtoraw::hcos_8 [ 2], Mpegtoraw::hcos_4; splay-0.9.5.2/libs/filter.cc0000644000175000017500000002345507242756414011247 /* MPEG Sound library (C) 1997 by Jung woo-jae */ // Filter.cc // Subbandsynthesis routines from maplay 1.2 for Linux // I've modified some macros for reducing source code. #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "mpegsound.h" void Mpegtoraw::computebuffer(REAL *fraction,REAL buffer[2][CALCBUFFERSIZE]) { REAL p0,p1,p2,p3,p4,p5,p6,p7,p8,p9,pa,pb,pc,pd,pe,pf; REAL q0,q1,q2,q3,q4,q5,q6,q7,q8,q9,qa,qb,qc,qd,qe,qf; REAL *out1,*out2; out1=buffer[currentcalcbuffer]+calcbufferoffset; out2=buffer[currentcalcbuffer^1]+calcbufferoffset; #define OUT1(v,t) out1[(32-(v))*16] =(-(out1[(v)*16]=t)) #define OUT2(v) out2[(96-(v)-32)*16]=out2[((v)-32)*16] // compute new values via a fast cosine transform: { register REAL *x=fraction; p0=x[ 0]+x[31];p1=x[ 1]+x[30];p2=x[ 2]+x[29];p3=x[ 3]+x[28]; p4=x[ 4]+x[27];p5=x[ 5]+x[26];p6=x[ 6]+x[25];p7=x[ 7]+x[24]; p8=x[ 8]+x[23];p9=x[ 9]+x[22];pa=x[10]+x[21];pb=x[11]+x[20]; pc=x[12]+x[19];pd=x[13]+x[18];pe=x[14]+x[17];pf=x[15]+x[16]; } q0=p0+pf;q1=p1+pe;q2=p2+pd;q3=p3+pc; q4=p4+pb;q5=p5+pa;q6=p6+p9;q7=p7+p8; q8=hcos_32[0]*(p0-pf);q9=hcos_32[1]*(p1-pe); qa=hcos_32[2]*(p2-pd);qb=hcos_32[3]*(p3-pc); qc=hcos_32[4]*(p4-pb);qd=hcos_32[5]*(p5-pa); qe=hcos_32[6]*(p6-p9);qf=hcos_32[7]*(p7-p8); p0=q0+q7;p1=q1+q6;p2=q2+q5;p3=q3+q4; p4=hcos_16[0]*(q0-q7);p5=hcos_16[1]*(q1-q6); p6=hcos_16[2]*(q2-q5);p7=hcos_16[3]*(q3-q4); p8=q8+qf;p9=q9+qe;pa=qa+qd;pb=qb+qc; pc=hcos_16[0]*(q8-qf);pd=hcos_16[1]*(q9-qe); pe=hcos_16[2]*(qa-qd);pf=hcos_16[3]*(qb-qc); q0=p0+p3;q1=p1+p2;q2=hcos_8[0]*(p0-p3);q3=hcos_8[1]*(p1-p2); q4=p4+p7;q5=p5+p6;q6=hcos_8[0]*(p4-p7);q7=hcos_8[1]*(p5-p6); q8=p8+pb;q9=p9+pa;qa=hcos_8[0]*(p8-pb);qb=hcos_8[1]*(p9-pa); qc=pc+pf;qd=pd+pe;qe=hcos_8[0]*(pc-pf);qf=hcos_8[1]*(pd-pe); p0=q0+q1;p1=hcos_4*(q0-q1);p2=q2+q3;p3=hcos_4*(q2-q3); p4=q4+q5;p5=hcos_4*(q4-q5);p6=q6+q7;p7=hcos_4*(q6-q7); p8=q8+q9;p9=hcos_4*(q8-q9);pa=qa+qb;pb=hcos_4*(qa-qb); pc=qc+qd;pd=hcos_4*(qc-qd);pe=qe+qf;pf=hcos_4*(qe-qf); { register REAL tmp; tmp=p6+p7; OUT2(36)=-(p5+tmp); OUT2(44)=-(p4+tmp); tmp=pb+pf; OUT1(10,tmp); OUT1(6,pd+tmp); tmp=pe+pf; OUT2(46)=-(p8+pc+tmp); OUT2(34)=-(p9+pd+tmp); tmp+=pa+pb; OUT2(38)=-(pd+tmp); OUT2(42)=-(pc+tmp); OUT1(2,p9+pd+pf); OUT1(4,p5+p7); OUT2(48)=-p0; out2[0]=-(out1[0]=p1); OUT1( 8,p3); OUT1(12,p7); OUT1(14,pf); OUT2(40)=-(p2+p3); } { register REAL *x=fraction; p0=hcos_64[ 0]*(x[ 0]-x[31]);p1=hcos_64[ 1]*(x[ 1]-x[30]); p2=hcos_64[ 2]*(x[ 2]-x[29]);p3=hcos_64[ 3]*(x[ 3]-x[28]); p4=hcos_64[ 4]*(x[ 4]-x[27]);p5=hcos_64[ 5]*(x[ 5]-x[26]); p6=hcos_64[ 6]*(x[ 6]-x[25]);p7=hcos_64[ 7]*(x[ 7]-x[24]); p8=hcos_64[ 8]*(x[ 8]-x[23]);p9=hcos_64[ 9]*(x[ 9]-x[22]); pa=hcos_64[10]*(x[10]-x[21]);pb=hcos_64[11]*(x[11]-x[20]); pc=hcos_64[12]*(x[12]-x[19]);pd=hcos_64[13]*(x[13]-x[18]); pe=hcos_64[14]*(x[14]-x[17]);pf=hcos_64[15]*(x[15]-x[16]); } q0=p0+pf;q1=p1+pe;q2=p2+pd;q3=p3+pc; q4=p4+pb;q5=p5+pa;q6=p6+p9;q7=p7+p8; q8=hcos_32[0]*(p0-pf);q9=hcos_32[1]*(p1-pe); qa=hcos_32[2]*(p2-pd);qb=hcos_32[3]*(p3-pc); qc=hcos_32[4]*(p4-pb);qd=hcos_32[5]*(p5-pa); qe=hcos_32[6]*(p6-p9);qf=hcos_32[7]*(p7-p8); p0=q0+q7;p1=q1+q6;p2=q2+q5;p3=q3+q4; p4=hcos_16[0]*(q0-q7);p5=hcos_16[1]*(q1-q6); p6=hcos_16[2]*(q2-q5);p7=hcos_16[3]*(q3-q4); p8=q8+qf;p9=q9+qe;pa=qa+qd;pb=qb+qc; pc=hcos_16[0]*(q8-qf);pd=hcos_16[1]*(q9-qe); pe=hcos_16[2]*(qa-qd);pf=hcos_16[3]*(qb-qc); q0=p0+p3;q1=p1+p2;q2=hcos_8[0]*(p0-p3);q3=hcos_8[1]*(p1-p2); q4=p4+p7;q5=p5+p6;q6=hcos_8[0]*(p4-p7);q7=hcos_8[1]*(p5-p6); q8=p8+pb;q9=p9+pa;qa=hcos_8[0]*(p8-pb);qb=hcos_8[1]*(p9-pa); qc=pc+pf;qd=pd+pe;qe=hcos_8[0]*(pc-pf);qf=hcos_8[1]*(pd-pe); p0=q0+q1;p1=hcos_4*(q0-q1); p2=q2+q3;p3=hcos_4*(q2-q3); p4=q4+q5;p5=hcos_4*(q4-q5); p6=q6+q7;p7=hcos_4*(q6-q7); p8=q8+q9;p9=hcos_4*(q8-q9); pa=qa+qb;pb=hcos_4*(qa-qb); pc=qc+qd;pd=hcos_4*(qc-qd); pe=qe+qf;pf=hcos_4*(qe-qf); { REAL tmp; tmp=pd+pf; OUT1(5,p5+p7+pb+tmp); tmp+=p9; OUT1(1,p1+tmp); OUT2(33)=-(p1+pe+tmp); tmp+=p5+p7; OUT1(3,tmp); OUT2(35)=-(p6+pe+tmp); tmp=pa+pb+pc+pd+pe+pf; OUT2(39)=-(p2+p3+tmp-pc); OUT2(43)=-(p4+p6+p7+tmp-pd); OUT2(37)=-(p5+p6+p7+tmp-pc); OUT2(41)=-(p2+p3+tmp-pd); tmp=p8+pc+pe+pf; OUT2(47)=-(p0+tmp); OUT2(45)=-(p4+p6+p7+tmp); tmp=pb+pf; OUT1(11,p7+tmp); tmp+=p3; OUT1( 9,tmp); OUT1( 7,pd+tmp); OUT1(13,p7+pf); OUT1(15,pf); } } #define SAVE \ raw=(int)(r*scalefactor); \ if(raw>MAXSCALE)raw=MAXSCALE;else if(rawMAXSCALE)raw=MAXSCALE;else if(rawMAXSCALE)raw=MAXSCALE;else if(rawMAXSCALE)raw=MAXSCALE;else if(rawMAXSCALE)raw=MAXSCALE;else if(rawMAXSCALE)raw=MAXSCALE;else if(raw #endif #include #include #include #include "mpegsound.h" #include "mpegsound_locals.h" #define MY_PI 3.14159265358979323846 Mpegtoraw::Mpegtoraw(Soundinputstream *loader,Soundplayer *player) { __errorcode=SOUND_ERROR_OK; frameoffsets=NULL; forcetomonoflag=false; downfrequency=0; this->loader=loader; this->player=player; } Mpegtoraw::~Mpegtoraw() { if(frameoffsets)delete [] frameoffsets; } #ifndef WORDS_BIGENDIAN #define _KEY 0 #else #define _KEY 3 #endif int Mpegtoraw::getbits(int bits) { union { char store[4]; int current; }u; int bi; if(!bits)return 0; u.current=0; bi=(bitindex&7); u.store[_KEY]=buffer[bitindex>>3]<>3]; bitindex+=8; bi=8; } if(bits>=bi) { u.current<<=bi; bits-=bi; bi=0; } else { u.current<<=bits; bi-=bits; bits=0; } } bitindex-=bi; return (u.current>>8); } void Mpegtoraw::setforcetomono(bool flag) { forcetomonoflag=flag; } void Mpegtoraw::setdownfrequency(int value) { downfrequency=0; if(value)downfrequency=1; } bool Mpegtoraw::getforcetomono(void) { return forcetomonoflag; } int Mpegtoraw::getdownfrequency(void) { return downfrequency; } int Mpegtoraw::getpcmperframe(void) { int s; s=32; if(layer==3) { s*=18; if(version==0)s*=2; } else { s*=SCALEBLOCK; if(layer==2)s*=3; } return s; } inline void Mpegtoraw::flushrawdata(void) #ifdef PTHREADEDMPEG { if(threadflags.thread) { if(((threadqueue.tail+1)%threadqueue.framenumber)==threadqueue.head) { while(((threadqueue.tail+1)%threadqueue.framenumber)==threadqueue.head) usleep(200); } memcpy(threadqueue.buffer+(threadqueue.tail*RAWDATASIZE),rawdata, RAWDATASIZE*sizeof(short int)); threadqueue.sizes[threadqueue.tail]=(rawdataoffset<<1); if(threadqueue.tail>=threadqueue.frametail) threadqueue.tail=0; else threadqueue.tail++; } else { player->putblock((char *)rawdata,rawdataoffset<<1); currentframe++; } rawdataoffset=0; } #else { player->putblock((char *)rawdata,rawdataoffset<<1); currentframe++; rawdataoffset=0; }; #endif inline void stripfilename(char *dtr,char *str,int max) { char *ss; int p=0,s=0; for(;str[p];p++) if(str[p]=='/') { p++; s=p; } ss=str+s; for(p=0;p=0;i--) calcbufferL[0][i]=calcbufferL[1][i]= calcbufferR[0][i]=calcbufferR[1][i]=0.0; if(!initialized) { for(i=0;i<16;i++)hcos_64[i]=1.0/(2.0*cos(MY_PI*double(i*2+1)/64.0)); for(i=0;i< 8;i++)hcos_32[i]=1.0/(2.0*cos(MY_PI*double(i*2+1)/32.0)); for(i=0;i< 4;i++)hcos_16[i]=1.0/(2.0*cos(MY_PI*double(i*2+1)/16.0)); for(i=0;i< 2;i++)hcos_8 [i]=1.0/(2.0*cos(MY_PI*double(i*2+1)/ 8.0)); hcos_4=1.0/(2.0*cos(MY_PI*1.0/4.0)); initialized=true; } layer3initialize(); currentframe=decodeframe=0; if(loadheader()) { totalframe=(loader->getsize()+framesize-1)/framesize; loader->setposition(0); } else totalframe=0; if(frameoffsets)delete [] frameoffsets; if(totalframe>0) { frameoffsets=new int[totalframe]; for(i=totalframe-1;i>=0;i--) frameoffsets[i]=0; } else frameoffsets=NULL; #ifdef PTHREADEDMPEG threadflags.thread=false; threadqueue.buffer=NULL; threadqueue.sizes=NULL; #endif }; void Mpegtoraw::setframe(int framenumber) { int pos=0; if(frameoffsets==NULL)return; if(framenumber==0)pos=frameoffsets[0]; else { if(framenumber>=totalframe)framenumber=totalframe-1; pos=frameoffsets[framenumber]; if(pos==0) { int i; for(i=framenumber-1;i>0;i--) if(frameoffsets[i]!=0)break; loader->setposition(frameoffsets[i]); while(igetposition(); } pos=frameoffsets[framenumber]; } } clearbuffer(); loader->setposition(pos); decodeframe=currentframe=framenumber; } void Mpegtoraw::clearbuffer(void) { #ifdef PTHREADEDMPEG if(threadflags.thread) { threadflags.criticalflag=false; threadflags.criticallock=true; while(!threadflags.criticalflag)usleep(1); threadqueue.head=threadqueue.tail=0; threadflags.criticallock=false; } #endif player->abort(); player->resetsoundtype(); } bool Mpegtoraw::loadheader(void) { register int c; bool flag; sync(); // Synchronize flag=false; do { if((c=loader->getbytedirect())<0)break; if(c==0xff) { while(!flag) { if((c=loader->getbytedirect())<0) { flag=true; break; } if((c&0xf0)==0xf0) { flag=true; break; } else if(c!=0xff)break; } } else if (c=='I') { // possible ID3v2 tag char buf[10]; int c2,c3; int length; if((c2=loader->getbytedirect())<0) break; if (c2=='D') { if((c3=loader->getbytedirect())<0) break; if(c3=='3') { // OK, found ID3v2 tag. if (!loader->_readbuffer(buf,7)) break; // Compute number of bytes to skip length=((buf[3]&0x7f)<<21) + ((buf[4]&0x7f)<<14) + ((buf[5]&0x7f)<<7) + (buf[6]&0x7f); //printf("Found ID3v2 tag; skipping %d bytes\n",length); while (length-->0) { if(loader->getbytedirect()<0) { break; } } } } } //else { // printf("garbage character: %02x\n",c); //} }while(!flag); if(c<0)return seterrorcode(SOUND_ERROR_FINISH); // Analyzing c&=0xf; protection=c&1; layer=4-((c>>1)&3); version=(_mpegversion)((c>>3)^1); c=((loader->getbytedirect()))>>1; padding=(c&1); c>>=1; frequency=(_frequency)(c&2); c>>=2; bitrateindex=(int)c; if(bitrateindex==15)return seterrorcode(SOUND_ERROR_BAD); c=((unsigned int)(loader->getbytedirect()))>>4; extendedmode=c&3; mode=(_mode)(c>>2); // Making information inputstereo= (mode==single)?0:1; if(forcetomonoflag)outputstereo=0; else outputstereo=inputstereo; /* if(layer==2) if((bitrateindex>=1 && bitrateindex<=3) || (bitrateindex==5)) { if(inputstereo)return seterrorcode(SOUND_ERROR_BAD); } else if(bitrateindex==11 && mode==single) return seterrorcode(SOUND_ERROR_BAD); */ channelbitrate=bitrateindex; if(inputstereo) if(channelbitrate==4)channelbitrate=1; else channelbitrate-=4; if(channelbitrate==1 || channelbitrate==2)tableindex=0; else tableindex=1; if(layer==1)subbandnumber=MAXSUBBAND; else { if(!tableindex) if(frequency==frequency32000)subbandnumber=12; else subbandnumber=8; else if(frequency==frequency48000|| (channelbitrate>=3 && channelbitrate<=5)) subbandnumber=27; else subbandnumber=30; } if(mode==single)stereobound=0; else if(mode==joint)stereobound=(extendedmode+1)<<2; else stereobound=subbandnumber; if(stereobound>subbandnumber)stereobound=subbandnumber; // framesize & slots if(layer==1) { framesize=(12000*bitrate[version][0][bitrateindex])/ frequencies[version][frequency]; if(frequency==frequency44100 && padding)framesize++; framesize<<=2; } else { framesize=(144000*bitrate[version][layer-1][bitrateindex])/ (frequencies[version][frequency]<eof())return seterrorcode(SOUND_ERROR_FINISH); return true; } /***************************/ /* Playing in multi-thread */ /***************************/ #ifdef PTHREADEDMPEG /* Player routine */ void Mpegtoraw::threadedplayer(void) { while(!threadflags.quit) { while(threadflags.pause || threadflags.criticallock) { threadflags.criticalflag=true; usleep(200); } if(threadqueue.head!=threadqueue.tail) { player->putblock(threadqueue.buffer+threadqueue.head*RAWDATASIZE, threadqueue.sizes[threadqueue.head]); currentframe++; if(threadqueue.head==threadqueue.frametail) threadqueue.head=0; else threadqueue.head++; } else { if(threadflags.done)break; // Terminate when done usleep(200); } } threadflags.thread=false; } static void *threadlinker(void *arg) { ((Mpegtoraw *)arg)->threadedplayer(); return NULL; } bool Mpegtoraw::makethreadedplayer(int framenumbers) { threadqueue.buffer= (short int *)malloc(sizeof(short int)*RAWDATASIZE*framenumbers); if(threadqueue.buffer==NULL) seterrorcode(SOUND_ERROR_MEMORYNOTENOUGH); threadqueue.sizes=(int *)malloc(sizeof(int)*framenumbers); if(threadqueue.sizes==NULL) seterrorcode(SOUND_ERROR_MEMORYNOTENOUGH); threadqueue.framenumber=framenumbers; threadqueue.frametail=framenumbers-1; threadqueue.head=threadqueue.tail=0; threadflags.quit=threadflags.done= threadflags.pause=threadflags.criticallock=false; threadflags.thread=true; if(pthread_create(&thread,0,threadlinker,this)) seterrorcode(SOUND_ERROR_THREADFAIL); return true; } void Mpegtoraw::freethreadedplayer(void) { threadflags.criticallock= threadflags.pause=false; threadflags.done=true; // Terminate thread player while(threadflags.thread)usleep(10); // Wait for done... if(threadqueue.buffer)free(threadqueue.buffer); if(threadqueue.sizes)free(threadqueue.sizes); } void Mpegtoraw::stopthreadedplayer(void) { threadflags.quit=true; }; void Mpegtoraw::pausethreadedplayer(void) { threadflags.pause=true; }; void Mpegtoraw::unpausethreadedplayer(void) { threadflags.pause=false; }; bool Mpegtoraw::existthread(void) { return threadflags.thread; } int Mpegtoraw::getframesaved(void) { if(threadqueue.framenumber) return ((threadqueue.tail+threadqueue.framenumber-threadqueue.head) %threadqueue.framenumber); return 0; } #endif #include // Convert mpeg to raw bool Mpegtoraw::run(int frames) { clearrawdata(); if(frames<0)lastfrequency=0; for(;frames;frames--) { if(totalframe>0) { if(decodeframegetposition(); } if(loader->eof()) { seterrorcode(SOUND_ERROR_FINISH); break; } if(loadheader()==false)break; if(frequency!=lastfrequency) { if(lastfrequency>0)seterrorcode(SOUND_ERROR_BAD); lastfrequency=frequency; } if(frames<0) { frames=-frames; player->setsoundtype(outputstereo,16, frequencies[version][frequency]>>downfrequency); } decodeframe++; if (layer==3)extractlayer3(); else if(layer==2)extractlayer2(); else if(layer==1)extractlayer1(); flushrawdata(); if(player->geterrorcode())seterrorcode(geterrorcode()); } return (geterrorcode()==SOUND_ERROR_OK); } splay-0.9.5.2/libs/mpeglayer1.cc0000644000175000017500000000572207242756414012025 /* MPEG Sound library (C) 1997 by Jung woo-jae */ // Mpeglayer1.cc // It's for MPEG Layer 1 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "mpegsound.h" // Tables for layer 1 static const REAL factortable[15] = { 0.0, (1.0/2.0) * (4.0/3.0), (1.0/4.0) * (8.0/7.0), (1.0/8.0) * (16.0/15.0), (1.0/16.0) * (32.0/31.0), (1.0/32.0) * (64.0/63.0), (1.0/64.0) * (128.0/127.0), (1.0/128.0) * (256.0/255.0), (1.0/256.0) * (512.0/511.0), (1.0/512.0) * (1024.0/1023.0), (1.0/1024.0) * (2048.0/2047.0), (1.0/2048.0) * (4096.0/4095.0), (1.0/4096.0) * (8192.0/8191.0), (1.0/8192.0) * (16384.0/16383.0), (1.0/16384.0) * (32768.0/32767.0) }; static const REAL offsettable[15] = { 0.0, ((1.0/2.0)-1.0) * (4.0/3.0), ((1.0/4.0)-1.0) * (8.0/7.0), ((1.0/8.0)-1.0) * (16.0/15.0), ((1.0/16.0)-1.0) * (32.0/31.0), ((1.0/32.0)-1.0) * (64.0/63.0), ((1.0/64.0)-1.0) * (128.0/127.0), ((1.0/128.0)-1.0) * (256.0/255.0), ((1.0/256.0)-1.0) * (512.0/511.0), ((1.0/512.0)-1.0) * (1024.0/1023.0), ((1.0/1024.0)-1.0) * (2048.0/2047.0), ((1.0/2048.0)-1.0) * (4096.0/4095.0), ((1.0/4096.0)-1.0) * (8192.0/8191.0), ((1.0/8192.0)-1.0) * (16384.0/16383.0), ((1.0/16384.0)-1.0) * (32768.0/32767.0) }; // Mpeg layer 1 void Mpegtoraw::extractlayer1(void) { REAL fraction[MAXCHANNEL][MAXSUBBAND]; REAL scalefactor[MAXCHANNEL][MAXSUBBAND]; int bitalloc[MAXCHANNEL][MAXSUBBAND], sample[MAXCHANNEL][MAXSUBBAND]; register int i,j; int s=stereobound,l; // Bitalloc for(i=0;i>2][i]; fraction[LS][0][i]*=t; fraction[LS][1][i]*=t; fraction[LS][2][i]*=t; } if(bitalloc[RS][i]) { if(!group[RS][i]) { fraction[RS][0][i]=(fraction[RS][0][i]+d[RS][i])*c[LS][i]; fraction[RS][1][i]=(fraction[RS][1][i]+d[RS][i])*c[LS][i]; fraction[RS][2][i]=(fraction[RS][2][i]+d[RS][i])*c[LS][i]; } register REAL t=scalefactor[RS][l>>2][i]; fraction[RS][0][i]*=t; fraction[RS][1][i]*=t; fraction[RS][2][i]*=t; } } else for(i=0;i>2][i]; fraction[LS][0][i]*=t; fraction[LS][1][i]*=t; fraction[LS][2][i]*=t; } for(;i #include #include "mpegsound.h" #include "mpegsound_locals.h" inline void Mpegbitwindow::wrap(void) { int p=bitindex>>3; point&=(WINDOWSIZE-1); if(p>=point) { for(register int i=4;i>3)&(WINDOWSIZE-1)]>>(7-(bitindex&7)))&1; register int r=(buffer[bitindex>>3]>>(7-(bitindex&7)))&1; bitindex++; return r; }; inline int Mpegbitwindow::getbits9(int bits) { register unsigned short a; #ifndef WORDS_BIGENDIAN { // int offset=(bitindex>>3)&(WINDOWSIZE-1); int offset=bitindex>>3; a=(((unsigned char)buffer[offset])<<8) | ((unsigned char)buffer[offset+1]); } #else // a=*((unsigned short *)(buffer+((bitindex>>3)&(WINDOWSIZE-1)))); a=*((unsigned short *)(buffer+((bitindex>>3)))); #endif a<<=(bitindex&7); bitindex+=bits; return (int)((unsigned int)(a>>(16-bits))); } inline int Mpegtoraw::wgetbit (void) {return bitwindow.getbit (); } inline int Mpegtoraw::wgetbits9(int bits){return bitwindow.getbits9(bits);} inline int Mpegtoraw::wgetbits (int bits){return bitwindow.getbits (bits);} #define MUL3(a) (((a)<<1)+(a)) #define REAL0 0 #define ARRAYSIZE (SBLIMIT*SSLIMIT) #define REALSIZE (sizeof(REAL)) #ifdef PI #undef PI #endif #define PI 3.141593 #define PI_12 (PI/12.0) #define PI_18 (PI/18.0) #define PI_24 (PI/24.0) #define PI_36 (PI/36.0) #define PI_72 (PI/72.0) #ifdef NATIVE_ASSEMBLY inline void long_memset(void * s,unsigned int c,int count) { __asm__ __volatile__( "cld\n\t" "rep ; stosl\n\t" : /* no output */ :"a" (c), "c" (count/4), "D" ((long) s) :"cx","di","memory"); } #endif #define FOURTHIRDSTABLENUMBER (1<<13) static REAL two_to_negative_half_pow[40]; static REAL TO_FOUR_THIRDSTABLE[FOURTHIRDSTABLENUMBER*2]; static REAL POW2[256]; static REAL POW2_1[8][2][16]; static REAL ca[8],cs[8]; static REAL cos1_6=cos(PI/6.0*1.0); static REAL cos2_6=cos(PI/6.0*2.0); static REAL win[4][36]; static REAL cos_18[9]; static REAL hsec_36[9],hsec_12[3]; typedef struct { REAL l,r; }RATIOS; static RATIOS rat_1[16],rat_2[2][64]; void Mpegtoraw::layer3initialize(void) { static bool initializedlayer3=false; layer3framestart=0; currentprevblock=0; { int i,j,k,l; for(l=0;l<2;l++) for(i=0;i<2;i++) for(j=0;jpart2_3_length =getbits(12); gi->big_values =getbits(9); gi->global_gain =getbits(8); gi->scalefac_compress =getbits(4); gi->window_switching_flag=getbit(); if(gi->window_switching_flag) { gi->block_type =getbits(2); gi->mixed_block_flag=getbit(); gi->table_select[0] =getbits(5); gi->table_select[1] =getbits(5); gi->subblock_gain[0]=getbits(3); gi->subblock_gain[1]=getbits(3); gi->subblock_gain[2]=getbits(3); /* Set region_count parameters since they are implicit in this case. */ if(gi->block_type==0) { /* printf("Side info bad: block_type == 0 in split block.\n"); exit(0); */ return false; } else if (gi->block_type==2 && gi->mixed_block_flag==0) gi->region0_count=8; /* MI 9; */ else gi->region0_count=7; /* MI 8; */ gi->region1_count=20-(gi->region0_count); } else { gi->table_select[0] =getbits(5); gi->table_select[1] =getbits(5); gi->table_select[2] =getbits(5); gi->region0_count =getbits(4); gi->region1_count =getbits(3); gi->block_type =0; } gi->preflag =getbit(); gi->scalefac_scale =getbit(); gi->count1table_select=getbit(); gi->generalflag=gi->window_switching_flag && (gi->block_type==2); if(!inputstereo || ch)break; } return true; } bool Mpegtoraw::layer3getsideinfo_2(void) { sideinfo.main_data_begin=getbits(8); if(!inputstereo)sideinfo.private_bits=getbit(); else sideinfo.private_bits=getbits(2); for(int ch=0;;ch++) { layer3grinfo *gi=&(sideinfo.ch[ch].gr[0]); gi->part2_3_length =getbits(12); gi->big_values =getbits(9); gi->global_gain =getbits(8); gi->scalefac_compress =getbits(9); gi->window_switching_flag=getbit(); if(gi->window_switching_flag) { gi->block_type =getbits(2); gi->mixed_block_flag=getbit(); gi->table_select[0] =getbits(5); gi->table_select[1] =getbits(5); gi->subblock_gain[0]=getbits(3); gi->subblock_gain[1]=getbits(3); gi->subblock_gain[2]=getbits(3); /* Set region_count parameters since they are implicit in this case. */ if(gi->block_type==0) { /* printf("Side info bad: block_type == 0 in split block.\n"); exit(0); */ return false; } else if (gi->block_type==2 && gi->mixed_block_flag==0) gi->region0_count=8; /* MI 9; */ else gi->region0_count=7; /* MI 8; */ gi->region1_count=20-(gi->region0_count); } else { gi->table_select[0] =getbits(5); gi->table_select[1] =getbits(5); gi->table_select[2] =getbits(5); gi->region0_count =getbits(4); gi->region1_count =getbits(3); gi->block_type =0; } gi->scalefac_scale =getbit(); gi->count1table_select=getbit(); gi->generalflag=gi->window_switching_flag && (gi->block_type==2); if(!inputstereo || ch)break; } return true; } void Mpegtoraw::layer3getscalefactors(int ch,int gr) { static int slen[2][16]={{0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4}, {0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3}}; layer3grinfo *gi=&(sideinfo.ch[ch].gr[gr]); register layer3scalefactor *sf=(&scalefactors[ch]); int l0,l1; { int scale_comp=gi->scalefac_compress; l0=slen[0][scale_comp]; l1=slen[1][scale_comp]; } if(gi->generalflag) { if(gi->mixed_block_flag) { /* MIXED */ /* NEW-ag 11/25 */ sf->l[0]=wgetbits9(l0);sf->l[1]=wgetbits9(l0); sf->l[2]=wgetbits9(l0);sf->l[3]=wgetbits9(l0); sf->l[4]=wgetbits9(l0);sf->l[5]=wgetbits9(l0); sf->l[6]=wgetbits9(l0);sf->l[7]=wgetbits9(l0); sf->s[0][ 3]=wgetbits9(l0);sf->s[1][ 3]=wgetbits9(l0); sf->s[2][ 3]=wgetbits9(l0); sf->s[0][ 4]=wgetbits9(l0);sf->s[1][ 4]=wgetbits9(l0); sf->s[2][ 4]=wgetbits9(l0); sf->s[0][ 5]=wgetbits9(l0);sf->s[1][ 5]=wgetbits9(l0); sf->s[2][ 5]=wgetbits9(l0); sf->s[0][ 6]=wgetbits9(l1);sf->s[1][ 6]=wgetbits9(l1); sf->s[2][ 6]=wgetbits9(l1); sf->s[0][ 7]=wgetbits9(l1);sf->s[1][ 7]=wgetbits9(l1); sf->s[2][ 7]=wgetbits9(l1); sf->s[0][ 8]=wgetbits9(l1);sf->s[1][ 8]=wgetbits9(l1); sf->s[2][ 8]=wgetbits9(l1); sf->s[0][ 9]=wgetbits9(l1);sf->s[1][ 9]=wgetbits9(l1); sf->s[2][ 9]=wgetbits9(l1); sf->s[0][10]=wgetbits9(l1);sf->s[1][10]=wgetbits9(l1); sf->s[2][10]=wgetbits9(l1); sf->s[0][11]=wgetbits9(l1);sf->s[1][11]=wgetbits9(l1); sf->s[2][11]=wgetbits9(l1); sf->s[0][12]=sf->s[1][12]=sf->s[2][12]=0; } else { /* SHORT*/ sf->s[0][ 0]=wgetbits9(l0);sf->s[1][ 0]=wgetbits9(l0); sf->s[2][ 0]=wgetbits9(l0); sf->s[0][ 1]=wgetbits9(l0);sf->s[1][ 1]=wgetbits9(l0); sf->s[2][ 1]=wgetbits9(l0); sf->s[0][ 2]=wgetbits9(l0);sf->s[1][ 2]=wgetbits9(l0); sf->s[2][ 2]=wgetbits9(l0); sf->s[0][ 3]=wgetbits9(l0);sf->s[1][ 3]=wgetbits9(l0); sf->s[2][ 3]=wgetbits9(l0); sf->s[0][ 4]=wgetbits9(l0);sf->s[1][ 4]=wgetbits9(l0); sf->s[2][ 4]=wgetbits9(l0); sf->s[0][ 5]=wgetbits9(l0);sf->s[1][ 5]=wgetbits9(l0); sf->s[2][ 5]=wgetbits9(l0); sf->s[0][ 6]=wgetbits9(l1);sf->s[1][ 6]=wgetbits9(l1); sf->s[2][ 6]=wgetbits9(l1); sf->s[0][ 7]=wgetbits9(l1);sf->s[1][ 7]=wgetbits9(l1); sf->s[2][ 7]=wgetbits9(l1); sf->s[0][ 8]=wgetbits9(l1);sf->s[1][ 8]=wgetbits9(l1); sf->s[2][ 8]=wgetbits9(l1); sf->s[0][ 9]=wgetbits9(l1);sf->s[1][ 9]=wgetbits9(l1); sf->s[2][ 9]=wgetbits9(l1); sf->s[0][10]=wgetbits9(l1);sf->s[1][10]=wgetbits9(l1); sf->s[2][10]=wgetbits9(l1); sf->s[0][11]=wgetbits9(l1);sf->s[1][11]=wgetbits9(l1); sf->s[2][11]=wgetbits9(l1); sf->s[0][12]=sf->s[1][12]=sf->s[2][12]=0; } } else { /* LONG types 0,1,3 */ if(gr==0) { sf->l[ 0]=wgetbits9(l0);sf->l[ 1]=wgetbits9(l0); sf->l[ 2]=wgetbits9(l0);sf->l[ 3]=wgetbits9(l0); sf->l[ 4]=wgetbits9(l0);sf->l[ 5]=wgetbits9(l0); sf->l[ 6]=wgetbits9(l0);sf->l[ 7]=wgetbits9(l0); sf->l[ 8]=wgetbits9(l0);sf->l[ 9]=wgetbits9(l0); sf->l[10]=wgetbits9(l0); sf->l[11]=wgetbits9(l1);sf->l[12]=wgetbits9(l1); sf->l[13]=wgetbits9(l1);sf->l[14]=wgetbits9(l1); sf->l[15]=wgetbits9(l1); sf->l[16]=wgetbits9(l1);sf->l[17]=wgetbits9(l1); sf->l[18]=wgetbits9(l1);sf->l[19]=wgetbits9(l1); sf->l[20]=wgetbits9(l1); } else { if(sideinfo.ch[ch].scfsi[0]==0) { sf->l[ 0]=wgetbits9(l0);sf->l[ 1]=wgetbits9(l0); sf->l[ 2]=wgetbits9(l0);sf->l[ 3]=wgetbits9(l0); sf->l[ 4]=wgetbits9(l0);sf->l[ 5]=wgetbits9(l0); } if(sideinfo.ch[ch].scfsi[1]==0) { sf->l[ 6]=wgetbits9(l0);sf->l[ 7]=wgetbits9(l0); sf->l[ 8]=wgetbits9(l0);sf->l[ 9]=wgetbits9(l0); sf->l[10]=wgetbits9(l0); } if(sideinfo.ch[ch].scfsi[2]==0) { sf->l[11]=wgetbits9(l1);sf->l[12]=wgetbits9(l1); sf->l[13]=wgetbits9(l1);sf->l[14]=wgetbits9(l1); sf->l[15]=wgetbits9(l1); } if(sideinfo.ch[ch].scfsi[3]==0) { sf->l[16]=wgetbits9(l1);sf->l[17]=wgetbits9(l1); sf->l[18]=wgetbits9(l1);sf->l[19]=wgetbits9(l1); sf->l[20]=wgetbits9(l1); } } sf->l[21]=sf->l[22]=0; } } void Mpegtoraw::layer3getscalefactors_2(int ch) { static int sfbblockindex[6][3][4]= { {{ 6, 5, 5, 5},{ 9, 9, 9, 9},{ 6, 9, 9, 9}}, {{ 6, 5, 7, 3},{ 9, 9,12, 6},{ 6, 9,12, 6}}, {{11,10, 0, 0},{18,18, 0, 0},{15,18, 0, 0}}, {{ 7, 7, 7, 0},{12,12,12, 0},{ 6,15,12, 0}}, {{ 6, 6, 6, 3},{12, 9, 9, 6},{ 6,12, 9, 6}}, {{ 8, 8, 5, 0},{15,12, 9, 0},{ 6,18, 9, 0}} }; int sb[54]; layer3grinfo *gi=&(sideinfo.ch[ch].gr[0]); register layer3scalefactor *sf=(&scalefactors[ch]); { int blocktypenumber,sc; int blocknumber; int slen[4]; if(gi->block_type==2)blocktypenumber=1+gi->mixed_block_flag; else blocktypenumber=0; sc=gi->scalefac_compress; if(!((extendedmode==1 || extendedmode==3) && (ch==1))) { if(sc<400) { slen[0]=(sc>>4)/5; slen[1]=(sc>>4)%5; slen[2]=(sc%16)>>2; slen[3]=(sc%4); gi->preflag=0; blocknumber=0; } else if(sc<500) { sc-=400; slen[0]=(sc>>2)/5; slen[1]=(sc>>2)%5; slen[2]=sc%4; slen[3]=0; gi->preflag=0; blocknumber=1; } else // if(sc<512) { sc-=500; slen[0]=sc/3; slen[1]=sc%3; slen[2]=0; slen[3]=0; gi->preflag=1; blocknumber=2; } } else { sc>>=1; if(sc<180) { slen[0]=sc/36; slen[1]=(sc%36)/6; slen[2]=(sc%36)%6; slen[3]=0; gi->preflag=0; blocknumber=3; } else if(sc<244) { sc-=180; slen[0]=(sc%64)>>4; slen[1]=(sc%16)>>2; slen[2]=sc%4; slen[3]=0; gi->preflag=0; blocknumber=4; } else // if(sc<255) { sc-=244; slen[0]=sc/3; slen[1]=sc%3; slen[2]= slen[3]=0; gi->preflag=0; blocknumber=5; } } { int i,j,k,*si; si=sfbblockindex[blocknumber][blocktypenumber]; for(i=0;i<45;i++)sb[i]=0; for(k=i=0;i<4;i++) for(j=0;jwindow_switching_flag && (gi->block_type==2)) { if(gi->mixed_block_flag) { for(sfb=0;sfb<8;sfb++)sf->l[sfb]=sb[k++]; sfb=3; } else sfb=0; for(;sfb<12;sfb++) for(window=0;window<3;window++) sf->s[window][sfb]=sb[k++]; sf->s[0][12]=sf->s[1][12]=sf->s[2][12]=0; } else { for(sfb=0;sfb<21;sfb++) sf->l[sfb]=sb[k++]; sf->l[21]=sf->l[22]=0; } } } typedef unsigned int HUFFBITS; #define MXOFF 250 /* do the huffman-decoding */ /* note! for counta,countb -the 4 bit value is returned in y, discard x */ // Huffman decoder for tablename<32 inline void Mpegtoraw::huffmandecoder_1(const HUFFMANCODETABLE *h,int *x,int *y) { HUFFBITS level=(1<<(sizeof(HUFFBITS)*8-1)); int point=0; /* Lookup in Huffman table. */ for(;;) { if(h->val[point][0]==0) { /*end of tree*/ int xx,yy; xx=h->val[point][1]>>4; yy=h->val[point][1]&0xf; if(h->linbits) { if((h->xlen)==(unsigned)xx)xx+=wgetbits(h->linbits); if(xx)if(wgetbit())xx=-xx; if((h->ylen)==(unsigned)yy)yy+=wgetbits(h->linbits); if(yy)if(wgetbit())yy=-yy; } else { if(xx)if(wgetbit())xx=-xx; if(yy)if(wgetbit())yy=-yy; } *x=xx;*y=yy; break; } point+=h->val[point][wgetbit()]; level>>=1; if(!(level || ((unsigned)pointtreelen))) { register int xx,yy; xx=(h->xlen<<1);// set x and y to a medium value as a simple concealment yy=(h->ylen<<1); // h->xlen and h->ylen can't be 1 under tablename 32 // if(xx) if(wgetbit())xx=-xx; // if(yy) if(wgetbit())yy=-yy; *x=xx;*y=yy; break; } } } // Huffman decoder tablenumber>=32 inline void Mpegtoraw::huffmandecoder_2(const HUFFMANCODETABLE *h, int *x,int *y,int *v,int *w) { HUFFBITS level=(1<<(sizeof(HUFFBITS)*8-1)); int point=0; /* Lookup in Huffman table. */ for(;;) { if(h->val[point][0]==0) { /*end of tree*/ register int t=h->val[point][1]; if(t&8)*v=1-(wgetbit()<<1); else *v=0; if(t&4)*w=1-(wgetbit()<<1); else *w=0; if(t&2)*x=1-(wgetbit()<<1); else *x=0; if(t&1)*y=1-(wgetbit()<<1); else *y=0; break; } point+=h->val[point][wgetbit()]; level>>=1; if(!(level || ((unsigned)pointtreelen))) { *v=1-(wgetbit()<<1); *w=1-(wgetbit()<<1); *x=1-(wgetbit()<<1); *y=1-(wgetbit()<<1); break; } } } typedef struct { int l[23]; int s[14]; }SFBANDINDEX; static SFBANDINDEX sfBandIndextable[2][3]= { // MPEG 1 {{{0,4,8,12,16,20,24,30,36,44,52,62,74,90,110,134,162,196,238,288,342,418,576}, {0,4,8,12,16,22,30,40,52,66,84,106,136,192}}, {{0,4,8,12,16,20,24,30,36,42,50,60,72,88,106,128,156,190,230,276,330,384,576}, {0,4,8,12,16,22,28,38,50,64,80,100,126,192}}, {{0,4,8,12,16,20,24,30,36,44,54,66,82,102,126,156,194,240,296,364,448,550,576}, {0,4,8,12,16,22,30,42,58,78,104,138,180,192}}}, // MPEG 2 {{{0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576}, {0,4,8,12,18,24,32,42,56,74,100,132,174,192}}, {{0,6,12,18,24,30,36,44,54,66,80,96,114,136,162,194,232,278,330,394,464,540,576}, {0,4,8,12,18,26,36,48,62,80,104,136,180,192}}, {{0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576}, {0,4,8,12,18,26,36,48,62,80,104,134,174,192}}} }; void Mpegtoraw::layer3huffmandecode(int ch,int gr,int out[SBLIMIT][SSLIMIT]) { layer3grinfo *gi=&(sideinfo.ch[ch].gr[gr]); int part2_3_end=layer3part2start+(gi->part2_3_length); int region1Start,region2Start; int i,e=gi->big_values<<1; /* Find region boundary for short block case. */ if(gi->generalflag) { /* Region2. */ region1Start=36; /* sfb[9/3]*3=36 */ region2Start=576;/* No Region2 for short block case. */ } else { /* Find region boundary for long block case. */ region1Start=sfBandIndextable[version][frequency].l[gi->region0_count+1]; region2Start=sfBandIndextable[version][frequency].l[gi->region0_count+ gi->region1_count+2]; } /* Read bigvalues area. */ for(i=0;itable_select[0]]; if(region1Start>e)end=e; else end=region1Start; } else if(itable_select[1]]; if(region2Start>e)end=e; else end=region2Start; } else { h=&ht[gi->table_select[2]]; end=e; } if(h->treelen) while(icount1table_select+32]; while(bitwindow.gettotalbit()=ARRAYSIZE) { bitwindow.rewind(bitwindow.gettotalbit()-part2_3_end); return; } } for(;iglobal_gain]; REAL *TO_FOUR_THIRDS=TO_FOUR_THIRDSTABLE+FOURTHIRDSTABLENUMBER; /* choose correct scalefactor band per block type, initalize boundary */ /* and apply formula per block type */ if(!gi->generalflag) { /* LONG blocks: 0,1,3 */ int next_cb_boundary; int cb=-1,index=0; REAL factor; do { next_cb_boundary=sfBandIndex->l[(++cb)+1]; factor=globalgain* layer3twopow2(gi->scalefac_scale,gi->preflag, pretab[cb],scalefactors[ch].l[cb]); for(;indexmixed_block_flag) { int cb=0,index=0; int cb_width; do { cb_width=(sfBandIndex->s[cb+1]-sfBandIndex->s[cb])>>1; for(register int k=0;k<3;k++) { register REAL factor; register int count=cb_width; factor=globalgain* layer3twopow2_1(gi->subblock_gain[k],gi->scalefac_scale, scalefactors[ch].s[k][cb]); do{ out[0][index]=factor*TO_FOUR_THIRDS[in[0][index]];index++; out[0][index]=factor*TO_FOUR_THIRDS[in[0][index]];index++; }while(--count); } cb++; }while(indexl[1]; /* LONG blocks: 0,1,3 */ int index; /* Compute overall (global) scaling. */ { for(int sb=0;sbl[8]) { next_cb_boundary=sfBandIndex->s[4]; next_cb_boundary=MUL3(next_cb_boundary); cb=3; cb_width=sfBandIndex->s[4]-sfBandIndex->s[3]; cb_begin=sfBandIndex->s[3]; cb_begin=MUL3(cb_begin); } else if(indexl[8]) next_cb_boundary=sfBandIndex->l[(++cb)+1]; else { next_cb_boundary=sfBandIndex->s[(++cb)+1]; next_cb_boundary=MUL3(next_cb_boundary); cb_begin=sfBandIndex->s[cb]; cb_width=sfBandIndex->s[cb+1]-cb_begin; cb_begin=MUL3(cb_begin); } } /* LONG block types 0,1,3 & 1st 2 subbands of switched blocks */ out[0][index]*=layer3twopow2(gi->scalefac_scale,gi->preflag, pretab[cb],scalefactors[ch].l[cb]); } for(;indexl[8]) { next_cb_boundary=sfBandIndex->s[4]; next_cb_boundary=MUL3(next_cb_boundary); cb=3; cb_width=sfBandIndex->s[4]-sfBandIndex->s[3]; cb_begin=sfBandIndex->s[3]; cb_begin=(cb_begin<<2)-cb_begin; } else if(indexl[8]) next_cb_boundary=sfBandIndex->l[(++cb)+1]; else { next_cb_boundary=sfBandIndex->s[(++cb)+1]; next_cb_boundary=MUL3(next_cb_boundary); cb_begin=sfBandIndex->s[cb]; cb_width=sfBandIndex->s[cb+1]-cb_begin; cb_begin=MUL3(cb_begin); } } { int t_index=(index-cb_begin)/cb_width; out[0][index]*=layer3twopow2_1(gi->subblock_gain[t_index], gi->scalefac_scale, scalefactors[ch].s[t_index][cb]); } } } } inline void Mpegtoraw::layer3fixtostereo(int gr,REAL in[2][SBLIMIT][SSLIMIT]) { layer3grinfo *gi=&(sideinfo.ch[0].gr[gr]); SFBANDINDEX *sfBandIndex=&(sfBandIndextable[version][frequency]); int ms_stereo=(mode==joint) && (extendedmode & 0x2); int i_stereo =(mode==joint) && (extendedmode & 0x1); if(!inputstereo) { /* mono , bypass xr[0][][] to lr[0][][]*/ // memcpy(out[0][0],in[0][0],ARRAYSIZE*REALSIZE); return; } if(i_stereo) { int i; int is_pos[ARRAYSIZE]; RATIOS is_ratio[ARRAYSIZE]; RATIOS *ratios; if(version)ratios=rat_2[gi->scalefac_compress%2]; else ratios=rat_1; /* initialization */ for(i=0;igeneralflag) { if(gi->mixed_block_flag) // Part I { int max_sfb=0; for(int j=0;j<3;j++) { int sfb,sfbcnt=2; for(sfb=12;sfb>=3;sfb--) { int lines; i=sfBandIndex->s[sfb]; lines=sfBandIndex->s[sfb+1]-i; i=MUL3(i)+(j+1)*lines-1; for(;lines>0;lines--,i--) if(in[1][0][i]!=0.0f) { sfbcnt=sfb; sfb=0;break; // quit loop } } sfb=sfbcnt+1; if(sfb>max_sfb)max_sfb=sfb; for(;sfb<12;sfb++) { int k,t; t=sfBandIndex->s[sfb]; k=sfBandIndex->s[sfb+1]-t; i=MUL3(t)+j*k; t=scalefactors[1].s[j][sfb]; if(t!=7) { RATIOS r=ratios[t]; for(;k>0;k--,i++){ is_pos[i]=t;is_ratio[i]=r;} } else for(;k>0;k--,i++)is_pos[i]=t; } sfb=sfBandIndex->s[10]; sfb=MUL3(sfb)+j*(sfBandIndex->s[11]-sfb); { int k,t; t=sfBandIndex->s[11]; k=sfBandIndex->s[12]-t; i=MUL3(t)+j*k; t=is_pos[sfb]; if(t!=7) { RATIOS r=is_ratio[sfb]; for(;k>0;k--,i++){ is_pos[i]=t;is_ratio[i]=r;} } else for(;k>0;k--,i++)is_pos[i]=t; } } if(max_sfb<=3) { { REAL temp; int k; temp=in[1][0][0];in[1][0][0]=1.0; for(k=3*SSLIMIT-1;in[1][0][k]==0.0;k--); in[1][0][0]=temp; for(i=0;sfBandIndex->l[i]<=k;i++); } { int sfb=i; i=sfBandIndex->l[i]; for(;sfb<8;sfb++) { int t=scalefactors[1].l[sfb]; int k=sfBandIndex->l[sfb+1]-sfBandIndex->l[sfb]; if(t!=7) { RATIOS r=ratios[t]; for(;k>0;k--,i++){ is_pos[i]=t;is_ratio[i]=r;} } else for(;k>0;k--,i++)is_pos[i]=t; } } } } else // Part II { for(int j=0;j<3;j++) { int sfbcnt=-1; for(int sfb=12;sfb>=0;sfb--) { int lines; { int t; t=sfBandIndex->s[sfb]; lines=sfBandIndex->s[sfb+1]-t; i=MUL3(t)+(j+1)*lines-1; } for(;lines>0;lines--,i--) if(in[1][0][i]!=0.0f) { sfbcnt=sfb; sfb=0;break; // quit loop } } for(int sfb=sfbcnt+1;sfb<12;sfb++) { int k,t; t=sfBandIndex->s[sfb]; k=sfBandIndex->s[sfb+1]-t; i=MUL3(t)+j*k; t=scalefactors[1].s[j][sfb]; if(t!=7) { RATIOS r=ratios[t]; for(;k>0;k--,i++){ is_pos[i]=t;is_ratio[i]=r;} } else for(;k>0;k--,i++)is_pos[i]=t; } { int t1=sfBandIndex->s[10], t2=sfBandIndex->s[11]; int k,tt; tt=MUL3(t1)+j*(t2-t1); k =sfBandIndex->s[12]-t2; if(is_pos[tt]!=7) { RATIOS r=is_ratio[tt]; int t=is_pos[tt]; i =MUL3(t1)+j*k; for(;k>0;k--,i++){ is_pos[i]=t;is_ratio[i]=r;} } else for(;k>0;k--,i++)is_pos[i]=7; } } } } else // ms-stereo (Part III) { { REAL temp; int k; temp=in[1][0][0];in[1][0][0]=1.0; for(k=ARRAYSIZE-1;in[1][0][k]==0.0;k--); in[1][0][0]=temp; for(i=0;sfBandIndex->l[i]<=k;i++); } { int sfb; sfb=i; i=sfBandIndex->l[i]; for(;sfb<21;sfb++) { int k,t; k=sfBandIndex->l[sfb+1]-sfBandIndex->l[sfb]; t=scalefactors[1].l[sfb]; if(t!=7) { RATIOS r=ratios[t]; for(;k>0;k--,i++){ is_pos[i]=t;is_ratio[i]=r;} } else for(;k>0;k--,i++)is_pos[i]=t; } } { int k,t,tt; tt=sfBandIndex->l[20]; k=576-sfBandIndex->l[21]; t=is_pos[tt]; if(t!=7) { RATIOS r=is_ratio[tt]; for(;k>0;k--,i++){ is_pos[i]=t;is_ratio[i]=r;} } else for(;k>0;k--,i++)is_pos[i]=t; } } if(ms_stereo) { i=ARRAYSIZE-1; do{ if(is_pos[i]==7) { register REAL t=in[LS][0][i]; in[LS][0][i]=(t+in[RS][0][i])*0.7071068f; in[RS][0][i]=(t-in[RS][0][i])*0.7071068f; } else { in[RS][0][i]=in[LS][0][i]*is_ratio[i].r; in[LS][0][i]*=is_ratio[i].l; } }while(i--); } else { i=ARRAYSIZE-1; do{ if(is_pos[i]!=7) { in[RS][0][i]=in[LS][0][i]*is_ratio[i].r; in[LS][0][i]*=is_ratio[i].l; } }while(i--); } } else { if(ms_stereo) { int i=ARRAYSIZE-1; do{ register REAL t=in[LS][0][i]; in[LS][0][i]=(t+in[RS][0][i])*0.7071068f; in[RS][0][i]=(t-in[RS][0][i])*0.7071068f; }while(i--); } } // channels==2 } inline void layer3reorder_1(int version,int frequency, REAL in[SBLIMIT][SSLIMIT], REAL out[SBLIMIT][SSLIMIT]) { SFBANDINDEX *sfBandIndex=&(sfBandIndextable[version][frequency]); int sfb,sfb_start,sfb_lines; /* NO REORDER FOR LOW 2 SUBBANDS */ out[0][ 0]=in[0][ 0];out[0][ 1]=in[0][ 1];out[0][ 2]=in[0][ 2]; out[0][ 3]=in[0][ 3];out[0][ 4]=in[0][ 4];out[0][ 5]=in[0][ 5]; out[0][ 6]=in[0][ 6];out[0][ 7]=in[0][ 7];out[0][ 8]=in[0][ 8]; out[0][ 9]=in[0][ 9];out[0][10]=in[0][10];out[0][11]=in[0][11]; out[0][12]=in[0][12];out[0][13]=in[0][13];out[0][14]=in[0][14]; out[0][15]=in[0][15];out[0][16]=in[0][16];out[0][17]=in[0][17]; out[1][ 0]=in[1][ 0];out[1][ 1]=in[1][ 1];out[1][ 2]=in[1][ 2]; out[1][ 3]=in[1][ 3];out[1][ 4]=in[1][ 4];out[1][ 5]=in[1][ 5]; out[1][ 6]=in[1][ 6];out[1][ 7]=in[1][ 7];out[1][ 8]=in[1][ 8]; out[1][ 9]=in[1][ 9];out[1][10]=in[1][10];out[1][11]=in[1][11]; out[1][12]=in[1][12];out[1][13]=in[1][13];out[1][14]=in[1][14]; out[1][15]=in[1][15];out[1][16]=in[1][16];out[1][17]=in[1][17]; /* REORDERING FOR REST SWITCHED SHORT */ for(sfb=3,sfb_start=sfBandIndex->s[3], sfb_lines=sfBandIndex->s[4]-sfb_start; sfb<13; sfb++,sfb_start=sfBandIndex->s[sfb], (sfb_lines=sfBandIndex->s[sfb+1]-sfb_start)) { for(int freq=0;freqs[1]; sfb<13; sfb++,sfb_start=sfBandIndex->s[sfb], (sfb_lines=sfBandIndex->s[sfb+1]-sfb_start)) { for(int freq=0;freqgeneralflag) { if(gi->mixed_block_flag) { fprintf(stderr,"Notchecked!"); layer3reorder_1 (version,frequency,in,out); // Not checked... layer3antialias_1(out); } else layer3reorder_2(version,frequency,in,out); } else layer3antialias_2(in,out); } static void dct36(REAL *inbuf,REAL *prevblk1,REAL *prevblk2,REAL *wi,REAL *out) { #define MACRO0(v) { \ REAL tmp; \ out2[9+(v)]=(tmp=sum0+sum1)*wi[27+(v)]; \ out2[8-(v)]=tmp * wi[26-(v)]; } \ sum0-=sum1; \ ts[SBLIMIT*(8-(v))]=out1[8-(v)]+sum0*wi[8-(v)]; \ ts[SBLIMIT*(9+(v))]=out1[9+(v)]+sum0*wi[9+(v)]; #define MACRO1(v) { \ REAL sum0,sum1; \ sum0=tmp1a+tmp2a; \ sum1=(tmp1b+tmp2b)*hsec_36[(v)]; \ MACRO0(v); } #define MACRO2(v) { \ REAL sum0,sum1; \ sum0=tmp2a-tmp1a; \ sum1=(tmp2b-tmp1b) * hsec_36[(v)]; \ MACRO0(v); } { register REAL *in = inbuf; in[17]+=in[16];in[16]+=in[15];in[15]+=in[14];in[14]+=in[13]; in[13]+=in[12];in[12]+=in[11];in[11]+=in[10];in[10]+=in[ 9]; in[ 9]+=in[ 8];in[ 8]+=in[ 7];in[ 7]+=in[ 6];in[ 6]+=in[ 5]; in[ 5]+=in[ 4];in[ 4]+=in[ 3];in[ 3]+=in[ 2];in[ 2]+=in[ 1]; in[ 1]+=in[ 0]; in[17]+=in[15];in[15]+=in[13];in[13]+=in[11];in[11]+=in[ 9]; in[ 9]+=in[ 7];in[7] +=in[ 5];in[ 5]+=in[ 3];in[ 3]+=in[ 1]; { register REAL *c = cos_18; register REAL *out2 = prevblk2; register REAL *out1 = prevblk1; register REAL *ts = out; REAL ta33,ta66,tb33,tb66; ta33=in[2*3+0]*c[3]; ta66=in[2*6+0]*c[6]; tb33=in[2*3+1]*c[3]; tb66=in[2*6+1]*c[6]; { REAL tmp1a,tmp2a,tmp1b,tmp2b; tmp1a= in[2*1+0]*c[1]+ta33 +in[2*5+0]*c[5]+in[2*7+0]*c[7]; tmp1b= in[2*1+1]*c[1]+tb33 +in[2*5+1]*c[5]+in[2*7+1]*c[7]; tmp2a=in[2*0+0]+in[2*2+0]*c[2]+in[2*4+0]*c[4]+ta66 +in[2*8+0]*c[8]; tmp2b=in[2*0+1]+in[2*2+1]*c[2]+in[2*4+1]*c[4]+tb66 +in[2*8+1]*c[8]; MACRO1(0); MACRO2(8); } { REAL tmp1a,tmp2a,tmp1b,tmp2b; tmp1a=(in[2*1+0]-in[2*5+0]-in[2*7+0])*c[3]; tmp1b=(in[2*1+1]-in[2*5+1]-in[2*7+1])*c[3]; tmp2a=(in[2*2+0]-in[2*4+0]-in[2*8+0])*c[6]-in[2*6+0]+in[2*0+0]; tmp2b=(in[2*2+1]-in[2*4+1]-in[2*8+1])*c[6]-in[2*6+1]+in[2*0+1]; MACRO1(1); MACRO2(7); } { REAL tmp1a,tmp2a,tmp1b,tmp2b; tmp1a= in[2*1+0]*c[5]-ta33 -in[2*5+0]*c[7]+in[2*7+0]*c[1]; tmp1b= in[2*1+1]*c[5]-tb33 -in[2*5+1]*c[7]+in[2*7+1]*c[1]; tmp2a=in[2*0+0]-in[2*2+0]*c[8]-in[2*4+0]*c[2]+ta66 +in[2*8+0]*c[4]; tmp2b=in[2*0+1]-in[2*2+1]*c[8]-in[2*4+1]*c[2]+tb66 +in[2*8+1]*c[4]; MACRO1(2); MACRO2(6); } { REAL tmp1a,tmp2a,tmp1b,tmp2b; tmp1a= in[2*1+0]*c[7]-ta33 +in[2*5+0]*c[1]-in[2*7+0]*c[5]; tmp1b= in[2*1+1]*c[7]-tb33 +in[2*5+1]*c[1]-in[2*7+1]*c[5]; tmp2a=in[2*0+0]-in[2*2+0]*c[4]+in[2*4+0]*c[8]+ta66 -in[2*8+0]*c[2]; tmp2b=in[2*0+1]-in[2*2+1]*c[4]+in[2*4+1]*c[8]+tb66 -in[2*8+1]*c[2]; MACRO1(3); MACRO2(5); } { REAL sum0,sum1; sum0= in[2*0+0]-in[2*2+0]+in[2*4+0]-in[2*6+0]+in[2*8+0]; sum1=(in[2*0+1]-in[2*2+1]+in[2*4+1]-in[2*6+1]+in[2*8+1])*hsec_36[4]; MACRO0(4); } } } } static void dct12(REAL *in,REAL *prevblk1,REAL *prevblk2,register REAL *wi,register REAL *out) { #define DCT12_PART1 \ in5=in[5*3]; \ in5+=(in4=in[4*3]); \ in4+=(in3=in[3*3]); \ in3+=(in2=in[2*3]); \ in2+=(in1=in[1*3]); \ in1+=(in0=in[0*3]); \ \ in5+=in3;in3+=in1; \ \ in2*=cos1_6; \ in3*=cos1_6; #define DCT12_PART2 \ in0+=in4*cos2_6; \ \ in4=in0+in2; \ in0-=in2; \ \ in1+=in5*cos2_6; \ \ in5=(in1+in3)*hsec_12[0]; \ in1=(in1-in3)*hsec_12[2]; \ \ in3=in4+in5; \ in4-=in5; \ \ in2=in0+in1; \ in0-=in1; { REAL in0,in1,in2,in3,in4,in5; register REAL *pb1=prevblk1; out[SBLIMIT*0]=pb1[0];out[SBLIMIT*1]=pb1[1];out[SBLIMIT*2]=pb1[2]; out[SBLIMIT*3]=pb1[3];out[SBLIMIT*4]=pb1[4];out[SBLIMIT*5]=pb1[5]; DCT12_PART1; { REAL tmp0,tmp1=(in0-in4); { register REAL tmp2=(in1-in5)*hsec_12[1]; tmp0=tmp1+tmp2; tmp1-=tmp2; } out[(17-1)*SBLIMIT]=pb1[17-1]+tmp0*wi[11-1]; out[(12+1)*SBLIMIT]=pb1[12+1]+tmp0*wi[ 6+1]; out[(6 +1)*SBLIMIT]=pb1[6 +1]+tmp1*wi[ 1 ]; out[(11-1)*SBLIMIT]=pb1[11-1]+tmp1*wi[ 5-1]; } DCT12_PART2; out[(17-0)*SBLIMIT]=pb1[17-0]+in2*wi[11-0]; out[(12+0)*SBLIMIT]=pb1[12+0]+in2*wi[ 6+0]; out[(12+2)*SBLIMIT]=pb1[12+2]+in3*wi[ 6+2]; out[(17-2)*SBLIMIT]=pb1[17-2]+in3*wi[11-2]; out[( 6+0)*SBLIMIT]=pb1[ 6+0]+in0*wi[0]; out[(11-0)*SBLIMIT]=pb1[11-0]+in0*wi[5-0]; out[( 6+2)*SBLIMIT]=pb1[ 6+2]+in4*wi[2]; out[(11-2)*SBLIMIT]=pb1[11-2]+in4*wi[5-2]; } in++; { REAL in0,in1,in2,in3,in4,in5; register REAL *pb2 = prevblk2; DCT12_PART1; { REAL tmp0,tmp1=(in0-in4); { REAL tmp2=(in1-in5)*hsec_12[1]; tmp0=tmp1+tmp2; tmp1-=tmp2; } pb2[5-1]=tmp0*wi[11-1]; pb2[0+1]=tmp0*wi[6+1]; out[(12+1)*SBLIMIT]+=tmp1*wi[1]; out[(17-1)*SBLIMIT]+=tmp1*wi[5-1]; } DCT12_PART2; pb2[5-0]=in2*wi[11-0]; pb2[0+0]=in2*wi[6+0]; pb2[0+2]=in3*wi[6+2]; pb2[5-2]=in3*wi[11-2]; out[(12+0)*SBLIMIT]+=in0*wi[0]; out[(17-0)*SBLIMIT]+=in0*wi[5-0]; out[(12+2)*SBLIMIT]+=in4*wi[2]; out[(17-2)*SBLIMIT]+=in4*wi[5-2]; } in++; { REAL in0,in1,in2,in3,in4,in5; register REAL *pb2 = prevblk2; pb2[12]=pb2[13]=pb2[14]=pb2[15]=pb2[16]=pb2[17]=0.0; DCT12_PART1; { REAL tmp0,tmp1=(in0-in4); { REAL tmp2=(in1-in5)*hsec_12[1]; tmp0=tmp1+tmp2; tmp1-=tmp2; } pb2[11-1]=tmp0*wi[11-1]; pb2[ 6+1]=tmp0*wi[6+1]; pb2[ 0+1]+=tmp1*wi[1]; pb2[ 5-1]+=tmp1*wi[5-1]; } DCT12_PART2; pb2[11-0]=in2*wi[11-0]; pb2[ 6+0]=in2*wi[ 6+0]; pb2[ 6+2]=in3*wi[ 6+2]; pb2[11-2]=in3*wi[11-2]; pb2[ 0+0]+=in0*wi[0 ]; pb2[ 5-0]+=in0*wi[5-0]; pb2[ 0+2]+=in4*wi[2 ]; pb2[ 5-2]+=in4*wi[5-2]; } } void Mpegtoraw::layer3hybrid(int ch,int gr,REAL in[SBLIMIT][SSLIMIT], REAL out[SSLIMIT][SBLIMIT]) { layer3grinfo *gi=&(sideinfo.ch[ch].gr[gr]); int bt1,bt2; REAL *prev1,*prev2; prev1=prevblck[ch][currentprevblock][0]; prev2=prevblck[ch][currentprevblock^1][0]; bt1 = gi->mixed_block_flag ? 0 : gi->block_type; bt2 = gi->block_type; { REAL *ci=(REAL *)in, *co=(REAL *)out; int i; if(downfrequency)i=(SBLIMIT/2)-2; else i=SBLIMIT-2; if(bt2==2) { if(!bt1) { dct36(ci,prev1,prev2,win[0],co); ci+=SSLIMIT;prev1+=SSLIMIT;prev2+=SSLIMIT;co++; dct36(ci,prev1,prev2,win[0],co); } else { dct12(ci,prev1,prev2,win[2],co); ci+=SSLIMIT;prev1+=SSLIMIT;prev2+=SSLIMIT;co++; dct12(ci,prev1,prev2,win[2],co); } do{ ci+=SSLIMIT;prev1+=SSLIMIT;prev2+=SSLIMIT;co++; dct12(ci,prev1,prev2,win[2],co); }while(--i); } else { dct36(ci,prev1,prev2,win[bt1],co); ci+=SSLIMIT;prev1+=SSLIMIT;prev2+=SSLIMIT;co++; dct36(ci,prev1,prev2,win[bt1],co); do { ci+=SSLIMIT;prev1+=SSLIMIT;prev2+=SSLIMIT;co++; dct36(ci,prev1,prev2,win[bt2],co); }while(--i); } } } #define NEG(a) (a)=-(a) void Mpegtoraw::extractlayer3(void) { if(version) { extractlayer3_2(); return; } { int main_data_end,flush_main; int bytes_to_discard; layer3getsideinfo(); if(issync()) { for(register int i=layer3slots;i>0;i--) // read main data. bitwindow.putbyte(getbyte()); } else { for(register int i=layer3slots;i>0;i--) // read main data. bitwindow.putbyte(getbits8()); } main_data_end=bitwindow.gettotalbit()>>3;// of previous frame if((flush_main=(bitwindow.gettotalbit() & 0x7))) { bitwindow.forward(8-flush_main); main_data_end++; } bytes_to_discard=layer3framestart-(main_data_end+sideinfo.main_data_begin); if(main_data_end>WINDOWSIZE) { layer3framestart-=WINDOWSIZE; bitwindow.rewind(WINDOWSIZE*8); } layer3framestart+=layer3slots; bitwindow.wrap(); if(bytes_to_discard<0)return; bitwindow.forward(bytes_to_discard<<3); } for(int gr=0;gr<2;gr++) { union { int is [SBLIMIT][SSLIMIT]; REAL hin [2][SBLIMIT][SSLIMIT]; }b1; union { REAL ro [2][SBLIMIT][SSLIMIT]; REAL lr [2][SBLIMIT][SSLIMIT]; REAL hout [2][SSLIMIT][SBLIMIT]; }b2; layer3part2start=bitwindow.gettotalbit(); layer3getscalefactors (LS,gr); layer3huffmandecode (LS,gr ,b1.is); layer3dequantizesample(LS,gr,b1.is,b2.ro[LS]); if(inputstereo) { layer3part2start=bitwindow.gettotalbit(); layer3getscalefactors (RS,gr); layer3huffmandecode (RS,gr ,b1.is); layer3dequantizesample(RS,gr,b1.is,b2.ro[RS]); } layer3fixtostereo(gr,b2.ro); // b2.ro -> b2.lr currentprevblock^=1; layer3reorderandantialias(LS,gr,b2.lr[LS],b1.hin[LS]); layer3hybrid (LS,gr,b1.hin[LS],b2.hout[LS]); if(outputstereo) { layer3reorderandantialias(RS,gr,b2.lr[RS],b1.hin[RS]); layer3hybrid (RS,gr,b1.hin[RS],b2.hout[RS]); register int i=2*SSLIMIT*SBLIMIT-1; do{ NEG(b2.hout[0][0][i ]);NEG(b2.hout[0][0][i- 2]); NEG(b2.hout[0][0][i- 4]);NEG(b2.hout[0][0][i- 6]); NEG(b2.hout[0][0][i- 8]);NEG(b2.hout[0][0][i-10]); NEG(b2.hout[0][0][i-12]);NEG(b2.hout[0][0][i-14]); NEG(b2.hout[0][0][i-16]);NEG(b2.hout[0][0][i-18]); NEG(b2.hout[0][0][i-20]);NEG(b2.hout[0][0][i-22]); NEG(b2.hout[0][0][i-24]);NEG(b2.hout[0][0][i-26]); NEG(b2.hout[0][0][i-28]);NEG(b2.hout[0][0][i-30]); }while((i-=2*SBLIMIT)>0); } else { register int i=SSLIMIT*SBLIMIT-1; do{ NEG(b2.hout[0][0][i ]);NEG(b2.hout[0][0][i- 2]); NEG(b2.hout[0][0][i- 4]);NEG(b2.hout[0][0][i- 6]); NEG(b2.hout[0][0][i- 8]);NEG(b2.hout[0][0][i-10]); NEG(b2.hout[0][0][i-12]);NEG(b2.hout[0][0][i-14]); NEG(b2.hout[0][0][i-16]);NEG(b2.hout[0][0][i-18]); NEG(b2.hout[0][0][i-20]);NEG(b2.hout[0][0][i-22]); NEG(b2.hout[0][0][i-24]);NEG(b2.hout[0][0][i-26]); NEG(b2.hout[0][0][i-28]);NEG(b2.hout[0][0][i-30]); }while((i-=2*SBLIMIT)>0); } for(int ss=0;ss0;i--) // read main data. bitwindow.putbyte(getbyte()); } else { for(register int i=layer3slots;i>0;i--) // read main data. bitwindow.putbyte(getbits8()); } bitwindow.wrap(); main_data_end=bitwindow.gettotalbit()>>3;// of previous frame if((flush_main=(bitwindow.gettotalbit() & 0x7))) { bitwindow.forward(8-flush_main); main_data_end++; } bytes_to_discard=layer3framestart-main_data_end-sideinfo.main_data_begin; if(main_data_end>WINDOWSIZE) { layer3framestart-=WINDOWSIZE; bitwindow.rewind(WINDOWSIZE*8); } layer3framestart+=layer3slots; if(bytes_to_discard<0)return; bitwindow.forward(bytes_to_discard<<3); } // for(int gr=0;gr<2;gr++) { union { int is [SBLIMIT][SSLIMIT]; REAL hin [2][SBLIMIT][SSLIMIT]; }b1; union { REAL ro [2][SBLIMIT][SSLIMIT]; REAL lr [2][SBLIMIT][SSLIMIT]; REAL hout [2][SSLIMIT][SBLIMIT]; }b2; layer3part2start=bitwindow.gettotalbit(); layer3getscalefactors_2(LS); layer3huffmandecode (LS,0 ,b1.is); layer3dequantizesample (LS,0,b1.is,b2.ro[LS]); if(inputstereo) { layer3part2start=bitwindow.gettotalbit(); layer3getscalefactors_2(RS); layer3huffmandecode (RS,0 ,b1.is); layer3dequantizesample (RS,0,b1.is,b2.ro[RS]); } layer3fixtostereo(0,b2.ro); // b2.ro -> b2.lr currentprevblock^=1; layer3reorderandantialias(LS,0,b2.lr[LS],b1.hin[LS]); layer3hybrid (LS,0,b1.hin[LS],b2.hout[LS]); if(outputstereo) { layer3reorderandantialias(RS,0,b2.lr[RS],b1.hin[RS]); layer3hybrid (RS,0,b1.hin[RS],b2.hout[RS]); register int i=2*SSLIMIT*SBLIMIT-1; do{ NEG(b2.hout[0][0][i-16]);NEG(b2.hout[0][0][i-18]); NEG(b2.hout[0][0][i-20]);NEG(b2.hout[0][0][i-22]); NEG(b2.hout[0][0][i-24]);NEG(b2.hout[0][0][i-26]); NEG(b2.hout[0][0][i-28]);NEG(b2.hout[0][0][i-30]); }while((i-=2*SBLIMIT)>0); } else { register int i=SSLIMIT*SBLIMIT-1; do{ NEG(b2.hout[0][0][i-16]);NEG(b2.hout[0][0][i-18]); NEG(b2.hout[0][0][i-20]);NEG(b2.hout[0][0][i-22]); NEG(b2.hout[0][0][i-24]);NEG(b2.hout[0][0][i-26]); NEG(b2.hout[0][0][i-28]);NEG(b2.hout[0][0][i-30]); }while((i-=2*SBLIMIT)>0); } for(int ss=0;ss>3)&(WINDOWSIZE-1)]<>3]<>3)&(WINDOWSIZE-1)]; u.store[_KEY]=buffer[bitindex>>3]; bitindex+=8; bi=8; } if(bits>=bi) { u.current<<=bi; bits-=bi; bi=0; } else { u.current<<=bits; bi-=bits; bits=0; } } bitindex-=bi; return (u.current>>8); } splay-0.9.5.2/libs/huffmantable.cc0000644000175000017500000010250307242756414012406 /* MPEG Sound library (C) 1997 by Jung woo-jae */ // Huffmantable.cc // It contains initialized huffman table for MPEG layer 3 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "mpegsound.h" static const unsigned int htd01[ 7][2]={{ 2, 1},{ 0, 0},{ 2, 1},{ 0, 16},{ 2, 1},{ 0, 1}, { 0, 17}}, htd02[ 17][2]={{ 2, 1},{ 0, 0},{ 4, 1},{ 2, 1},{ 0, 16},{ 0, 1}, { 2, 1},{ 0, 17},{ 4, 1},{ 2, 1},{ 0, 32},{ 0, 33}, { 2, 1},{ 0, 18},{ 2, 1},{ 0, 2},{ 0, 34}}, htd03[ 17][2]={{ 4, 1},{ 2, 1},{ 0, 0},{ 0, 1},{ 2, 1},{ 0, 17}, { 2, 1},{ 0, 16},{ 4, 1},{ 2, 1},{ 0, 32},{ 0, 33}, { 2, 1},{ 0, 18},{ 2, 1},{ 0, 2},{ 0, 34}}, htd05[ 31][2]={{ 2, 1},{ 0, 0},{ 4, 1},{ 2, 1},{ 0, 16},{ 0, 1}, { 2, 1},{ 0, 17},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 32}, { 0, 2},{ 2, 1},{ 0, 33},{ 0, 18},{ 8, 1},{ 4, 1}, { 2, 1},{ 0, 34},{ 0, 48},{ 2, 1},{ 0, 3},{ 0, 19}, { 2, 1},{ 0, 49},{ 2, 1},{ 0, 50},{ 2, 1},{ 0, 35}, { 0, 51}}, htd06[ 31][2]={{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 0},{ 0, 16},{ 0, 17}, { 6, 1},{ 2, 1},{ 0, 1},{ 2, 1},{ 0, 32},{ 0, 33}, { 6, 1},{ 2, 1},{ 0, 18},{ 2, 1},{ 0, 2},{ 0, 34}, { 4, 1},{ 2, 1},{ 0, 49},{ 0, 19},{ 4, 1},{ 2, 1}, { 0, 48},{ 0, 50},{ 2, 1},{ 0, 35},{ 2, 1},{ 0, 3}, { 0, 51}}, htd07[ 71][2]={{ 2, 1},{ 0, 0},{ 4, 1},{ 2, 1},{ 0, 16},{ 0, 1}, { 8, 1},{ 2, 1},{ 0, 17},{ 4, 1},{ 2, 1},{ 0, 32}, { 0, 2},{ 0, 33},{ 18, 1},{ 6, 1},{ 2, 1},{ 0, 18}, { 2, 1},{ 0, 34},{ 0, 48},{ 4, 1},{ 2, 1},{ 0, 49}, { 0, 19},{ 4, 1},{ 2, 1},{ 0, 3},{ 0, 50},{ 2, 1}, { 0, 35},{ 0, 4},{ 10, 1},{ 4, 1},{ 2, 1},{ 0, 64}, { 0, 65},{ 2, 1},{ 0, 20},{ 2, 1},{ 0, 66},{ 0, 36}, { 12, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 51},{ 0, 67}, { 0, 80},{ 4, 1},{ 2, 1},{ 0, 52},{ 0, 5},{ 0, 81}, { 6, 1},{ 2, 1},{ 0, 21},{ 2, 1},{ 0, 82},{ 0, 37}, { 4, 1},{ 2, 1},{ 0, 68},{ 0, 53},{ 4, 1},{ 2, 1}, { 0, 83},{ 0, 84},{ 2, 1},{ 0, 69},{ 0, 85}}, htd08[ 71][2]={{ 6, 1},{ 2, 1},{ 0, 0},{ 2, 1},{ 0, 16},{ 0, 1}, { 2, 1},{ 0, 17},{ 4, 1},{ 2, 1},{ 0, 33},{ 0, 18}, { 14, 1},{ 4, 1},{ 2, 1},{ 0, 32},{ 0, 2},{ 2, 1}, { 0, 34},{ 4, 1},{ 2, 1},{ 0, 48},{ 0, 3},{ 2, 1}, { 0, 49},{ 0, 19},{ 14, 1},{ 8, 1},{ 4, 1},{ 2, 1}, { 0, 50},{ 0, 35},{ 2, 1},{ 0, 64},{ 0, 4},{ 2, 1}, { 0, 65},{ 2, 1},{ 0, 20},{ 0, 66},{ 12, 1},{ 6, 1}, { 2, 1},{ 0, 36},{ 2, 1},{ 0, 51},{ 0, 80},{ 4, 1}, { 2, 1},{ 0, 67},{ 0, 52},{ 0, 81},{ 6, 1},{ 2, 1}, { 0, 21},{ 2, 1},{ 0, 5},{ 0, 82},{ 6, 1},{ 2, 1}, { 0, 37},{ 2, 1},{ 0, 68},{ 0, 53},{ 2, 1},{ 0, 83}, { 2, 1},{ 0, 69},{ 2, 1},{ 0, 84},{ 0, 85}}, htd09[ 71][2]={{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 0},{ 0, 16},{ 2, 1}, { 0, 1},{ 0, 17},{ 10, 1},{ 4, 1},{ 2, 1},{ 0, 32}, { 0, 33},{ 2, 1},{ 0, 18},{ 2, 1},{ 0, 2},{ 0, 34}, { 12, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 48},{ 0, 3}, { 0, 49},{ 2, 1},{ 0, 19},{ 2, 1},{ 0, 50},{ 0, 35}, { 12, 1},{ 4, 1},{ 2, 1},{ 0, 65},{ 0, 20},{ 4, 1}, { 2, 1},{ 0, 64},{ 0, 51},{ 2, 1},{ 0, 66},{ 0, 36}, { 10, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 4},{ 0, 80}, { 0, 67},{ 2, 1},{ 0, 52},{ 0, 81},{ 8, 1},{ 4, 1}, { 2, 1},{ 0, 21},{ 0, 82},{ 2, 1},{ 0, 37},{ 0, 68}, { 6, 1},{ 4, 1},{ 2, 1},{ 0, 5},{ 0, 84},{ 0, 83}, { 2, 1},{ 0, 53},{ 2, 1},{ 0, 69},{ 0, 85}}, htd10[127][2]={{ 2, 1},{ 0, 0},{ 4, 1},{ 2, 1},{ 0, 16},{ 0, 1}, { 10, 1},{ 2, 1},{ 0, 17},{ 4, 1},{ 2, 1},{ 0, 32}, { 0, 2},{ 2, 1},{ 0, 33},{ 0, 18},{ 28, 1},{ 8, 1}, { 4, 1},{ 2, 1},{ 0, 34},{ 0, 48},{ 2, 1},{ 0, 49}, { 0, 19},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 3},{ 0, 50}, { 2, 1},{ 0, 35},{ 0, 64},{ 4, 1},{ 2, 1},{ 0, 65}, { 0, 20},{ 4, 1},{ 2, 1},{ 0, 4},{ 0, 51},{ 2, 1}, { 0, 66},{ 0, 36},{ 28, 1},{ 10, 1},{ 6, 1},{ 4, 1}, { 2, 1},{ 0, 80},{ 0, 5},{ 0, 96},{ 2, 1},{ 0, 97}, { 0, 22},{ 12, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 67}, { 0, 52},{ 0, 81},{ 2, 1},{ 0, 21},{ 2, 1},{ 0, 82}, { 0, 37},{ 4, 1},{ 2, 1},{ 0, 38},{ 0, 54},{ 0,113}, { 20, 1},{ 8, 1},{ 2, 1},{ 0, 23},{ 4, 1},{ 2, 1}, { 0, 68},{ 0, 83},{ 0, 6},{ 6, 1},{ 4, 1},{ 2, 1}, { 0, 53},{ 0, 69},{ 0, 98},{ 2, 1},{ 0,112},{ 2, 1}, { 0, 7},{ 0,100},{ 14, 1},{ 4, 1},{ 2, 1},{ 0,114}, { 0, 39},{ 6, 1},{ 2, 1},{ 0, 99},{ 2, 1},{ 0, 84}, { 0, 85},{ 2, 1},{ 0, 70},{ 0,115},{ 8, 1},{ 4, 1}, { 2, 1},{ 0, 55},{ 0,101},{ 2, 1},{ 0, 86},{ 0,116}, { 6, 1},{ 2, 1},{ 0, 71},{ 2, 1},{ 0,102},{ 0,117}, { 4, 1},{ 2, 1},{ 0, 87},{ 0,118},{ 2, 1},{ 0,103}, { 0,119}}, htd11[127][2]={{ 6, 1},{ 2, 1},{ 0, 0},{ 2, 1},{ 0, 16},{ 0, 1}, { 8, 1},{ 2, 1},{ 0, 17},{ 4, 1},{ 2, 1},{ 0, 32}, { 0, 2},{ 0, 18},{ 24, 1},{ 8, 1},{ 2, 1},{ 0, 33}, { 2, 1},{ 0, 34},{ 2, 1},{ 0, 48},{ 0, 3},{ 4, 1}, { 2, 1},{ 0, 49},{ 0, 19},{ 4, 1},{ 2, 1},{ 0, 50}, { 0, 35},{ 4, 1},{ 2, 1},{ 0, 64},{ 0, 4},{ 2, 1}, { 0, 65},{ 0, 20},{ 30, 1},{ 16, 1},{ 10, 1},{ 4, 1}, { 2, 1},{ 0, 66},{ 0, 36},{ 4, 1},{ 2, 1},{ 0, 51}, { 0, 67},{ 0, 80},{ 4, 1},{ 2, 1},{ 0, 52},{ 0, 81}, { 0, 97},{ 6, 1},{ 2, 1},{ 0, 22},{ 2, 1},{ 0, 6}, { 0, 38},{ 2, 1},{ 0, 98},{ 2, 1},{ 0, 21},{ 2, 1}, { 0, 5},{ 0, 82},{ 16, 1},{ 10, 1},{ 6, 1},{ 4, 1}, { 2, 1},{ 0, 37},{ 0, 68},{ 0, 96},{ 2, 1},{ 0, 99}, { 0, 54},{ 4, 1},{ 2, 1},{ 0,112},{ 0, 23},{ 0,113}, { 16, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 7},{ 0,100}, { 0,114},{ 2, 1},{ 0, 39},{ 4, 1},{ 2, 1},{ 0, 83}, { 0, 53},{ 2, 1},{ 0, 84},{ 0, 69},{ 10, 1},{ 4, 1}, { 2, 1},{ 0, 70},{ 0,115},{ 2, 1},{ 0, 55},{ 2, 1}, { 0,101},{ 0, 86},{ 10, 1},{ 6, 1},{ 4, 1},{ 2, 1}, { 0, 85},{ 0, 87},{ 0,116},{ 2, 1},{ 0, 71},{ 0,102}, { 4, 1},{ 2, 1},{ 0,117},{ 0,118},{ 2, 1},{ 0,103}, { 0,119}}, htd12[127][2]={{ 12, 1},{ 4, 1},{ 2, 1},{ 0, 16},{ 0, 1},{ 2, 1}, { 0, 17},{ 2, 1},{ 0, 0},{ 2, 1},{ 0, 32},{ 0, 2}, { 16, 1},{ 4, 1},{ 2, 1},{ 0, 33},{ 0, 18},{ 4, 1}, { 2, 1},{ 0, 34},{ 0, 49},{ 2, 1},{ 0, 19},{ 2, 1}, { 0, 48},{ 2, 1},{ 0, 3},{ 0, 64},{ 26, 1},{ 8, 1}, { 4, 1},{ 2, 1},{ 0, 50},{ 0, 35},{ 2, 1},{ 0, 65}, { 0, 51},{ 10, 1},{ 4, 1},{ 2, 1},{ 0, 20},{ 0, 66}, { 2, 1},{ 0, 36},{ 2, 1},{ 0, 4},{ 0, 80},{ 4, 1}, { 2, 1},{ 0, 67},{ 0, 52},{ 2, 1},{ 0, 81},{ 0, 21}, { 28, 1},{ 14, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 82}, { 0, 37},{ 2, 1},{ 0, 83},{ 0, 53},{ 4, 1},{ 2, 1}, { 0, 96},{ 0, 22},{ 0, 97},{ 4, 1},{ 2, 1},{ 0, 98}, { 0, 38},{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 5},{ 0, 6}, { 0, 68},{ 2, 1},{ 0, 84},{ 0, 69},{ 18, 1},{ 10, 1}, { 4, 1},{ 2, 1},{ 0, 99},{ 0, 54},{ 4, 1},{ 2, 1}, { 0,112},{ 0, 7},{ 0,113},{ 4, 1},{ 2, 1},{ 0, 23}, { 0,100},{ 2, 1},{ 0, 70},{ 0,114},{ 10, 1},{ 6, 1}, { 2, 1},{ 0, 39},{ 2, 1},{ 0, 85},{ 0,115},{ 2, 1}, { 0, 55},{ 0, 86},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,101}, { 0,116},{ 2, 1},{ 0, 71},{ 0,102},{ 4, 1},{ 2, 1}, { 0,117},{ 0, 87},{ 2, 1},{ 0,118},{ 2, 1},{ 0,103}, { 0,119}}, htd13[511][2]={{ 2, 1},{ 0, 0},{ 6, 1},{ 2, 1},{ 0, 16},{ 2, 1}, { 0, 1},{ 0, 17},{ 28, 1},{ 8, 1},{ 4, 1},{ 2, 1}, { 0, 32},{ 0, 2},{ 2, 1},{ 0, 33},{ 0, 18},{ 8, 1}, { 4, 1},{ 2, 1},{ 0, 34},{ 0, 48},{ 2, 1},{ 0, 3}, { 0, 49},{ 6, 1},{ 2, 1},{ 0, 19},{ 2, 1},{ 0, 50}, { 0, 35},{ 4, 1},{ 2, 1},{ 0, 64},{ 0, 4},{ 0, 65}, { 70, 1},{ 28, 1},{ 14, 1},{ 6, 1},{ 2, 1},{ 0, 20}, { 2, 1},{ 0, 51},{ 0, 66},{ 4, 1},{ 2, 1},{ 0, 36}, { 0, 80},{ 2, 1},{ 0, 67},{ 0, 52},{ 4, 1},{ 2, 1}, { 0, 81},{ 0, 21},{ 4, 1},{ 2, 1},{ 0, 5},{ 0, 82}, // 60 { 2, 1},{ 0, 37},{ 2, 1},{ 0, 68},{ 0, 83},{ 14, 1}, { 8, 1},{ 4, 1},{ 2, 1},{ 0, 96},{ 0, 6},{ 2, 1}, { 0, 97},{ 0, 22},{ 4, 1},{ 2, 1},{ 0,128},{ 0, 8}, { 0,129},{ 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 53}, { 0, 98},{ 2, 1},{ 0, 38},{ 0, 84},{ 4, 1},{ 2, 1}, { 0, 69},{ 0, 99},{ 2, 1},{ 0, 54},{ 0,112},{ 6, 1}, { 4, 1},{ 2, 1},{ 0, 7},{ 0, 85},{ 0,113},{ 2, 1}, { 0, 23},{ 2, 1},{ 0, 39},{ 0, 55},{ 72, 1},{ 24, 1}, { 12, 1},{ 4, 1},{ 2, 1},{ 0, 24},{ 0,130},{ 2, 1}, { 0, 40},{ 4, 1},{ 2, 1},{ 0,100},{ 0, 70},{ 0,114}, // 120 { 8, 1},{ 4, 1},{ 2, 1},{ 0,132},{ 0, 72},{ 2, 1}, { 0,144},{ 0, 9},{ 2, 1},{ 0,145},{ 0, 25},{ 24, 1}, { 14, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,115},{ 0,101}, { 2, 1},{ 0, 86},{ 0,116},{ 4, 1},{ 2, 1},{ 0, 71}, { 0,102},{ 0,131},{ 6, 1},{ 2, 1},{ 0, 56},{ 2, 1}, { 0,117},{ 0, 87},{ 2, 1},{ 0,146},{ 0, 41},{ 14, 1}, { 8, 1},{ 4, 1},{ 2, 1},{ 0,103},{ 0,133},{ 2, 1}, { 0, 88},{ 0, 57},{ 2, 1},{ 0,147},{ 2, 1},{ 0, 73}, { 0,134},{ 6, 1},{ 2, 1},{ 0,160},{ 2, 1},{ 0,104}, { 0, 10},{ 2, 1},{ 0,161},{ 0, 26},{ 68, 1},{ 24, 1}, // 180 { 12, 1},{ 4, 1},{ 2, 1},{ 0,162},{ 0, 42},{ 4, 1}, { 2, 1},{ 0,149},{ 0, 89},{ 2, 1},{ 0,163},{ 0, 58}, { 8, 1},{ 4, 1},{ 2, 1},{ 0, 74},{ 0,150},{ 2, 1}, { 0,176},{ 0, 11},{ 2, 1},{ 0,177},{ 0, 27},{ 20, 1}, { 8, 1},{ 2, 1},{ 0,178},{ 4, 1},{ 2, 1},{ 0,118}, { 0,119},{ 0,148},{ 6, 1},{ 4, 1},{ 2, 1},{ 0,135}, { 0,120},{ 0,164},{ 4, 1},{ 2, 1},{ 0,105},{ 0,165}, { 0, 43},{ 12, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 90}, { 0,136},{ 0,179},{ 2, 1},{ 0, 59},{ 2, 1},{ 0,121}, { 0,166},{ 6, 1},{ 4, 1},{ 2, 1},{ 0,106},{ 0,180}, // 240 { 0,192},{ 4, 1},{ 2, 1},{ 0, 12},{ 0,152},{ 0,193}, { 60, 1},{ 22, 1},{ 10, 1},{ 6, 1},{ 2, 1},{ 0, 28}, { 2, 1},{ 0,137},{ 0,181},{ 2, 1},{ 0, 91},{ 0,194}, { 4, 1},{ 2, 1},{ 0, 44},{ 0, 60},{ 4, 1},{ 2, 1}, { 0,182},{ 0,107},{ 2, 1},{ 0,196},{ 0, 76},{ 16, 1}, { 8, 1},{ 4, 1},{ 2, 1},{ 0,168},{ 0,138},{ 2, 1}, { 0,208},{ 0, 13},{ 2, 1},{ 0,209},{ 2, 1},{ 0, 75}, { 2, 1},{ 0,151},{ 0,167},{ 12, 1},{ 6, 1},{ 2, 1}, { 0,195},{ 2, 1},{ 0,122},{ 0,153},{ 4, 1},{ 2, 1}, { 0,197},{ 0, 92},{ 0,183},{ 4, 1},{ 2, 1},{ 0, 29}, // 300 { 0,210},{ 2, 1},{ 0, 45},{ 2, 1},{ 0,123},{ 0,211}, { 52, 1},{ 28, 1},{ 12, 1},{ 4, 1},{ 2, 1},{ 0, 61}, { 0,198},{ 4, 1},{ 2, 1},{ 0,108},{ 0,169},{ 2, 1}, { 0,154},{ 0,212},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,184}, { 0,139},{ 2, 1},{ 0, 77},{ 0,199},{ 4, 1},{ 2, 1}, { 0,124},{ 0,213},{ 2, 1},{ 0, 93},{ 0,224},{ 10, 1}, { 4, 1},{ 2, 1},{ 0,225},{ 0, 30},{ 4, 1},{ 2, 1}, { 0, 14},{ 0, 46},{ 0,226},{ 8, 1},{ 4, 1},{ 2, 1}, { 0,227},{ 0,109},{ 2, 1},{ 0,140},{ 0,228},{ 4, 1}, { 2, 1},{ 0,229},{ 0,186},{ 0,240},{ 38, 1},{ 16, 1}, // 360 { 4, 1},{ 2, 1},{ 0,241},{ 0, 31},{ 6, 1},{ 4, 1}, { 2, 1},{ 0,170},{ 0,155},{ 0,185},{ 2, 1},{ 0, 62}, { 2, 1},{ 0,214},{ 0,200},{ 12, 1},{ 6, 1},{ 2, 1}, { 0, 78},{ 2, 1},{ 0,215},{ 0,125},{ 2, 1},{ 0,171}, { 2, 1},{ 0, 94},{ 0,201},{ 6, 1},{ 2, 1},{ 0, 15}, { 2, 1},{ 0,156},{ 0,110},{ 2, 1},{ 0,242},{ 0, 47}, { 32, 1},{ 16, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0,216}, { 0,141},{ 0, 63},{ 6, 1},{ 2, 1},{ 0,243},{ 2, 1}, { 0,230},{ 0,202},{ 2, 1},{ 0,244},{ 0, 79},{ 8, 1}, { 4, 1},{ 2, 1},{ 0,187},{ 0,172},{ 2, 1},{ 0,231}, // 420 { 0,245},{ 4, 1},{ 2, 1},{ 0,217},{ 0,157},{ 2, 1}, { 0, 95},{ 0,232},{ 30, 1},{ 12, 1},{ 6, 1},{ 2, 1}, { 0,111},{ 2, 1},{ 0,246},{ 0,203},{ 4, 1},{ 2, 1}, { 0,188},{ 0,173},{ 0,218},{ 8, 1},{ 2, 1},{ 0,247}, { 4, 1},{ 2, 1},{ 0,126},{ 0,127},{ 0,142},{ 6, 1}, { 4, 1},{ 2, 1},{ 0,158},{ 0,174},{ 0,204},{ 2, 1}, { 0,248},{ 0,143},{ 18, 1},{ 8, 1},{ 4, 1},{ 2, 1}, { 0,219},{ 0,189},{ 2, 1},{ 0,234},{ 0,249},{ 4, 1}, { 2, 1},{ 0,159},{ 0,235},{ 2, 1},{ 0,190},{ 2, 1}, { 0,205},{ 0,250},{ 14, 1},{ 4, 1},{ 2, 1},{ 0,221}, // 480 { 0,236},{ 6, 1},{ 4, 1},{ 2, 1},{ 0,233},{ 0,175}, { 0,220},{ 2, 1},{ 0,206},{ 0,251},{ 8, 1},{ 4, 1}, { 2, 1},{ 0,191},{ 0,222},{ 2, 1},{ 0,207},{ 0,238}, { 4, 1},{ 2, 1},{ 0,223},{ 0,239},{ 2, 1},{ 0,255}, { 2, 1},{ 0,237},{ 2, 1},{ 0,253},{ 2, 1},{ 0,252}, { 0,254}}, htd15[511][2]={{ 16, 1},{ 6, 1},{ 2, 1},{ 0, 0},{ 2, 1},{ 0, 16}, { 0, 1},{ 2, 1},{ 0, 17},{ 4, 1},{ 2, 1},{ 0, 32}, { 0, 2},{ 2, 1},{ 0, 33},{ 0, 18},{ 50, 1},{ 16, 1}, { 6, 1},{ 2, 1},{ 0, 34},{ 2, 1},{ 0, 48},{ 0, 49}, { 6, 1},{ 2, 1},{ 0, 19},{ 2, 1},{ 0, 3},{ 0, 64}, { 2, 1},{ 0, 50},{ 0, 35},{ 14, 1},{ 6, 1},{ 4, 1}, { 2, 1},{ 0, 4},{ 0, 20},{ 0, 65},{ 4, 1},{ 2, 1}, { 0, 51},{ 0, 66},{ 2, 1},{ 0, 36},{ 0, 67},{ 10, 1}, { 6, 1},{ 2, 1},{ 0, 52},{ 2, 1},{ 0, 80},{ 0, 5}, { 2, 1},{ 0, 81},{ 0, 21},{ 4, 1},{ 2, 1},{ 0, 82}, // 60 { 0, 37},{ 4, 1},{ 2, 1},{ 0, 68},{ 0, 83},{ 0, 97}, { 90, 1},{ 36, 1},{ 18, 1},{ 10, 1},{ 6, 1},{ 2, 1}, { 0, 53},{ 2, 1},{ 0, 96},{ 0, 6},{ 2, 1},{ 0, 22}, { 0, 98},{ 4, 1},{ 2, 1},{ 0, 38},{ 0, 84},{ 2, 1}, { 0, 69},{ 0, 99},{ 10, 1},{ 6, 1},{ 2, 1},{ 0, 54}, { 2, 1},{ 0,112},{ 0, 7},{ 2, 1},{ 0,113},{ 0, 85}, { 4, 1},{ 2, 1},{ 0, 23},{ 0,100},{ 2, 1},{ 0,114}, { 0, 39},{ 24, 1},{ 16, 1},{ 8, 1},{ 4, 1},{ 2, 1}, { 0, 70},{ 0,115},{ 2, 1},{ 0, 55},{ 0,101},{ 4, 1}, { 2, 1},{ 0, 86},{ 0,128},{ 2, 1},{ 0, 8},{ 0,116}, // 120 { 4, 1},{ 2, 1},{ 0,129},{ 0, 24},{ 2, 1},{ 0,130}, { 0, 40},{ 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 71}, { 0,102},{ 2, 1},{ 0,131},{ 0, 56},{ 4, 1},{ 2, 1}, { 0,117},{ 0, 87},{ 2, 1},{ 0,132},{ 0, 72},{ 6, 1}, { 4, 1},{ 2, 1},{ 0,144},{ 0, 25},{ 0,145},{ 4, 1}, { 2, 1},{ 0,146},{ 0,118},{ 2, 1},{ 0,103},{ 0, 41}, { 92, 1},{ 36, 1},{ 18, 1},{ 10, 1},{ 4, 1},{ 2, 1}, { 0,133},{ 0, 88},{ 4, 1},{ 2, 1},{ 0, 9},{ 0,119}, { 0,147},{ 4, 1},{ 2, 1},{ 0, 57},{ 0,148},{ 2, 1}, { 0, 73},{ 0,134},{ 10, 1},{ 6, 1},{ 2, 1},{ 0,104}, // 180 { 2, 1},{ 0,160},{ 0, 10},{ 2, 1},{ 0,161},{ 0, 26}, { 4, 1},{ 2, 1},{ 0,162},{ 0, 42},{ 2, 1},{ 0,149}, { 0, 89},{ 26, 1},{ 14, 1},{ 6, 1},{ 2, 1},{ 0,163}, { 2, 1},{ 0, 58},{ 0,135},{ 4, 1},{ 2, 1},{ 0,120}, { 0,164},{ 2, 1},{ 0, 74},{ 0,150},{ 6, 1},{ 4, 1}, { 2, 1},{ 0,105},{ 0,176},{ 0,177},{ 4, 1},{ 2, 1}, { 0, 27},{ 0,165},{ 0,178},{ 14, 1},{ 8, 1},{ 4, 1}, { 2, 1},{ 0, 90},{ 0, 43},{ 2, 1},{ 0,136},{ 0,151}, { 2, 1},{ 0,179},{ 2, 1},{ 0,121},{ 0, 59},{ 8, 1}, { 4, 1},{ 2, 1},{ 0,106},{ 0,180},{ 2, 1},{ 0, 75}, // 240 { 0,193},{ 4, 1},{ 2, 1},{ 0,152},{ 0,137},{ 2, 1}, { 0, 28},{ 0,181},{ 80, 1},{ 34, 1},{ 16, 1},{ 6, 1}, { 4, 1},{ 2, 1},{ 0, 91},{ 0, 44},{ 0,194},{ 6, 1}, { 4, 1},{ 2, 1},{ 0, 11},{ 0,192},{ 0,166},{ 2, 1}, { 0,167},{ 0,122},{ 10, 1},{ 4, 1},{ 2, 1},{ 0,195}, { 0, 60},{ 4, 1},{ 2, 1},{ 0, 12},{ 0,153},{ 0,182}, { 4, 1},{ 2, 1},{ 0,107},{ 0,196},{ 2, 1},{ 0, 76}, { 0,168},{ 20, 1},{ 10, 1},{ 4, 1},{ 2, 1},{ 0,138}, { 0,197},{ 4, 1},{ 2, 1},{ 0,208},{ 0, 92},{ 0,209}, { 4, 1},{ 2, 1},{ 0,183},{ 0,123},{ 2, 1},{ 0, 29}, // 300 { 2, 1},{ 0, 13},{ 0, 45},{ 12, 1},{ 4, 1},{ 2, 1}, { 0,210},{ 0,211},{ 4, 1},{ 2, 1},{ 0, 61},{ 0,198}, { 2, 1},{ 0,108},{ 0,169},{ 6, 1},{ 4, 1},{ 2, 1}, { 0,154},{ 0,184},{ 0,212},{ 4, 1},{ 2, 1},{ 0,139}, { 0, 77},{ 2, 1},{ 0,199},{ 0,124},{ 68, 1},{ 34, 1}, { 18, 1},{ 10, 1},{ 4, 1},{ 2, 1},{ 0,213},{ 0, 93}, { 4, 1},{ 2, 1},{ 0,224},{ 0, 14},{ 0,225},{ 4, 1}, { 2, 1},{ 0, 30},{ 0,226},{ 2, 1},{ 0,170},{ 0, 46}, { 8, 1},{ 4, 1},{ 2, 1},{ 0,185},{ 0,155},{ 2, 1}, { 0,227},{ 0,214},{ 4, 1},{ 2, 1},{ 0,109},{ 0, 62}, // 360 { 2, 1},{ 0,200},{ 0,140},{ 16, 1},{ 8, 1},{ 4, 1}, { 2, 1},{ 0,228},{ 0, 78},{ 2, 1},{ 0,215},{ 0,125}, { 4, 1},{ 2, 1},{ 0,229},{ 0,186},{ 2, 1},{ 0,171}, { 0, 94},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,201},{ 0,156}, { 2, 1},{ 0,241},{ 0, 31},{ 6, 1},{ 4, 1},{ 2, 1}, { 0,240},{ 0,110},{ 0,242},{ 2, 1},{ 0, 47},{ 0,230}, { 38, 1},{ 18, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,216}, { 0,243},{ 2, 1},{ 0, 63},{ 0,244},{ 6, 1},{ 2, 1}, { 0, 79},{ 2, 1},{ 0,141},{ 0,217},{ 2, 1},{ 0,187}, { 0,202},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,172},{ 0,231}, // 420 { 2, 1},{ 0,126},{ 0,245},{ 8, 1},{ 4, 1},{ 2, 1}, { 0,157},{ 0, 95},{ 2, 1},{ 0,232},{ 0,142},{ 2, 1}, { 0,246},{ 0,203},{ 34, 1},{ 18, 1},{ 10, 1},{ 6, 1}, { 4, 1},{ 2, 1},{ 0, 15},{ 0,174},{ 0,111},{ 2, 1}, { 0,188},{ 0,218},{ 4, 1},{ 2, 1},{ 0,173},{ 0,247}, { 2, 1},{ 0,127},{ 0,233},{ 8, 1},{ 4, 1},{ 2, 1}, { 0,158},{ 0,204},{ 2, 1},{ 0,248},{ 0,143},{ 4, 1}, { 2, 1},{ 0,219},{ 0,189},{ 2, 1},{ 0,234},{ 0,249}, { 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,159},{ 0,220}, { 2, 1},{ 0,205},{ 0,235},{ 4, 1},{ 2, 1},{ 0,190}, // 480 { 0,250},{ 2, 1},{ 0,175},{ 0,221},{ 14, 1},{ 6, 1}, { 4, 1},{ 2, 1},{ 0,236},{ 0,206},{ 0,251},{ 4, 1}, { 2, 1},{ 0,191},{ 0,237},{ 2, 1},{ 0,222},{ 0,252}, { 6, 1},{ 4, 1},{ 2, 1},{ 0,207},{ 0,253},{ 0,238}, { 4, 1},{ 2, 1},{ 0,223},{ 0,254},{ 2, 1},{ 0,239}, { 0,255}}, htd16[511][2]={{ 2, 1},{ 0, 0},{ 6, 1},{ 2, 1},{ 0, 16},{ 2, 1}, { 0, 1},{ 0, 17},{ 42, 1},{ 8, 1},{ 4, 1},{ 2, 1}, { 0, 32},{ 0, 2},{ 2, 1},{ 0, 33},{ 0, 18},{ 10, 1}, { 6, 1},{ 2, 1},{ 0, 34},{ 2, 1},{ 0, 48},{ 0, 3}, { 2, 1},{ 0, 49},{ 0, 19},{ 10, 1},{ 4, 1},{ 2, 1}, { 0, 50},{ 0, 35},{ 4, 1},{ 2, 1},{ 0, 64},{ 0, 4}, { 0, 65},{ 6, 1},{ 2, 1},{ 0, 20},{ 2, 1},{ 0, 51}, { 0, 66},{ 4, 1},{ 2, 1},{ 0, 36},{ 0, 80},{ 2, 1}, { 0, 67},{ 0, 52},{138, 1},{ 40, 1},{ 16, 1},{ 6, 1}, { 4, 1},{ 2, 1},{ 0, 5},{ 0, 21},{ 0, 81},{ 4, 1}, // 60 { 2, 1},{ 0, 82},{ 0, 37},{ 4, 1},{ 2, 1},{ 0, 68}, { 0, 53},{ 0, 83},{ 10, 1},{ 6, 1},{ 4, 1},{ 2, 1}, { 0, 96},{ 0, 6},{ 0, 97},{ 2, 1},{ 0, 22},{ 0, 98}, { 8, 1},{ 4, 1},{ 2, 1},{ 0, 38},{ 0, 84},{ 2, 1}, { 0, 69},{ 0, 99},{ 4, 1},{ 2, 1},{ 0, 54},{ 0,112}, { 0,113},{ 40, 1},{ 18, 1},{ 8, 1},{ 2, 1},{ 0, 23}, { 2, 1},{ 0, 7},{ 2, 1},{ 0, 85},{ 0,100},{ 4, 1}, { 2, 1},{ 0,114},{ 0, 39},{ 4, 1},{ 2, 1},{ 0, 70}, { 0,101},{ 0,115},{ 10, 1},{ 6, 1},{ 2, 1},{ 0, 55}, { 2, 1},{ 0, 86},{ 0, 8},{ 2, 1},{ 0,128},{ 0,129}, // 120 { 6, 1},{ 2, 1},{ 0, 24},{ 2, 1},{ 0,116},{ 0, 71}, { 2, 1},{ 0,130},{ 2, 1},{ 0, 40},{ 0,102},{ 24, 1}, { 14, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,131},{ 0, 56}, { 2, 1},{ 0,117},{ 0,132},{ 4, 1},{ 2, 1},{ 0, 72}, { 0,144},{ 0,145},{ 6, 1},{ 2, 1},{ 0, 25},{ 2, 1}, { 0, 9},{ 0,118},{ 2, 1},{ 0,146},{ 0, 41},{ 14, 1}, { 8, 1},{ 4, 1},{ 2, 1},{ 0,133},{ 0, 88},{ 2, 1}, { 0,147},{ 0, 57},{ 4, 1},{ 2, 1},{ 0,160},{ 0, 10}, { 0, 26},{ 8, 1},{ 2, 1},{ 0,162},{ 2, 1},{ 0,103}, { 2, 1},{ 0, 87},{ 0, 73},{ 6, 1},{ 2, 1},{ 0,148}, // 180 { 2, 1},{ 0,119},{ 0,134},{ 2, 1},{ 0,161},{ 2, 1}, { 0,104},{ 0,149},{220, 1},{126, 1},{ 50, 1},{ 26, 1}, { 12, 1},{ 6, 1},{ 2, 1},{ 0, 42},{ 2, 1},{ 0, 89}, { 0, 58},{ 2, 1},{ 0,163},{ 2, 1},{ 0,135},{ 0,120}, { 8, 1},{ 4, 1},{ 2, 1},{ 0,164},{ 0, 74},{ 2, 1}, { 0,150},{ 0,105},{ 4, 1},{ 2, 1},{ 0,176},{ 0, 11}, { 0,177},{ 10, 1},{ 4, 1},{ 2, 1},{ 0, 27},{ 0,178}, { 2, 1},{ 0, 43},{ 2, 1},{ 0,165},{ 0, 90},{ 6, 1}, { 2, 1},{ 0,179},{ 2, 1},{ 0,166},{ 0,106},{ 4, 1}, { 2, 1},{ 0,180},{ 0, 75},{ 2, 1},{ 0, 12},{ 0,193}, // 240 { 30, 1},{ 14, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0,181}, { 0,194},{ 0, 44},{ 4, 1},{ 2, 1},{ 0,167},{ 0,195}, { 2, 1},{ 0,107},{ 0,196},{ 8, 1},{ 2, 1},{ 0, 29}, { 4, 1},{ 2, 1},{ 0,136},{ 0,151},{ 0, 59},{ 4, 1}, { 2, 1},{ 0,209},{ 0,210},{ 2, 1},{ 0, 45},{ 0,211}, { 18, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 30},{ 0, 46}, { 0,226},{ 6, 1},{ 4, 1},{ 2, 1},{ 0,121},{ 0,152}, { 0,192},{ 2, 1},{ 0, 28},{ 2, 1},{ 0,137},{ 0, 91}, { 14, 1},{ 6, 1},{ 2, 1},{ 0, 60},{ 2, 1},{ 0,122}, { 0,182},{ 4, 1},{ 2, 1},{ 0, 76},{ 0,153},{ 2, 1}, // 300 { 0,168},{ 0,138},{ 6, 1},{ 2, 1},{ 0, 13},{ 2, 1}, { 0,197},{ 0, 92},{ 4, 1},{ 2, 1},{ 0, 61},{ 0,198}, { 2, 1},{ 0,108},{ 0,154},{ 88, 1},{ 86, 1},{ 36, 1}, { 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,139},{ 0, 77}, { 2, 1},{ 0,199},{ 0,124},{ 4, 1},{ 2, 1},{ 0,213}, { 0, 93},{ 2, 1},{ 0,224},{ 0, 14},{ 8, 1},{ 2, 1}, { 0,227},{ 4, 1},{ 2, 1},{ 0,208},{ 0,183},{ 0,123}, { 6, 1},{ 4, 1},{ 2, 1},{ 0,169},{ 0,184},{ 0,212}, { 2, 1},{ 0,225},{ 2, 1},{ 0,170},{ 0,185},{ 24, 1}, { 10, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0,155},{ 0,214}, // 360 { 0,109},{ 2, 1},{ 0, 62},{ 0,200},{ 6, 1},{ 4, 1}, { 2, 1},{ 0,140},{ 0,228},{ 0, 78},{ 4, 1},{ 2, 1}, { 0,215},{ 0,229},{ 2, 1},{ 0,186},{ 0,171},{ 12, 1}, { 4, 1},{ 2, 1},{ 0,156},{ 0,230},{ 4, 1},{ 2, 1}, { 0,110},{ 0,216},{ 2, 1},{ 0,141},{ 0,187},{ 8, 1}, { 4, 1},{ 2, 1},{ 0,231},{ 0,157},{ 2, 1},{ 0,232}, { 0,142},{ 4, 1},{ 2, 1},{ 0,203},{ 0,188},{ 0,158}, { 0,241},{ 2, 1},{ 0, 31},{ 2, 1},{ 0, 15},{ 0, 47}, { 66, 1},{ 56, 1},{ 2, 1},{ 0,242},{ 52, 1},{ 50, 1}, { 20, 1},{ 8, 1},{ 2, 1},{ 0,189},{ 2, 1},{ 0, 94}, // 420 { 2, 1},{ 0,125},{ 0,201},{ 6, 1},{ 2, 1},{ 0,202}, { 2, 1},{ 0,172},{ 0,126},{ 4, 1},{ 2, 1},{ 0,218}, { 0,173},{ 0,204},{ 10, 1},{ 6, 1},{ 2, 1},{ 0,174}, { 2, 1},{ 0,219},{ 0,220},{ 2, 1},{ 0,205},{ 0,190}, { 6, 1},{ 4, 1},{ 2, 1},{ 0,235},{ 0,237},{ 0,238}, { 6, 1},{ 4, 1},{ 2, 1},{ 0,217},{ 0,234},{ 0,233}, { 2, 1},{ 0,222},{ 4, 1},{ 2, 1},{ 0,221},{ 0,236}, { 0,206},{ 0, 63},{ 0,240},{ 4, 1},{ 2, 1},{ 0,243}, { 0,244},{ 2, 1},{ 0, 79},{ 2, 1},{ 0,245},{ 0, 95}, { 10, 1},{ 2, 1},{ 0,255},{ 4, 1},{ 2, 1},{ 0,246}, // 480 { 0,111},{ 2, 1},{ 0,247},{ 0,127},{ 12, 1},{ 6, 1}, { 2, 1},{ 0,143},{ 2, 1},{ 0,248},{ 0,249},{ 4, 1}, { 2, 1},{ 0,159},{ 0,250},{ 0,175},{ 8, 1},{ 4, 1}, { 2, 1},{ 0,251},{ 0,191},{ 2, 1},{ 0,252},{ 0,207}, { 4, 1},{ 2, 1},{ 0,253},{ 0,223},{ 2, 1},{ 0,254}, { 0,239}}, htd24[512][2]={{ 60, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 0},{ 0, 16}, { 2, 1},{ 0, 1},{ 0, 17},{ 14, 1},{ 6, 1},{ 4, 1}, { 2, 1},{ 0, 32},{ 0, 2},{ 0, 33},{ 2, 1},{ 0, 18}, { 2, 1},{ 0, 34},{ 2, 1},{ 0, 48},{ 0, 3},{ 14, 1}, { 4, 1},{ 2, 1},{ 0, 49},{ 0, 19},{ 4, 1},{ 2, 1}, { 0, 50},{ 0, 35},{ 4, 1},{ 2, 1},{ 0, 64},{ 0, 4}, { 0, 65},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 20},{ 0, 51}, { 2, 1},{ 0, 66},{ 0, 36},{ 6, 1},{ 4, 1},{ 2, 1}, { 0, 67},{ 0, 52},{ 0, 81},{ 6, 1},{ 4, 1},{ 2, 1}, { 0, 80},{ 0, 5},{ 0, 21},{ 2, 1},{ 0, 82},{ 0, 37}, // 60 {250+85, 1},{ 98, 1},{ 34, 1},{ 18, 1},{ 10, 1},{ 4, 1}, { 2, 1},{ 0, 68},{ 0, 83},{ 2, 1},{ 0, 53},{ 2, 1}, { 0, 96},{ 0, 6},{ 4, 1},{ 2, 1},{ 0, 97},{ 0, 22}, { 2, 1},{ 0, 98},{ 0, 38},{ 8, 1},{ 4, 1},{ 2, 1}, { 0, 84},{ 0, 69},{ 2, 1},{ 0, 99},{ 0, 54},{ 4, 1}, { 2, 1},{ 0,113},{ 0, 85},{ 2, 1},{ 0,100},{ 0, 70}, { 32, 1},{ 14, 1},{ 6, 1},{ 2, 1},{ 0,114},{ 2, 1}, { 0, 39},{ 0, 55},{ 2, 1},{ 0,115},{ 4, 1},{ 2, 1}, { 0,112},{ 0, 7},{ 0, 23},{ 10, 1},{ 4, 1},{ 2, 1}, { 0,101},{ 0, 86},{ 4, 1},{ 2, 1},{ 0,128},{ 0, 8}, // 120 { 0,129},{ 4, 1},{ 2, 1},{ 0,116},{ 0, 71},{ 2, 1}, { 0, 24},{ 0,130},{ 16, 1},{ 8, 1},{ 4, 1},{ 2, 1}, { 0, 40},{ 0,102},{ 2, 1},{ 0,131},{ 0, 56},{ 4, 1}, { 2, 1},{ 0,117},{ 0, 87},{ 2, 1},{ 0,132},{ 0, 72}, { 8, 1},{ 4, 1},{ 2, 1},{ 0,145},{ 0, 25},{ 2, 1}, { 0,146},{ 0,118},{ 4, 1},{ 2, 1},{ 0,103},{ 0, 41}, { 2, 1},{ 0,133},{ 0, 88},{ 92, 1},{ 34, 1},{ 16, 1}, { 8, 1},{ 4, 1},{ 2, 1},{ 0,147},{ 0, 57},{ 2, 1}, { 0,148},{ 0, 73},{ 4, 1},{ 2, 1},{ 0,119},{ 0,134}, { 2, 1},{ 0,104},{ 0,161},{ 8, 1},{ 4, 1},{ 2, 1}, // 180 { 0,162},{ 0, 42},{ 2, 1},{ 0,149},{ 0, 89},{ 4, 1}, { 2, 1},{ 0,163},{ 0, 58},{ 2, 1},{ 0,135},{ 2, 1}, { 0,120},{ 0, 74},{ 22, 1},{ 12, 1},{ 4, 1},{ 2, 1}, { 0,164},{ 0,150},{ 4, 1},{ 2, 1},{ 0,105},{ 0,177}, { 2, 1},{ 0, 27},{ 0,165},{ 6, 1},{ 2, 1},{ 0,178}, { 2, 1},{ 0, 90},{ 0, 43},{ 2, 1},{ 0,136},{ 0,179}, { 16, 1},{ 10, 1},{ 6, 1},{ 2, 1},{ 0,144},{ 2, 1}, { 0, 9},{ 0,160},{ 2, 1},{ 0,151},{ 0,121},{ 4, 1}, { 2, 1},{ 0,166},{ 0,106},{ 0,180},{ 12, 1},{ 6, 1}, { 2, 1},{ 0, 26},{ 2, 1},{ 0, 10},{ 0,176},{ 2, 1}, // 240 { 0, 59},{ 2, 1},{ 0, 11},{ 0,192},{ 4, 1},{ 2, 1}, { 0, 75},{ 0,193},{ 2, 1},{ 0,152},{ 0,137},{ 67, 1}, { 34, 1},{ 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 28}, { 0,181},{ 2, 1},{ 0, 91},{ 0,194},{ 4, 1},{ 2, 1}, { 0, 44},{ 0,167},{ 2, 1},{ 0,122},{ 0,195},{ 10, 1}, { 6, 1},{ 2, 1},{ 0, 60},{ 2, 1},{ 0, 12},{ 0,208}, { 2, 1},{ 0,182},{ 0,107},{ 4, 1},{ 2, 1},{ 0,196}, { 0, 76},{ 2, 1},{ 0,153},{ 0,168},{ 16, 1},{ 8, 1}, { 4, 1},{ 2, 1},{ 0,138},{ 0,197},{ 2, 1},{ 0, 92}, { 0,209},{ 4, 1},{ 2, 1},{ 0,183},{ 0,123},{ 2, 1}, // 300 { 0, 29},{ 0,210},{ 9, 1},{ 4, 1},{ 2, 1},{ 0, 45}, { 0,211},{ 2, 1},{ 0, 61},{ 0,198},{ 85,250},{ 4, 1}, // 306 - { 2, 1},{ 0,108},{ 0,169},{ 2, 1},{ 0,154},{ 0,212}, { 32, 1},{ 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,184}, { 0,139},{ 2, 1},{ 0, 77},{ 0,199},{ 4, 1},{ 2, 1}, { 0,124},{ 0,213},{ 2, 1},{ 0, 93},{ 0,225},{ 8, 1}, { 4, 1},{ 2, 1},{ 0, 30},{ 0,226},{ 2, 1},{ 0,170}, { 0,185},{ 4, 1},{ 2, 1},{ 0,155},{ 0,227},{ 2, 1}, { 0,214},{ 0,109},{ 20, 1},{ 10, 1},{ 6, 1},{ 2, 1}, { 0, 62},{ 2, 1},{ 0, 46},{ 0, 78},{ 2, 1},{ 0,200}, // 360 { 0,140},{ 4, 1},{ 2, 1},{ 0,228},{ 0,215},{ 4, 1}, { 2, 1},{ 0,125},{ 0,171},{ 0,229},{ 10, 1},{ 4, 1}, { 2, 1},{ 0,186},{ 0, 94},{ 2, 1},{ 0,201},{ 2, 1}, { 0,156},{ 0,110},{ 8, 1},{ 2, 1},{ 0,230},{ 2, 1}, { 0, 13},{ 2, 1},{ 0,224},{ 0, 14},{ 4, 1},{ 2, 1}, { 0,216},{ 0,141},{ 2, 1},{ 0,187},{ 0,202},{ 74, 1}, { 2, 1},{ 0,255},{ 64, 1},{ 58, 1},{ 32, 1},{ 16, 1}, { 8, 1},{ 4, 1},{ 2, 1},{ 0,172},{ 0,231},{ 2, 1}, { 0,126},{ 0,217},{ 4, 1},{ 2, 1},{ 0,157},{ 0,232}, { 2, 1},{ 0,142},{ 0,203},{ 8, 1},{ 4, 1},{ 2, 1}, // 420 { 0,188},{ 0,218},{ 2, 1},{ 0,173},{ 0,233},{ 4, 1}, { 2, 1},{ 0,158},{ 0,204},{ 2, 1},{ 0,219},{ 0,189}, { 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,234},{ 0,174}, { 2, 1},{ 0,220},{ 0,205},{ 4, 1},{ 2, 1},{ 0,235}, { 0,190},{ 2, 1},{ 0,221},{ 0,236},{ 8, 1},{ 4, 1}, { 2, 1},{ 0,206},{ 0,237},{ 2, 1},{ 0,222},{ 0,238}, { 0, 15},{ 4, 1},{ 2, 1},{ 0,240},{ 0, 31},{ 0,241}, { 4, 1},{ 2, 1},{ 0,242},{ 0, 47},{ 2, 1},{ 0,243}, { 0, 63},{ 18, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,244}, { 0, 79},{ 2, 1},{ 0,245},{ 0, 95},{ 4, 1},{ 2, 1}, // 480 { 0,246},{ 0,111},{ 2, 1},{ 0,247},{ 2, 1},{ 0,127}, { 0,143},{ 10, 1},{ 4, 1},{ 2, 1},{ 0,248},{ 0,249}, { 4, 1},{ 2, 1},{ 0,159},{ 0,175},{ 0,250},{ 8, 1}, { 4, 1},{ 2, 1},{ 0,251},{ 0,191},{ 2, 1},{ 0,252}, { 0,207},{ 4, 1},{ 2, 1},{ 0,253},{ 0,223},{ 2, 1}, { 0,254},{ 0,239}}, htd32[ 31][2]={{ 2, 1},{ 0, 0},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 8}, { 0, 4},{ 2, 1},{ 0, 1},{ 0, 2},{ 8, 1},{ 4, 1}, { 2, 1},{ 0, 12},{ 0, 10},{ 2, 1},{ 0, 3},{ 0, 6}, { 6, 1},{ 2, 1},{ 0, 9},{ 2, 1},{ 0, 5},{ 0, 7}, { 4, 1},{ 2, 1},{ 0, 14},{ 0, 13},{ 2, 1},{ 0, 15}, { 0, 11}}, htd33[ 31][2]={{ 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 0},{ 0, 1}, { 2, 1},{ 0, 2},{ 0, 3},{ 4, 1},{ 2, 1},{ 0, 4}, { 0, 5},{ 2, 1},{ 0, 6},{ 0, 7},{ 8, 1},{ 4, 1}, { 2, 1},{ 0, 8},{ 0, 9},{ 2, 1},{ 0, 10},{ 0, 11}, { 4, 1},{ 2, 1},{ 0, 12},{ 0, 13},{ 2, 1},{ 0, 14}, { 0, 15}}; const HUFFMANCODETABLE Mpegtoraw::ht[HTN]= { { 0, 0-1, 0-1, 0, 0, htd33}, { 1, 2-1, 2-1, 0, 7,htd01}, { 2, 3-1, 3-1, 0, 17,htd02}, { 3, 3-1, 3-1, 0, 17,htd03}, { 4, 0-1, 0-1, 0, 0, htd33}, { 5, 4-1, 4-1, 0, 31,htd05}, { 6, 4-1, 4-1, 0, 31,htd06}, { 7, 6-1, 6-1, 0, 71,htd07}, { 8, 6-1, 6-1, 0, 71,htd08}, { 9, 6-1, 6-1, 0, 71,htd09}, {10, 8-1, 8-1, 0,127,htd10}, {11, 8-1, 8-1, 0,127,htd11}, {12, 8-1, 8-1, 0,127,htd12}, {13,16-1,16-1, 0,511,htd13}, {14, 0-1, 0-1, 0, 0, htd33}, {15,16-1,16-1, 0,511,htd15}, {16,16-1,16-1, 1,511,htd16}, {17,16-1,16-1, 2,511,htd16}, {18,16-1,16-1, 3,511,htd16}, {19,16-1,16-1, 4,511,htd16}, {20,16-1,16-1, 6,511,htd16}, {21,16-1,16-1, 8,511,htd16}, {22,16-1,16-1,10,511,htd16}, {23,16-1,16-1,13,511,htd16}, {24,16-1,16-1, 4,512,htd24}, {25,16-1,16-1, 5,512,htd24}, {26,16-1,16-1, 6,512,htd24}, {27,16-1,16-1, 7,512,htd24}, {28,16-1,16-1, 8,512,htd24}, {29,16-1,16-1, 9,512,htd24}, {30,16-1,16-1,11,512,htd24}, {31,16-1,16-1,13,512,htd24}, {32, 1-1,16-1, 0, 31,htd32}, {33, 1-1,16-1, 0, 31,htd33} }; splay-0.9.5.2/libs/fileplayer.cc0000644000175000017500000001125607254731610012104 /* MPEG Sound library (C) 1997 by Jung woo-jae */ // Fileplayer.cc // It's an example for how to use MPEG Sound library #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include "mpegsound.h" // File player superclass Fileplayer::Fileplayer() { __errorcode=SOUND_ERROR_OK; player=NULL; }; Fileplayer::~Fileplayer() { delete player; }; // Mpegfileplayer Mpegfileplayer::Mpegfileplayer() { loader=NULL; server=NULL; }; Mpegfileplayer::~Mpegfileplayer() { if(loader)delete loader; if(server)delete server; } bool Mpegfileplayer::openfile(char *filename,char *device) { // Player if(device==NULL){ int fd; device="/dev/sound/dsp"; fd=open(device, O_WRONLY|O_NDELAY); if( fd == -1 ) { device="/dev/dsp"; fd=open(device, O_WRONLY|O_NDELAY); } if ( fd == -1 ) { cerr << "Cannot open /dev/dsp or /dev/sound/dsp!" << endl; return seterrorcode(SOUND_ERROR_DEVOPENFAIL); } close(fd); } if(device[0]=='/')player=new Rawplayer; else { if(device[0]=='-')device=NULL; player=new Rawtofile; } if(player==NULL) return seterrorcode(SOUND_ERROR_MEMORYNOTENOUGH); if(!player->initialize(device)) return seterrorcode(player->geterrorcode()); // Loader { int err; if((loader=Soundinputstream::hopen(filename,&err))==NULL) return seterrorcode(err); } // Server if((server=new Mpegtoraw(loader,player))==NULL) return seterrorcode(SOUND_ERROR_MEMORYNOTENOUGH); // Initialize server server->initialize(filename); return true; } void Mpegfileplayer::setforcetomono(bool flag) { server->setforcetomono(flag); }; void Mpegfileplayer::setdownfrequency(int value) { server->setdownfrequency(value); }; #include char * tominsec(double s) { int min=int(floor(s/60)); double sec=s-60*min; char * buff = new char[15]; sprintf(buff,"%d:%2.2f",min,sec); return buff; } bool Mpegfileplayer::playing(int verbose, bool frameinfo, int startframe) { if(!server->run(-1))return false; // Initialize MPEG Layer 3 if(verbose>0)showverbose(verbose); if (startframe) server->setframe(startframe); int pcmperframe=server->getpcmperframe(); int frequency=server->getfrequency(); int totframes=server->gettotalframe(); double tottime=1.0*totframes*pcmperframe/frequency; if(frameinfo) { cout << "Totalframes " << totframes; cout << "; Totaltime " << tominsec(tottime) << endl; } // Playing int err; while( err) { err = server->run(100); if(frameinfo) { int currframe=server-> getcurrentframe(); double currtime=1.0*currframe*pcmperframe/frequency; cout << "Frame " << currframe << " [" << totframes-currframe << "]; "; cout << "Time " << tominsec(currtime) << " [" ; cout << tominsec(tottime-currtime) << "]" << endl ; } } seterrorcode(server->geterrorcode()); if(seterrorcode(SOUND_ERROR_FINISH))return true; return false; } #ifdef PTHREADEDMPEG bool Mpegfileplayer::playingwiththread(int verbose,bool frameinfo, int framenumbers, int startframe) { if(framenumbers<20)return playing(verbose,frameinfo,startframe); server->makethreadedplayer(framenumbers); if(!server->run(-1))return false; // Initialize MPEG Layer 3 if(verbose>0)showverbose(verbose); if (startframe) server->setframe(startframe); int pcmperframe=server->getpcmperframe(); int frequency=server->getfrequency(); int totframes=server->gettotalframe(); double tottime=1.0*totframes*pcmperframe/frequency; if(frameinfo) { cout << "Totalframes " << totframes; cout << "; Totaltime " << tominsec(tottime) << endl; } // Playing int err; while( err) { err = server->run(100); if(frameinfo) { int currframe=server-> getcurrentframe(); double currtime=1.0*currframe*pcmperframe/frequency; cout << "Frame " << currframe << " [" << totframes-currframe << "]; "; cout << "Time " << tominsec(currtime) << " [" ; cout << tominsec(tottime-currtime) << "]" << endl ; } } server->freethreadedplayer(); seterrorcode(server->geterrorcode()); if(seterrorcode(SOUND_ERROR_FINISH))return true; return false; } #endif void Mpegfileplayer::showverbose(int ) { static char *modestring[4]={"stereo","joint stereo","dual channel","mono"}; fprintf(stderr,"\tMPEG-%d Layer %d, %s,\n\t%dHz%s, %dkbit/s, ", server->getversion()+1, server->getlayer(),modestring[server->getmode()], server->getfrequency(),server->getdownfrequency()?"//2":"", server->getbitrate()); fprintf(stderr,server->getcrccheck() ? "with crc check\n" : "without crc check\n"); } splay-0.9.5.2/libs/mpegsound.h0000644000175000017500000003561507275343712011625 /* MPEG Sound library (C) 1997 by Woo-jae Jung */ // Mpegsound.h // This is typeset for functions in MPEG Sound library. // Now, it's for only linux-pc-?86 /************************************/ /* Inlcude default library packages */ /************************************/ #include #include #include #ifdef PTHREADEDMPEG #ifdef HAVE_PTHREAD_H #include #else #ifdef HAVE_PTHREAD_MIT_PTHREAD_H #include #endif #endif #endif #ifndef _L__SOUND__ #define _L__SOUND__ /****************/ /* Sound Errors */ /****************/ // General error #define SOUND_ERROR_OK 0 #define SOUND_ERROR_FINISH -1 // Device error (for player) #define SOUND_ERROR_DEVOPENFAIL 1 #define SOUND_ERROR_DEVBUSY 2 #define SOUND_ERROR_DEVBADBUFFERSIZE 3 #define SOUND_ERROR_DEVCTRLERROR 4 // Sound file (for reader) #define SOUND_ERROR_FILEOPENFAIL 5 #define SOUND_ERROR_FILEREADFAIL 6 // Network #define SOUND_ERROR_UNKNOWNPROXY 7 #define SOUND_ERROR_UNKNOWNHOST 8 #define SOUND_ERROR_SOCKET 9 #define SOUND_ERROR_CONNECT 10 #define SOUND_ERROR_FDOPEN 11 #define SOUND_ERROR_HTTPFAIL 12 #define SOUND_ERROR_HTTPWRITEFAIL 13 #define SOUND_ERROR_TOOMANYRELOC 14 // Miscellneous (for translater) #define SOUND_ERROR_MEMORYNOTENOUGH 15 #define SOUND_ERROR_EOF 16 #define SOUND_ERROR_BAD 17 #define SOUND_ERROR_THREADFAIL 18 #define SOUND_ERROR_UNKNOWN 19 /**************************/ /* Define values for MPEG */ /**************************/ #define SCALEBLOCK 12 #define CALCBUFFERSIZE 512 #define MAXSUBBAND 32 #define MAXCHANNEL 2 #define MAXTABLE 2 #define SCALE 32768 #define MAXSCALE (SCALE-1) #define MINSCALE (-SCALE) #define RAWDATASIZE (2*2*32*SSLIMIT) #define LS 0 #define RS 1 #define SSLIMIT 18 #define SBLIMIT 32 #define WINDOWSIZE 4096 // Huffmancode #define HTN 34 #define MODE_MONO 0 #define MODE_STEREO 1 /********************/ /* Type definitions */ /********************/ typedef float REAL; typedef struct { bool generalflag; unsigned int part2_3_length; unsigned int big_values; unsigned int global_gain; unsigned int scalefac_compress; unsigned int window_switching_flag; unsigned int block_type; unsigned int mixed_block_flag; unsigned int table_select[3]; unsigned int subblock_gain[3]; unsigned int region0_count; unsigned int region1_count; unsigned int preflag; unsigned int scalefac_scale; unsigned int count1table_select; }layer3grinfo; typedef struct { unsigned main_data_begin; unsigned private_bits; struct { unsigned scfsi[4]; layer3grinfo gr[2]; }ch[2]; }layer3sideinfo; typedef struct { int l[23]; /* [cb] */ int s[3][13]; /* [window][cb] */ }layer3scalefactor; /* [ch] */ typedef struct { int tablename; unsigned int xlen,ylen; unsigned int linbits; unsigned int treelen; const unsigned int (*val)[2]; }HUFFMANCODETABLE; /*********************************/ /* Sound input interface classes */ /*********************************/ // Superclass for Inputbitstream // Yet, Temporary class Soundinputstream { public: Soundinputstream(); virtual ~Soundinputstream(); static Soundinputstream *hopen(char *filename,int *errcode); int geterrorcode(void) {return __errorcode;}; virtual bool open(char *filename) =0; virtual int getbytedirect(void) =0; virtual bool _readbuffer(char *buffer,int size)=0; virtual bool eof(void) =0; virtual int getblock(char *buffer,int size) =0; virtual int getsize(void) =0; virtual int getposition(void) =0; virtual void setposition(int pos) =0; protected: void seterrorcode(int errorcode) {__errorcode=errorcode;}; private: int __errorcode; }; // Inputstream from file class Soundinputstreamfromfile : public Soundinputstream { public: Soundinputstreamfromfile() {fp=NULL;}; ~Soundinputstreamfromfile(); bool open(char *filename); bool _readbuffer(char *buffer,int bytes); int getbytedirect(void); bool eof(void); int getblock(char *buffer,int size); int getsize(void); int getposition(void); void setposition(int pos); private: FILE *fp; int size; }; // Inputstream from http class Soundinputstreamfromhttp : public Soundinputstream { public: Soundinputstreamfromhttp(); ~Soundinputstreamfromhttp(); bool open(char *filename); bool _readbuffer(char *buffer,int bytes); int getbytedirect(void); bool eof(void); int getblock(char *buffer,int size); int getsize(void); int getposition(void); void setposition(int pos); private: FILE *fp; int size; bool writestring(int fd,char *string); bool readstring(char *string,int maxlen,FILE *f); FILE *http_open(char *url); }; /**********************************/ /* Sound player interface classes */ /**********************************/ // Superclass for player class Soundplayer { public: Soundplayer() {__errorcode=SOUND_ERROR_OK;}; virtual ~Soundplayer(); virtual bool initialize(char *filename) =0; virtual void abort(void); virtual int getprocessed(void); virtual bool setsoundtype(int stereo,int samplesize,int speed)=0; virtual bool resetsoundtype(void); virtual bool putblock(void *buffer,int size) =0; virtual int getblocksize(void); int geterrorcode(void) {return __errorcode;}; protected: bool seterrorcode(int errorno) {__errorcode=errorno; return false;}; private: int __errorcode; }; class Rawtofile : public Soundplayer { public: ~Rawtofile(); bool initialize(char *filename); bool setsoundtype(int stereo,int samplesize,int speed); bool putblock(void *buffer,int size); private: int filehandle; int rawstereo,rawsamplesize,rawspeed; }; // Class for playing raw data class Rawplayer : public Soundplayer { public: ~Rawplayer(); bool initialize(char *filename); void abort(void); int getprocessed(void); bool setsoundtype(int stereo,int samplesize,int speed); bool resetsoundtype(void); bool putblock(void *buffer,int size); int getblocksize(void); void setquota(int q){quota=q;}; int getquota(void) {return quota;}; static char *defaultdevice; static int setvolume(int volume); private: short int rawbuffer[RAWDATASIZE]; int rawbuffersize; int audiohandle,audiobuffersize; int rawstereo,rawsamplesize,rawspeed; bool forcetomono,forceto8; int quota; }; /*********************************/ /* Data format converter classes */ /*********************************/ // Class for Mpeg layer3 class Mpegbitwindow { public: Mpegbitwindow(){bitindex=point=0;}; void initialize(void) {bitindex=point=0;}; int gettotalbit(void) const {return bitindex;}; void putbyte(int c) {buffer[point&(WINDOWSIZE-1)]=c;point++;}; void wrap(void); void rewind(int bits) {bitindex-=bits;}; void forward(int bits) {bitindex+=bits;}; int getbit(void); int getbits9(int bits); int getbits(int bits); private: int point,bitindex; char buffer[2*WINDOWSIZE]; }; // Class for converting mpeg format to raw format class Mpegtoraw { /*****************************/ /* Constant tables for layer */ /*****************************/ private: static const int bitrate[2][3][15],frequencies[2][3]; static const REAL scalefactorstable[64]; static const HUFFMANCODETABLE ht[HTN]; static const REAL filter[512]; static REAL hcos_64[16],hcos_32[8],hcos_16[4],hcos_8[2],hcos_4; /*************************/ /* MPEG header variables */ /*************************/ private: int layer,protection,bitrateindex,padding,extendedmode; enum _mpegversion {mpeg1,mpeg2} version; enum _mode {fullstereo,joint,dual,single} mode; enum _frequency {frequency44100,frequency48000,frequency32000} frequency; /*******************************************/ /* Functions getting MPEG header variables */ /*******************************************/ public: // General int getversion(void) const {return version;}; int getlayer(void) const {return layer;}; bool getcrccheck(void) const {return (!protection);}; // Stereo or not int getmode(void) const {return mode;}; bool isstereo(void) const {return (getmode()!=single);}; // Frequency and bitrate int getfrequency(void) const {return frequencies[version][frequency];}; int getbitrate(void) const {return bitrate[version][layer-1][bitrateindex];}; /***************************************/ /* Interface for setting music quality */ /***************************************/ private: bool forcetomonoflag; int downfrequency; public: void setforcetomono(bool flag); void setdownfrequency(int value); /******************************************/ /* Functions getting other MPEG variables */ /******************************************/ public: bool getforcetomono(void); int getdownfrequency(void); int getpcmperframe(void); /******************************/ /* Frame management variables */ /******************************/ private: int currentframe,totalframe; int decodeframe; int *frameoffsets; /******************************/ /* Frame management functions */ /******************************/ public: int getcurrentframe(void) const {return currentframe;}; int gettotalframe(void) const {return totalframe;}; void setframe(int framenumber); /***************************************/ /* Variables made by MPEG-Audio header */ /***************************************/ private: int tableindex,channelbitrate; int stereobound,subbandnumber,inputstereo,outputstereo; REAL scalefactor; int framesize; /*******************/ /* Mpegtoraw class */ /*******************/ public: Mpegtoraw(Soundinputstream *loader,Soundplayer *player); ~Mpegtoraw(); void initialize(char *filename); bool run(int frames); int geterrorcode(void) {return __errorcode;}; void clearbuffer(void); private: int __errorcode; bool seterrorcode(int errorno){__errorcode=errorno;return false;}; /*****************************/ /* Loading MPEG-Audio stream */ /*****************************/ private: Soundinputstream *loader; // Interface union { unsigned char store[4]; unsigned int current; }u; char buffer[4096]; int bitindex; bool fillbuffer(int size){bitindex=0;return loader->_readbuffer(buffer,size);}; void sync(void) {bitindex=(bitindex+7)&0xFFFFFFF8;}; bool issync(void){return (bitindex&7);}; int getbyte(void); int getbits(int bits); int getbits9(int bits); int getbits8(void); int getbit(void); /********************/ /* Global variables */ /********************/ private: int lastfrequency,laststereo; // for Layer3 int layer3slots,layer3framestart,layer3part2start; REAL prevblck[2][2][SBLIMIT][SSLIMIT]; int currentprevblock; layer3sideinfo sideinfo; layer3scalefactor scalefactors[2]; Mpegbitwindow bitwindow; int wgetbit(void); int wgetbits9(int bits); int wgetbits(int bits); /*************************************/ /* Decoding functions for each layer */ /*************************************/ private: bool loadheader(void); // // Subbandsynthesis // REAL calcbufferL[2][CALCBUFFERSIZE],calcbufferR[2][CALCBUFFERSIZE]; int currentcalcbuffer,calcbufferoffset; void computebuffer(REAL *fraction,REAL buffer[2][CALCBUFFERSIZE]); void generatesingle(void); void generate(void); void subbandsynthesis(REAL *fractionL,REAL *fractionR); void computebuffer_2(REAL *fraction,REAL buffer[2][CALCBUFFERSIZE]); void generatesingle_2(void); void generate_2(void); void subbandsynthesis_2(REAL *fractionL,REAL *fractionR); // Extarctor void extractlayer1(void); // MPEG-1 void extractlayer2(void); void extractlayer3(void); void extractlayer3_2(void); // MPEG-2 // Functions for layer 3 void layer3initialize(void); bool layer3getsideinfo(void); bool layer3getsideinfo_2(void); void layer3getscalefactors(int ch,int gr); void layer3getscalefactors_2(int ch); void layer3huffmandecode(int ch,int gr,int out[SBLIMIT][SSLIMIT]); REAL layer3twopow2(int scale,int preflag,int pretab_offset,int l); REAL layer3twopow2_1(int a,int b,int c); void layer3dequantizesample(int ch,int gr,int in[SBLIMIT][SSLIMIT], REAL out[SBLIMIT][SSLIMIT]); void layer3fixtostereo(int gr,REAL in[2][SBLIMIT][SSLIMIT]); void layer3reorderandantialias(int ch,int gr,REAL in[SBLIMIT][SSLIMIT], REAL out[SBLIMIT][SSLIMIT]); void layer3hybrid(int ch,int gr,REAL in[SBLIMIT][SSLIMIT], REAL out[SSLIMIT][SBLIMIT]); void huffmandecoder_1(const HUFFMANCODETABLE *h,int *x,int *y); void huffmandecoder_2(const HUFFMANCODETABLE *h,int *x,int *y,int *v,int *w); /********************/ /* Playing raw data */ /********************/ private: Soundplayer *player; // General playing interface int rawdataoffset; short int rawdata[RAWDATASIZE]; void clearrawdata(void) {rawdataoffset=0;}; void putraw(short int pcm) {rawdata[rawdataoffset++]=pcm;}; void flushrawdata(void); /***************************/ /* Interface for threading */ /***************************/ #ifdef PTHREADEDMPEG private: struct { short int *buffer; int framenumber,frametail; int head,tail; int *sizes; }threadqueue; struct { bool thread; bool quit,done; bool pause; bool criticallock,criticalflag; }threadflags; pthread_t thread; public: void threadedplayer(void); bool makethreadedplayer(int framenumbers); void freethreadedplayer(void); void stopthreadedplayer(void); void pausethreadedplayer(void); void unpausethreadedplayer(void); bool existthread(void); int getframesaved(void); #endif }; /***********************/ /* File player classes */ /***********************/ // Superclass for playing file class Fileplayer { public: Fileplayer(); virtual ~Fileplayer(); int geterrorcode(void) {return __errorcode;}; virtual bool openfile(char *filename,char *device)=0; virtual void setforcetomono(bool flag) =0; virtual bool playing(int verbose,bool frameinfo, int startframe) =0; protected: bool seterrorcode(int errorno){__errorcode=errorno;return false;}; Soundplayer *player; private: int __errorcode; }; // Class for playing MPEG file class Mpegfileplayer : public Fileplayer { public: Mpegfileplayer(); ~Mpegfileplayer(); bool openfile(char *filename,char *device); void setforcetomono(bool flag); void setdownfrequency(int value); bool playing(int verbose, bool frameinfo, int startframe); #if PTHREADEDMPEG bool playingwiththread(int verbose,bool frameinfo,int framenumbers, int startframe); #endif private: Soundinputstream *loader; Mpegtoraw *server; void showverbose(int verbose); }; #endif splay-0.9.5.2/libs/mpegsound_locals.h0000644000175000017500000000220407242756414013147 /* MPEG Sound library (C) 1997 by Jung woo-jae */ // Mpegsound_locals.h // It is used for compiling library #ifndef _L__SOUND_LOCALS__ #define _L__SOUND_LOCALS__ // Inline functions inline int Mpegtoraw::getbyte(void) { int r=(unsigned char)buffer[bitindex>>3]; bitindex+=8; return r; }; inline int Mpegtoraw::getbits9(int bits) { register unsigned short a; #ifndef WORDS_BIGENDIAN { int offset=bitindex>>3; a=(((unsigned char)buffer[offset])<<8) | ((unsigned char)buffer[offset+1]); } #else a=*((unsigned short *)(buffer+((bitindex>>3)))); #endif a<<=(bitindex&7); bitindex+=bits; return (int)((unsigned int)(a>>(16-bits))); }; inline int Mpegtoraw::getbits8(void) { register unsigned short a; #ifndef WORDS_BIGENDIAN { int offset=bitindex>>3; a=(((unsigned char)buffer[offset])<<8) | ((unsigned char)buffer[offset+1]); } #else a=*((unsigned short *)(buffer+((bitindex>>3)))); #endif a<<=(bitindex&7); bitindex+=8; return (int)((unsigned int)(a>>8)); }; inline int Mpegtoraw::getbit(void) { register int r=(buffer[bitindex>>3]>>(7-(bitindex&7)))&1; bitindex++; return r; }; #endif splay-0.9.5.2/apps/0000777000175000017500000000000007275344605007541 5splay-0.9.5.2/apps/Makefile.in0000644000175000017500000002337707275344604011535 # Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : AWK = @AWK@ CC = @CC@ CXX = @CXX@ LN_S = @LN_S@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ VERSION = @VERSION@ XSPLAY = @XSPLAY@ bin_PROGRAMS = splay @XSPLAY@ EXTRA_PROGRAMS = xsplay splay_SOURCES = common.cc splay.cc splay.h xsplay_SOURCES = xsplay.cc functions.cc multipleselect.cc fileselect.cc panel.cc optionpanel.cc moc_multi.cc moc_file.cc moc_panel.cc moc_optionp.cc common.cc noinst_HEADERS = multipleselect.h fileselect.h panel.h optionpanel.h xsplay.h LDADD = ../libs/libmpeg.a INCLUDES = -I../libs -I/usr/include/qt xsplay_LDADD = -lqt $(LDADD) man_MANS = splay.1 xsplay.1 EXTRA_DIST = $(man_MANS) LIBS = @LIBS@ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = PROGRAMS = $(bin_PROGRAMS) DEFS = @DEFS@ -I. -I$(srcdir) CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ xsplay_OBJECTS = xsplay.o functions.o multipleselect.o fileselect.o \ panel.o optionpanel.o moc_multi.o moc_file.o moc_panel.o moc_optionp.o \ common.o xsplay_DEPENDENCIES = ../libs/libmpeg.a xsplay_LDFLAGS = splay_OBJECTS = common.o splay.o splay_LDADD = $(LDADD) splay_DEPENDENCIES = ../libs/libmpeg.a splay_LDFLAGS = CXXFLAGS = @CXXFLAGS@ CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ man1dir = $(mandir)/man1 MANS = $(man_MANS) NROFF = nroff HEADERS = $(noinst_HEADERS) DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP_ENV = --best SOURCES = $(xsplay_SOURCES) $(splay_SOURCES) OBJECTS = $(xsplay_OBJECTS) $(splay_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .cc .o .s $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps apps/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-binPROGRAMS: clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) distclean-binPROGRAMS: maintainer-clean-binPROGRAMS: install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) list='$(bin_PROGRAMS)'; for p in $$list; do \ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ done .c.o: $(COMPILE) -c $< .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core clean-compile: distclean-compile: -rm -f *.tab.c maintainer-clean-compile: xsplay: $(xsplay_OBJECTS) $(xsplay_DEPENDENCIES) @rm -f xsplay $(CXXLINK) $(xsplay_LDFLAGS) $(xsplay_OBJECTS) $(xsplay_LDADD) $(LIBS) splay: $(splay_OBJECTS) $(splay_DEPENDENCIES) @rm -f splay $(CXXLINK) $(splay_LDFLAGS) $(splay_OBJECTS) $(splay_LDADD) $(LIBS) .cc.o: $(CXXCOMPILE) -c $< install-man1: $(mkinstalldirs) $(DESTDIR)$(man1dir) @list='$(man1_MANS)'; \ l2='$(man_MANS)'; for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ done uninstall-man1: @list='$(man1_MANS)'; \ l2='$(man_MANS)'; for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ rm -f $(DESTDIR)$(man1dir)/$$inst; \ done install-man: $(MANS) @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-man1 uninstall-man: @$(NORMAL_UNINSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-man1 tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = apps distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done common.o: common.cc ../libs/mpegsound.h splay.h splay.o: splay.cc ../libs/mpegsound.h splay.h info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-binPROGRAMS install-exec: install-exec-am install-data-am: install-man install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall: uninstall-am all-am: Makefile $(PROGRAMS) $(MANS) $(HEADERS) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1 mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \ mostlyclean-tags mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-binPROGRAMS clean-compile clean-tags clean-generic \ mostlyclean-am clean: clean-am distclean-am: distclean-binPROGRAMS distclean-compile distclean-tags \ distclean-generic clean-am distclean: distclean-am maintainer-clean-am: maintainer-clean-binPROGRAMS \ maintainer-clean-compile maintainer-clean-tags \ maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile install-man1 uninstall-man1 install-man \ uninstall-man tags mostlyclean-tags distclean-tags clean-tags \ maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \ installcheck-am installcheck install-exec-am install-exec \ install-data-am install-data install-am install uninstall-am uninstall \ all-redirect all-am all installdirs mostlyclean-generic \ distclean-generic clean-generic maintainer-clean-generic clean \ mostlyclean distclean maintainer-clean moc_multi.cc : multipleselect.h moc -o moc_multi.cc multipleselect.h moc_file.cc : fileselect.h moc -o moc_file.cc fileselect.h moc_panel.cc : panel.h moc -o moc_panel.cc panel.h moc_optionp.cc : optionpanel.h moc -o moc_optionp.cc optionpanel.h # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: splay-0.9.5.2/apps/Makefile.am0000644000175000017500000000141207244537646011514 bin_PROGRAMS = splay @XSPLAY@ EXTRA_PROGRAMS =xsplay splay_SOURCES = common.cc splay.cc splay.h xsplay_SOURCES = xsplay.cc functions.cc \ multipleselect.cc fileselect.cc panel.cc \ optionpanel.cc \ moc_multi.cc moc_file.cc moc_panel.cc \ moc_optionp.cc common.cc noinst_HEADERS = multipleselect.h fileselect.h \ panel.h optionpanel.h xsplay.h LDADD= ../libs/libmpeg.a INCLUDES = -I../libs -I/usr/include/qt xsplay_LDADD=-lqt $(LDADD) man_MANS = splay.1 xsplay.1 EXTRA_DIST = $(man_MANS) LIBS = @LIBS@ moc_multi.cc : multipleselect.h moc -o moc_multi.cc multipleselect.h moc_file.cc : fileselect.h moc -o moc_file.cc fileselect.h moc_panel.cc : panel.h moc -o moc_panel.cc panel.h moc_optionp.cc : optionpanel.h moc -o moc_optionp.cc optionpanel.h splay-0.9.5.2/apps/xsplay.cc0000644000175000017500000002660507244537647011323 /* Sound Player Copyright (C) 1997 by Woo-jae Jung */ // It's an example of using MPEG Sound library // This is X interface of splay using QT // Now, it require pthread. // But X library and pthread can't work together now... // Then if you want to use xsplay, you must get patched X-library // You can get patched X-library from http://adam.kaist.ac.kr/~jwj95/ // If you don't want to use patched X-library, // you can get splay which is compiled in statically. // Anyone can use MPEG Sound library under GPL #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_LIBID3 #include #include #endif /* HAVE_LIBID3 */ #include #include #include #include #include #include "mpegsound.h" #include "xsplay.h" static struct { bool pause,quit; bool setframeflag; int setframenumber; }music; static struct { bool stop; bool restart; int move,currentrun; pthread_mutex_t movelock; bool errorflag; int errorcode; }musics; char *nullstring=""; char *stopstring="Stop"; char *nonestring="None"; static pthread_mutex_t startuplock; /**********************/ /* Setting music flag */ /**********************/ // internal static void music_move(int value) { pthread_mutex_lock(&musics.movelock); musics.move+=value; pthread_mutex_unlock(&musics.movelock); } inline void music_done(void) { music_move(1); } inline void music_term(void) { music.pause=false; music.quit=true; } // external bool music_isstop(void) { return musics.stop; } bool music_ispause(void) { return music.pause; } void music_restart(void) { musics.restart=true; } void music_stop(void) { musics.stop=true; music_term(); } void music_play(void) { music.pause=false; music.quit=false; musics.stop=false; } void music_pause(void) { music.pause=true; } void music_previous(void) { music_move(-1); music_term(); } void music_next(void) { music_move(1); music_term(); } /*******************/ /* Frame functions */ /*******************/ int getslidernumber(int framenumber,int maxframe) { register unsigned int a; a=MAXFRAMESLIDER*(unsigned int)framenumber; a/=(unsigned int)maxframe; return (int)a; } static int getframenumber(int slidernum,int maxframe) { register unsigned int a; a=(unsigned int)maxframe*(unsigned int)slidernum; a/=(unsigned int)MAXFRAMESLIDER; return (int)a; } static int adjustframe(int slider,int maxframe) { int f,s; if(maxframe==0)return 0; f=getframenumber(slider,maxframe); for(;;) { s=getslidernumber(f,maxframe); if(s>=slider)break; f++; } return f; } //Wrapper to convert null-string to the empty string inline const char * nn(const char* str) { return str?str:""; } /*************************************/ /* Funcitions playing MPEG file */ /*************************************/ static void seterrorcode(int errcode) { musics.errorcode=errcode; musics.errorflag=true; music_done(); } static void xplaympeg(char *filename,Soundinputstream *loader,Rawplayer *player) { Mpegtoraw *server; bool threadflag=(splay_threadnum>=20); int panelupdate=0; int pcmperframe,frequency; int updatedelay; // Server if((server=new Mpegtoraw(loader,player))==NULL) { seterrorcode(SOUND_ERROR_MEMORYNOTENOUGH); return; } server->initialize(filename); server->setforcetomono(splay_forcetomonoflag); server->setdownfrequency(splay_downfrequency); if(threadflag)server->makethreadedplayer(splay_threadnum); #ifdef HAVE_LIBID3 try { const ID3_Tag* mytag = new ID3_Tag(filename); if ( mytag->HasV1Tag() || mytag->HasV2Tag() ) { Setsongname(nn(ID3_GetTitle(mytag))); Setsongmusican(nn(ID3_GetArtist(mytag))); delete mytag; } } catch(ID3_Error &err){ cout << err.GetErrorFile() << " (" << err.GetErrorLine() << "): " << err.GetErrorType() << ": " << err.GetErrorDesc() << endl; } #endif /* HAVE_LIBID3 */ music.quit=music.pause= music.setframeflag=false; if(!server->run(-1)) // Initialize MPEG player { Setcurrentmpegstatus(0,0,0,0,0,0,0,0); if(threadflag)server->freethreadedplayer(); seterrorcode(server->geterrorcode()); Paneldone();delete server; return; } pcmperframe=server->getpcmperframe(); frequency=server->getfrequency(); updatedelay=frequency/pcmperframe/6; if(getquotaflag()) { int q=server->getfrequency()*(server->isstereo()+1); if(!splay_forcetomonoflag)q<<=1; q>>=1; player->setquota(1024); } Setcurrentmpegstatus(server->getversion(), server->getlayer(), server->getfrequency(), server->getbitrate(), server->getcrccheck(), server->isstereo(), server->getforcetomono(),server->getdownfrequency()); Unlockframeslider(); for(;;) { if(music.setframeflag) { int a; music.setframeflag=false; panelupdate=updatedelay; a=adjustframe(music.setframenumber, server->gettotalframe()); server->setframe(a); Unlockframeslider(); Setframestatus(server->getcurrentframe(), 0, pcmperframe,frequency); } if(music.pause) // When pause set, { if(threadflag) { server->pausethreadedplayer(); server->setframe(server->getcurrentframe()); } server->clearbuffer(); while(music.pause) if(threadflag && (server->getframesaved()<(splay_threadnum-1))) { server->run(1); panelupdate=updatedelay; } else if(music.setframeflag) { music.setframeflag=false; server->setframe(adjustframe(music.setframenumber, server->gettotalframe())); Setframestatus(server->getcurrentframe(), 0, pcmperframe,frequency); Unlockframeslider(); } else usleep(100); if(music.setframeflag) { panelupdate=-1; music.setframeflag=false; server->setframe(adjustframe(music.setframenumber, server->gettotalframe())); } if(threadflag)server->unpausethreadedplayer(); } if(panelupdate<0) { Setframestatus(server->getcurrentframe(), server->gettotalframe(), pcmperframe,frequency); panelupdate=updatedelay; } else panelupdate--; if(music.quit) { if(threadflag) { server->stopthreadedplayer(); while(server->existthread())usleep(10); } player->abort();player->resetsoundtype(); break; } if(!server->run(5)) { if(!threadflag) { music_done(); break; } if(server->getframesaved()==0) { music_done(); break; } usleep(100); } } if(threadflag) server->freethreadedplayer(); Paneldone();delete server; return; } static char *stripfilename(char *str) { static char songname[30+1]; char *ss; int p=0,s=0; for(;str[p];p++) if(str[p]=='/') { p++; s=p; } ss=str+s; for(p=0;p<30 && ss[p];p++)songname[p]=ss[p]; songname[p]=0; return songname; } #define FRAMESIZE (4096) static void xplayfile(char *filename) { char *device=Rawplayer::defaultdevice; Soundinputstream *loader; Rawplayer *player; // Loader { int err; if((loader=Soundinputstream::hopen(filename,&err))==NULL) { seterrorcode(err); return; } } // Player if(device==NULL)device=Rawplayer::defaultdevice; if(device[0]!='/')device=Rawplayer::defaultdevice; player=new Rawplayer; if(player==NULL) { seterrorcode(SOUND_ERROR_MEMORYNOTENOUGH); return; } if(!player->initialize(device)) { seterrorcode(player->geterrorcode()); return; } xplaympeg(filename,loader,player); Clearcurrentstatus(); // Clean up delete loader; delete player; } /**********/ /* Player */ /**********/ static void xplay() { bool updateflag=true; // Control music_stop and music_move; musics.restart=true; musics.errorflag=false; pthread_mutex_init(&musics.movelock,NULL); for(;;) { if(musics.restart) { if(splay_listsize) { if(splay_shuffleflag) { Paneldone(); shufflelist(); } musics.stop=false; musics.restart=false; musics.currentrun=0; musics.move=0; } else musics.stop=true; updateflag=true; } if(musics.errorflag) { musics.errorflag=false; Displayerror(splay_Sounderrors[musics.errorcode-1]); while(!Msgboxdone())usleep(100); } if(musics.move!=0) { pthread_mutex_lock(&musics.movelock); musics.currentrun+=musics.move; if(musics.currentrun>=splay_listsize) { if(!musics.stop) { if(splay_repeatflag) musics.restart=true; } musics.currentrun=splay_listsize; musics.stop=true; } if(musics.currentrun<0)musics.currentrun=0; musics.move=0; Setcurrentsongnumber(musics.currentrun,splay_listsize); pthread_mutex_unlock(&musics.movelock); updateflag=true; } if(updateflag) { char *str; if(musics.currentrun=0) { switch(c) { #ifdef USE_KOREAN case 'h':{ extern char *hanfontname; hanfontname=optarg; }break; #endif case 'V':printf("x%s %s\n",PACKAGE,VERSION); return 0; case '2':splay_downfrequency = 1;break; case 'e':splay_exitwhendone =true;break; case 'm':splay_forcetomonoflag=true;break; case 'r':splay_repeatflag =true;break; case 's':splay_shuffleflag =true;break; case 'v':splay_verbose++; break; case 'd':splay_devicename=optarg;break; case 'l':if(splay_verbose) fprintf(stderr,"List file : %s\n",optarg); readlist(optarg); break; #ifdef PTHREADEDMPEG case 't': { int a; sscanf(optarg,"%d",&a); splay_threadnum=a; } break; #endif default:fprintf(stderr,"Bad argument.\n"); } } if(splay_listsize==0) // Make list by arguments arglist(argc,argv,optind); return xmain(); } splay-0.9.5.2/apps/functions.cc0000644000175000017500000000154107242756413011773 /* Sound Player Version Copyright (C) 1997 by Woo-jae Jung */ // Functions to support player // Anyone can use MPEG Sound library under GPL #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "xsplay.h" bool splay_exitwhendone=false; /* static bool exitflag=false; bool Getexitwhendone(void) { return exitflag; } void Setexitwhendone(bool flag) { exitflag=flag; } */ static char currentpath[300]={0}; char *Getcurrentpath(void) { if(currentpath[0]==0)return NULL; return currentpath; } void Setcurrentpath(char *path) { strcpy(currentpath,path); } static char currentwildcard[300]={0}; char *Getcurrentwildcard(void) { if(currentwildcard[0]==0) { currentwildcard[0]='*'; currentwildcard[1]=0; } return currentwildcard; } void Setcurrentwildcard(char *wildcard) { strcpy(currentwildcard,wildcard); } splay-0.9.5.2/apps/multipleselect.cc0000644000175000017500000000566407235656077013037 /* Sound Player Copyright (C) 1997 by Jung woo-jae */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "multipleselect.h" MFile::~MFile() { free((void *)str); } MSelect::MSelect(QWidget *parent,const char *name) : QTableView(parent,name) { currentselectnum=1; setFrameStyle(QFrame::WinPanel | QFrame::Sunken); setLineWidth(2); setBackgroundColor(white); setNumCols(1); setNumRows(1); setCellWidth(230); setCellHeight(20); setTableFlags(Tbl_vScrollBar | Tbl_clipCellPainting | Tbl_smoothScrolling); resize(400,200); filelist=new QList; filelist->setAutoDelete(TRUE); Clearfilelist(); Donefilelist(); } MSelect::~MSelect() { delete filelist; } void MSelect::Clearfilelist() { filelist->clear(); listnumber=0; } void MSelect::Appendfilelist(const char *str) { filelist->append(new MFile(str)); listnumber++; } void MSelect::Donefilelist(void) { setNumRows(listnumber); selectednumber=0; currentfileindex=0; } const char* MSelect::Cellstring(int fileindex) { return ((filelist->at(fileindex))->string()); } int MSelect::IsSelected(int fileindex) { return ((filelist->at(fileindex))->IsSelected()); } void MSelect::Select(int fileindex,bool select) { int selectnum=0; if(IsSelected(fileindex))selectednumber--; if(select) { selectnum=currentselectnum++; selectednumber++; } (filelist->at(fileindex))->Select(selectnum); } void MSelect::paintCell(QPainter* p,int fileindex,int) { int w=cellWidth(0); int h=cellHeight(fileindex); int x2=w-1; int y2=h-1; if(fileindex==currentfileindex) { if(hasFocus())p->drawRect(0,0,x2,y2); else { p->setPen(DotLine); p->drawRect(0,0,x2,y2); p->setPen(SolidLine); } } if(IsSelected(fileindex)) { QBrush brush(black); p->fillRect(0+2,0+2,x2-2*2,y2-2*2,brush); p->setPen(white); } else { p->setPen(white); p->drawRect(0+2,0+2,x2-2*2,y2-2*2); p->setPen(black); } p->drawText(0+2,0+2,x2-2*2,y2-2*2,AlignRight,Cellstring(fileindex)); } void MSelect::mousePressEvent(QMouseEvent* e) { int oldfileindex=currentfileindex; QPoint clickedPos=e->pos(); currentfileindex=findRow(clickedPos.y()); if(currentfileindex>=0 && currentfileindexpos(); currentfileindex=findRow(clickedPos.y()); if(currentfileindex>=0 && currentfileindex #include "xsplay.h" #include "fileselect.h" #include FileSelect::FileSelect( QWidget *parent,char *name ) : QDialog(parent,name,TRUE) { setCaption("Open Files"); move(mainwidget_x()+10,mainwidget_y()+10); resize(400,460); setFixedSize(400,460); filter_label=new QLabel("Filter:",this); filter_label->setGeometry(10,10,60,20); filter_ledit=new QLineEdit(this,"filterEdit"); filter_ledit->setGeometry(70,10,width()-70-10,20); filter_ledit->setText(Getcurrentwildcard()); connect(filter_ledit,SIGNAL(returnPressed()),SLOT(filterentered())); { char *path=Getcurrentpath(); if(path)dir=new QDir(path); else dir=new QDir; } currentdirectory_label=new QLabel(this,"Current directory"); currentdirectory_label->setGeometry(10,40,380,20); currentdirectory_label->setAlignment(AlignRight); currentdirectory_label->setText(dir->absPath()); dir_listbox=new QListBox(this); dir_listbox->setGeometry(10,70,100,300); connect(dir_listbox,SIGNAL(selected(int)),SLOT(dirSelected(int)) ); mselect=new MSelect(this); mselect->setGeometry(width()-10-250,70,250,300); connect(mselect,SIGNAL(clicked()),SLOT(MSelectclicked()) ); connect(mselect,SIGNAL(doubleclicked()),SLOT(SelectOk())); ok_button=new QPushButton("Ok",this); ok_button->setGeometry(10,height()-40,50,25 ); connect(ok_button,SIGNAL(clicked()),SLOT(SelectOk())); all_button=new QPushButton( "All", this ); all_button->setGeometry(width()/2-25-5,height()-40, 50,25 ); connect(all_button,SIGNAL(clicked()),SLOT(SelectAll()) ); cancel_button=new QPushButton( "Cancel", this ); cancel_button->setGeometry(width()-50-10,height()-40, 50,25 ); connect(cancel_button,SIGNAL(clicked()),SLOT(reject()) ); selectedfilenumber_label=new QLabel(this,"Selected"); selectedfilenumber_label->setGeometry(width()-120,height()-40-30,100,20); selectedfilenumber_label->setAlignment(AlignRight); readdir(); } FileSelect::~FileSelect() { Setcurrentwildcard((char *)((const char *)filter_ledit->text())); delete filter_label; delete filter_ledit; delete currentdirectory_label; delete dir_listbox; delete mselect; delete selectedfilenumber_label; delete ok_button; delete all_button; delete cancel_button; } void FileSelect::SelectOk() { if(mselect->Getselectedfilenumber()) { int e=mselect->Gettotalfilenumber()-1; int k,currentmin,nextmin=1; music_stop(); killlist(); k=mselect->Getselectedfilenumber(); while(k) { currentmin=nextmin; nextmin=0x7FFFFFFF; for(int i=0;i<=e;i++) { int n=mselect->IsSelected(i); if(n==currentmin) { addlist((const char *)dir->absPath(), (const char *)mselect->Cellstring(i)); k--; } if(n>currentmin) { if(nextmin>n)nextmin=n; } } if(nextmin==0x7FFFFFFF)break; // Avoid halting } music_restart(); if(splay_shuffleflag)shufflelist(); accept(); } } void FileSelect::SelectAll() { int e=mselect->Gettotalfilenumber(); for(int i=0;iSelect(i,true); mselect->update(); update(); } void FileSelect::dirSelected(int index) { if (dir->cd(dir_listbox->text(index)) && dir->isReadable()) { readdir(); currentdirectory_label->setText(dir->absPath()); Setcurrentpath((char *)((const char *)dir->absPath())); } /* else { QMessageBox::message( "Sorry", "Cannot open or read directory." ); d = tmp; }*/ } void FileSelect::MSelectclicked() { sprintf(selectedfilenumber_string, "Selected : %d/%d", mselect->Getselectedfilenumber(),mselect->Gettotalfilenumber()); selectedfilenumber_label->setText(selectedfilenumber_string); } void FileSelect::filterentered() { if(strcmp(filter_ledit->text(),"")==0) filter_ledit->setText("*"); // d.setNameFilter( filterEdit->text() ); readdir(); } void FileSelect::readdir() { const QFileInfoList *filelist=dir->entryInfoList(); QFileInfoListIterator l(*filelist); QFileInfo *inf; QRegExp **regexp; char **expression; int regexpnum=1; { char buffer[300]; const char *str; int p,j,k; str=filter_ledit->text(); if(str[0]==0)filter_ledit->setText("*"); str=filter_ledit->text(); for(p=0;str[p];p++) if(str[p]==':')regexpnum++; regexp=new (QRegExp *)[regexpnum]; expression=new (char *)[regexpnum]; for(p=j=k=0;;p++) { if(str[p]==':' || str[p]==0) { if(j) { buffer[j]=0; expression[k]=strdup(buffer); regexp[k]=new QRegExp(expression[k],TRUE,TRUE); k++; j=0; } else regexpnum--; if(str[p]==0)break; } else buffer[j++]=str[p]; } } dir_listbox->clear(); mselect->Clearfilelist(); for(inf=l.current();inf;inf=++l) { if(inf->isDir()) dir_listbox->insertItem(inf->fileName().data()); else { for(int k=0;kmatch(inf->fileName().data())>=0) mselect->Appendfilelist((inf->fileName().data())); } } } for(int p=0;pDonefilelist(); mselect->update(); MSelectclicked(); update(); } void RunFileSelect(QWidget *widget) { FileSelect fs(widget,"File Select"); fs.exec(); } splay-0.9.5.2/apps/panel.cc0000644000175000017500000003123307242756413011063 /* Sound Player Copyright (C) 1997 by Woo-jae Jung */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "xsplay.h" #include "panel.h" #include #include #include #include #include #include #include Panel *panel; QApplication *mainwidget; static bool errorflag=false; static char *errorstring; #define BOXWIDTH 2 #define FONTSIZE 16 #define LABELHEIGHT 30 #define SONGNAME_X 5 #define SONGNAME_Y 35 #define SONGNAME_WIDTH 200 #define SONGNAME_HEIGHT LABELHEIGHT #define SONGMUSI_X SONGNAME_X #define SONGMUSI_Y (SONGNAME_Y+SONGNAME_HEIGHT) #define SONGMUSI_WIDTH SONGNAME_WIDTH #define SONGMUSI_HEIGHT SONGNAME_HEIGHT #define SONGPATH_X SONGNAME_X #define SONGPATH_Y (SONGMUSI_Y+SONGMUSI_HEIGHT) #define SONGPATH_WIDTH SONGNAME_WIDTH #define SONGPATH_HEIGHT SONGNAME_HEIGHT #define FSTATUS_X SONGPATH_X #define FSTATUS_Y (SONGPATH_Y+FONTSIZE) #define FSTATUS_WIDTH 160 #define FSTATUS_HEIGHT FONTSIZE #define FRAME_X (FSTATUS_X+FSTATUS_WIDTH+10) #define FRAME_Y (FSTATUS_Y+2) #define FRAME_WIDTH (VOL_X-FRAME_X) #define FRAME_HEIGHT 13 #define BUTTON_NUMBER 5 #define BUTTON_WIDTH 30 #define BUTTON_HEIGHT 20 #define BUTTONS_X 5 #define BUTTONS_Y (FSTATUS_Y+FSTATUS_HEIGHT+5) #define BUTTONS_WIDTH (BUTTON_WIDTH*BUTTON_NUMBER) #define SONGNUM_X (BUTTONS_X+BUTTONS_WIDTH+10) #define SONGNUM_Y BUTTONS_Y #define SONGNUM_WIDTH 80 #define SONGNUM_HEIGHT 20 #define STATUS_X (SONGNAME_X+SONGNAME_WIDTH+10) #define STATUS_Y SONGNAME_Y #define STATUS_WIDTH 100 #define STATUS_HEIGHT 40 #define VOL_X (STATUS_X+STATUS_WIDTH+10) #define VOL_Y SONGNAME_Y #define VOL_WIDTH 15 #define VOL_HEIGHT (PANEL_HEIGHT-35) #define PANEL_WIDTH (VOL_X+VOL_WIDTH+20) #define PANEL_HEIGHT (BUTTONS_Y+BUTTON_HEIGHT) Panel::Panel(QWidget *parent,const char *name) : QWidget(parent,name) { resize(PANEL_WIDTH,PANEL_HEIGHT); setFixedSize(PANEL_WIDTH,PANEL_HEIGHT); setCaption(PACKAGE " " VERSION); { menu=new QMenuBar(this,"menu"); QPopupMenu *file=new QPopupMenu; QPopupMenu *option=new QPopupMenu; CHECK_PTR(file); menu->insertItem("&File",file); file->insertItem("Open", this,SLOT(load()), ALT+Key_O); file->insertItem("Open List",this,SLOT(loadlist()),ALT+Key_L); file->insertSeparator(); file->insertItem("Restart" ,this,SLOT(restart()),ALT+Key_R); file->insertSeparator(); file->insertItem("Quit", this,SLOT(quit()), ALT+Key_Q); menu->insertItem("&Option",option); option->insertItem("Setting",this,SLOT(option()), ALT+Key_S); } { currentsong.name.w=new QLabel(this,"name"); currentsong.name.w->setGeometry(SONGNAME_X,SONGNAME_Y, SONGNAME_WIDTH,SONGNAME_HEIGHT); currentsong.name.w->setFrameStyle(QFrame::Box | QFrame::Raised); currentsong.name.w->setLineWidth(BOXWIDTH); currentsong.name.w->setFont(QFont("Times",16,QFont::Bold)); currentsong.name.w->setAlignment(AlignLeft); currentsong.musican.w=new QLabel(this,"musican"); currentsong.musican.w->setGeometry(SONGMUSI_X,SONGMUSI_Y, SONGMUSI_WIDTH,SONGMUSI_HEIGHT); currentsong.musican.w->setFrameStyle(QFrame::Box | QFrame::Raised); currentsong.musican.w->setLineWidth(BOXWIDTH); currentsong.musican.w->setFont(QFont("Times",16,QFont::Bold)); currentsong.musican.w->setAlignment(AlignLeft); currentsong.path.w=new QLabel(this,"path"); currentsong.path.w->setGeometry(SONGPATH_X,SONGPATH_Y, SONGPATH_WIDTH,SONGPATH_HEIGHT); currentsong.path.w->setAlignment(AlignLeft); currentsong.number.w=new QLabel(this,"number"); currentsong.number.w->setGeometry(SONGNUM_X,SONGNUM_Y, SONGNUM_WIDTH,SONGNUM_HEIGHT); currentsong.number.w->setFont(QFont("Times",16,QFont::Bold)); currentsong.number.w->setAlignment(AlignLeft); currentstatus.w=new QLabel(this,"status"); currentstatus.w->setGeometry(STATUS_X,STATUS_Y, STATUS_WIDTH,STATUS_HEIGHT); currentstatus.w->setFont(QFont("Times",10)); currentstatus.w->setAlignment(AlignLeft); framestatus.w=new QLabel(this,"Framestatus"); framestatus.w->setGeometry(FSTATUS_X,FSTATUS_Y, FSTATUS_WIDTH,FSTATUS_HEIGHT); framestatus.w->setFont(QFont("Times",12)); framestatus.w->setAlignment(AlignLeft); } { QPainter p; QPixmap t(30,20); QBrush brush(black); int i; t.fill(backgroundColor()); p.begin(&t); for(i=0;i<=5;i++) { p.drawLine(10,10,25, 5+i); p.drawLine(10,10,25,15-i); } p.fillRect( 8, 3, 2,14,brush); p.fillRect( 4, 3, 2,14,brush); p.end(); previousbutton=new QPushButton("Previous",this); previousbutton->setGeometry(BUTTONS_X+BUTTON_WIDTH*0,BUTTONS_Y, BUTTON_WIDTH,BUTTON_HEIGHT); previousbutton->setPixmap(t); QObject::connect(previousbutton,SIGNAL(clicked()),this,SLOT(previous())); t.fill(backgroundColor()); p.begin(&t); p.fillRect(10,5,10,10,brush); p.end(); stopbutton=new QPushButton("Stop",this); stopbutton->setGeometry(BUTTONS_X+BUTTON_WIDTH*1,BUTTONS_Y, BUTTON_WIDTH,BUTTON_HEIGHT); stopbutton->setPixmap(t); QObject::connect(stopbutton,SIGNAL(clicked()),this,SLOT(stop())); t.fill(backgroundColor()); p.begin(&t); for(i=0;i<=5;i++) { p.drawLine(5, 5+i,25,10); p.drawLine(5,15-i,25,10); } p.end(); playbutton=new QPushButton("Play",this); playbutton->setGeometry(BUTTONS_X+BUTTON_WIDTH*2,BUTTONS_Y, BUTTON_WIDTH,BUTTON_HEIGHT); playbutton->setPixmap(t); QObject::connect(playbutton,SIGNAL(clicked()),this,SLOT(play())); t.fill(backgroundColor()); p.begin(&t); p.fillRect(10,3,3,14,brush); p.fillRect(17,3,3,14,brush); p.end(); pausebutton=new QPushButton("Pause",this); pausebutton->setGeometry(BUTTONS_X+BUTTON_WIDTH*3,BUTTONS_Y, BUTTON_WIDTH,BUTTON_HEIGHT); pausebutton->setPixmap(t); QObject::connect(pausebutton,SIGNAL(clicked()),this,SLOT(pause())); t.fill(backgroundColor()); p.begin(&t); for(i=0;i<=5;i++) { p.drawLine(5, 5+i,20,10); p.drawLine(5,15-i,20,10); } p.fillRect(20, 3, 2,14,brush); p.fillRect(24, 3, 2,14,brush); p.end(); nextbutton=new QPushButton("Previous",this); nextbutton->setGeometry(BUTTONS_X+BUTTON_WIDTH*4,BUTTONS_Y, BUTTON_WIDTH,BUTTON_HEIGHT); nextbutton->setPixmap(t); QObject::connect(nextbutton, SIGNAL(clicked()), this, SLOT(next()) ); } { volume_slider=new QSlider(QSlider::Vertical,this,"Slider"); volume_slider->setTickmarks(QSlider::Below); volume_slider->setGeometry(width()-20,32, VOL_WIDTH,VOL_HEIGHT); volume_slider->setValue(99-Setvolume(-1)); connect(volume_slider,SIGNAL(valueChanged(int)), SLOT(Volumechanged(int)) ); frame_slider.w=new QSlider(0,MAXFRAMESLIDER,0,0, QSlider::Horizontal,this,"FSlider"); frame_slider.w->setTickmarks(QSlider::NoMarks); frame_slider.w->setGeometry(FRAME_X,FRAME_Y, FRAME_WIDTH,FRAME_HEIGHT); frame_slider.w->setValue(0); connect(frame_slider.w,SIGNAL(sliderMoved(int)), SLOT(Framechanged(int)) ); } initializelabelflag=false; initializelabel(); timer=startTimer(200); } inline void refreshlabel(Label *l) { if(l->dirty) { l->dirty=false; l->w->setText(l->str); } } void Panel::Setframeslider(int frame,int maxframe) { if(maxframe>1) frame_slider.w->setValue(getslidernumber(frame,maxframe)); } void Panel::initializelabel(void) { currentsong.name.str = currentsong.musican.str= currentsong.number.str =nullstring; currentsong.path.str =nonestring; currentstatus.str = framestatus.str =stopstring; refreshflag=true; } void Panel::timerEvent(QTimerEvent *) { if(initializelabelflag) { initializelabel(); initializelabelflag=false; } if(refreshflag) { refreshflag=false; updateflag=true; if(errorflag) { char str[250]; QMessageBox mb; sprintf(str,"xsplay: %s",errorstring); mb.setText(str); mb.setButtonText(0, "Skip"); mb.show(); errorflag=false; } refreshlabel(¤tsong.path); refreshlabel(¤tsong.number); refreshlabel(¤tsong.name); refreshlabel(¤tsong.musican); refreshlabel(¤tstatus); } if(updateflag) { updateflag=false; refreshlabel(&framestatus); } if(frame_slider.dirty) { if(!frame_slider.lock) { frame_slider.dirty=false; Setframeslider(frame_slider.frame,frame_slider.maxframe); } } doneflag=true; } void Panel::load() { extern void RunFileSelect(QWidget *widget); RunFileSelect(this); } void Panel::loadlist() { QString fn = QFileDialog::getOpenFileName(); if(!fn.isEmpty()) { stop(); readlist((char *)((const char *)fn)); music_restart(); } } void Panel::restart() { music_stop(); music_restart(); } void Panel::quit() { exit(0); } void Panel::option() { extern void RunOptionPanel(QWidget *widget); RunOptionPanel(this); } void Panel::stop() { music_stop(); } void Panel::play() { music_play(); } void Panel::pause() { music_pause(); } void Panel::previous() { music_previous(); } void Panel::next() { music_next(); } void Panel::Volumechanged(int value) { int vol; vol=99-Setvolume(99-value); volume_slider->setValue(vol); } void Panel::Framechanged(int frame) { frame_slider.lock=true; Setframe(frame); } /*********************/ /* Interface routine */ /*********************/ void Displayerror(char *errstr) { errorstring=errstr; errorflag=true; panel->refreshflag=true; } bool Msgboxdone(void) { return !errorflag; } inline void Setlabel(Label *l,const char *name) { l->str=name; l->dirty=true; } void Setsongname(const char *name) { if(name[0])Setlabel(&(panel->currentsong.name),name); panel->refreshflag=true; } void Setsongmusican(const char *musican) { Setlabel(&(panel->currentsong.musican),musican); panel->refreshflag=true; } void Setsongpath(const char *path) { Setlabel(&(panel->currentsong.name),nullstring); Setlabel(&(panel->currentsong.path),path); Setsongmusican(nullstring); } void Setcurrentsongnumber(int crun,int no) { if(crun>=no) Setlabel(&(panel->currentsong.number),"END"); else { sprintf(panel->cbuffer.number,"%d/%d",crun+1,no); Setlabel(&(panel->currentsong.number),panel->cbuffer.number); } panel->refreshflag=true; } void Setcurrentmpegstatus(int version,int layer, int frequency,int bitrate, bool crc,int mode, bool forcetomono,int downfreq) { if(music_isstop()) Setlabel(&(panel->currentstatus),nullstring); else { sprintf(panel->cbuffer.status, "MPEG-%d, Layer %d\n" "%5.2fKHz%s, " "%dkbps\n" "%s, " "%s%s", version+1,layer, (float)frequency/1000.,downfreq ? "//2" : "", bitrate, (crc ? "Crc" : "No Crc"), (mode ? "Stereo" : "Mono"), forcetomono ? "(M)" : ""); Setlabel(&(panel->currentstatus),panel->cbuffer.status); } panel->refreshflag=true; } void Clearcurrentstatus(void) { Setlabel(&(panel->currentstatus),nullstring); panel->refreshflag=true; } void Setframestatus(int frame,int maxframe, int pcmperframe,int frequency) { if(music_isstop()) Setlabel(&(panel->framestatus),stopstring); else { int m,s,mm,ms; s=frame*pcmperframe/frequency; m=s/60;s=s%60; if(maxframe==0) sprintf(panel->cbuffer.framestatus,"%2d:%2d",m,s); else { ms=maxframe*pcmperframe/frequency; mm=ms/60;ms=ms%60; sprintf(panel->cbuffer.framestatus, "%2d:%2d(%2d:%2d)",m,s,mm,ms); } Setlabel(&(panel->framestatus),panel->cbuffer.framestatus); } if(maxframe) { panel->frame_slider.frame=frame; panel->frame_slider.maxframe=maxframe; panel->frame_slider.dirty=true; } panel->updateflag=true; } void Unlockframeslider(void) { panel->frame_slider.lock=false; } void Paneldone(void) { panel->doneflag=false; panel->initializelabelflag=true; while(!panel->doneflag)usleep(100); while(panel->initializelabelflag)usleep(100); } int mainwidget_x(void) { return panel->x(); } int mainwidget_y(void) { return panel->y(); } void Getxarg(int &argc,char *argv[]) { mainwidget=new QApplication(argc,argv); } void SetupPanel(void) { #ifdef USE_KOREAN { extern void Koreaninit(void); Koreaninit(); } #endif panel=new Panel; mainwidget->setMainWidget(panel); panel->show(); QObject::connect(mainwidget,SIGNAL(lastWindowClosed()), mainwidget,SLOT(quit()) ); } int RunPanel(void) { return mainwidget->exec(); } splay-0.9.5.2/apps/optionpanel.cc0000644000175000017500000000456307235656077012331 /* Sound Player Copyright (C) 1997 by Jung woo-jae */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "xsplay.h" #include "optionpanel.h" OptionPanel::OptionPanel(QWidget *parent,char *name) : QDialog(parent,name,TRUE) { setCaption("Options"); move(mainwidget_x()+10,mainwidget_y()+10); resize(200,190); setFixedSize(200,190); shuffle_checkbox=new QCheckBox("Shuffle",this); shuffle_checkbox->move(10,10); shuffle_checkbox->setChecked(splay_shuffleflag); half_checkbox=new QCheckBox("Half freq",this); half_checkbox->move(10,30); half_checkbox->setChecked(splay_downfrequency); forcetomono_checkbox=new QCheckBox("Force to mono",this); forcetomono_checkbox->move(10,50); forcetomono_checkbox->setChecked(splay_forcetomonoflag); repeat_checkbox=new QCheckBox("Repeat",this); repeat_checkbox->move(10,70); repeat_checkbox->setChecked(splay_repeatflag); thread_label=new QLabel(this); thread_label->setGeometry(10,100,100,25); thread_num=splay_threadnum; thread_slider=new QSlider(0,999,120,thread_num,QSlider::Horizontal,this); thread_slider->setTickmarks(QSlider::Below); thread_slider->setGeometry(10,120,180,20); connect(thread_slider,SIGNAL(valueChanged(int)), this,SLOT(setthread(int))); setthread(thread_num); ok_button=new QPushButton("Ok",this); ok_button->setGeometry(10,height()-40,50,25); connect(ok_button,SIGNAL(clicked()),SLOT(SelectOk())); cancel_button=new QPushButton("Cancel",this); cancel_button->setGeometry(width()-50-10,height()-40,50,25); connect(cancel_button,SIGNAL(clicked()),SLOT(SelectCancel())); } OptionPanel::~OptionPanel() { delete shuffle_checkbox; delete forcetomono_checkbox; delete thread_label; delete thread_slider; delete ok_button; delete cancel_button; } void OptionPanel::SelectOk() { splay_shuffleflag =shuffle_checkbox->isChecked(); splay_forcetomonoflag=forcetomono_checkbox->isChecked(); splay_repeatflag =repeat_checkbox->isChecked(); splay_threadnum =thread_num; splay_downfrequency =half_checkbox->isChecked(); accept(); } void OptionPanel::SelectCancel() { reject(); } void OptionPanel::setthread(int value) { thread_num=value; sprintf(thread_string,"Buffer: %3d\n",value); thread_label->setText(thread_string); } void RunOptionPanel(QWidget *widget) { OptionPanel op(widget,"Option Panel"); op.exec(); } splay-0.9.5.2/apps/moc_multi.cc0000644000175000017500000000457007244537647011770 /**************************************************************************** ** MSelect meta object code from reading C++ file 'multipleselect.h' ** ** Created: Tue Feb 20 18:35:09 2001 ** by: The Qt MOC ($Id: moc_multi.cc,v 1.2 2001/02/20 19:04:07 micce Exp $) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ #if !defined(Q_MOC_OUTPUT_REVISION) #define Q_MOC_OUTPUT_REVISION 9 #elif Q_MOC_OUTPUT_REVISION != 9 #error "Moc format conflict - please regenerate all moc files" #endif #include "multipleselect.h" #include #include const char *MSelect::className() const { return "MSelect"; } QMetaObject *MSelect::metaObj = 0; void MSelect::initMetaObject() { if ( metaObj ) return; if ( qstrcmp(QTableView::className(), "QTableView") != 0 ) badSuperclassWarning("MSelect","QTableView"); (void) staticMetaObject(); } #ifndef QT_NO_TRANSLATION QString MSelect::tr(const char* s) { return qApp->translate( "MSelect", s, 0 ); } QString MSelect::tr(const char* s, const char * c) { return qApp->translate( "MSelect", s, c ); } #endif // QT_NO_TRANSLATION QMetaObject* MSelect::staticMetaObject() { if ( metaObj ) return metaObj; (void) QTableView::staticMetaObject(); #ifndef QT_NO_PROPERTIES #endif // QT_NO_PROPERTIES QMetaData::Access *slot_tbl_access = 0; typedef void (MSelect::*m2_t0)(); typedef void (QObject::*om2_t0)(); typedef void (MSelect::*m2_t1)(); typedef void (QObject::*om2_t1)(); m2_t0 v2_0 = &MSelect::clicked; om2_t0 ov2_0 = (om2_t0)v2_0; m2_t1 v2_1 = &MSelect::doubleclicked; om2_t1 ov2_1 = (om2_t1)v2_1; QMetaData *signal_tbl = QMetaObject::new_metadata(2); signal_tbl[0].name = "clicked()"; signal_tbl[0].ptr = (QMember)ov2_0; signal_tbl[1].name = "doubleclicked()"; signal_tbl[1].ptr = (QMember)ov2_1; metaObj = QMetaObject::new_metaobject( "MSelect", "QTableView", 0, 0, signal_tbl, 2, #ifndef QT_NO_PROPERTIES 0, 0, 0, 0, #endif // QT_NO_PROPERTIES 0, 0 ); metaObj->set_slot_access( slot_tbl_access ); #ifndef QT_NO_PROPERTIES #endif // QT_NO_PROPERTIES return metaObj; } // SIGNAL clicked void MSelect::clicked() { activate_signal( "clicked()" ); } // SIGNAL doubleclicked void MSelect::doubleclicked() { activate_signal( "doubleclicked()" ); } splay-0.9.5.2/apps/moc_file.cc0000644000175000017500000000622007244537647011547 /**************************************************************************** ** FileSelect meta object code from reading C++ file 'fileselect.h' ** ** Created: Tue Feb 20 18:35:14 2001 ** by: The Qt MOC ($Id: moc_file.cc,v 1.2 2001/02/20 19:04:07 micce Exp $) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ #if !defined(Q_MOC_OUTPUT_REVISION) #define Q_MOC_OUTPUT_REVISION 9 #elif Q_MOC_OUTPUT_REVISION != 9 #error "Moc format conflict - please regenerate all moc files" #endif #include "fileselect.h" #include #include const char *FileSelect::className() const { return "FileSelect"; } QMetaObject *FileSelect::metaObj = 0; void FileSelect::initMetaObject() { if ( metaObj ) return; if ( qstrcmp(QDialog::className(), "QDialog") != 0 ) badSuperclassWarning("FileSelect","QDialog"); (void) staticMetaObject(); } #ifndef QT_NO_TRANSLATION QString FileSelect::tr(const char* s) { return qApp->translate( "FileSelect", s, 0 ); } QString FileSelect::tr(const char* s, const char * c) { return qApp->translate( "FileSelect", s, c ); } #endif // QT_NO_TRANSLATION QMetaObject* FileSelect::staticMetaObject() { if ( metaObj ) return metaObj; (void) QDialog::staticMetaObject(); #ifndef QT_NO_PROPERTIES #endif // QT_NO_PROPERTIES typedef void (FileSelect::*m1_t0)(); typedef void (QObject::*om1_t0)(); typedef void (FileSelect::*m1_t1)(); typedef void (QObject::*om1_t1)(); typedef void (FileSelect::*m1_t2)(int); typedef void (QObject::*om1_t2)(int); typedef void (FileSelect::*m1_t3)(); typedef void (QObject::*om1_t3)(); typedef void (FileSelect::*m1_t4)(); typedef void (QObject::*om1_t4)(); m1_t0 v1_0 = &FileSelect::SelectOk; om1_t0 ov1_0 = (om1_t0)v1_0; m1_t1 v1_1 = &FileSelect::SelectAll; om1_t1 ov1_1 = (om1_t1)v1_1; m1_t2 v1_2 = &FileSelect::dirSelected; om1_t2 ov1_2 = (om1_t2)v1_2; m1_t3 v1_3 = &FileSelect::MSelectclicked; om1_t3 ov1_3 = (om1_t3)v1_3; m1_t4 v1_4 = &FileSelect::filterentered; om1_t4 ov1_4 = (om1_t4)v1_4; QMetaData *slot_tbl = QMetaObject::new_metadata(5); QMetaData::Access *slot_tbl_access = QMetaObject::new_metaaccess(5); slot_tbl[0].name = "SelectOk()"; slot_tbl[0].ptr = (QMember)ov1_0; slot_tbl_access[0] = QMetaData::Public; slot_tbl[1].name = "SelectAll()"; slot_tbl[1].ptr = (QMember)ov1_1; slot_tbl_access[1] = QMetaData::Public; slot_tbl[2].name = "dirSelected(int)"; slot_tbl[2].ptr = (QMember)ov1_2; slot_tbl_access[2] = QMetaData::Public; slot_tbl[3].name = "MSelectclicked()"; slot_tbl[3].ptr = (QMember)ov1_3; slot_tbl_access[3] = QMetaData::Public; slot_tbl[4].name = "filterentered()"; slot_tbl[4].ptr = (QMember)ov1_4; slot_tbl_access[4] = QMetaData::Public; metaObj = QMetaObject::new_metaobject( "FileSelect", "QDialog", slot_tbl, 5, 0, 0, #ifndef QT_NO_PROPERTIES 0, 0, 0, 0, #endif // QT_NO_PROPERTIES 0, 0 ); metaObj->set_slot_access( slot_tbl_access ); #ifndef QT_NO_PROPERTIES #endif // QT_NO_PROPERTIES return metaObj; } splay-0.9.5.2/apps/moc_panel.cc0000644000175000017500000001144707244537647011736 /**************************************************************************** ** Panel meta object code from reading C++ file 'panel.h' ** ** Created: Tue Feb 20 18:35:21 2001 ** by: The Qt MOC ($Id: moc_panel.cc,v 1.2 2001/02/20 19:04:07 micce Exp $) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ #if !defined(Q_MOC_OUTPUT_REVISION) #define Q_MOC_OUTPUT_REVISION 9 #elif Q_MOC_OUTPUT_REVISION != 9 #error "Moc format conflict - please regenerate all moc files" #endif #include "panel.h" #include #include const char *Panel::className() const { return "Panel"; } QMetaObject *Panel::metaObj = 0; void Panel::initMetaObject() { if ( metaObj ) return; if ( qstrcmp(QWidget::className(), "QWidget") != 0 ) badSuperclassWarning("Panel","QWidget"); (void) staticMetaObject(); } #ifndef QT_NO_TRANSLATION QString Panel::tr(const char* s) { return qApp->translate( "Panel", s, 0 ); } QString Panel::tr(const char* s, const char * c) { return qApp->translate( "Panel", s, c ); } #endif // QT_NO_TRANSLATION QMetaObject* Panel::staticMetaObject() { if ( metaObj ) return metaObj; (void) QWidget::staticMetaObject(); #ifndef QT_NO_PROPERTIES #endif // QT_NO_PROPERTIES typedef void (Panel::*m1_t0)(); typedef void (QObject::*om1_t0)(); typedef void (Panel::*m1_t1)(); typedef void (QObject::*om1_t1)(); typedef void (Panel::*m1_t2)(); typedef void (QObject::*om1_t2)(); typedef void (Panel::*m1_t3)(); typedef void (QObject::*om1_t3)(); typedef void (Panel::*m1_t4)(); typedef void (QObject::*om1_t4)(); typedef void (Panel::*m1_t5)(); typedef void (QObject::*om1_t5)(); typedef void (Panel::*m1_t6)(); typedef void (QObject::*om1_t6)(); typedef void (Panel::*m1_t7)(); typedef void (QObject::*om1_t7)(); typedef void (Panel::*m1_t8)(); typedef void (QObject::*om1_t8)(); typedef void (Panel::*m1_t9)(); typedef void (QObject::*om1_t9)(); typedef void (Panel::*m1_t10)(int); typedef void (QObject::*om1_t10)(int); typedef void (Panel::*m1_t11)(int); typedef void (QObject::*om1_t11)(int); m1_t0 v1_0 = &Panel::load; om1_t0 ov1_0 = (om1_t0)v1_0; m1_t1 v1_1 = &Panel::loadlist; om1_t1 ov1_1 = (om1_t1)v1_1; m1_t2 v1_2 = &Panel::option; om1_t2 ov1_2 = (om1_t2)v1_2; m1_t3 v1_3 = &Panel::restart; om1_t3 ov1_3 = (om1_t3)v1_3; m1_t4 v1_4 = &Panel::quit; om1_t4 ov1_4 = (om1_t4)v1_4; m1_t5 v1_5 = &Panel::stop; om1_t5 ov1_5 = (om1_t5)v1_5; m1_t6 v1_6 = &Panel::play; om1_t6 ov1_6 = (om1_t6)v1_6; m1_t7 v1_7 = &Panel::pause; om1_t7 ov1_7 = (om1_t7)v1_7; m1_t8 v1_8 = &Panel::previous; om1_t8 ov1_8 = (om1_t8)v1_8; m1_t9 v1_9 = &Panel::next; om1_t9 ov1_9 = (om1_t9)v1_9; m1_t10 v1_10 = &Panel::Volumechanged; om1_t10 ov1_10 = (om1_t10)v1_10; m1_t11 v1_11 = &Panel::Framechanged; om1_t11 ov1_11 = (om1_t11)v1_11; QMetaData *slot_tbl = QMetaObject::new_metadata(12); QMetaData::Access *slot_tbl_access = QMetaObject::new_metaaccess(12); slot_tbl[0].name = "load()"; slot_tbl[0].ptr = (QMember)ov1_0; slot_tbl_access[0] = QMetaData::Public; slot_tbl[1].name = "loadlist()"; slot_tbl[1].ptr = (QMember)ov1_1; slot_tbl_access[1] = QMetaData::Public; slot_tbl[2].name = "option()"; slot_tbl[2].ptr = (QMember)ov1_2; slot_tbl_access[2] = QMetaData::Public; slot_tbl[3].name = "restart()"; slot_tbl[3].ptr = (QMember)ov1_3; slot_tbl_access[3] = QMetaData::Public; slot_tbl[4].name = "quit()"; slot_tbl[4].ptr = (QMember)ov1_4; slot_tbl_access[4] = QMetaData::Public; slot_tbl[5].name = "stop()"; slot_tbl[5].ptr = (QMember)ov1_5; slot_tbl_access[5] = QMetaData::Public; slot_tbl[6].name = "play()"; slot_tbl[6].ptr = (QMember)ov1_6; slot_tbl_access[6] = QMetaData::Public; slot_tbl[7].name = "pause()"; slot_tbl[7].ptr = (QMember)ov1_7; slot_tbl_access[7] = QMetaData::Public; slot_tbl[8].name = "previous()"; slot_tbl[8].ptr = (QMember)ov1_8; slot_tbl_access[8] = QMetaData::Public; slot_tbl[9].name = "next()"; slot_tbl[9].ptr = (QMember)ov1_9; slot_tbl_access[9] = QMetaData::Public; slot_tbl[10].name = "Volumechanged(int)"; slot_tbl[10].ptr = (QMember)ov1_10; slot_tbl_access[10] = QMetaData::Public; slot_tbl[11].name = "Framechanged(int)"; slot_tbl[11].ptr = (QMember)ov1_11; slot_tbl_access[11] = QMetaData::Public; metaObj = QMetaObject::new_metaobject( "Panel", "QWidget", slot_tbl, 12, 0, 0, #ifndef QT_NO_PROPERTIES 0, 0, 0, 0, #endif // QT_NO_PROPERTIES 0, 0 ); metaObj->set_slot_access( slot_tbl_access ); #ifndef QT_NO_PROPERTIES #endif // QT_NO_PROPERTIES return metaObj; } splay-0.9.5.2/apps/moc_optionp.cc0000644000175000017500000000516307244537647012325 /**************************************************************************** ** OptionPanel meta object code from reading C++ file 'optionpanel.h' ** ** Created: Tue Feb 20 18:35:27 2001 ** by: The Qt MOC ($Id: moc_optionp.cc,v 1.2 2001/02/20 19:04:07 micce Exp $) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ #if !defined(Q_MOC_OUTPUT_REVISION) #define Q_MOC_OUTPUT_REVISION 9 #elif Q_MOC_OUTPUT_REVISION != 9 #error "Moc format conflict - please regenerate all moc files" #endif #include "optionpanel.h" #include #include const char *OptionPanel::className() const { return "OptionPanel"; } QMetaObject *OptionPanel::metaObj = 0; void OptionPanel::initMetaObject() { if ( metaObj ) return; if ( qstrcmp(QDialog::className(), "QDialog") != 0 ) badSuperclassWarning("OptionPanel","QDialog"); (void) staticMetaObject(); } #ifndef QT_NO_TRANSLATION QString OptionPanel::tr(const char* s) { return qApp->translate( "OptionPanel", s, 0 ); } QString OptionPanel::tr(const char* s, const char * c) { return qApp->translate( "OptionPanel", s, c ); } #endif // QT_NO_TRANSLATION QMetaObject* OptionPanel::staticMetaObject() { if ( metaObj ) return metaObj; (void) QDialog::staticMetaObject(); #ifndef QT_NO_PROPERTIES #endif // QT_NO_PROPERTIES typedef void (OptionPanel::*m1_t0)(); typedef void (QObject::*om1_t0)(); typedef void (OptionPanel::*m1_t1)(); typedef void (QObject::*om1_t1)(); typedef void (OptionPanel::*m1_t2)(int); typedef void (QObject::*om1_t2)(int); m1_t0 v1_0 = &OptionPanel::SelectOk; om1_t0 ov1_0 = (om1_t0)v1_0; m1_t1 v1_1 = &OptionPanel::SelectCancel; om1_t1 ov1_1 = (om1_t1)v1_1; m1_t2 v1_2 = &OptionPanel::setthread; om1_t2 ov1_2 = (om1_t2)v1_2; QMetaData *slot_tbl = QMetaObject::new_metadata(3); QMetaData::Access *slot_tbl_access = QMetaObject::new_metaaccess(3); slot_tbl[0].name = "SelectOk()"; slot_tbl[0].ptr = (QMember)ov1_0; slot_tbl_access[0] = QMetaData::Public; slot_tbl[1].name = "SelectCancel()"; slot_tbl[1].ptr = (QMember)ov1_1; slot_tbl_access[1] = QMetaData::Public; slot_tbl[2].name = "setthread(int)"; slot_tbl[2].ptr = (QMember)ov1_2; slot_tbl_access[2] = QMetaData::Public; metaObj = QMetaObject::new_metaobject( "OptionPanel", "QDialog", slot_tbl, 3, 0, 0, #ifndef QT_NO_PROPERTIES 0, 0, 0, 0, #endif // QT_NO_PROPERTIES 0, 0 ); metaObj->set_slot_access( slot_tbl_access ); #ifndef QT_NO_PROPERTIES #endif // QT_NO_PROPERTIES return metaObj; } splay-0.9.5.2/apps/common.cc0000644000175000017500000000645307254731610011255 /* Sound Player Copyright (C) 1997 by Woo-jae Jung */ // Functions to support player // Anyone can use MPEG Sound library under GPL #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "mpegsound.h" #include "splay.h" int splay_verbose=0; int splay_startframe=0; char *splay_progname; char *splay_devicename=NULL; char *splay_list[MAXLISTSIZE]; int splay_listsize=0; int splay_downfrequency=0; bool splay_shuffleflag=false, splay_repeatflag=false, splay_forcetomonoflag=false, splay_frameinfo=false; #ifdef PTHREADEDMPEG int splay_threadnum=50; #endif char *splay_Sounderrors[SOUND_ERROR_UNKNOWN]= { "Failed to open sound device.", "Sound device is busy.", "Buffersize of sound device is wrong.", "Sound device control error.", "Failed to open file for reading.", // 5 "Failed to read file.", "Unkown proxy.", "Unkown host.", "Socket error.", "Connection failed.", // 10 "Fdopen error.", "Http request failed.", "Http write failed.", "Too many relocation", "Memory is not enough.", // 15 "Unexpected EOF.", "Bad sound file format.", "Cannot make thread.", "Unknown error.", }; int Setvolume(int volume) { return Rawplayer::setvolume(volume); } /***************/ /* Manage list */ /***************/ static bool argsflag=false; void arglist(int argc,char *argv[],int start) { register int i; argsflag=true; for(i=start;(igetbytedirect(); if(c==EOF)break; if(c=='#') for(;;) { c=fp->getbytedirect(); if(c==EOF)break; if(c=='\n')break; } else for(;;) { if((c==EOF) || (c=='\n'))break; if(c!=' ') { int p; for(p=0;;p++) { songfile[p]=c; c=fp->getbytedirect(); if((c==EOF) || (c=='\n'))break; } songfile[++p]='\0'; splay_list[splay_listsize]=strdup(songfile); splay_listsize++; break; } c=fp->getbytedirect(); } } if(splay_verbose>1) { for(int i=0;i0;i--) { p=random()%i; tmp=splay_list[p]; splay_list[p]=splay_list[i]; splay_list[i]=tmp; } } splay-0.9.5.2/apps/splay.cc0000644000175000017500000002036507255344217011117 /* Sound Player Copyright (C) 1997 by Woo-jae Jung */ // It's an example of using MPEG Sound library // Anyone can use MPEG Sound library under GPL #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #ifdef HAVE_LIBID3 #include #include #endif /* HAVE_LIBID3 */ #include #include "mpegsound.h" #include "splay.h" static char *help= "\t-2 : playing with half frequency.\n" "\t-e : exit when playing is done. (only XSPLAY)\n" "\t-f : display frame and time info (played and remaining).\n" "\t-m : force to mono.\n" "\t-r : repeat forever.\n" "\t-s : shuffle play.\n" "\t-v : verbose, Very verbose, Very very verbose.\n" "\t-M : playing MPEG-Audio file as standard input.\n" "\t-V : display version.\n" "\n" "\t-k num : start playing at frame num.\n" "\t-d dev : Set dev as device or file.\n" "\t-l list : list file.\n" "\t-t buf : Set number of buffer. (default : 50)\n" "\n" "For detail, see man pages.\n"; /***********************/ /* Command line player */ /***********************/ inline void error(int n) { fprintf(stderr,"%s: %s\n",splay_progname,splay_Sounderrors[n-1]); return; } #ifdef PTHREADEDMPEG static void playingthread(Mpegfileplayer *player) { if(player->geterrorcode()>0)error(player->geterrorcode()); else { player->setforcetomono(splay_forcetomonoflag); player->playingwiththread(splay_verbose-1,splay_frameinfo, splay_threadnum, splay_startframe); if(player->geterrorcode()>0)error(player->geterrorcode()); } } #endif static void playing(Fileplayer *player) { if(player->geterrorcode()>0)error(player->geterrorcode()); else { player->setforcetomono(splay_forcetomonoflag); player->playing(splay_verbose-1,splay_frameinfo,splay_startframe); if(player->geterrorcode()>0)error(player->geterrorcode()); } } //Wrapper to convert null-string to the empty string inline const char * nn(const char* str) { return str?str:""; } #ifdef HAVE_LIBID3 //List of ID3 genre names, copied from xmms.org const char *ID3_gen_list[255] = { //0-24 "Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk", "Grunge", "Hip-Hop", "Jazz", "Metal", "New Age", "Oldies", "Other", "Pop", "R&B", "Rap", "Reggae", "Rock", "Techno", "Industrial", "Alternative", "Ska", "Death Metal", "Pranks", "Soundtrack", //25-49 "Euro-Techno", "Ambient", "Trip-Hop", "Vocal", "Jazz+Funk", "Fusion", "Trance", "Classical", "Instrumental", "Acid", "House", "Game", "Sound Clip", "Gospel", "Noise", "Alt", "Bass", "Soul", "Punk", "Space", "Meditative", "Instrumental Pop", "Instrumental Rock", "Ethnic", "Gothic", //50-74 "Darkwave", "Techno-Industrial", "Electronic", "Pop-Folk", "Eurodance", "Dream", "Southern Rock", "Comedy", "Cult", "Gangsta Rap", "Top 40", "Christian Rap", "Pop/Funk", "Jungle", "Native American", "Cabaret", "New Wave", "Psychedelic", "Rave", "Showtunes", "Trailer", "Lo-Fi", "Tribal", "Acid Punk", "Acid Jazz", //75-99 "Polka", "Retro", "Musical", "Rock & Roll", "Hard Rock", "Folk", "Folk/Rock", "National Folk", "Swing", "Fast-Fusion", "Bebob", "Latin", "Revival", "Celtic", "Bluegrass", "Avantgarde", "Gothic Rock", "Progressive Rock", "Psychedelic Rock", "Symphonic Rock", "Slow Rock", "Big Band", "Chorus", "Easy Listening", "Acoustic", //100-124 "Humour", "Speech", "Chanson", "Opera", "Chamber Music", "Sonata", "Symphony", "Booty Bass", "Primus", "Porn Groove", "Satire", "Slow Jam", "Club", "Tango", "Samba", "Folklore", "Ballad", "Power Ballad", "Rhythmic Soul", "Freestyle", "Duet", "Punk Rock", "Drum Solo", "A Cappella", "Euro-House", //125-149 "Dance Hall", "Goa", "Drum & Bass", "Club-House", "Hardcore", "Terror", "Indie", "BritPop", "Negerpunk", "Polsk Punk", "Beat", "Christian Gangsta Rap", "Heavy Metal", "Black Metal", "Crossover", "Contemporary Christian", "Christian Rock", "Merengue", "Salsa", "Thrash Metal", "Anime", "JPop", "Synthpop" }; ostream& operator<<(ostream& s, const ID3_Tag* tag ) { /* this gets all frames, but the info is rather difficult to get, just assume all is ID3FN_TEXT here and hope we get the most... */ /* size_t max = tag->NumFrames(); // s << "frames: " << max << endl; for ( size_t n=0; nGetDescription() << " " << ID3_GetString(frame,ID3FN_TEXT) << endl; } } */ // Print just what we want... s.setf(ios::left); // The filled fields get the text to the left s << "Title : " << nn(ID3_GetTitle(tag)) << endl; s << "Artist: " << setw(30) << nn(ID3_GetArtist(tag)) << "Album: " << nn(ID3_GetAlbum(tag)) << endl ; s << "Genre : " << setw(18) << nn(ID3_gen_list[ID3_GetGenreNum(tag)]) << "Track: " << setw(5) << ID3_GetTrackNum(tag) << "Year: " << setw(6) << nn(ID3_GetYear(tag)); // if ( ID3_GetComment(tag) ){ // s << endl << "Comment:" << nn(ID3_GetComment(tag)) << // nn(ID3_GetLyricist(tag)) << nn(ID3_GetLyrics(tag)); // } return s; } #endif /* HAVE_LIBID3 */ static void play(char *filename) { if( splay_verbose-- ) cout << filename << ":" << endl; if( splay_verbose>0 ) { // cerr << getpid() << endl; #ifdef HAVE_LIBID3 try { const ID3_Tag* mytag = new ID3_Tag(filename); if ( mytag->HasV1Tag() || mytag->HasV2Tag() ) cout << mytag << endl; delete mytag; } catch(ID3_Error &err){ cout << err.GetErrorFile() << " (" << err.GetErrorLine() << "): " << err.GetErrorType() << ": " << err.GetErrorDesc() << endl; } #endif /* HAVE_LIBID3 */ } Mpegfileplayer *player; player=new Mpegfileplayer; if(!player->openfile(filename,splay_devicename)) { error(player->geterrorcode()); delete player; return; } player->setdownfrequency(splay_downfrequency); #ifdef PTHREADEDMPEG playingthread(player); #else playing(player); #endif delete player; } #include void mtest(int) { // cerr << "mtest got nr " << i << endl; } void mstop(int) { // cerr << "mstop got nr " << i << endl; exit(1); } int main(int argc,char *argv[]) { int c; splay_progname=argv[0]; while((c=getopt(argc,argv, "VM2mfrsvd:k:l:" #ifdef PTHREADEDMPEG "t:" #endif ))>=0) { switch(c) { case 'V':printf("%s %s" #ifdef PTHREADEDMPEG " with pthread" #endif "\n",PACKAGE,VERSION); return 0; case 'M': { Mpegfileplayer player; player.openfile(NULL,splay_devicename); playing(&player); return 0; } case '2':splay_downfrequency = 1;break; case 'f':splay_frameinfo =true;break; case 'm':splay_forcetomonoflag=true;break; case 'r':splay_repeatflag =true;break; case 's':splay_shuffleflag =true;break; case 'v':splay_verbose++; break; case 'd':splay_devicename=optarg; break; case 'k':splay_startframe=atoi(optarg); break; case 'l':if(splay_verbose) fprintf(stderr,"List file : %s\n",optarg); readlist(optarg); break; #ifdef PTHREADEDMPEG case 't': { int a; sscanf(optarg,"%d",&a); splay_threadnum=a; } break; #endif default:fprintf(stderr,"Bad argument.\n"); } } if(argc<=optind && splay_listsize==0) { printf("%s %s" #ifdef PTHREADEDMPEG " with pthread" #endif "\n" "Usage : splay [-2mrsvMVW] [-d device] [-l listfile] " #ifdef PTHREADEDMPEG "[-t number] " #endif "files ...\n" "\n" "%s" ,PACKAGE,VERSION,help); return 0; } if(splay_listsize==0) // Make list by arguments arglist(argc,argv,optind); do { if(splay_shuffleflag)shufflelist(); for(int i=0;i #include #include class MFile { public: MFile(const char *string) {str=strdup(string);selected=false;}; ~MFile(); const char *string(void){return str;}; void Select(int num){selected=num;}; int IsSelected(void){return selected;}; private: const char *str; int selected; }; class MSelect : public QTableView { Q_OBJECT public: MSelect(QWidget* parent=0,const char* name=0); ~MSelect(); void Clearfilelist(); void Appendfilelist(const char *str); void Donefilelist(); const char* Cellstring(int fileindex); void Select(int fileindex,bool select); int IsSelected(int fileindex); int Getselectedfilenumber() {return selectednumber;}; int Gettotalfilenumber() {return listnumber;}; signals: void clicked(); void doubleclicked(); protected: void paintCell(QPainter*,int fileindex,int); void mousePressEvent(QMouseEvent* e); void mouseDoubleClickEvent(QMouseEvent* e); void focusInEvent(QFocusEvent*); void focusOutEvent(QFocusEvent*); private: QList *filelist; int currentfileindex; int currentselectnum; int listnumber,selectednumber; }; splay-0.9.5.2/apps/fileselect.h0000644000175000017500000000140107235656077011746 /* Sound Player Copyright (C) 1997 by Woo-jae Jung*/ #include "multipleselect.h" #include #include #include #include #include #include class FileSelect : public QDialog { Q_OBJECT public: FileSelect(QWidget *parent=0,char *name=0); ~FileSelect(); void readdir(); public slots: void SelectOk(); void SelectAll(); void dirSelected(int index); void MSelectclicked(); void filterentered(); private: QPushButton *ok_button,*cancel_button,*all_button; QListBox *dir_listbox; MSelect *mselect; QLabel *selectedfilenumber_label, *currentdirectory_label, *filter_label; QLineEdit *filter_ledit; char selectedfilenumber_string[100]; QDir *dir; }; splay-0.9.5.2/apps/panel.h0000644000175000017500000000360707242756413010731 /* Sound Player Copyright (C) 1997 by Jung woo-jae */ #include #include #include #include class Label { public: Label() {dirty=false;}; const char *str; QLabel *w; bool dirty; }; class Panel : public QWidget { Q_OBJECT public: Panel(QWidget *parent=0,const char *name=0); friend void Displayerror(char *errstr); friend void Setsongname (const char *name); friend void Setsongmusican(const char *musican); friend void Setsongpath (const char *path); friend void Setcurrentsongnumber(int currentrun,int number); friend void Setcurrentmpegstatus(int version,int layer, int frequency,int bitrate, bool crc,int mode, bool forcetomono,int downfreq); friend void Clearcurrentstatus(void); friend void Setframestatus(int frame,int maxframe, int pcmperframe,int frequency); friend void Unlockframeslider(void); friend void Paneldone(void); private: void Setframeslider(int frame,int maxframe); void initializelabel(void); void timerEvent(QTimerEvent *e); public slots: void load(); void loadlist(); void option(); void restart(); void quit(); void stop(); void play(); void pause(); void previous(); void next(); void Volumechanged(int value); void Framechanged(int frame); private: bool updateflag,refreshflag; bool doneflag,initializelabelflag; int timer; QMenuBar *menu; QPushButton *playbutton,*pausebutton,*stopbutton; QPushButton *previousbutton,*nextbutton; struct { char number[20]; char status[100]; char framestatus[20]; }cbuffer; struct { Label path; Label number; Label name; Label musican; }currentsong; Label currentstatus,framestatus; QSlider *volume_slider; struct { void frame_slider(); QSlider *w; int frame,maxframe; bool dirty; bool lock; }frame_slider; }; splay-0.9.5.2/apps/optionpanel.h0000644000175000017500000000117707235656077012171 /* Sound Player Copyright (C) 1997 by Jung woo-jae */ #include #include #include #include #include class OptionPanel : public QDialog { Q_OBJECT public: OptionPanel(QWidget *parent=0,char *name=0); ~OptionPanel(); public slots: void SelectOk(); void SelectCancel(); void setthread(int); private: QCheckBox *shuffle_checkbox,*forcetomono_checkbox, *repeat_checkbox,*half_checkbox; int thread_num; char thread_string[20]; QLabel *thread_label; QSlider *thread_slider; QPushButton *ok_button,*cancel_button; }; splay-0.9.5.2/apps/xsplay.h0000644000175000017500000000302507244537647011154 /* Sound Player (X-interface) Copyright (C) 1997 by Woo-jae Jung */ #include "splay.h" #define MAXFRAMESLIDER 2000 // Strings used frequently extern char *stopstring,*nonestring,*nullstring; // Panel.cc void Displayerror(char *errstr); bool Msgboxdone(void); void Setsongname (const char *name); void Setsongmusican(const char *musican); void Setsongpath (const char *path); void Setcurrentsongnumber(int crun,int no); void Setcurrentmpegstatus(int version,int layer, int frequency,int bitrate, bool crc,int mode, bool forcetomono,int downfreq); void Clearcurrentstatus(void); void Setframestatus(int frame,int maxframe, int pcmperframe,int frequency); void Unlockframeslider(void); void Paneldone(void); int mainwidget_x(void); int mainwidget_y(void); void Getxarg(int& argc,char *argv[]); void SetupPanel(void); int RunPanel(void); // // Functions.cc // extern bool splay_exitwhendone; // directory environment char *Getcurrentpath(void); void Setcurrentpath(char *path); char *Getcurrentwildcard(void); void Setcurrentwildcard(char *wildcard); // // Xsplay.cc // // Control music bool music_isstop(void); bool music_ispause(void); void music_restart(void); void music_stop(void); void music_play(void); void music_pause(void); void music_previous(void); void music_next(void); // frame managemant void Setframe(int frame); int getslidernumber(int frame,int maxframe); // misc bool getquotaflag(void); void setquotaflag(bool flag); // start up function void xinit(int& argc,char *argv[]); int xmain(void); splay-0.9.5.2/apps/splay.10000644000175000017500000000442207254731610010662 .ds PX \s-1UNIX\s+1 .TH SPLAY 1 "Aug 3 1997" "by Woo-jae Jung" "Applications/Sound" .SH NAME splay \- MPEG-1,2 Audio layer 1,2,3 file player .SH SYNOPSIS .B splay [-2VMfmrsv] [-k num] [-d dev] [-l list] [-t num] .I filenames... .B xsplay [-2Vemrsv] [-d dev] [-l list] [-t num] .I filenames... .SH DESCRIPTION .I Splay is the sound file player such as MPEG-1,2 Audio files. And you can play these files using list file. With pthread, it can play sound files smoother. And it has X-interface with libqt. Splay with qt may make you splay easily. .SH OPTIONS .I Splay has several options. .TP .BI \-2 play MPEG-Audio files with half-frequency.\fR If you use this option, you may play MPEG audio files with job which exhausts CPU very much. .PD 0 .TP .BI \-e exit when play is done. (xsplay) .TP .BI \-f display info on played and remaining frames and time. .TP .BI \-m force to mono.\fR .PD 0 Play with mono even if file have stereo quality. .PD 0 .TP .BI \-r Repeat forever. (Not X-interface) If you \-r with \-s, list files would be shuffled everytime. .PD 0 .TP .BI \-s Shuffle play. If you give list file or a number of files, Splay will makes them rearranged randomly. And with \-r Everytime the order of files would be changed. .PD 0 .TP .BI \-v Verbose, Very verbose, Very very verbose. .PD 0 .TP .BI \-M Play MPEG file as standard input. .PD 0 .TP .BI \-V Show version number. .TP .PD .B \-t " num" .I num of frames were saved during playing. When CPU is so busy and prevents splay from decoding, splay will play back using saved frames. This feature makes you do other job freely with listing MPEG music. .PD 0 .TP .B \-k " num" .I num of frames are skipped at the start of playing. .PD 0 .TP .B \-d " dev" Change device file. Default device file is .I /dev/dsp. If you can't use this device file or you can output raw type data to file, you can use this option. If the first character of .I dev is .B / , .I dev would be considered as device file, If the first character of .I dev is .B - , .I dev would be considered as standard output, otherwise .I dev would be considered as normal file. .PD 0 .TP .B \-l " list" Select list file. .B http:// can be used. (e.g. http://localhost/abc.m3u) .PD 0 .TP .B filenames You can put several files, and use .B http:// If you use .B -l option, these will be ignored. splay-0.9.5.2/apps/xsplay.10000644000175000017500000000002107242744700011042 .so man1/splay.1