From: john Date: Tue, 21 Aug 2007 01:37:30 +0000 (-0600) Subject: Import fmit upstream version 0.97.6 X-Git-Tag: 0.97.6 X-Git-Url: http://git.johnwright.org/?p=fmit.git;a=commitdiff_plain;h=4b957a098b637ebe4d07827a80aeae157791a148 Import fmit upstream version 0.97.6 --- 4b957a098b637ebe4d07827a80aeae157791a148 diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..f309b93 --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +Gilles Degottex diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..5b6e7c6 --- /dev/null +++ b/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..26f83df --- /dev/null +++ b/ChangeLog @@ -0,0 +1,159 @@ +2007-01-17 Gilles Degottex + * Add FFTW3 class + * Add Fourier transform view + * finished global frequency estimation from strongest component + +2006-12-23 Gilles Degottex + * Quantizer review + * remove capture system indicator, merged with note stability indicator + * curse parisian rer + * change volume bar, from max amplitude to max component + +2006-12-19 Gilles Degottex + * add OSS support + * new selection scheme of capture system + * switch to 440=A4 (and not A3) and do not skip 0-octave + (maybe it's the anglo-saxon notation, not clear on wikipedia) + * remove frequency variance limit + * change settings to decibel scale + +2006-12-18 Gilles Degottex + * many fix in GetAverageWaveLengthFromApproxEnergy + * add choice of the device in PortAudio + * adapted window since against lowest note + * many other fixes + +2006-12-17 Gilles Degottex + * bug fix in PortAudio packet size determination + * a few code cleaning + +2006-12-17 Gilles Degottex + * many changes in CaptureThread + * add PortAudio support + * JACK support not yet verified ! + +2006-12-06 Gilles Degottex + * bug fix in high frequencies recognition for new algo + * code clearing + +2006-12-05 Gilles Degottex + * QTDIR bug fix in autotools + * one or two design fix + * add fftw3 dependency for new algo + +2006-12-02 Gilles Degottex + * ALSA bug fixes in case of multiple channels + * tagged 0.96.6 + +2006-11-12 Gilles Degottex + * names changes in Music library + * vocabulary corrections + * change qt m4 script and configure.ac concerned lines + * read correctly the buffer with two channels + +2006-01-25 Gilles Degottex + * remove fftw3 depedency + +2006-01-14 Gilles Degottex + * channel count bug fix + * tagged 0.96.2 + +2005-12-15 Gilles Degottex + * Update Dial View by inversing scale + * tagged 0.95.1 + +2005-10-26 Gilles Degottex + * refresh Changelog again ... + * fix error on ALSA nb channel settings + * remember toolbars shown state + * various fixes + * tagged 0.91.3 + +2005-05-27 Gilles Degottex + * autotools configuration bug fixes + * many finishing touches, bug fixes + (repports from ALSA capture errors and other small things) + +2005-01-07 Gilles Degottex + * moved to autotools + * tagged 0.9.9 + +2005-1-2 Gilles Degottex + * move algorithms settings to a particular tab page + * text review + * french translation review + * tagged 0.9.8 + +2004-12-22 Gilles Degottex + * rename 'Just Intonation' to 'Microtonal' + * add absolute algorithm for microtonal view + * add titles to popups + * code cleaning + +2004-12-20 Gilles Degottex + * code cleaning + * Just Intonation view, errors follow selected value + * Just Intonation view, add option to keep root to left side + * Just Intonation view, duplicate cursor when near borders + * bug fixes + +2004-12-19 Gilles Degottex + * move settings managment to Views + * code cleaning + * Just Intonation view, add info file preview + * Just Intonation view, bug fixes + +2004-12-17 Gilles Degottex + * move view settings to popups + * dial view, bug fix + +2004-12-16 Gilles Degottex + * draw min and max on the dial + * add a recognition stability led in the toolbar + * just intonation view, load Scala files + +2004-12-15 Gilles Degottex + * add a customized dial + * add a page for each views in the config panel + +2004-12-14 Gilles Degottex + * add just intonation ratio-based tuning + * add volume history view + +2004-12-07 Gilles Degottex + * add translation capabilities + * add volume history in the error graph + * add Qt project file for alternative built method + * tagged 0.9.7 + +2004-12-03 Gilles Degottex + * jack implementation, do not catch the sampling rate when built + * jack implementation of capture thread do not crash anymore if jack server shutdown + +2004-12-03 Gilles Degottex + * update to yam 0.16.1 (change CFLAGS behavior and use DESTDIR instead of COMMON_ROOT) + +2004-12-02 Gilles Degottex + * implementations of CaptureThread class are no more exclusive. ALSA and JACK can be compiled together and one choosed at running time + * add 'qt-remove-duplicated-const' goal to Makefile to avoid the uic version 3.3.0 bug + * tagged 0.9.5 + +2004-11-26 Gilles Degottex + * interpolate wave length + * put 'Note Stability' in red when there is noise but no notes recognized + * fix bug in ALSA sampling rate settings + * fix precision bug in correlation algo + * fix a bug in the frequency view + * tagged 0.9.4 + +2004-11-25 Gilles Degottex + * update to YAMakefile version 0.16.0 + * add desktop shortcut icon file + +2004-11-24 Gilles Degottex + * did a real pause mode and move the old one to a reset button + * in settings, add notes name under analysis range + * some interface changes + * remove "Capture System" indicator and add error messages to the status bar + * remove Common C++ dependency + * tagged 0.9.2 diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..54caf7c --- /dev/null +++ b/INSTALL @@ -0,0 +1,229 @@ +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software +Foundation, Inc. + + This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +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, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. (Caching is +disabled by default to prevent problems with accidental use of stale +cache files.) + + 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 you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You only need +`configure.ac' 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. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + + *Note Defining Variables::, for more details. + +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 support 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' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + 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 machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the `--target=TYPE' option to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +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. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +will cause the specified gcc to be used as the C compiler (unless it is +overridden in the site shell script). + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--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. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..60d85e0 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,28 @@ +SUBDIRS = m4 libs ui src tr +default_DATA = fmit.desktop +defaultdir = $(prefix)/share/applications +EXTRA_DIST = ChangeLog AUTHORS COPYING TODO INSTALL fmit.desktop + +.PHONY: run dwl test-build test-build-cvs test-build-dist + +run: all + ./src/fmit + +dwl: + @echo update dwl directory + chown -R norwin.users dwl + cd dwl; rsync --delete -avr --rsh="ssh" . norwin@download.gna.org:/upload/fmit; cd .. + +test-build: test-build-cvs test-build-dist + +test-build-cvs: + rm -fr test/fmit + @echo test build through cvs + cd test; cvs -d norwin@cvs.gna.org:/cvs/fmit co fmit; cd fmit; sh burn_and_honk.sh; ./configure; make; cd ../.. +# cd test; cvs -d:pserver:anonymous@cvs.gna.org:/cvs/fmit co fmit; cd fmit; sh burn_and_honk.sh; ./configure; make; cd ../.. + +test-build-dist: dist + rm -fr test/$(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.bz2 $(PACKAGE_NAME)-$(PACKAGE_VERSION) + @echo test build through archive + cp $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.bz2 test/; cd test; uz $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.bz2; cd $(PACKAGE_NAME)-$(PACKAGE_VERSION); ./configure; make; cd ../.. + diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..7a0e4e7 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,658 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = . +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = . +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ + TODO depcomp install-sh missing +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_cxx_exceptions.m4 \ + $(top_srcdir)/m4/ac_cxx_have_complex.m4 \ + $(top_srcdir)/m4/ac_cxx_have_numeric_limits.m4 \ + $(top_srcdir)/m4/ac_cxx_have_sstream.m4 \ + $(top_srcdir)/m4/ac_cxx_have_stl.m4 \ + $(top_srcdir)/m4/ac_cxx_namespaces.m4 \ + $(top_srcdir)/m4/ac_cxx_templates.m4 \ + $(top_srcdir)/m4/bnv_have_qt.m4 \ + $(top_srcdir)/m4/mdl_have_opengl.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno configure.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(defaultdir)" +defaultDATA_INSTALL = $(INSTALL_DATA) +DATA = $(default_DATA) +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QT_CXXFLAGS = @QT_CXXFLAGS@ +QT_DIR = @QT_DIR@ +QT_LIBS = @QT_LIBS@ +QT_MOC = @QT_MOC@ +QT_UIC = @QT_UIC@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_prefix = @ac_prefix@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +SUBDIRS = m4 libs ui src tr +default_DATA = fmit.desktop +defaultdir = $(prefix)/share/applications +EXTRA_DIST = ChangeLog AUTHORS COPYING TODO INSTALL fmit.desktop +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +uninstall-info-am: +install-defaultDATA: $(default_DATA) + @$(NORMAL_INSTALL) + test -z "$(defaultdir)" || $(mkdir_p) "$(DESTDIR)$(defaultdir)" + @list='$(default_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(defaultDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(defaultdir)/$$f'"; \ + $(defaultDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(defaultdir)/$$f"; \ + done + +uninstall-defaultDATA: + @$(NORMAL_UNINSTALL) + @list='$(default_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(defaultdir)/$$f'"; \ + rm -f "$(DESTDIR)$(defaultdir)/$$f"; \ + done + +# 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. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + 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) \ + || eval $$failcom; \ + 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: + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + 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) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + mkdir $(distdir) + $(mkdir_p) $(distdir)/m4 + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(mkdir_p) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + distdir) \ + || exit 1; \ + fi; \ + done + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_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 + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' +distuninstallcheck: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile $(DATA) config.h +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(defaultdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: install-defaultDATA + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-defaultDATA uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ + check-am clean clean-generic clean-recursive ctags \ + ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \ + dist-tarZ dist-zip distcheck distclean distclean-generic \ + distclean-hdr distclean-recursive distclean-tags \ + distcleancheck distdir distuninstallcheck dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-defaultDATA install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-defaultDATA uninstall-info-am + + +.PHONY: run dwl test-build test-build-cvs test-build-dist + +run: all + ./src/fmit + +dwl: + @echo update dwl directory + chown -R norwin.users dwl + cd dwl; rsync --delete -avr --rsh="ssh" . norwin@download.gna.org:/upload/fmit; cd .. + +test-build: test-build-cvs test-build-dist + +test-build-cvs: + rm -fr test/fmit + @echo test build through cvs + cd test; cvs -d norwin@cvs.gna.org:/cvs/fmit co fmit; cd fmit; sh burn_and_honk.sh; ./configure; make; cd ../.. +# cd test; cvs -d:pserver:anonymous@cvs.gna.org:/cvs/fmit co fmit; cd fmit; sh burn_and_honk.sh; ./configure; make; cd ../.. + +test-build-dist: dist + rm -fr test/$(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.bz2 $(PACKAGE_NAME)-$(PACKAGE_VERSION) + @echo test build through archive + cp $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.bz2 test/; cd test; uz $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.bz2; cd $(PACKAGE_NAME)-$(PACKAGE_VERSION); ./configure; make; cd ../.. +# 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: diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/README b/README new file mode 100644 index 0000000..e69de29 diff --git a/TODO b/TODO new file mode 100644 index 0000000..2cf53df --- /dev/null +++ b/TODO @@ -0,0 +1,49 @@ +look for translations + +volume à partir de la somme des harmoniques pas de la valeur max + perceptive volume from weighted spectrum ? +high pass with FIR +band pass ranges with low pass +tests corrects des working transport possibles +shortcuts + +Doc + speak about 50hz on web site FAQ + Do not use a too big sampling rate. 22050Hz should be largely enough in most cases. + +promotion + contact AGNULA project + http://apps.linuxaudio.org/apps/screenshots + +algo + sep en bandes avec resampling ? + Quantizer + Viterbi + +interface + statistics + in a preselected range of notes + keep the history of the note (not only an average over the note) + be able to drop too short notes + average of volume + mean or median averaging + post-process notes with Viterbi + harm struct + add inharmonicity values in cents + phase + DFT + envelope ? + microtonal view + autodetect octave +? stretch scale view to the complet scale length (not always 12 !) + create your own scales inside FMIT + configure +? 'restore factory settings' bug for ui_chkJACKAutoConnect and his source + +code cleaning + use AutoQSetting under Views + +autotools + maintainer-clean + doc directories of libs + curse autotools authors families up to five generations diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..5af85d4 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,1013 @@ +# generated automatically by aclocal 1.9.6 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 Free Software Foundation, Inc. +# This file 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. + +dnl Configure Paths for Alsa +dnl Some modifications by Richard Boulton +dnl Christopher Lansdown +dnl Jaroslav Kysela +dnl Last modification: $Id: alsa.m4,v 1.24 2004/09/15 18:48:07 tiwai Exp $ +dnl AM_PATH_ALSA([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for libasound, and define ALSA_CFLAGS and ALSA_LIBS as appropriate. +dnl enables arguments --with-alsa-prefix= +dnl --with-alsa-enc-prefix= +dnl --disable-alsatest +dnl +dnl For backwards compatibility, if ACTION_IF_NOT_FOUND is not specified, +dnl and the alsa libraries are not found, a fatal AC_MSG_ERROR() will result. +dnl +AC_DEFUN([AM_PATH_ALSA], +[dnl Save the original CFLAGS, LDFLAGS, and LIBS +alsa_save_CFLAGS="$CFLAGS" +alsa_save_LDFLAGS="$LDFLAGS" +alsa_save_LIBS="$LIBS" +alsa_found=yes + +dnl +dnl Get the cflags and libraries for alsa +dnl +AC_ARG_WITH(alsa-prefix, +[ --with-alsa-prefix=PFX Prefix where Alsa library is installed(optional)], +[alsa_prefix="$withval"], [alsa_prefix=""]) + +AC_ARG_WITH(alsa-inc-prefix, +[ --with-alsa-inc-prefix=PFX Prefix where include libraries are (optional)], +[alsa_inc_prefix="$withval"], [alsa_inc_prefix=""]) + +dnl FIXME: this is not yet implemented +AC_ARG_ENABLE(alsatest, +[ --disable-alsatest Do not try to compile and run a test Alsa program], +[enable_alsatest="$enableval"], +[enable_alsatest=yes]) + +dnl Add any special include directories +AC_MSG_CHECKING(for ALSA CFLAGS) +if test "$alsa_inc_prefix" != "" ; then + ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix" + CFLAGS="$CFLAGS -I$alsa_inc_prefix" +fi +AC_MSG_RESULT($ALSA_CFLAGS) + +dnl add any special lib dirs +AC_MSG_CHECKING(for ALSA LDFLAGS) +if test "$alsa_prefix" != "" ; then + ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix" + LDFLAGS="$LDFLAGS $ALSA_LIBS" +fi + +dnl add the alsa library +ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread" +LIBS="$ALSA_LIBS $LIBS" +AC_MSG_RESULT($ALSA_LIBS) + +dnl Check for a working version of libasound that is of the right version. +min_alsa_version=ifelse([$1], ,0.1.1,$1) +AC_MSG_CHECKING(for libasound headers version >= $min_alsa_version) +no_alsa="" + alsa_min_major_version=`echo $min_alsa_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + alsa_min_minor_version=`echo $min_alsa_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + alsa_min_micro_version=`echo $min_alsa_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + +AC_LANG_SAVE +AC_LANG_C +AC_TRY_COMPILE([ +#include +], [ +/* ensure backward compatibility */ +#if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR) +#define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR +#endif +#if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR) +#define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR +#endif +#if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR) +#define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR +#endif + +# if(SND_LIB_MAJOR > $alsa_min_major_version) + exit(0); +# else +# if(SND_LIB_MAJOR < $alsa_min_major_version) +# error not present +# endif + +# if(SND_LIB_MINOR > $alsa_min_minor_version) + exit(0); +# else +# if(SND_LIB_MINOR < $alsa_min_minor_version) +# error not present +# endif + +# if(SND_LIB_SUBMINOR < $alsa_min_micro_version) +# error not present +# endif +# endif +# endif +exit(0); +], + [AC_MSG_RESULT(found.)], + [AC_MSG_RESULT(not present.) + ifelse([$3], , [AC_MSG_ERROR(Sufficiently new version of libasound not found.)]) + alsa_found=no] +) +AC_LANG_RESTORE + +dnl Now that we know that we have the right version, let's see if we have the library and not just the headers. +if test "x$enable_alsatest" = "xyes"; then +AC_CHECK_LIB([asound], [snd_ctl_open],, + [ifelse([$3], , [AC_MSG_ERROR(No linkable libasound was found.)]) + alsa_found=no] +) +fi + +if test "x$alsa_found" = "xyes" ; then + ifelse([$2], , :, [$2]) + LIBS=`echo $LIBS | sed 's/-lasound//g'` + LIBS=`echo $LIBS | sed 's/ //'` + LIBS="-lasound $LIBS" +fi +if test "x$alsa_found" = "xno" ; then + ifelse([$3], , :, [$3]) + CFLAGS="$alsa_save_CFLAGS" + LDFLAGS="$alsa_save_LDFLAGS" + LIBS="$alsa_save_LIBS" + ALSA_CFLAGS="" + ALSA_LIBS="" +fi + +dnl That should be it. Now just export out symbols: +AC_SUBST(ALSA_CFLAGS) +AC_SUBST(ALSA_LIBS) +]) + + +# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file 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. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.9.6])]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file 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. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file 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. + +# serial 7 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file 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. + +# serial 8 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file 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. + +#serial 3 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file 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. + +# serial 8 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file 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. + +# serial 12 + +# 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. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.58])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])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 + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file 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. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file 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. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file 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. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file 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. + +# serial 4 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# +# This file 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. + +# AM_PROG_MKDIR_P +# --------------- +# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. +# +# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories +# created by `make install' are always world readable, even if the +# installer happens to have an overly restrictive umask (e.g. 077). +# This was a mistake. There are at least two reasons why we must not +# use `-m 0755': +# - it causes special bits like SGID to be ignored, +# - it may be too restrictive (some setups expect 775 directories). +# +# Do not use -m 0755 and let people choose whatever they expect by +# setting umask. +# +# We cannot accept any implementation of `mkdir' that recognizes `-p'. +# Some implementations (such as Solaris 8's) are not thread-safe: if a +# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' +# concurrently, both version can detect that a/ is missing, but only +# one can create it and the other will error out. Consequently we +# restrict ourselves to GNU make (using the --version option ensures +# this.) +AC_DEFUN([AM_PROG_MKDIR_P], +[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi +AC_SUBST([mkdir_p])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file 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. + +# serial 3 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file 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. + +# serial 4 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# 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 conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $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]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file 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. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file 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. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([m4/ac_cxx_exceptions.m4]) +m4_include([m4/ac_cxx_have_complex.m4]) +m4_include([m4/ac_cxx_have_numeric_limits.m4]) +m4_include([m4/ac_cxx_have_sstream.m4]) +m4_include([m4/ac_cxx_have_stl.m4]) +m4_include([m4/ac_cxx_namespaces.m4]) +m4_include([m4/ac_cxx_templates.m4]) +m4_include([m4/bnv_have_qt.m4]) +m4_include([m4/mdl_have_opengl.m4]) diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..d47ded0 --- /dev/null +++ b/config.h.in @@ -0,0 +1,122 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* define if the compiler has complex */ +#undef HAVE_COMPLEX + +/* define if the compiler supports exceptions */ +#undef HAVE_EXCEPTIONS + +/* Define to 1 if you have the header file. */ +#undef HAVE_FFTW3_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `asound' library (-lasound). */ +#undef HAVE_LIBASOUND + +/* Define to 1 if you have the `fftw3' library (-lfftw3). */ +#undef HAVE_LIBFFTW3 + +/* Define to 1 if you have the `jack' library (-ljack). */ +#undef HAVE_LIBJACK + +/* Define to 1 if you have the `portaudio' library (-lportaudio). */ +#undef HAVE_LIBPORTAUDIO + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* define if the compiler implements namespaces */ +#undef HAVE_NAMESPACES + +/* define if the compiler has numeric_limits */ +#undef HAVE_NUMERIC_LIMITS + +/* Define to 1 if you have the `pow' function. */ +#undef HAVE_POW + +/* Define to 1 if you have the `sqrt' function. */ +#undef HAVE_SQRT + +/* define if the compiler has stringstream */ +#undef HAVE_SSTREAM + +/* Define to 1 if stdbool.h conforms to C99. */ +#undef HAVE_STDBOOL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* define if the compiler supports Standard Template Library */ +#undef HAVE_STL + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* define if the compiler supports basic templates */ +#undef HAVE_TEMPLATES + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if the system has the type `_Bool'. */ +#undef HAVE__BOOL + +/* References of the packager in the about box */ +#undef PACKAGER_STRING + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Installation prefix. */ +#undef PREFIX + +/* Define as the return type of signal handlers (`int' or `void'). */ +#undef RETSIGTYPE + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if the X Window System is missing or not being used. */ +#undef X_DISPLAY_MISSING + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +/* Define to `unsigned' if does not define. */ +#undef size_t + +/* Define to empty if the keyword `volatile' does not work. Warning: valid + code using `volatile' can become incorrect without. Disable with care. */ +#undef volatile diff --git a/configure b/configure new file mode 100755 index 0000000..ac51f3a --- /dev/null +++ b/configure @@ -0,0 +1,10956 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.59 for fmit 0.97.6. +# +# Copyright (C) 2003 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME='fmit' +PACKAGE_TARNAME='fmit' +PACKAGE_VERSION='0.97.6' +PACKAGE_STRING='fmit 0.97.6' +PACKAGE_BUGREPORT='' + +ac_default_prefix=/usr/local/ +ac_default_prefix=/usr/local +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar ac_prefix RANLIB ac_ct_RANLIB CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP EGREP X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS QT_CXXFLAGS QT_DIR QT_LIBS QT_UIC QT_MOC GL_CFLAGS GL_LIBS ALSA_CFLAGS ALSA_LIBS LIBOBJS LTLIBOBJS' +ac_subst_files='' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +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' + +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 + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # 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_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$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 ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) 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 | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$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 | -n) + 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_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + 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 "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +# 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_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + 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 "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP +ac_env_CXX_set=${CXX+set} +ac_env_CXX_value=$CXX +ac_cv_env_CXX_set=${CXX+set} +ac_cv_env_CXX_value=$CXX +ac_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_env_CXXFLAGS_value=$CXXFLAGS +ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_cv_env_CXXFLAGS_value=$CXXFLAGS +ac_env_CXXCPP_set=${CXXCPP+set} +ac_env_CXXCPP_value=$CXXCPP +ac_cv_env_CXXCPP_set=${CXXCPP+set} +ac_cv_env_CXXCPP_value=$CXXCPP + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # 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 <<_ACEOF +\`configure' configures fmit 0.97.6 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +_ACEOF + + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF + +Program names: + --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 + +X features: + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of fmit 0.97.6:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-debug turn on debugging (default=no) + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-Mesa Prefer the Mesa library over a vendors native OpenGL + library (default=yes) + --enable-alsa turn on ALSA support (default=yes) + --disable-alsatest Do not try to compile and run a test Alsa program + --enable-oss turn on OSS support (default=yes) + --enable-jack turn on JACK support (default=yes) + --enable-portaudio turn on PortAudio support (default=no) + --enable-packager-string=NAME + add references of the packager in the about box + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-x use the X Window System + --with-Qt-dir=DIR DIR is equal to $QTDIR if you have followed the + installation instructions of Trolltech. Header + files are in DIR/include, binary utilities are + in DIR/bin. The library is in DIR/lib, unless + --with-Qt-lib-dir is also set. + --with-Qt-include-dir=DIR + Qt header files are in DIR + --with-Qt-bin-dir=DIR Qt utilities such as moc and uic are in DIR + --with-Qt-lib-dir=DIR The Qt library is in DIR + --with-Qt-lib=LIB Use -lLIB to link with the Qt library + --with-alsa-prefix=PFX Prefix where Alsa library is installed(optional) + --with-alsa-inc-prefix=PFX Prefix where include libraries are (optional) + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CXXCPP C++ preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF +fmit configure 0.97.6 +generated by GNU Autoconf 2.59 + +Copyright (C) 2003 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by fmit $as_me 0.97.6, which was +generated by GNU Autoconf 2.59. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# 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 + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# 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 "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + + + + + + + + + + + ac_config_headers="$ac_config_headers config.h" + + +am__api_version="1.9" +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 + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $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 +# AmigaOS /C/install, which installs bootblocks on floppy discs +# 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" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /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 + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +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 "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&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}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 +# Just in case +sleep 1 +echo timestamp > conftest.file +# 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 conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $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 "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +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" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi + +for ac_prog in gawk mawk 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 "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 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 conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='fmit' + VERSION='0.97.6' + + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +install_sh=${install_sh-"$am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + + +echo "$as_me:$LINENO: checking whether to enable debugging" >&5 +echo $ECHO_N "checking whether to enable debugging... $ECHO_C" >&6 +# Check whether --enable-debug or --disable-debug was given. +if test "${enable_debug+set}" = set; then + enableval="$enable_debug" + +fi; +if test "x$enable_debug" = "xyes"; then + CXXFLAGS="$CPPFLAGS -g -DDEBUG" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + CXXFLAGS="$CPPFLAGS -O3 -ffast-math" + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +# Set default installation prefix. + +ac_prefix=$prefix +if test "x$ac_prefix" = "xNONE"; then + ac_prefix=$ac_default_prefix +fi + + +cat >>confdefs.h <<_ACEOF +#define PREFIX "$ac_prefix" +_ACEOF + + +# Checks for programs. +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +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 "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +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 $# != 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 + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in 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 "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&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 +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + + ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6 +rm -f confinc confmf + +# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval="$enable_dependency_tracking" + +fi; +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + + +if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + + +depcc="$CC" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC +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 "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CXX" && break +done +test -n "$ac_ct_CXX" || ac_ct_CXX="g++" + + CXX=$ac_ct_CXX +fi + + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 +GXX=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +CXXFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cxx_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cxx_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&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 +for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CXX" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 +echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 +if test -z "$CXXCPP"; then + if test "${ac_cv_prog_CXXCPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +echo "$as_me:$LINENO: result: $CXXCPP" >&5 +echo "${ECHO_T}$CXXCPP" >&6 +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + +if test $ac_cv_c_compiler_gnu = yes; then + echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 +echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 +if test "${ac_cv_prog_gcc_traditional+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_pattern="Autoconf.*'x'" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +Autoconf TIOCGETP +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then + ac_cv_prog_gcc_traditional=yes +else + ac_cv_prog_gcc_traditional=no +fi +rm -f conftest* + + + if test $ac_cv_prog_gcc_traditional = no; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +Autoconf TCGETA +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then + ac_cv_prog_gcc_traditional=yes +fi +rm -f conftest* + + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 +echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + 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 +# AmigaOS /C/install, which installs bootblocks on floppy discs +# 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" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /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 + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +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 "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&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}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +# Checks for languages. +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +# Checks for header files. + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + 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 <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + 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 <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#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); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + +for ac_header in stdlib.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------- ## +## Report this to the fmit lists. ## +## ------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +# Checks for typedefs, structures, and compiler characteristics. +echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 +echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6 +if test "${ac_cv_header_stdbool_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#ifndef bool +# error bool is not defined +#endif +#ifndef false +# error false is not defined +#endif +#if false +# error false is not 0 +#endif +#ifndef true +# error true is not defined +#endif +#if true != 1 +# error true is not 1 +#endif +#ifndef __bool_true_false_are_defined +# error __bool_true_false_are_defined is not defined +#endif + + struct s { _Bool s: 1; _Bool t; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) -0.5 == true ? 1 : -1]; + bool e = &s; + char f[(_Bool) -0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (_Bool)]; + char i[sizeof s.t]; + +int +main () +{ + return !a + !b + !c + !d + !e + !f + !g + !h + !i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdbool_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdbool_h=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6 +echo "$as_me:$LINENO: checking for _Bool" >&5 +echo $ECHO_N "checking for _Bool... $ECHO_C" >&6 +if test "${ac_cv_type__Bool+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((_Bool *) 0) + return 0; +if (sizeof (_Bool)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type__Bool=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type__Bool=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 +echo "${ECHO_T}$ac_cv_type__Bool" >&6 +if test $ac_cv_type__Bool = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE__BOOL 1 +_ACEOF + + +fi + +if test $ac_cv_header_stdbool_h = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STDBOOL_H 1 +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset x; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *ccp; + char **p; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + ccp = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++ccp; + p = (char**) ccp; + ccp = (char const *const *) p; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + } +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_const=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_const=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6 +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\_ACEOF +#define const +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for inline" >&5 +echo $ECHO_N "checking for inline... $ECHO_C" >&6 +if test "${ac_cv_c_inline+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_inline=$ac_kw; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 +echo "${ECHO_T}$ac_cv_c_inline" >&6 + + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + +echo "$as_me:$LINENO: checking for working volatile" >&5 +echo $ECHO_N "checking for working volatile... $ECHO_C" >&6 +if test "${ac_cv_c_volatile+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + +volatile int x; +int * volatile y; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_volatile=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_volatile=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_volatile" >&5 +echo "${ECHO_T}$ac_cv_c_volatile" >&6 +if test $ac_cv_c_volatile = no; then + +cat >>confdefs.h <<\_ACEOF +#define volatile +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((size_t *) 0) + return 0; +if (sizeof (size_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_size_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_size_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6 +if test $ac_cv_type_size_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned +_ACEOF + +fi + +echo "$as_me:$LINENO: checking whether the compiler implements namespaces" >&5 +echo $ECHO_N "checking whether the compiler implements namespaces... $ECHO_C" >&6 +if test "${ac_cv_cxx_namespaces+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +namespace Outer { namespace Inner { int i = 0; }} +int +main () +{ +using namespace Outer::Inner; return i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_cxx_namespaces=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_cxx_namespaces=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_namespaces" >&5 +echo "${ECHO_T}$ac_cv_cxx_namespaces" >&6 +if test "$ac_cv_cxx_namespaces" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_NAMESPACES +_ACEOF + +fi + +echo "$as_me:$LINENO: checking whether the compiler supports Standard Template Library" >&5 +echo $ECHO_N "checking whether the compiler supports Standard Template Library... $ECHO_C" >&6 +if test "${ac_cv_cxx_have_stl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + + + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#ifdef HAVE_NAMESPACES +using namespace std; +#endif +int +main () +{ +list x; x.push_back(5); +list::iterator iter = x.begin(); if (iter != x.end()) ++iter; return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_cxx_have_stl=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_cxx_have_stl=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_have_stl" >&5 +echo "${ECHO_T}$ac_cv_cxx_have_stl" >&6 +if test "$ac_cv_cxx_have_stl" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STL +_ACEOF + +fi + +echo "$as_me:$LINENO: checking whether the compiler has numeric_limits" >&5 +echo $ECHO_N "checking whether the compiler has numeric_limits... $ECHO_C" >&6 +if test "${ac_cv_cxx_have_numeric_limits+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + + + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#ifdef HAVE_NAMESPACES +using namespace std; +#endif +int +main () +{ +double e = numeric_limits::epsilon(); return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_cxx_have_numeric_limits=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_cxx_have_numeric_limits=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_have_numeric_limits" >&5 +echo "${ECHO_T}$ac_cv_cxx_have_numeric_limits" >&6 +if test "$ac_cv_cxx_have_numeric_limits" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_NUMERIC_LIMITS +_ACEOF + +fi + +echo "$as_me:$LINENO: checking whether the compiler has stringstream" >&5 +echo $ECHO_N "checking whether the compiler has stringstream... $ECHO_C" >&6 +if test "${ac_cv_cxx_have_sstream+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + + + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#ifdef HAVE_NAMESPACES +using namespace std; +#endif +int +main () +{ +stringstream message; message << "Hello"; return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_cxx_have_sstream=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_cxx_have_sstream=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_have_sstream" >&5 +echo "${ECHO_T}$ac_cv_cxx_have_sstream" >&6 +if test "$ac_cv_cxx_have_sstream" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_SSTREAM +_ACEOF + +fi + +echo "$as_me:$LINENO: checking whether the compiler supports basic templates" >&5 +echo $ECHO_N "checking whether the compiler supports basic templates... $ECHO_C" >&6 +if test "${ac_cv_cxx_templates+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +template class A {public:A(){}}; +template void f(const A& ){} +int +main () +{ + +A d; A i; f(d); f(i); return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_cxx_templates=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_cxx_templates=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_templates" >&5 +echo "${ECHO_T}$ac_cv_cxx_templates" >&6 +if test "$ac_cv_cxx_templates" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_TEMPLATES +_ACEOF + +fi + +echo "$as_me:$LINENO: checking whether the compiler supports exceptions" >&5 +echo $ECHO_N "checking whether the compiler supports exceptions... $ECHO_C" >&6 +if test "${ac_cv_cxx_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +try { throw 1; } catch (int i) { return i; } + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_cxx_exceptions=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_cxx_exceptions=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_exceptions" >&5 +echo "${ECHO_T}$ac_cv_cxx_exceptions" >&6 +if test "$ac_cv_cxx_exceptions" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_EXCEPTIONS +_ACEOF + +fi + +echo "$as_me:$LINENO: checking whether the compiler has complex" >&5 +echo $ECHO_N "checking whether the compiler has complex... $ECHO_C" >&6 +if test "${ac_cv_cxx_have_complex+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + + + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#ifdef HAVE_NAMESPACES +using namespace std; +#endif +int +main () +{ +complex a; complex b; return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_cxx_have_complex=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_cxx_have_complex=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_have_complex" >&5 +echo "${ECHO_T}$ac_cv_cxx_have_complex" >&6 +if test "$ac_cv_cxx_have_complex" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_COMPLEX +_ACEOF + +fi + + +# Checks for library functions. +echo "$as_me:$LINENO: checking return type of signal handlers" >&5 +echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 +if test "${ac_cv_type_signal+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#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; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_signal=void +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_signal=int +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 +echo "${ECHO_T}$ac_cv_type_signal" >&6 + +cat >>confdefs.h <<_ACEOF +#define RETSIGTYPE $ac_cv_type_signal +_ACEOF + + + + +for ac_func in pow sqrt +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* 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 (); +/* 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 +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + +for ac_header in fftw3.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------- ## +## Report this to the fmit lists. ## +## ------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +echo "$as_me:$LINENO: checking for fftw_plan_dft_1d in -lfftw3" >&5 +echo $ECHO_N "checking for fftw_plan_dft_1d in -lfftw3... $ECHO_C" >&6 +if test "${ac_cv_lib_fftw3_fftw_plan_dft_1d+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lfftw3 $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char fftw_plan_dft_1d (); +int +main () +{ +fftw_plan_dft_1d (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_fftw3_fftw_plan_dft_1d=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_fftw3_fftw_plan_dft_1d=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_fftw3_fftw_plan_dft_1d" >&5 +echo "${ECHO_T}$ac_cv_lib_fftw3_fftw_plan_dft_1d" >&6 +if test $ac_cv_lib_fftw3_fftw_plan_dft_1d = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBFFTW3 1 +_ACEOF + + LIBS="-lfftw3 $LIBS" + +fi + + +# --- Qt --- +echo "$as_me:$LINENO: checking for X" >&5 +echo $ECHO_N "checking for X... $ECHO_C" >&6 + + +# Check whether --with-x or --without-x was given. +if test "${with_x+set}" = set; then + withval="$with_x" + +fi; +# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +if test "x$with_x" = xno; then + # The user explicitly disabled X. + have_x=disabled +else + if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then + # Both variables are already set. + have_x=yes + else + if test "${ac_cv_have_x+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # One or both of the vars are not set, and there is no cached value. +ac_x_includes=no ac_x_libraries=no +rm -fr conftest.dir +if mkdir conftest.dir; then + cd conftest.dir + # Make sure to not put "make" in the Imakefile rules, since we grep it out. + cat >Imakefile <<'_ACEOF' +acfindx: + @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' +_ACEOF + if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then + # GNU make sometimes prints "make[1]: Entering...", which would confuse us. + eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` + # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. + for ac_extension in a so sl; do + if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && + test -f $ac_im_libdir/libX11.$ac_extension; then + ac_im_usrlibdir=$ac_im_libdir; break + fi + done + # Screen out bogus values from the imake configuration. They are + # bogus both because they are the default anyway, and because + # using them would break gcc on systems where it needs fixed includes. + case $ac_im_incroot in + /usr/include) ;; + *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; + esac + case $ac_im_usrlibdir in + /usr/lib | /lib) ;; + *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; + esac + fi + cd .. + rm -fr conftest.dir +fi + +# Standard set of common directories for X headers. +# Check X11 before X11Rn because it is often a symlink to the current release. +ac_x_header_dirs=' +/usr/X11/include +/usr/X11R6/include +/usr/X11R5/include +/usr/X11R4/include + +/usr/include/X11 +/usr/include/X11R6 +/usr/include/X11R5 +/usr/include/X11R4 + +/usr/local/X11/include +/usr/local/X11R6/include +/usr/local/X11R5/include +/usr/local/X11R4/include + +/usr/local/include/X11 +/usr/local/include/X11R6 +/usr/local/include/X11R5 +/usr/local/include/X11R4 + +/usr/X386/include +/usr/x386/include +/usr/XFree86/include/X11 + +/usr/include +/usr/local/include +/usr/unsupported/include +/usr/athena/include +/usr/local/x11r5/include +/usr/lpp/Xamples/include + +/usr/openwin/include +/usr/openwin/share/include' + +if test "$ac_x_includes" = no; then + # Guess where to find include files, by looking for Intrinsic.h. + # First, try using that file with no special directory specified. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # We can compile using X headers with no special include directory. +ac_x_includes= +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + for ac_dir in $ac_x_header_dirs; do + if test -r "$ac_dir/X11/Intrinsic.h"; then + ac_x_includes=$ac_dir + break + fi +done +fi +rm -f conftest.err conftest.$ac_ext +fi # $ac_x_includes = no + +if test "$ac_x_libraries" = no; then + # Check for the libraries. + # See if we find them without any special options. + # Don't add to $LIBS permanently. + ac_save_LIBS=$LIBS + LIBS="-lXt $LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +XtMalloc (0) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + LIBS=$ac_save_LIBS +# We can link X programs with no special library path. +ac_x_libraries= +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +LIBS=$ac_save_LIBS +for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` +do + # Don't even attempt the hair of trying to link an X program! + for ac_extension in a so sl; do + if test -r $ac_dir/libXt.$ac_extension; then + ac_x_libraries=$ac_dir + break 2 + fi + done +done +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi # $ac_x_libraries = no + +if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then + # Didn't find X anywhere. Cache the known absence of X. + ac_cv_have_x="have_x=no" +else + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" +fi +fi + + fi + eval "$ac_cv_have_x" +fi # $with_x != no + +if test "$have_x" != yes; then + echo "$as_me:$LINENO: result: $have_x" >&5 +echo "${ECHO_T}$have_x" >&6 + no_x=yes +else + # If each of the values was on the command line, it overrides each guess. + test "x$x_includes" = xNONE && x_includes=$ac_x_includes + test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries + # Update the cache value to reflect the command line values. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$x_includes ac_x_libraries=$x_libraries" + echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 +echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6 +fi + +if test "$no_x" = yes; then + # Not all programs may use this symbol, but it does not hurt to define it. + +cat >>confdefs.h <<\_ACEOF +#define X_DISPLAY_MISSING 1 +_ACEOF + + X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= +else + if test -n "$x_includes"; then + X_CFLAGS="$X_CFLAGS -I$x_includes" + fi + + # It would also be nice to do this for all -L options, not just this one. + if test -n "$x_libraries"; then + X_LIBS="$X_LIBS -L$x_libraries" + # For Solaris; some versions of Sun CC require a space after -R and + # others require no space. Words are not sufficient . . . . + case `(uname -sr) 2>/dev/null` in + "SunOS 5"*) + echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5 +echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6 + ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_R_nospace=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_R_nospace=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test $ac_R_nospace = yes; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + X_LIBS="$X_LIBS -R$x_libraries" + else + LIBS="$ac_xsave_LIBS -R $x_libraries" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_R_space=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_R_space=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test $ac_R_space = yes; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + X_LIBS="$X_LIBS -R $x_libraries" + else + echo "$as_me:$LINENO: result: neither works" >&5 +echo "${ECHO_T}neither works" >&6 + fi + fi + LIBS=$ac_xsave_LIBS + esac + fi + + # Check for system-dependent libraries X programs must link with. + # Do this before checking for the system-independent R6 libraries + # (-lICE), since we may need -lsocket or whatever for X linking. + + if test "$ISC" = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" + else + # Martyn Johnson says this is needed for Ultrix, if the X + # libraries were built with DECnet support. And Karl Berry says + # the Alpha needs dnet_stub (dnet does not exist). + ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char XOpenDisplay (); +int +main () +{ +XOpenDisplay (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 +echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6 +if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldnet $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dnet_ntoa (); +int +main () +{ +dnet_ntoa (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dnet_dnet_ntoa=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dnet_dnet_ntoa=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 +echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6 +if test $ac_cv_lib_dnet_dnet_ntoa = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" +fi + + if test $ac_cv_lib_dnet_dnet_ntoa = no; then + echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5 +echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6 +if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldnet_stub $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dnet_ntoa (); +int +main () +{ +dnet_ntoa (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dnet_stub_dnet_ntoa=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dnet_stub_dnet_ntoa=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 +echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6 +if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" +fi + + fi +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_xsave_LIBS" + + # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, + # to get the SysV transport functions. + # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) + # needs -lnsl. + # The nsl library prevents programs from opening the X display + # on Irix 5.2, according to T.E. Dickey. + # The functions gethostbyname, getservbyname, and inet_addr are + # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. + echo "$as_me:$LINENO: checking for gethostbyname" >&5 +echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 +if test "${ac_cv_func_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define gethostbyname to an innocuous variant, in case declares gethostbyname. + For example, HP-UX 11i declares gettimeofday. */ +#define gethostbyname innocuous_gethostbyname + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char gethostbyname (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef gethostbyname + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname (); +/* 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_gethostbyname) || defined (__stub___gethostbyname) +choke me +#else +char (*f) () = gethostbyname; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != gethostbyname; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_gethostbyname=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 + + if test $ac_cv_func_gethostbyname = no; then + echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 +echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 +if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname (); +int +main () +{ +gethostbyname (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_nsl_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_nsl_gethostbyname=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 +if test $ac_cv_lib_nsl_gethostbyname = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" +fi + + if test $ac_cv_lib_nsl_gethostbyname = no; then + echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5 +echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6 +if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbsd $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname (); +int +main () +{ +gethostbyname (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_bsd_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_bsd_gethostbyname=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6 +if test $ac_cv_lib_bsd_gethostbyname = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" +fi + + fi + fi + + # lieder@skyler.mavd.honeywell.com says without -lsocket, + # socket/setsockopt and other routines are undefined under SCO ODT + # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary + # on later versions), says Simon Leinen: it contains gethostby* + # variants that don't use the name server (or something). -lsocket + # must be given before -lnsl if both are needed. We assume that + # if connect needs -lnsl, so does gethostbyname. + echo "$as_me:$LINENO: checking for connect" >&5 +echo $ECHO_N "checking for connect... $ECHO_C" >&6 +if test "${ac_cv_func_connect+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define connect to an innocuous variant, in case declares connect. + For example, HP-UX 11i declares gettimeofday. */ +#define connect innocuous_connect + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char connect (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef connect + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char connect (); +/* 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_connect) || defined (__stub___connect) +choke me +#else +char (*f) () = connect; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != connect; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_connect=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_connect=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 +echo "${ECHO_T}$ac_cv_func_connect" >&6 + + if test $ac_cv_func_connect = no; then + echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 +echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6 +if test "${ac_cv_lib_socket_connect+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $X_EXTRA_LIBS $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char connect (); +int +main () +{ +connect (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_socket_connect=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_socket_connect=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 +echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6 +if test $ac_cv_lib_socket_connect = yes; then + X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" +fi + + fi + + # Guillermo Gomez says -lposix is necessary on A/UX. + echo "$as_me:$LINENO: checking for remove" >&5 +echo $ECHO_N "checking for remove... $ECHO_C" >&6 +if test "${ac_cv_func_remove+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define remove to an innocuous variant, in case declares remove. + For example, HP-UX 11i declares gettimeofday. */ +#define remove innocuous_remove + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char remove (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef remove + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char remove (); +/* 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_remove) || defined (__stub___remove) +choke me +#else +char (*f) () = remove; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != remove; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_remove=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_remove=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5 +echo "${ECHO_T}$ac_cv_func_remove" >&6 + + if test $ac_cv_func_remove = no; then + echo "$as_me:$LINENO: checking for remove in -lposix" >&5 +echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6 +if test "${ac_cv_lib_posix_remove+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lposix $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char remove (); +int +main () +{ +remove (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_posix_remove=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_posix_remove=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5 +echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6 +if test $ac_cv_lib_posix_remove = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" +fi + + fi + + # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. + echo "$as_me:$LINENO: checking for shmat" >&5 +echo $ECHO_N "checking for shmat... $ECHO_C" >&6 +if test "${ac_cv_func_shmat+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shmat to an innocuous variant, in case declares shmat. + For example, HP-UX 11i declares gettimeofday. */ +#define shmat innocuous_shmat + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shmat (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shmat + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shmat (); +/* 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_shmat) || defined (__stub___shmat) +choke me +#else +char (*f) () = shmat; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != shmat; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_shmat=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_shmat=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 +echo "${ECHO_T}$ac_cv_func_shmat" >&6 + + if test $ac_cv_func_shmat = no; then + echo "$as_me:$LINENO: checking for shmat in -lipc" >&5 +echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6 +if test "${ac_cv_lib_ipc_shmat+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lipc $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shmat (); +int +main () +{ +shmat (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_ipc_shmat=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_ipc_shmat=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5 +echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6 +if test $ac_cv_lib_ipc_shmat = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" +fi + + fi + fi + + # Check for libraries that X11R6 Xt/Xaw programs need. + ac_save_LDFLAGS=$LDFLAGS + test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" + # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to + # check for ICE first), but we must link in the order -lSM -lICE or + # we get undefined symbols. So assume we have SM if we have ICE. + # These have to be linked with before -lX11, unlike the other + # libraries we check for below, so use a different variable. + # John Interrante, Karl Berry + echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5 +echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6 +if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lICE $X_EXTRA_LIBS $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char IceConnectionNumber (); +int +main () +{ +IceConnectionNumber (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_ICE_IceConnectionNumber=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_ICE_IceConnectionNumber=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 +echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6 +if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then + X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" +fi + + LDFLAGS=$ac_save_LDFLAGS + +fi + + + + + + + echo "$as_me:$LINENO: checking for Qt" >&5 +echo $ECHO_N "checking for Qt... $ECHO_C" >&6 + + +# Check whether --with-Qt-dir or --without-Qt-dir was given. +if test "${with_Qt_dir+set}" = set; then + withval="$with_Qt_dir" + +fi; + +# Check whether --with-Qt-include-dir or --without-Qt-include-dir was given. +if test "${with_Qt_include_dir+set}" = set; then + withval="$with_Qt_include_dir" + +fi; + +# Check whether --with-Qt-bin-dir or --without-Qt-bin-dir was given. +if test "${with_Qt_bin_dir+set}" = set; then + withval="$with_Qt_bin_dir" + +fi; + +# Check whether --with-Qt-lib-dir or --without-Qt-lib-dir was given. +if test "${with_Qt_lib_dir+set}" = set; then + withval="$with_Qt_lib_dir" + +fi; + +# Check whether --with-Qt-lib or --without-Qt-lib was given. +if test "${with_Qt_lib+set}" = set; then + withval="$with_Qt_lib" + +fi; + if test x"$with_Qt_dir" = x"no" || + test x"$with_Qt_include-dir" = x"no" || + test x"$with_Qt_bin_dir" = x"no" || + test x"$with_Qt_lib_dir" = x"no" || + test x"$with_Qt_lib" = x"no"; then + # user disabled Qt. Leave cache alone. + have_qt="User disabled Qt." + else + # "yes" is a bogus option + if test x"$with_Qt_dir" = xyes; then + with_Qt_dir= + fi + if test x"$with_Qt_include_dir" = xyes; then + with_Qt_include_dir= + fi + if test x"$with_Qt_bin_dir" = xyes; then + with_Qt_bin_dir= + fi + if test x"$with_Qt_lib_dir" = xyes; then + with_Qt_lib_dir= + fi + if test x"$with_Qt_lib" = xyes; then + with_Qt_lib= + fi + # No Qt unless we discover otherwise + have_qt=no + # Check whether we are requested to link with a specific version + if test x"$with_Qt_lib" != x; then + bnv_qt_lib="$with_Qt_lib" + fi + # Check whether we were supplied with an answer already + if test x"$with_Qt_dir" != x; then + have_qt=yes + bnv_qt_dir="$with_Qt_dir" + bnv_qt_include_dir="$with_Qt_dir/include" + bnv_qt_bin_dir="$with_Qt_dir/bin" + bnv_qt_lib_dir="$with_Qt_dir/lib" + # Only search for the lib if the user did not define one already + if test x"$bnv_qt_lib" = x; then + bnv_qt_lib="`ls $bnv_qt_lib_dir/libqt* | sed -n 1p | + sed s@$bnv_qt_lib_dir/lib@@ | sed s@[.].*@@`" + fi + bnv_qt_LIBS="-L$bnv_qt_lib_dir -l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS" + else + # Use cached value or do search, starting with suggestions from + # the command line + if test "${bnv_cv_have_qt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + # We are not given a solution and there is no cached value. + bnv_qt_dir=NO + bnv_qt_include_dir=NO + bnv_qt_lib_dir=NO + if test x"$bnv_qt_lib" = x; then + bnv_qt_lib=NO + fi + + ## Binary utilities ## + if test x"$with_Qt_bin_dir" != x; then + bnv_qt_bin_dir=$with_Qt_bin_dir + fi + ## Look for header files ## + if test x"$with_Qt_include_dir" != x; then + bnv_qt_include_dir="$with_Qt_include_dir" + else + # The following header file is expected to define QT_VERSION. + qt_direct_test_header=qglobal.h + # Look for the header file in a standard set of common directories. + bnv_include_path_list=" + /usr/include + `ls -dr ${QTDIR}/include 2>/dev/null` + `ls -dr /usr/include/qt* 2>/dev/null` + `ls -dr /usr/lib/qt*/include 2>/dev/null` + `ls -dr /usr/local/qt*/include 2>/dev/null` + `ls -dr /opt/qt*/include 2>/dev/null` + `ls -dr /Developer/qt*/include 2>/dev/null` + " + for bnv_dir in $bnv_include_path_list; do + if test -r "$bnv_dir/$qt_direct_test_header"; then + bnv_dirs="$bnv_dirs $bnv_dir" + fi + done + # Now look for the newest in this list + bnv_prev_ver=0 + for bnv_dir in $bnv_dirs; do + bnv_this_ver=`egrep -w '#define QT_VERSION' $bnv_dir/$qt_direct_test_header | sed s/'#define QT_VERSION'//` + if expr $bnv_this_ver '>' $bnv_prev_ver > /dev/null; then + bnv_qt_include_dir=$bnv_dir + bnv_prev_ver=$bnv_this_ver + fi + done + fi + # Are these headers located in a traditional Trolltech installation? + # That would be $bnv_qt_include_dir stripped from its last element: + bnv_possible_qt_dir=`dirname $bnv_qt_include_dir` + if (test -x $bnv_possible_qt_dir/bin/moc) && + ((ls $bnv_possible_qt_dir/lib/libqt* > /dev/null 2>/dev/null) || + (ls $bnv_possible_qt_dir/lib64/libqt* > /dev/null 2>/dev/null)); then + # Then the rest is a piece of cake + bnv_qt_dir=$bnv_possible_qt_dir + bnv_qt_bin_dir="$bnv_qt_dir/bin" + if test x"$with_Qt_lib_dir" != x; then + bnv_qt_lib_dir="$with_Qt_lib_dir" + else + if (test -d $bnv_qt_dir/lib64); then + bnv_qt_lib_dir="$bnv_qt_dir/lib64" + else + bnv_qt_lib_dir="$bnv_qt_dir/lib" + fi + fi + # Only look for lib if the user did not supply it already + if test x"$bnv_qt_lib" = xNO; then + bnv_qt_lib="`ls $bnv_qt_lib_dir/libqt* | sed -n 1p | + sed s@$bnv_qt_lib_dir/lib@@ | sed s@[.].*@@`" + fi + bnv_qt_LIBS="-L$bnv_qt_lib_dir -l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS" + else + # There is no valid definition for $QTDIR as Trolltech likes to see it + bnv_qt_dir= + ## Look for Qt library ## + if test x"$with_Qt_lib_dir" != x; then + bnv_qt_lib_dir="$with_Qt_lib_dir" + # Only look for lib if the user did not supply it already + if test x"$bnv_qt_lib" = xNO; then + bnv_qt_lib="`ls $bnv_qt_lib_dir/libqt* | sed -n 1p | + sed s@$bnv_qt_lib_dir/lib@@ | sed s@[.].*@@`" + fi + bnv_qt_LIBS="-L$bnv_qt_lib_dir -l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS" + else + # Normally, when there is no traditional Trolltech installation, + # the library is installed in a place where the linker finds it + # automatically. + # If the user did not define the library name, try with qt + if test x"$bnv_qt_lib" = xNO; then + bnv_qt_lib=qt + fi + qt_direct_test_header=qapplication.h + qt_direct_test_main=" + int argc; + char ** argv; + QApplication app(argc,argv); + " + # See if we find the library without any special options. + # Don't add top $LIBS permanently yet + bnv_save_LIBS="$LIBS" + LIBS="-l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS" + bnv_qt_LIBS="$LIBS" + bnv_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="-I$bnv_qt_include_dir" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$qt_direct_test_header> +int +main () +{ +$qt_direct_test_main + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + # Success. + # We can link with no special library directory. + bnv_qt_lib_dir= + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + # That did not work. Try the multi-threaded version + echo "Non-critical error, please neglect the above." >&5 + bnv_qt_lib=qt-mt + LIBS="-l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$qt_direct_test_header> +int +main () +{ +$qt_direct_test_main + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + # Success. + # We can link with no special library directory. + bnv_qt_lib_dir= + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + # That did not work. Try the OpenGL version + echo "Non-critical error, please neglect the above." >&5 + bnv_qt_lib=qt-gl + LIBS="-l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$qt_direct_test_header> +int +main () +{ +$qt_direct_test_main + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + # Success. + # We can link with no special library directory. + bnv_qt_lib_dir= + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + # That did not work. Maybe a library version I don't know about? + echo "Non-critical error, please neglect the above." >&5 + # Look for some Qt lib in a standard set of common directories. + bnv_dir_list=" + `echo $bnv_qt_includes | sed ss/includess` + /lib + /usr/lib64 + /usr/lib + /usr/local/lib64 + /usr/local/lib + /opt/lib64 + /opt/lib + `ls -dr /usr/lib64/qt* 2>/dev/null` + `ls -dr /usr/lib64/qt*/lib64 2>/dev/null` + `ls -dr /usr/lib/qt* 2>/dev/null` + `ls -dr /usr/local/qt* 2>/dev/null` + `ls -dr /opt/qt* 2>/dev/null` + " + for bnv_dir in $bnv_dir_list; do + if ls $bnv_dir/libqt* >/dev/null 2>/dev/null; then + # Gamble that it's the first one... + bnv_qt_lib="`ls $bnv_dir/libqt* | sed -n 1p | + sed s@$bnv_dir/lib@@ | sed s/[.].*//`" + bnv_qt_lib_dir="$bnv_dir" + break + fi + done + # Try with that one + LIBS="-l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$qt_direct_test_header> +int +main () +{ +$qt_direct_test_main + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + # Success. + # We can link with no special library directory. + bnv_qt_lib_dir= + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + # Leave bnv_qt_lib_dir defined + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test x"$bnv_qt_lib_dir" != x; then + bnv_qt_LIBS="-L$bnv_qt_lib_dir $LIBS" + else + bnv_qt_LIBS="$LIBS" + fi + LIBS="$bnv_save_LIBS" + CXXFLAGS="$bnv_save_CXXFLAGS" + fi fi + if test "$bnv_qt_dir" = NO || + test "$bnv_qt_include_dir" = NO || + test "$bnv_qt_lib_dir" = NO || + test "$bnv_qt_lib" = NO; then + # Problem with finding complete Qt. Cache the known absence of Qt. + bnv_cv_have_qt="have_qt=no" + else + # Record where we found Qt for the cache. + bnv_cv_have_qt="have_qt=yes \ + bnv_qt_dir=$bnv_qt_dir \ + bnv_qt_include_dir=$bnv_qt_include_dir \ + bnv_qt_bin_dir=$bnv_qt_bin_dir \ + bnv_qt_LIBS=\"$bnv_qt_LIBS\"" + fi + +fi + eval "$bnv_cv_have_qt" + fi # all $bnv_qt_* are set + fi # $have_qt reflects the system status + if test x"$have_qt" = xyes; then + QT_CXXFLAGS="-I$bnv_qt_include_dir" + if test x"$bnv_qt_lib" = xqt-mt; then + QT_CXXFLAGS="$QT_CXXFLAGS -DQT_THREAD_SUPPORT" + fi + QT_DIR="$bnv_qt_dir" + QT_LIBS="$bnv_qt_LIBS" + # If bnv_qt_dir is defined, utilities are expected to be in the + # bin subdirectory + if test x"$bnv_qt_dir" != x; then + if test -x "$bnv_qt_dir/bin/uic"; then + QT_UIC="$bnv_qt_dir/bin/uic" + else + # Old versions of Qt don't have uic + QT_UIC= + fi + QT_MOC="$bnv_qt_dir/bin/moc" + else + # Or maybe we are told where to look for the utilities + if test x"$bnv_qt_bin_dir" != x; then + if test -x "$bnv_qt_bin_dir/uic"; then + QT_UIC="$bnv_qt_bin_dir/uic" + else + # Old versions of Qt don't have uic + QT_UIC= + fi + QT_MOC="$bnv_qt_bin_dir/moc" + else + # Last possibility is that they are in $PATH + QT_UIC="`which uic`" + QT_MOC="`which moc`" + fi + fi + # All variables are defined, report the result + echo "$as_me:$LINENO: result: $have_qt: + QT_CXXFLAGS=$QT_CXXFLAGS + QT_DIR=$QT_DIR + QT_LIBS=$QT_LIBS + QT_UIC=$QT_UIC + QT_MOC=$QT_MOC" >&5 +echo "${ECHO_T}$have_qt: + QT_CXXFLAGS=$QT_CXXFLAGS + QT_DIR=$QT_DIR + QT_LIBS=$QT_LIBS + QT_UIC=$QT_UIC + QT_MOC=$QT_MOC" >&6 + else + # Qt was not found + QT_CXXFLAGS= + QT_DIR= + QT_LIBS= + QT_UIC= + QT_MOC= + echo "$as_me:$LINENO: result: $have_qt" >&5 +echo "${ECHO_T}$have_qt" >&6 + fi + + + + + + + #### Being paranoid: + if test x"$have_qt" = xyes; then + echo "$as_me:$LINENO: checking correct functioning of Qt installation" >&5 +echo $ECHO_N "checking correct functioning of Qt installation... $ECHO_C" >&6 + if test "${bnv_cv_qt_test_result+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat > bnv_qt_test.h << EOF +#include +class Test : public QObject +{ +Q_OBJECT +public: + Test() {} + ~Test() {} +public slots: + void receive() {} +signals: + void send(); +}; +EOF + + cat > bnv_qt_main.$ac_ext << EOF +#include "bnv_qt_test.h" +#include +int main( int argc, char **argv ) +{ + QApplication app( argc, argv ); + Test t; + QObject::connect( &t, SIGNAL(send()), &t, SLOT(receive()) ); +} +EOF + + bnv_cv_qt_test_result="failure" + bnv_try_1="$QT_MOC bnv_qt_test.h -o moc_bnv_qt_test.$ac_ext >/dev/null 2>/dev/null" + { (eval echo "$as_me:$LINENO: \"$bnv_try_1\"") >&5 + (eval $bnv_try_1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + if test x"$ac_status" != x0; then + echo "$bnv_err_1" >&5 + echo "configure: could not run $QT_MOC on:" >&5 + cat bnv_qt_test.h >&5 + else + bnv_try_2="$CXX $QT_CXXFLAGS -c $CXXFLAGS -o moc_bnv_qt_test.o moc_bnv_qt_test.$ac_ext >/dev/null 2>/dev/null" + { (eval echo "$as_me:$LINENO: \"$bnv_try_2\"") >&5 + (eval $bnv_try_2) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + if test x"$ac_status" != x0; then + echo "$bnv_err_2" >&5 + echo "configure: could not compile:" >&5 + cat moc_bnv_qt_test.$ac_ext >&5 + else + bnv_try_3="$CXX $QT_CXXFLAGS -c $CXXFLAGS -o bnv_qt_main.o bnv_qt_main.$ac_ext >/dev/null 2>/dev/null" + { (eval echo "$as_me:$LINENO: \"$bnv_try_3\"") >&5 + (eval $bnv_try_3) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + if test x"$ac_status" != x0; then + echo "$bnv_err_3" >&5 + echo "configure: could not compile:" >&5 + cat bnv_qt_main.$ac_ext >&5 + else + bnv_try_4="$CXX $LIBS -o bnv_qt_main bnv_qt_main.o moc_bnv_qt_test.o $QT_LIBS >/dev/null 2>/dev/null" + { (eval echo "$as_me:$LINENO: \"$bnv_try_4\"") >&5 + (eval $bnv_try_4) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + if test x"$ac_status" != x0; then + echo "$bnv_err_4" >&5 + else + bnv_cv_qt_test_result="success" + fi + fi + fi + fi + +fi + echo "$as_me:$LINENO: result: $bnv_cv_qt_test_result" >&5 +echo "${ECHO_T}$bnv_cv_qt_test_result" >&6; + if test x"$bnv_cv_qt_test_result" = "xfailure"; then + { { echo "$as_me:$LINENO: error: Failed to find matching components of a complete + Qt installation. Try using more options, + see ./configure --help." >&5 +echo "$as_me: error: Failed to find matching components of a complete + Qt installation. Try using more options, + see ./configure --help." >&2;} + { (exit 1); exit 1; }; } + fi + + rm -f bnv_qt_test.h moc_bnv_qt_test.$ac_ext moc_bnv_qt_test.o \ + bnv_qt_main.$ac_ext bnv_qt_main.o bnv_qt_main + fi + + +QTDIR="$QT_DIR" +CFLAGS="$CFLAGS $QT_CXXFLAGS" +CPPFLAGS="$CPPFLAGS $QT_CXXFLAGS" +LIBS="$LIBS $QT_LIBS" + + +# --- OpenGL --- + + + + + + echo "$as_me:$LINENO: checking for OpenGL" >&5 +echo $ECHO_N "checking for OpenGL... $ECHO_C" >&6 +if test "${mdl_cv_have_OpenGL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + # Check whether --enable-Mesa or --disable-Mesa was given. +if test "${enable_Mesa+set}" = set; then + enableval="$enable_Mesa" + use_Mesa=$enableval +else + use_Mesa=yes +fi; + + if test x"$use_Mesa" = xyes; then + GL_search_list="MesaGL GL" + GLU_search_list="MesaGLU GLU" + GLX_search_list="MesaGLX GLX" + else + GL_search_list="GL MesaGL" + GLU_search_list="GLU MesaGLU" + GLX_search_list="GLX MesaGLX" + fi + + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +if test x"$no_x" != xyes; then + GL_CFLAGS="$X_CFLAGS" + GL_X_LIBS="$X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS" +fi + GL_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$GL_CFLAGS" + + GL_save_LIBS="$LIBS" + LIBS="$GL_X_LIBS" + + + # Save the "AC_MSG_RESULT file descriptor" to FD 8. + exec 8>&6 + + # Temporarily turn off AC_MSG_RESULT so that the user gets pretty + # messages. + exec 6>/dev/null + + echo "$as_me:$LINENO: checking for library containing glAccum" >&5 +echo $ECHO_N "checking for library containing glAccum... $ECHO_C" >&6 +if test "${ac_cv_search_glAccum+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_glAccum=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char glAccum (); +int +main () +{ +glAccum (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_glAccum="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_glAccum" = no; then + for ac_lib in $GL_search_list; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char glAccum (); +int +main () +{ +glAccum (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_glAccum="-l$ac_lib" +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_glAccum" >&5 +echo "${ECHO_T}$ac_cv_search_glAccum" >&6 +if test "$ac_cv_search_glAccum" != no; then + test "$ac_cv_search_glAccum" = "none required" || LIBS="$ac_cv_search_glAccum $LIBS" + have_GL=yes +else + have_GL=no +fi + + echo "$as_me:$LINENO: checking for library containing gluBeginCurve" >&5 +echo $ECHO_N "checking for library containing gluBeginCurve... $ECHO_C" >&6 +if test "${ac_cv_search_gluBeginCurve+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_gluBeginCurve=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gluBeginCurve (); +int +main () +{ +gluBeginCurve (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_gluBeginCurve="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_gluBeginCurve" = no; then + for ac_lib in $GLU_search_list; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gluBeginCurve (); +int +main () +{ +gluBeginCurve (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_gluBeginCurve="-l$ac_lib" +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_gluBeginCurve" >&5 +echo "${ECHO_T}$ac_cv_search_gluBeginCurve" >&6 +if test "$ac_cv_search_gluBeginCurve" != no; then + test "$ac_cv_search_gluBeginCurve" = "none required" || LIBS="$ac_cv_search_gluBeginCurve $LIBS" + have_GLU=yes +else + have_GLU=no +fi + + echo "$as_me:$LINENO: checking for library containing glXChooseVisual" >&5 +echo $ECHO_N "checking for library containing glXChooseVisual... $ECHO_C" >&6 +if test "${ac_cv_search_glXChooseVisual+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_glXChooseVisual=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char glXChooseVisual (); +int +main () +{ +glXChooseVisual (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_glXChooseVisual="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_glXChooseVisual" = no; then + for ac_lib in $GLX_search_list; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char glXChooseVisual (); +int +main () +{ +glXChooseVisual (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_glXChooseVisual="-l$ac_lib" +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_glXChooseVisual" >&5 +echo "${ECHO_T}$ac_cv_search_glXChooseVisual" >&6 +if test "$ac_cv_search_glXChooseVisual" != no; then + test "$ac_cv_search_glXChooseVisual" = "none required" || LIBS="$ac_cv_search_glXChooseVisual $LIBS" + have_GLX=yes +else + have_GLX=no +fi + + echo "$as_me:$LINENO: checking for library containing glutInit" >&5 +echo $ECHO_N "checking for library containing glutInit... $ECHO_C" >&6 +if test "${ac_cv_search_glutInit+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_glutInit=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char glutInit (); +int +main () +{ +glutInit (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_glutInit="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_glutInit" = no; then + for ac_lib in glut; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char glutInit (); +int +main () +{ +glutInit (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_glutInit="-l$ac_lib" +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_glutInit" >&5 +echo "${ECHO_T}$ac_cv_search_glutInit" >&6 +if test "$ac_cv_search_glutInit" != no; then + test "$ac_cv_search_glutInit" = "none required" || LIBS="$ac_cv_search_glutInit $LIBS" + have_glut=yes +else + have_glut=no +fi + + + + + # Restore pretty messages. + exec 6>&8 + + if test -n "$LIBS"; then + mdl_cv_have_OpenGL=yes + GL_LIBS="$LIBS" + + + else + mdl_cv_have_OpenGL=no + GL_CFLAGS= + fi + + GL_X_LIBS= + + LIBS="$GL_save_LIBS" + CPPFLAGS="$GL_save_CPPFLAGS" + + ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + mdl_cv_GL_CFLAGS="$GL_CFLAGS" + mdl_cv_GL_LIBS="$GL_LIBS" + mdl_cv_have_GL="$have_GL" + mdl_cv_have_GLU="$have_GLU" + mdl_cv_have_GLX="$have_GLX" + mdl_cv_have_glut="$have_glut" + +fi +echo "$as_me:$LINENO: result: $mdl_cv_have_OpenGL" >&5 +echo "${ECHO_T}$mdl_cv_have_OpenGL" >&6 + GL_CFLAGS="$mdl_cv_GL_CFLAGS" + GL_LIBS="$mdl_cv_GL_LIBS" + have_GL="$mdl_cv_have_GL" + have_GLU="$mdl_cv_have_GLU" + have_GLX="$mdl_cv_have_GLX" + have_glut="$mdl_cv_have_glut" + +echo "$as_me:$LINENO: checking for GL" >&5 +echo $ECHO_N "checking for GL... $ECHO_C" >&6 +if test "x$have_GL" = "xyes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + { { echo "$as_me:$LINENO: error: no GL library found" >&5 +echo "$as_me: error: no GL library found" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:$LINENO: checking for GLU" >&5 +echo $ECHO_N "checking for GLU... $ECHO_C" >&6 +if test "x$have_GLU" = "xyes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + { { echo "$as_me:$LINENO: error: no GLU library found" >&5 +echo "$as_me: error: no GLU library found" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:$LINENO: checking for glut" >&5 +echo $ECHO_N "checking for glut... $ECHO_C" >&6 +if test "x$have_glut" = "xyes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + { { echo "$as_me:$LINENO: error: no glut library found" >&5 +echo "$as_me: error: no glut library found" >&2;} + { (exit 1); exit 1; }; } +fi + + +# Checks for features +# --- ALSA --- +echo "$as_me:$LINENO: checking whether to enable ALSA" >&5 +echo $ECHO_N "checking whether to enable ALSA... $ECHO_C" >&6 +# Check whether --enable-alsa or --disable-alsa was given. +if test "${enable_alsa+set}" = set; then + enableval="$enable_alsa" + enable_alsa=$enableval +else + enable_alsa=yes +fi; +if test "x$enable_alsa" = "xyes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + alsa_save_CFLAGS="$CFLAGS" +alsa_save_LDFLAGS="$LDFLAGS" +alsa_save_LIBS="$LIBS" +alsa_found=yes + + +# Check whether --with-alsa-prefix or --without-alsa-prefix was given. +if test "${with_alsa_prefix+set}" = set; then + withval="$with_alsa_prefix" + alsa_prefix="$withval" +else + alsa_prefix="" +fi; + + +# Check whether --with-alsa-inc-prefix or --without-alsa-inc-prefix was given. +if test "${with_alsa_inc_prefix+set}" = set; then + withval="$with_alsa_inc_prefix" + alsa_inc_prefix="$withval" +else + alsa_inc_prefix="" +fi; + +# Check whether --enable-alsatest or --disable-alsatest was given. +if test "${enable_alsatest+set}" = set; then + enableval="$enable_alsatest" + enable_alsatest="$enableval" +else + enable_alsatest=yes +fi; + +echo "$as_me:$LINENO: checking for ALSA CFLAGS" >&5 +echo $ECHO_N "checking for ALSA CFLAGS... $ECHO_C" >&6 +if test "$alsa_inc_prefix" != "" ; then + ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix" + CFLAGS="$CFLAGS -I$alsa_inc_prefix" +fi +echo "$as_me:$LINENO: result: $ALSA_CFLAGS" >&5 +echo "${ECHO_T}$ALSA_CFLAGS" >&6 + +echo "$as_me:$LINENO: checking for ALSA LDFLAGS" >&5 +echo $ECHO_N "checking for ALSA LDFLAGS... $ECHO_C" >&6 +if test "$alsa_prefix" != "" ; then + ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix" + LDFLAGS="$LDFLAGS $ALSA_LIBS" +fi + +ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread" +LIBS="$ALSA_LIBS $LIBS" +echo "$as_me:$LINENO: result: $ALSA_LIBS" >&5 +echo "${ECHO_T}$ALSA_LIBS" >&6 + +min_alsa_version=0.9 +echo "$as_me:$LINENO: checking for libasound headers version >= $min_alsa_version" >&5 +echo $ECHO_N "checking for libasound headers version >= $min_alsa_version... $ECHO_C" >&6 +no_alsa="" + alsa_min_major_version=`echo $min_alsa_version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` + alsa_min_minor_version=`echo $min_alsa_version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` + alsa_min_micro_version=`echo $min_alsa_version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include + +int +main () +{ + +/* ensure backward compatibility */ +#if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR) +#define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR +#endif +#if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR) +#define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR +#endif +#if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR) +#define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR +#endif + +# if(SND_LIB_MAJOR > $alsa_min_major_version) + exit(0); +# else +# if(SND_LIB_MAJOR < $alsa_min_major_version) +# error not present +# endif + +# if(SND_LIB_MINOR > $alsa_min_minor_version) + exit(0); +# else +# if(SND_LIB_MINOR < $alsa_min_minor_version) +# error not present +# endif + +# if(SND_LIB_SUBMINOR < $alsa_min_micro_version) +# error not present +# endif +# endif +# endif +exit(0); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:$LINENO: result: found." >&5 +echo "${ECHO_T}found." >&6 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: result: not present." >&5 +echo "${ECHO_T}not present." >&6 + { { echo "$as_me:$LINENO: error: Sufficiently new version of libasound not found." >&5 +echo "$as_me: error: Sufficiently new version of libasound not found." >&2;} + { (exit 1); exit 1; }; } + alsa_found=no + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +if test "x$enable_alsatest" = "xyes"; then + +echo "$as_me:$LINENO: checking for snd_ctl_open in -lasound" >&5 +echo $ECHO_N "checking for snd_ctl_open in -lasound... $ECHO_C" >&6 +if test "${ac_cv_lib_asound_snd_ctl_open+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lasound $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char snd_ctl_open (); +int +main () +{ +snd_ctl_open (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_asound_snd_ctl_open=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_asound_snd_ctl_open=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_asound_snd_ctl_open" >&5 +echo "${ECHO_T}$ac_cv_lib_asound_snd_ctl_open" >&6 +if test $ac_cv_lib_asound_snd_ctl_open = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBASOUND 1 +_ACEOF + + LIBS="-lasound $LIBS" + +else + { { echo "$as_me:$LINENO: error: No linkable libasound was found." >&5 +echo "$as_me: error: No linkable libasound was found." >&2;} + { (exit 1); exit 1; }; } + alsa_found=no + +fi + +fi + +if test "x$alsa_found" = "xyes" ; then + CXXFLAGS="$CXXFLAGS -DCAPTURE_ALSA" + LIBS=`echo $LIBS | sed 's/-lasound//g'` + LIBS=`echo $LIBS | sed 's/ //'` + LIBS="-lasound $LIBS" +fi +if test "x$alsa_found" = "xno" ; then + : + CFLAGS="$alsa_save_CFLAGS" + LDFLAGS="$alsa_save_LDFLAGS" + LIBS="$alsa_save_LIBS" + ALSA_CFLAGS="" + ALSA_LIBS="" +fi + + + + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +# --- OSS --- +echo "$as_me:$LINENO: checking whether to enable OSS" >&5 +echo $ECHO_N "checking whether to enable OSS... $ECHO_C" >&6 +# Check whether --enable-oss or --disable-oss was given. +if test "${enable_oss+set}" = set; then + enableval="$enable_oss" + enable_oss=$enableval +else + enable_oss=yes +fi; +if test "x$enable_oss" = "xyes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + CXXFLAGS="$CXXFLAGS -DCAPTURE_OSS" + if test "${ac_cv_header_sys_soundcard_h+set}" = set; then + echo "$as_me:$LINENO: checking for sys/soundcard.h" >&5 +echo $ECHO_N "checking for sys/soundcard.h... $ECHO_C" >&6 +if test "${ac_cv_header_sys_soundcard_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_sys_soundcard_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_soundcard_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking sys/soundcard.h usability" >&5 +echo $ECHO_N "checking sys/soundcard.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking sys/soundcard.h presence" >&5 +echo $ECHO_N "checking sys/soundcard.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: sys/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: sys/soundcard.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: sys/soundcard.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sys/soundcard.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: sys/soundcard.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: sys/soundcard.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sys/soundcard.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/soundcard.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: sys/soundcard.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------- ## +## Report this to the fmit lists. ## +## ------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for sys/soundcard.h" >&5 +echo $ECHO_N "checking for sys/soundcard.h... $ECHO_C" >&6 +if test "${ac_cv_header_sys_soundcard_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_sys_soundcard_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_sys_soundcard_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_soundcard_h" >&6 + +fi +if test $ac_cv_header_sys_soundcard_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: OSS header not found." >&5 +echo "$as_me: error: OSS header not found." >&2;} + { (exit 1); exit 1; }; } +fi + + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +# --- JACK --- +echo "$as_me:$LINENO: checking whether to enable JACK" >&5 +echo $ECHO_N "checking whether to enable JACK... $ECHO_C" >&6 +# Check whether --enable-jack or --disable-jack was given. +if test "${enable_jack+set}" = set; then + enableval="$enable_jack" + enable_jack=$enableval +else + enable_jack=yes +fi; +if test "x$enable_jack" = "xyes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + CXXFLAGS="$CXXFLAGS -DCAPTURE_JACK" + if test "${ac_cv_header_jack_jack_h+set}" = set; then + echo "$as_me:$LINENO: checking for jack/jack.h" >&5 +echo $ECHO_N "checking for jack/jack.h... $ECHO_C" >&6 +if test "${ac_cv_header_jack_jack_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_jack_jack_h" >&5 +echo "${ECHO_T}$ac_cv_header_jack_jack_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking jack/jack.h usability" >&5 +echo $ECHO_N "checking jack/jack.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking jack/jack.h presence" >&5 +echo $ECHO_N "checking jack/jack.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: jack/jack.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: jack/jack.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: jack/jack.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: jack/jack.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: jack/jack.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: jack/jack.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: jack/jack.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: jack/jack.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: jack/jack.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: jack/jack.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: jack/jack.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: jack/jack.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: jack/jack.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: jack/jack.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: jack/jack.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: jack/jack.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------- ## +## Report this to the fmit lists. ## +## ------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for jack/jack.h" >&5 +echo $ECHO_N "checking for jack/jack.h... $ECHO_C" >&6 +if test "${ac_cv_header_jack_jack_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_jack_jack_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_jack_jack_h" >&5 +echo "${ECHO_T}$ac_cv_header_jack_jack_h" >&6 + +fi +if test $ac_cv_header_jack_jack_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: JACK headers not found." >&5 +echo "$as_me: error: JACK headers not found." >&2;} + { (exit 1); exit 1; }; } +fi + + + +echo "$as_me:$LINENO: checking for main in -ljack" >&5 +echo $ECHO_N "checking for main in -ljack... $ECHO_C" >&6 +if test "${ac_cv_lib_jack_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ljack $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_jack_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_jack_main=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_jack_main" >&5 +echo "${ECHO_T}$ac_cv_lib_jack_main" >&6 +if test $ac_cv_lib_jack_main = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBJACK 1 +_ACEOF + + LIBS="-ljack $LIBS" + +else + { { echo "$as_me:$LINENO: error: JACK library not found." >&5 +echo "$as_me: error: JACK library not found." >&2;} + { (exit 1); exit 1; }; } +fi + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +# --- PortAudio --- +echo "$as_me:$LINENO: checking whether to enable PortAudio" >&5 +echo $ECHO_N "checking whether to enable PortAudio... $ECHO_C" >&6 +# Check whether --enable-portaudio or --disable-portaudio was given. +if test "${enable_portaudio+set}" = set; then + enableval="$enable_portaudio" + enable_portaudio=$enableval +else + enable_portaudio=no +fi; +if test "x$enable_portaudio" = "xyes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + CXXFLAGS="$CXXFLAGS -DCAPTURE_PORTAUDIO" + if test "${ac_cv_header_portaudio_h+set}" = set; then + echo "$as_me:$LINENO: checking for portaudio.h" >&5 +echo $ECHO_N "checking for portaudio.h... $ECHO_C" >&6 +if test "${ac_cv_header_portaudio_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_portaudio_h" >&5 +echo "${ECHO_T}$ac_cv_header_portaudio_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking portaudio.h usability" >&5 +echo $ECHO_N "checking portaudio.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking portaudio.h presence" >&5 +echo $ECHO_N "checking portaudio.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: portaudio.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: portaudio.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: portaudio.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: portaudio.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: portaudio.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: portaudio.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: portaudio.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: portaudio.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: portaudio.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: portaudio.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: portaudio.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: portaudio.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: portaudio.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: portaudio.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: portaudio.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: portaudio.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------- ## +## Report this to the fmit lists. ## +## ------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for portaudio.h" >&5 +echo $ECHO_N "checking for portaudio.h... $ECHO_C" >&6 +if test "${ac_cv_header_portaudio_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_portaudio_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_portaudio_h" >&5 +echo "${ECHO_T}$ac_cv_header_portaudio_h" >&6 + +fi +if test $ac_cv_header_portaudio_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: PortAudio header not found." >&5 +echo "$as_me: error: PortAudio header not found." >&2;} + { (exit 1); exit 1; }; } +fi + + + +echo "$as_me:$LINENO: checking for main in -lportaudio" >&5 +echo $ECHO_N "checking for main in -lportaudio... $ECHO_C" >&6 +if test "${ac_cv_lib_portaudio_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lportaudio $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_portaudio_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_portaudio_main=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_portaudio_main" >&5 +echo "${ECHO_T}$ac_cv_lib_portaudio_main" >&6 +if test $ac_cv_lib_portaudio_main = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPORTAUDIO 1 +_ACEOF + + LIBS="-lportaudio $LIBS" + +else + { { echo "$as_me:$LINENO: error: PortAudio library not found." >&5 +echo "$as_me: error: PortAudio library not found." >&2;} + { (exit 1); exit 1; }; } +fi + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + ac_config_files="$ac_config_files Makefile m4/Makefile libs/Makefile libs/CppAddons/Makefile libs/Music/Makefile ui/Makefile src/Makefile src/modules/Makefile tr/Makefile" + + + +echo "$as_me:$LINENO: checking packager string" >&5 +echo $ECHO_N "checking packager string... $ECHO_C" >&6 +# Check whether --enable-packager-string or --disable-packager-string was given. +if test "${enable_packager_string+set}" = set; then + enableval="$enable_packager_string" + enable_packager_string=$enableval +else + enable_packager_string="" +fi; +if test -n "$enable_packager_string"; then + echo "$as_me:$LINENO: result: $enable_packager_string" >&5 +echo "${ECHO_T}$enable_packager_string" >&6 + +cat >>confdefs.h <<_ACEOF +#define PACKAGER_STRING "${enable_packager_string}" +_ACEOF + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +cat >confcache <<\_ACEOF +# 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, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# 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 \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by fmit $as_me 0.97.6, which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +fmit config.status 0.97.6 +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2003 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "m4/Makefile" ) CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;; + "libs/Makefile" ) CONFIG_FILES="$CONFIG_FILES libs/Makefile" ;; + "libs/CppAddons/Makefile" ) CONFIG_FILES="$CONFIG_FILES libs/CppAddons/Makefile" ;; + "libs/Music/Makefile" ) CONFIG_FILES="$CONFIG_FILES libs/Music/Makefile" ;; + "ui/Makefile" ) CONFIG_FILES="$CONFIG_FILES ui/Makefile" ;; + "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "src/modules/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/modules/Makefile" ;; + "tr/Makefile" ) CONFIG_FILES="$CONFIG_FILES tr/Makefile" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@CYGPATH_W@,$CYGPATH_W,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@ACLOCAL@,$ACLOCAL,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOMAKE@,$AUTOMAKE,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@install_sh@,$install_sh,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@mkdir_p@,$mkdir_p,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@am__leading_dot@,$am__leading_dot,;t t +s,@AMTAR@,$AMTAR,;t t +s,@am__tar@,$am__tar,;t t +s,@am__untar@,$am__untar,;t t +s,@ac_prefix@,$ac_prefix,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@DEPDIR@,$DEPDIR,;t t +s,@am__include@,$am__include,;t t +s,@am__quote@,$am__quote,;t t +s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t +s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t +s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t +s,@CCDEPMODE@,$CCDEPMODE,;t t +s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t +s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t +s,@CPP@,$CPP,;t t +s,@CXX@,$CXX,;t t +s,@CXXFLAGS@,$CXXFLAGS,;t t +s,@ac_ct_CXX@,$ac_ct_CXX,;t t +s,@CXXDEPMODE@,$CXXDEPMODE,;t t +s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t +s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t +s,@CXXCPP@,$CXXCPP,;t t +s,@EGREP@,$EGREP,;t t +s,@X_CFLAGS@,$X_CFLAGS,;t t +s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t +s,@X_LIBS@,$X_LIBS,;t t +s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t +s,@QT_CXXFLAGS@,$QT_CXXFLAGS,;t t +s,@QT_DIR@,$QT_DIR,;t t +s,@QT_LIBS@,$QT_LIBS,;t t +s,@QT_UIC@,$QT_UIC,;t t +s,@QT_MOC@,$QT_MOC,;t t +s,@GL_CFLAGS@,$GL_CFLAGS,;t t +s,@GL_LIBS@,$GL_LIBS,;t t +s,@ALSA_CFLAGS@,$ALSA_CFLAGS,;t t +s,@ALSA_LIBS@,$ALSA_LIBS,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # 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_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # 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" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + # Do quote $f, to prevent DOS paths from being IFS'd. + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi +# Compute $ac_file's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $ac_file | $ac_file:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || +$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X$ac_file : 'X\(//\)[^/]' \| \ + X$ac_file : 'X\(//\)$' \| \ + X$ac_file : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X$ac_file | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'`/stamp-h$_am_stamp_count +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`(dirname "$mf") 2>/dev/null || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`(dirname "$file") 2>/dev/null || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p $dirpart/$fdir + else + as_dir=$dirpart/$fdir + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 +echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + { (exit 1); exit 1; }; }; } + + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + esac +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + + +echo "" +echo "Now type 'make', followed by 'make install' as root." +echo "" + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..aedbf1d --- /dev/null +++ b/configure.ac @@ -0,0 +1,190 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.59) +AC_INIT(fmit, 0.97.6) +AM_CONFIG_HEADER(config.h) +AC_PREFIX_DEFAULT(/usr/local/) +AM_INIT_AUTOMAKE([no-define dist-bzip2]) + +AC_MSG_CHECKING(whether to enable debugging) +AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging (default=no)]) +if test "x$enable_debug" = "xyes"; then + CXXFLAGS="$CPPFLAGS -g -DDEBUG" + AC_MSG_RESULT(yes) +else + CXXFLAGS="$CPPFLAGS -O3 -ffast-math" + AC_MSG_RESULT(no) +fi + +# Set default installation prefix. +AC_PREFIX_DEFAULT(/usr/local) +ac_prefix=$prefix +if test "x$ac_prefix" = "xNONE"; then + ac_prefix=$ac_default_prefix +fi +AC_SUBST(ac_prefix) +AC_DEFINE_UNQUOTED(PREFIX, ["$ac_prefix"], [Installation prefix.]) + +# Checks for programs. +AC_PROG_RANLIB +AC_PROG_CC +AC_PROG_CPP +AC_PROG_CXX +AC_PROG_CXXCPP +AC_PROG_GCC_TRADITIONAL +AC_PROG_INSTALL + +# Checks for languages. +AC_LANG_C +AC_LANG_CPLUSPLUS + +# Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS([stdlib.h unistd.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_HEADER_STDBOOL +AC_C_CONST +AC_C_INLINE +AC_C_VOLATILE +AC_TYPE_SIZE_T +AC_CXX_NAMESPACES +AC_CXX_HAVE_STL +AC_CXX_HAVE_NUMERIC_LIMITS +AC_CXX_HAVE_SSTREAM +AC_CXX_TEMPLATES +AC_CXX_EXCEPTIONS +AC_CXX_HAVE_COMPLEX + +# Checks for library functions. +AC_TYPE_SIGNAL +AC_CHECK_FUNCS([pow sqrt]) + +AC_CHECK_HEADERS([fftw3.h]) +AC_CHECK_LIB(fftw3, fftw_plan_dft_1d) + +# --- Qt --- +BNV_HAVE_QT + +QTDIR="$QT_DIR" +CFLAGS="$CFLAGS $QT_CXXFLAGS" +CPPFLAGS="$CPPFLAGS $QT_CXXFLAGS" +LIBS="$LIBS $QT_LIBS" + +dnl AC_CACHE_CHECK([for Qt library version >= 3.2], +dnl ac_qtlib_version, [ +dnl AC_TRY_LINK([#include "qglobal.h"], [ +dnl #if QT_VERSION < 0x030200 +dnl #error Qt library 3.2 or greater required. +dnl #endif +dnl ], +dnl ac_qtlib_version="yes", [ +dnl echo "no; Qt 3.2 or greater is required" +dnl exit +dnl ]) +dnl ]) + +# --- OpenGL --- +MDL_HAVE_OPENGL +AC_MSG_CHECKING(for GL) +if test "x$have_GL" = "xyes"; then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) + AC_MSG_ERROR(no GL library found) +fi +AC_MSG_CHECKING(for GLU) +if test "x$have_GLU" = "xyes"; then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) + AC_MSG_ERROR(no GLU library found) +fi +AC_MSG_CHECKING(for glut) +if test "x$have_glut" = "xyes"; then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) + AC_MSG_ERROR(no glut library found) +fi + + +# Checks for features +# --- ALSA --- +AC_MSG_CHECKING(whether to enable ALSA) +AC_ARG_ENABLE(alsa, + AC_HELP_STRING([--enable-alsa],[turn on ALSA support (default=yes)]), + [enable_alsa=$enableval],[enable_alsa=yes]) +if test "x$enable_alsa" = "xyes"; then + AC_MSG_RESULT(yes) + AM_PATH_ALSA(0.9,[CXXFLAGS="$CXXFLAGS -DCAPTURE_ALSA"]) +else + AC_MSG_RESULT(no) +fi + +# --- OSS --- +AC_MSG_CHECKING(whether to enable OSS) +AC_ARG_ENABLE(oss, + AC_HELP_STRING([--enable-oss],[turn on OSS support (default=yes)]), + [enable_oss=$enableval],[enable_oss=yes]) +if test "x$enable_oss" = "xyes"; then + AC_MSG_RESULT(yes) + CXXFLAGS="$CXXFLAGS -DCAPTURE_OSS" + AC_CHECK_HEADER(sys/soundcard.h,,AC_MSG_ERROR([OSS header not found.])) +else + AC_MSG_RESULT(no) +fi + +# --- JACK --- +AC_MSG_CHECKING(whether to enable JACK) +AC_ARG_ENABLE(jack, + AC_HELP_STRING([--enable-jack],[turn on JACK support (default=yes)]), + [enable_jack=$enableval],[enable_jack=yes]) +if test "x$enable_jack" = "xyes"; then + AC_MSG_RESULT(yes) + CXXFLAGS="$CXXFLAGS -DCAPTURE_JACK" + AC_CHECK_HEADER(jack/jack.h,,AC_MSG_ERROR([JACK headers not found.])) + AC_CHECK_LIB(jack, main,,AC_MSG_ERROR([JACK library not found.])) +else + AC_MSG_RESULT(no) +fi + +# --- PortAudio --- +AC_MSG_CHECKING(whether to enable PortAudio) +AC_ARG_ENABLE(portaudio, + AC_HELP_STRING([--enable-portaudio],[turn on PortAudio support (default=no)]), + [enable_portaudio=$enableval],[enable_portaudio=no]) +if test "x$enable_portaudio" = "xyes"; then + AC_MSG_RESULT(yes) + CXXFLAGS="$CXXFLAGS -DCAPTURE_PORTAUDIO" + AC_CHECK_HEADER(portaudio.h,,AC_MSG_ERROR([PortAudio header not found.])) + AC_CHECK_LIB(portaudio, main,,AC_MSG_ERROR([PortAudio library not found.])) +else + AC_MSG_RESULT(no) +fi + +AC_CONFIG_FILES([Makefile m4/Makefile libs/Makefile libs/CppAddons/Makefile + libs/Music/Makefile ui/Makefile src/Makefile src/modules/Makefile + tr/Makefile]) + +dnl CFLAGS="$CFLAGS -pg" +dnl CPPFLAGS="$CPPFLAGS -pg" + +AC_MSG_CHECKING(packager string) +AC_ARG_ENABLE(packager-string, + AC_HELP_STRING([--enable-packager-string=NAME],[add references of the packager in the about box]), + [enable_packager_string=$enableval],[enable_packager_string=""]) +if test -n "$enable_packager_string"; then + AC_MSG_RESULT($enable_packager_string) + AC_DEFINE_UNQUOTED(PACKAGER_STRING,"${enable_packager_string}",[References of the packager in the about box]) +else + AC_MSG_RESULT(no) +fi + +AC_OUTPUT + +echo "" +echo "Now type 'make', followed by 'make install' as root." +echo "" + diff --git a/depcomp b/depcomp new file mode 100755 index 0000000..04701da --- /dev/null +++ b/depcomp @@ -0,0 +1,530 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2005-07-09.11 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. + +# 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., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. + "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + stat=$? + + if test -f "$tmpdepfile"; then : + else + stripped=`echo "$stripped" | sed 's,^.*/,,'` + tmpdepfile="$stripped.u" + fi + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + outname="$stripped.o" + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mecanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no + for arg in "$@"; do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + "$@" || exit $? + IFS=" " + for arg + do + case "$arg" in + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/fmit.desktop b/fmit.desktop new file mode 100644 index 0000000..c5a3e90 --- /dev/null +++ b/fmit.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Application +Name=fmit +Comment=Music instrument tuner +Exec=fmit +Icon=mix_mic +Categories=Qt;AudioVideo diff --git a/install-sh b/install-sh new file mode 100755 index 0000000..4d4a951 --- /dev/null +++ b/install-sh @@ -0,0 +1,323 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2005-05-14.22 + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# 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}" + +chmodcmd="$chmodprog 0755" +chowncmd= +chgrpcmd= +stripcmd= +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src= +dst= +dir_arg= +dstarg= +no_target_directory= + +usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: +-c (ignored) +-d create directories instead of installing files. +-g GROUP $chgrpprog installed files to GROUP. +-m MODE $chmodprog installed files to MODE. +-o USER $chownprog installed files to USER. +-s $stripprog installed files. +-t DIRECTORY install into DIRECTORY. +-T report an error if DSTFILE is a directory. +--help display this help and exit. +--version display version info and exit. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG +" + +while test -n "$1"; do + case $1 in + -c) shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + --help) echo "$usage"; exit $?;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t) dstarg=$2 + shift + shift + continue;; + + -T) no_target_directory=true + shift + continue;; + + --version) echo "$0 $scriptversion"; exit $?;; + + *) # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + test -n "$dir_arg$dstarg" && break + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dstarg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dstarg" + shift # fnord + fi + shift # arg + dstarg=$arg + done + break;; + esac +done + +if test -z "$1"; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src ;; + esac + + if test -n "$dir_arg"; then + dst=$src + src= + + if test -d "$dst"; then + mkdircmd=: + chmodcmd= + else + mkdircmd=$mkdirprog + fi + else + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dstarg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dstarg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst ;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dstarg: Is a directory" >&2 + exit 1 + fi + dst=$dst/`basename "$src"` + fi + fi + + # This sed command emulates the dirname command. + dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` + + # Make sure that the destination directory exists. + + # Skip lots of stat calls in the usual case. + if test ! -d "$dstdir"; then + defaultIFS=' + ' + IFS="${IFS-$defaultIFS}" + + oIFS=$IFS + # Some sh's can't handle IFS=/ for some reason. + IFS='%' + set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` + shift + IFS=$oIFS + + pathcomp= + + while test $# -ne 0 ; do + pathcomp=$pathcomp$1 + shift + if test ! -d "$pathcomp"; then + $mkdirprog "$pathcomp" + # mkdir can fail with a `File exist' error in case several + # install-sh are creating the directory concurrently. This + # is OK. + test -d "$pathcomp" || exit + fi + pathcomp=$pathcomp/ + done + fi + + if test -n "$dir_arg"; then + $doit $mkdircmd "$dst" \ + && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } + + else + dstfile=`basename "$dst"` + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + trap '(exit $?); exit' 1 2 13 15 + + # Copy the file name to the temp name. + $doit $cpprog "$src" "$dsttmp" && + + # 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 $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && + + # Now rename the file to the real destination. + { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ + || { + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + if test -f "$dstdir/$dstfile"; then + $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ + || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ + || { + echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 + (exit 1); exit 1 + } + else + : + fi + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" + } + } + fi || { (exit 1); exit 1; } +done + +# The final little trick to "correctly" pass the exit status to the exit trap. +{ + (exit 0); exit 0 +} + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/libs/CppAddons/AUTHORS b/libs/CppAddons/AUTHORS new file mode 100644 index 0000000..e24d612 --- /dev/null +++ b/libs/CppAddons/AUTHORS @@ -0,0 +1 @@ +Gilles Degottex [gilles.degottex@net2000.ch] diff --git a/libs/CppAddons/CAMath.cpp b/libs/CppAddons/CAMath.cpp new file mode 100644 index 0000000..4ded106 --- /dev/null +++ b/libs/CppAddons/CAMath.cpp @@ -0,0 +1,95 @@ +// Copyright 2003 "Gilles Degottex" + +// This file is part of "CppAddons" + +// "CppAddons" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "CppAddons" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#include "CAMath.h" + +double Math::SolOfEq2::getPosSol() +{ + if(x1<0) + { + if(x2<0) + { + m_err=NE_X1_AND_X2_NEG; + return 0; + } + else return x2; + } + else + { + if(x2>0) + { + m_err=NE_X1_AND_X2_POS; + return 0; + } + else return x1; + } +} + +Math::SolOfEq2::SolOfEq2(double a, double b, double c) +{ + m_err = NE_OK; + + if(a==0) + { + if(b==0) + { + m_err=NE_A_AND_B_EQ_ZERO; + x1=0; + x2=0; + } + else + { + x1=-c/b; + x2=x1; + } + } + else if(b==0) + { + double d=-c/a; + if(d<0) + { + m_err=NE_RACINE_NEG; + x1=0; + x2=0; + } + else + { + x1=sqrt(d); + x2=-x1; + } + } + else + { + double d=b*b-4*a*c; + if(d<0) + { + m_err=NE_DISCRIMINENT_NEG; + x1=0; + x2=0; + } + else + { + d=sqrt(d); + + a*=2; + x1=(-b+d)/a; + x2=(-b-d)/a; + } + } +} diff --git a/libs/CppAddons/CAMath.h b/libs/CppAddons/CAMath.h new file mode 100644 index 0000000..294ce8d --- /dev/null +++ b/libs/CppAddons/CAMath.h @@ -0,0 +1,138 @@ +// Copyright 2003 "Gilles Degottex" + +// This file is part of "CppAddons" + +// "CppAddons" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "CppAddons" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#ifndef _Math_h_ +#define _Math_h_ + +#include +#include +#include +using namespace std; + +#undef min +#undef max + +namespace Math +{ + template inline TypeData sgn(TypeData a) {return (a<0)?-1:1;} + + static const double Pi = 2*acos(0); + static const float fPi = 2*acos(0); + + static const double E = exp(1); + static const float fE = exp(1); + + // résoud une equation du 2ème degré + class SolOfEq2 + { + public: + enum ENError{NE_OK=0, NE_DISCRIMINENT_NEG, NE_A_AND_B_EQ_ZERO, NE_RACINE_NEG, NE_X1_AND_X2_NEG, NE_X1_AND_X2_POS}; + + private: + ENError m_err; + + double x1; + double x2; + + public: + double getX1(){return x1;} + double getX2(){return x2;} + double getPosSol(); + + SolOfEq2(double a, double b, double c); + }; + + // calcul l'intérale de f sur [a;b] avec un pas de h + // méhode de Simpson + template + double Simpson(double a, double b, Function f, double h) + { + double I4=f(a+h/2.0), I2=0; + for(double x4=a+(h/2.0)+h, x2=a+h; x4 std::complex make_complex(Type value[]){return std::complex(value[0], value[1]);} + + inline double modulo(double d1, double d2) + { + return d1-int(d1/d2)*d2; + } + inline double mod2(const double c[2]) + { + return c[0]*c[0]+c[1]*c[1]; + } + inline double mod(const double c[2]) + { + return sqrt(mod2(c)); + } + inline double mod2(const std::complex& c) + { + return c.real()*c.real()+c.imag()*c.imag(); + } + inline double mod(const std::complex& c) + { + return sqrt(mod2(c)); + } + + inline double mod_equal(double& d1, double d2) + { + return d1 -= int(d1/d2)*d2; + } + + //! gauss fonction + /*! + * \param x \f$\in ]-\infty,\infty[\f$ + */ + inline double gauss(double x) + { + return exp(-Math::Pi*x*x); + } + + inline double sinc(double t) + { + if(t==0.0) return 1.0; + + return sin(Math::Pi*t)/(Math::Pi*t); + } + +/* doesn't need for Linux for sure, seems to be probelatic under win32 (macro ambiquity) + template + TypeData1 max(const TypeData1& a, const TypeData2& b) + { + return (a>b)?a:b; +} + + template + TypeData1 min(const TypeData1& a, const TypeData2& b) + { + return (a TypeData abs(const TypeData& a) {return (a<0)?-a:a;} // include instead +// template TypeData abs(TypeData a) {return (a<0)?-a:a;} // include instead + +} + +#endif + diff --git a/libs/CppAddons/COPYING b/libs/CppAddons/COPYING new file mode 100644 index 0000000..b1e3f5a --- /dev/null +++ b/libs/CppAddons/COPYING @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + 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 Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +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 and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +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 other code 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. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + 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, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser 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 combine 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) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) 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. + + d) 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. + + e) 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 materials to be 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 with +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 Lesser 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 + + 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 Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +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! + + diff --git a/libs/CppAddons/Fit.cpp b/libs/CppAddons/Fit.cpp new file mode 100644 index 0000000..6a45d18 --- /dev/null +++ b/libs/CppAddons/Fit.cpp @@ -0,0 +1,37 @@ +// Copyright 2007 "Gilles Degottex" + +// This file is part of "CppAddons" + +// "CppAddons" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "CppAddons" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#include "Fit.h" +#include + +void Math::FitParabola(double x1, double y1, double x2, double y2, double x3, double y3, + double& a, double& b, double& c, double& xapex, double& yapex) +{ + assert(x1!=x2 && x1!=x3 && x2!=x3); + + double h31 = (y3-y1)/(x3-x1); + double h21 = (y2-y1)/(x2-x1); + + a = (h31-h21)/(x3-x2); + b = h21 - a*(x2+x1); + c = y1 - a*x1*x1 - b*x1; + + xapex = -b/2/a; + yapex = c - b*b/4/a; +} diff --git a/libs/CppAddons/Fit.h b/libs/CppAddons/Fit.h new file mode 100644 index 0000000..4ced5f4 --- /dev/null +++ b/libs/CppAddons/Fit.h @@ -0,0 +1,28 @@ +// Copyright 2007 "Gilles Degottex" + +// This file is part of "CppAddons" + +// "CppAddons" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "CppAddons" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + +#ifndef _Fit_h_ +#define _Fit_h_ + +namespace Math +{ + void FitParabola(double x1, double y1, double x2, double y2, double x3, double y3, + double& a, double& b, double& c, double& xapex, double& yapex); +} + +#endif diff --git a/libs/CppAddons/Makefile.am b/libs/CppAddons/Makefile.am new file mode 100644 index 0000000..a28f494 --- /dev/null +++ b/libs/CppAddons/Makefile.am @@ -0,0 +1,4 @@ +lib_LIBRARIES = libCppAddons.a +AM_CXXFLAGS = -Wall -ansi -pedantic +libCppAddons_a_SOURCES = CAMath.cpp Random.cpp Fit.cpp +EXTRA_DIST = *.h diff --git a/libs/CppAddons/Makefile.in b/libs/CppAddons/Makefile.in new file mode 100644 index 0000000..22d2abb --- /dev/null +++ b/libs/CppAddons/Makefile.in @@ -0,0 +1,442 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = libs/CppAddons +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in AUTHORS \ + COPYING TODO +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_cxx_exceptions.m4 \ + $(top_srcdir)/m4/ac_cxx_have_complex.m4 \ + $(top_srcdir)/m4/ac_cxx_have_numeric_limits.m4 \ + $(top_srcdir)/m4/ac_cxx_have_sstream.m4 \ + $(top_srcdir)/m4/ac_cxx_have_stl.m4 \ + $(top_srcdir)/m4/ac_cxx_namespaces.m4 \ + $(top_srcdir)/m4/ac_cxx_templates.m4 \ + $(top_srcdir)/m4/bnv_have_qt.m4 \ + $(top_srcdir)/m4/mdl_have_opengl.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLIBRARIES_INSTALL = $(INSTALL_DATA) +LIBRARIES = $(lib_LIBRARIES) +AR = ar +ARFLAGS = cru +libCppAddons_a_AR = $(AR) $(ARFLAGS) +libCppAddons_a_LIBADD = +am_libCppAddons_a_OBJECTS = CAMath.$(OBJEXT) Random.$(OBJEXT) \ + Fit.$(OBJEXT) +libCppAddons_a_OBJECTS = $(am_libCppAddons_a_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +SOURCES = $(libCppAddons_a_SOURCES) +DIST_SOURCES = $(libCppAddons_a_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QT_CXXFLAGS = @QT_CXXFLAGS@ +QT_DIR = @QT_DIR@ +QT_LIBS = @QT_LIBS@ +QT_MOC = @QT_MOC@ +QT_UIC = @QT_UIC@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_prefix = @ac_prefix@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +lib_LIBRARIES = libCppAddons.a +AM_CXXFLAGS = -Wall -ansi -pedantic +libCppAddons_a_SOURCES = CAMath.cpp Random.cpp Fit.cpp +EXTRA_DIST = *.h +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libs/CppAddons/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu libs/CppAddons/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLIBRARIES: $(lib_LIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + @list='$(lib_LIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(libLIBRARIES_INSTALL) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(libLIBRARIES_INSTALL) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + @$(POST_INSTALL) + @list='$(lib_LIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + p=$(am__strip_dir) \ + echo " $(RANLIB) '$(DESTDIR)$(libdir)/$$p'"; \ + $(RANLIB) "$(DESTDIR)$(libdir)/$$p"; \ + else :; fi; \ + done + +uninstall-libLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLIBRARIES: + -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES) +libCppAddons.a: $(libCppAddons_a_OBJECTS) $(libCppAddons_a_DEPENDENCIES) + -rm -f libCppAddons.a + $(libCppAddons_a_AR) libCppAddons.a $(libCppAddons_a_OBJECTS) $(libCppAddons_a_LIBADD) + $(RANLIB) libCppAddons.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CAMath.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Fit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Random.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-libLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-libLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLIBRARIES ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-libLIBRARIES install-man install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-info-am uninstall-libLIBRARIES + +# 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: diff --git a/libs/CppAddons/Observer.h b/libs/CppAddons/Observer.h new file mode 100644 index 0000000..40d33fb --- /dev/null +++ b/libs/CppAddons/Observer.h @@ -0,0 +1,144 @@ +// Copyright 2003 "Gilles Degottex" + +// This file is part of "CppAddons" + +// "CppAddons" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "CppAddons" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#ifndef _Observer_h_ +#define _Observer_h_ + +#include +#include +#include // for: find +using namespace std; + +template class Talker; + +template +class Listener +{ + friend class Talker; + + bool m_isListenning; + +protected: + void todo(const string& fn){cerr << typeid(this).name() << "::" << fn << " not yet implemented" << endl;} + +public: + Listener() : m_isListenning(false) {} + + bool isListenning() {return m_isListenning;} +}; + +template +class FireFun +{ + void (TListener::*m_pfOccured)(TypeEvent*); + + TypeEvent* m_evt; + +public: + explicit FireFun(void (TListener::*pfOccured)(TypeEvent*), TypeEvent* evt) + : m_pfOccured(pfOccured), m_evt(evt) + {} + + void operator()(TListener* l) const {(l->*m_pfOccured)(m_evt);} +}; + +template +class EventObject +{ + SourceType* m_obj; + +public: + EventObject(SourceType* source) : m_obj(source) {} + + SourceType* getSource() const {return m_obj;} +}; + +template +class Talker +{ +public: + typedef Listener TypeListener; + typedef list ListenersList; + typedef typename ListenersList::iterator ListenersIterator; + +private: + ListenersList m_removed; + +protected: + + ListenersList m_listeners; + + bool m_firing; + void removeRemoved() + { + while(!m_removed.empty()) + { + m_removed.front()->m_isListenning = false; + m_listeners.remove(m_removed.front()); + m_removed.pop_front(); + } + } + + #define MFireEventL(s, L) {Talker::m_firing=true;for(Talker::ListenersList::iterator _listenerIterator_=(Talker::m_listeners).begin(); _listenerIterator_!=(Talker::m_listeners).end(); ++_listenerIterator_) (*_listenerIterator_)->s;Talker::m_firing=false;Talker::removeRemoved();} + #define MFireEvent(s) MFireEventL(s, TypeListener) + + template + void fireEvent(void (Listener::*fOccured)(TypeEvent*), TypeEvent* evt) + { + m_firing=true; + for_each( (Talker::m_listeners).begin(), + (Talker::m_listeners).end(), + FireFun(fOccured, evt)); + m_firing=false; + removeRemoved(); + } + +public: + Talker() : m_firing(false) {} + + bool hasListeners(){return !m_listeners.empty();} + bool hasListener(Listener* l) + { + return find(m_listeners.begin(), m_listeners.end(), l)!=m_listeners.end(); + } + void addListener(Listener* l) + { + m_listeners.push_back(l); // discutable: back/front + + l->m_isListenning = true; + } + void removeListener(Listener* l) + { + if(m_firing) m_removed.push_back(l); + else + { + m_listeners.remove(l); + l->m_isListenning = false; + } + } + void toggleListener(Listener* l) + { + if(hasListener(l)) addListener(l); + else removeListener(l); + } + + list& getListeners(){return m_listeners;} +}; + +#endif diff --git a/libs/CppAddons/Random.cpp b/libs/CppAddons/Random.cpp new file mode 100644 index 0000000..fd163ea --- /dev/null +++ b/libs/CppAddons/Random.cpp @@ -0,0 +1,92 @@ +// Copyright 2003 "Gilles Degottex" + +// This file is part of "CppAddons" + +// "CppAddons" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "CppAddons" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#include "Random.h" +#include +#include + +const int Random::A = 48271; +//const int Random::M = 2147483647; +const int Random::M = RAND_MAX; +const int Random::Q = M / A; +const int Random::R = M % A; + +Random Random::s_random; + +Random::Random(long seed) +{ + m_haveNextNextGaussian=false; + + setSeed(seed); + + next(); +} + +void Random::setSeed(long seed) +{ + srand(seed); + + if(seed < 0) seed += M+1; + m_seed = seed; + if(m_seed==0) m_seed = 1; + + m_haveNextNextGaussian = false; +} + +long Random::next() +{ +// int tmp = A * (m_seed % Q) - R * (m_seed / Q); +// if(tmp>=0) m_seed = tmp; +// else m_seed = tmp + M; +// +// return m_seed; + + return rand(); +} + +double Random::nextGaussian() +{ +// Throw("nextGaussian", "not yet implemented"); + + // See Knuth, ACP, Section 3.4.1 Algorithm C. + if(m_haveNextNextGaussian) + { + m_haveNextNextGaussian = false; + return m_nextNextGaussian; + } + else + { + double v1, v2, s; + do + { + v1 = 2 * nextDouble() - 1; // between -1 and 1 + v2 = 2 * nextDouble() - 1; // between -1 and 1 + s = v1 * v1 + v2 * v2; + } + while (s >= 1 || s == 0); + + double multiplier = sqrt(-2 * log(s)/s); + + m_nextNextGaussian = v2 * multiplier; + m_haveNextNextGaussian = true; + + return v1 * multiplier; + } +} + diff --git a/libs/CppAddons/Random.h b/libs/CppAddons/Random.h new file mode 100644 index 0000000..95a95ce --- /dev/null +++ b/libs/CppAddons/Random.h @@ -0,0 +1,98 @@ +// Copyright 2003 "Gilles Degottex" + +// This file is part of "CppAddons" + +// "CppAddons" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "CppAddons" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#ifndef _Random_h_ +#define _Random_h_ + +#include + +class Random +{ +private: + static const int A; + static const int M; + static const int Q; + static const int R; + + long m_seed; + double m_nextNextGaussian; + bool m_haveNextNextGaussian; + +public: + Random(long seed=time(NULL)); + + void setSeed(long seed); + + static Random s_random; + +protected: + long next(); + +public: + + int nextInt() + { + return (int)next(); + } + + int nextInt(int max) + { + return nextInt()%max; + } + + int nextInt(int a, int b) + { + return nextInt()%(b-a) + a; + } + + long nextLong() + { + return next(); + } + + bool nextBoolean() + { + return next() % 2 == 0; + } + + float nextFloat() + { + return nextInt() / float(M); + } + + double nextDouble() + { + return nextInt() / double(M); + } + + char nextLetter() + { + return char(('z' - 'a' + 1) * nextDouble() + 'a'); + } + + char nextFigure() + { + return char(('9' - '0' + 1) * nextDouble() + '0'); + } + + double nextGaussian(); +}; + +#endif + diff --git a/libs/CppAddons/Singleton.h b/libs/CppAddons/Singleton.h new file mode 100644 index 0000000..58313b4 --- /dev/null +++ b/libs/CppAddons/Singleton.h @@ -0,0 +1,46 @@ +// Copyright 2003 "Gilles Degottex" + +// This file is part of "CppAddons" + +// "CppAddons" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "CppAddons" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#ifndef _Singleton_h_ +#define _Singleton_h_ + +#include + +template class Singleton +{ + static Type* sm_instance; + +protected: + Singleton() + { + assert(sm_instance==0); + sm_instance = (Type*)this; + } + +public: + inline static Type& getInstance() + { + assert(sm_instance!=0); + return *sm_instance; + } +}; + +template Type* Singleton::sm_instance=0; + +#endif diff --git a/libs/CppAddons/StringAddons.h b/libs/CppAddons/StringAddons.h new file mode 100644 index 0000000..9a3d9f6 --- /dev/null +++ b/libs/CppAddons/StringAddons.h @@ -0,0 +1,118 @@ +// Copyright 2003 "Gilles Degottex" + +// This file is part of "CppAddons" + +// "CppAddons" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "CppAddons" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#ifndef _StringAddons_h_ +#define _StringAddons_h_ + +#include +#include +#include + +#include + +#include + +namespace StringAddons +{ + template std::string toString(Type i) + { + std::stringstream str; + str << i; + return str.str(); + } + template void toString(std::string& s, Type i) + { + std::stringstream str; + str << i; + s = str.str(); + } + + inline std::string ereaseEmptyChars(const std::string& str) + { + std::string result; + + for(unsigned int i=0; i inline std::string binValue(T& d) + { + char* data = (char*)&d; + + std::string str; + + for(int i=sizeof(T)-1; i>=0; i--) + { + for(int j=7; j>=0; j--) + { + if(data[i] & (0x01<0) str += "'"; + } + + return str; + } + +#ifdef WIN32 + std::wstring toWide(const std::string& str); + std::string toAnsi(const std::wstring& str); +#endif + + // Undoable Out + template void undoable_out_clear(OstreamType& out, int n) + { + while(n-->0) out << "\b"; + } + template int undoable_out(OstreamType& out, const std::string& s, int n) + { + undoable_out_clear(out, n); + std::stringstream str; + str.precision(1); + str << s; + n = str.tellp(); + out << str.str(); + return n; + } + template int undoable_out_percent(OstreamType& out, float f, int n=0) + { + undoable_out_clear(out, n); + std::stringstream str; + str.precision(1); + str << std::fixed << f << "% " << std::flush; + n = str.tellp(); + out << str.str(); + return n; + } + +/* //----------------------------------------------------------------------------- + // UNICODE support for converting between CHAR, TCHAR, and WCHAR strings + //----------------------------------------------------------------------------- + void ConvertGenericStringToAnsi( CHAR* strDestination, const TCHAR* tstrSource, int cchDestChar = -1 ); + void ConvertGenericStringToWide( WCHAR* wstrDestination, const TCHAR* tstrSource, int cchDestChar = -1 ); + void ConvertAnsiStringToGeneric( TCHAR* tstrDestination, const CHAR* strSource, int cchDestChar = -1 ); + void ConvertWideStringToGeneric( TCHAR* tstrDestination, const WCHAR* wstrSource, int cchDestChar = -1 ); +*/ +} + +#endif diff --git a/libs/CppAddons/TODO b/libs/CppAddons/TODO new file mode 100644 index 0000000..cae290b --- /dev/null +++ b/libs/CppAddons/TODO @@ -0,0 +1,4 @@ +- Math: SolOfEq2, metre à jour +mixer algèbre lin. de music et Matrix + complèter Matrix +Declarator => Métaclass +retirer asser de errors \ No newline at end of file diff --git a/libs/CppAddons/polar.h b/libs/CppAddons/polar.h new file mode 100644 index 0000000..5ec86ce --- /dev/null +++ b/libs/CppAddons/polar.h @@ -0,0 +1,61 @@ +// Copyright 2007 "Gilles Degottex" + +// This file is part of "CppAddons" + +// "CppAddons" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "CppAddons" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + +#ifndef _polar_h_ +#define _polar_h_ + +#include +#include + +#undef min +#undef max + +namespace Math +{ + template + struct polar + { + Type mod; + Type arg; + + polar(Type m, Type a) : mod(m), arg(a) {} + + polar(const std::complex& c){*this=c;} + polar(){} + + polar& operator = (const std::complex& c){mod = sqrt(std::norm(c)); arg = std::arg(c); return *this;} + }; + + //! convert cartesian coordinates to polar coordinates +// inline pair cart2pol(double x, double y) +// { +// double m = sqrt(x*x+y*y); +// +// if(m == 0.0) return make_pair(m, 0.0); +// +// double a = acos(x/m); +// +// if(y < 0.0) return make_pair(m, -a); +// +// return make_pair(m, a); +// } + + template std::complex make_complex(const polar& p){return std::complex(p.mod*cos(p.arg), p.mod*sin(p.arg));} +} + +#endif diff --git a/libs/Makefile.am b/libs/Makefile.am new file mode 100644 index 0000000..58e04ae --- /dev/null +++ b/libs/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = CppAddons Music diff --git a/libs/Makefile.in b/libs/Makefile.in new file mode 100644 index 0000000..1dbeac8 --- /dev/null +++ b/libs/Makefile.in @@ -0,0 +1,459 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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. + +@SET_MAKE@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = libs +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_cxx_exceptions.m4 \ + $(top_srcdir)/m4/ac_cxx_have_complex.m4 \ + $(top_srcdir)/m4/ac_cxx_have_numeric_limits.m4 \ + $(top_srcdir)/m4/ac_cxx_have_sstream.m4 \ + $(top_srcdir)/m4/ac_cxx_have_stl.m4 \ + $(top_srcdir)/m4/ac_cxx_namespaces.m4 \ + $(top_srcdir)/m4/ac_cxx_templates.m4 \ + $(top_srcdir)/m4/bnv_have_qt.m4 \ + $(top_srcdir)/m4/mdl_have_opengl.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QT_CXXFLAGS = @QT_CXXFLAGS@ +QT_DIR = @QT_DIR@ +QT_LIBS = @QT_LIBS@ +QT_MOC = @QT_MOC@ +QT_UIC = @QT_UIC@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_prefix = @ac_prefix@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +SUBDIRS = CppAddons Music +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libs/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu libs/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +uninstall-info-am: + +# 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. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + 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) \ + || eval $$failcom; \ + 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: + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + 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) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(mkdir_p) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ + clean clean-generic clean-recursive ctags ctags-recursive \ + distclean distclean-generic distclean-recursive distclean-tags \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-info-am + +# 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: diff --git a/libs/Music/AUTHORS b/libs/Music/AUTHORS new file mode 100644 index 0000000..ffd5abe --- /dev/null +++ b/libs/Music/AUTHORS @@ -0,0 +1 @@ +Gilles Degottex \ No newline at end of file diff --git a/libs/Music/Algorithm.cpp b/libs/Music/Algorithm.cpp new file mode 100644 index 0000000..f74a444 --- /dev/null +++ b/libs/Music/Algorithm.cpp @@ -0,0 +1,36 @@ +// Copyright 2004 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#include "Algorithm.h" +using namespace Music; + +Algorithm::Algorithm() +: m_amplitude_treshold(0.0) +, m_max_amplitude(0.0) +{ +} + +Algorithm::~Algorithm() +{ +} + +Transform::Transform() +: m_component_treshold(0.0) +{ +} diff --git a/libs/Music/Algorithm.h b/libs/Music/Algorithm.h new file mode 100644 index 0000000..58a26f7 --- /dev/null +++ b/libs/Music/Algorithm.h @@ -0,0 +1,90 @@ +// Copyright 2004 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#ifndef _Algorithm_h_ +#define _Algorithm_h_ + +#include +#include +#include +#include +using namespace std; +#include "Music.h" + +namespace Music +{ + class Algorithm : public SettingsListener + { + static list s_algos; + + protected: + double m_amplitude_treshold; + double m_max_amplitude; + + virtual void samplingRateChanged() {cerr<<__FILE__<<":"<<__LINE__<<" Algorithm::samplingRateChanged Not Yet Implemented"<& buff)=0; + virtual bool hasNoteRecognized() const =0; + virtual double getFundamentalWaveLength() const {return GetSamplingRate()/getFundamentalFreq();} + virtual double getFundamentalFreq() const {return GetSamplingRate()/getFundamentalWaveLength();} + virtual double getFundamentalNote() const {return f2hf(getFundamentalFreq());} + virtual int getMinSize() const =0; + + virtual ~Algorithm(); + }; + + class Transform : public Algorithm + { + protected: + double m_component_treshold; + + vector< complex > m_harmonics; + vector m_components; + double m_components_max; + + public: + inline double getComponentTreshold() {return m_component_treshold;} + inline void setComponentTreshold(double t) {m_component_treshold=t;} + + Transform(); + + size_t size() const {return m_components.size();} + + const vector< complex >& getHarmonics() {return m_harmonics;} + const vector& getComponents() {return m_components;} + double getComponentsMax() {return m_components_max;} + + virtual ~Transform(){} + }; +} + +#endif // _Algorithms_h_ + diff --git a/libs/Music/Autocorrelation.cpp b/libs/Music/Autocorrelation.cpp new file mode 100644 index 0000000..15d1f2b --- /dev/null +++ b/libs/Music/Autocorrelation.cpp @@ -0,0 +1,18 @@ +#include "Autocorrelation.h" + +/* Compute the autocorrelation + * ,--, + * ac(i) = > x(n) * x(n-i) for all n + * `--' + * for lags between 0 and lag-1, and x == 0 outside 0...n-1 + */ +void autocorrelation( + int n, double const * x, /* in: [0...n-1] samples x */ + int lag, double * ac) /* out: [0...lag-1] ac values */ +{ + double d; int i; + while (lag--) { + for (i = lag, d = 0; i < n; i++) d += x[i] * x[i-lag]; + ac[lag] = d; + } +} diff --git a/libs/Music/Autocorrelation.h b/libs/Music/Autocorrelation.h new file mode 100644 index 0000000..9a73d53 --- /dev/null +++ b/libs/Music/Autocorrelation.h @@ -0,0 +1,14 @@ +#ifndef _Autocorrelation_h_ +#define _Autocorrelation_h_ + +/* Compute the autocorrelation + * ,--, + * ac(i) = > x(n) * x(n-i) for all n + * `--' + * for lags between 0 and lag-1, and x == 0 outside 0...n-1 + */ +void autocorrelation( + int n, double const * x, /* in: [0...n-1] samples x */ + int lag, double * ac); /* out: [0...lag-1] ac values */ + +#endif diff --git a/libs/Music/CFFTW3.cpp b/libs/Music/CFFTW3.cpp new file mode 100644 index 0000000..a2e95c9 --- /dev/null +++ b/libs/Music/CFFTW3.cpp @@ -0,0 +1,68 @@ +#include "CFFTW3.h" + +#include +using namespace std; +#include +using namespace Math; + +CFFTW3::CFFTW3(bool forward) +{ + m_size = 0; + m_out = m_in = NULL; + m_plan = NULL; + m_forward = forward; +} +CFFTW3::CFFTW3(int n) +{ + resize(n); +} +void CFFTW3::resize(int n) +{ + assert(n>0); + + m_size = n; + + m_out = m_in = NULL; + + m_in = new fftw_complex[m_size]; + m_out = new fftw_complex[m_size]; + in.resize(m_size); + out.resize(m_size); + + // | FFTW_PRESERVE_INPUT + if(m_forward) + m_plan = fftw_plan_dft_1d(m_size, m_in, m_out, FFTW_FORWARD, FFTW_MEASURE); + else + m_plan = fftw_plan_dft_1d(m_size, m_in, m_out, FFTW_BACKWARD, FFTW_MEASURE); +} + +void CFFTW3::execute() +{ + execute(in, out); +} + +void CFFTW3::execute(const vector& in, vector >& out) +{ + assert(int(in.size())>=m_size); + + for(int i=0; i +#include +#include +#include + +class CFFTW3 +{ + int m_size; + + fftw_plan m_plan; + fftw_complex *m_in, *m_out; + bool m_forward; + + public: + CFFTW3(bool forward=true); + CFFTW3(int n); + void resize(int n); + + int size(){return m_size;} + + std::vector in; + std::vector > out; + + void execute(const std::vector& in, std::vector >& out); + void execute(); + + ~CFFTW3(); +}; + +#endif diff --git a/libs/Music/COPYING b/libs/Music/COPYING new file mode 100644 index 0000000..5b6e7c6 --- /dev/null +++ b/libs/Music/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/libs/Music/CombedFT.cpp b/libs/Music/CombedFT.cpp new file mode 100644 index 0000000..d8ce488 --- /dev/null +++ b/libs/Music/CombedFT.cpp @@ -0,0 +1,199 @@ +// Copyright 2007 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + +#include "CombedFT.h" + +#include +#include +using namespace std; +using namespace Math; +#include "Music.h" +#include "SPWindow.h" +#include "FreqAnalysis.h" + +namespace Music +{ + CombedFT::CombedFT() + { + m_use_audibility_treshold = false; + m_audib_ratio = 0.1; + + m_zp_factor = 1.0; + m_window_factor = 1.0; + + init(); + } + void CombedFT::setZeroPaddingFactor(double zp) + { + if(zp!=m_zp_factor) + { + m_zp_factor = zp; + init(); + } + } + void CombedFT::setWindowFactor(double wf) + { + if(wf!=m_window_factor) + { + m_window_factor = wf; + init(); + } + } + + void CombedFT::init() + { + if(GetSamplingRate()<=0) return; + + m_f0 = 0.0; + + int win_size = int(m_window_factor*GetSamplingRate()/h2f(GetSemitoneMin()));// at least m_window_factor period of the lowest freq + + int best_size = 2; + while(best_sizem_max_amplitude) + m_max_amplitude = abs(buff[i]); + } + for(int i=m_win.size(); im_components_max) + { + max_index = i; + m_components_max = m_comb.in[i]; + } + } + + m_f0 = 0.0; + + if(m_components_max>getComponentTreshold()) + { + m_f0 = PeakRefinementLogParabola(m_plan.out, max_index)*double(GetSamplingRate())/m_plan.size(); + + // TODO TEST *win[i]; // me semble qu'une trans de harm signal n'est pas trop discontinue aux extrémités + m_comb.execute(); + + for(size_t i=0; i temp_comp(int(m_components.size()/step), 0.0); + for(int i=1; imax_amp) + { + max_index = i; + max_amp = m_components[i]; + } + } + + if(max_index>0) + m_f0 /= max_index; + } + +// cerr << " final: " << GetSamplingRate() << ":" << m_f0 << endl; + } + CombedFT::~CombedFT() + { + } +} diff --git a/libs/Music/CombedFT.h b/libs/Music/CombedFT.h new file mode 100644 index 0000000..c101a8a --- /dev/null +++ b/libs/Music/CombedFT.h @@ -0,0 +1,90 @@ +// Copyright 2004 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#ifndef _CombedFT_h_ +#define _CombedFT_h_ + +#include +#include +#include +using namespace std; +#include + +#include "Music.h" +#include "CFFTW3.h" +#include "Algorithm.h" + +namespace Music +{ + /*! Combed FT for one voice + * Hypothesis: the highest energy peak takes part of the instrument sound + * O(2*nln(n)) + */ + class CombedFT : public Transform + { + protected: + vector m_win; + CFFTW3 m_comb; + + double m_f0; + double m_audib_ratio; + bool m_use_audibility_treshold; + double m_zp_factor; + double m_window_factor; + + virtual void init(); + virtual void AFreqChanged() {init();} + virtual void samplingRateChanged() {init();} + virtual void semitoneBoundsChanged() {init();} + + public: + CombedFT(); + + CFFTW3 m_plan; + + void setZeroPaddingFactor(double zp); + double getZeroPaddingFactor() const {return m_zp_factor;} + + void setWindowFactor(double wf); + double getWindowFactor() const {return m_window_factor;} + + /*! set audibility ratio of low harmonics against higher ones + * decrease influences of low harmonics in the evaluation of the fundamental. + * (avoid many too-low evaluation in high frequencies) + * Sometimes in high pitch notes (eg. G3 with bari-sax) a "disturbing" component appears + * at frequency f=G2 and so the fundamental is badly evaluated. + * By "disturbing" I mean: present in the spectral representation, but not audible or weak to much to change the impression of the pitch. + * Actually, that's a physiological setting, there is no "true" choice for a such situation. + * in [0, inf], 0 mean no correction, a good value seems to be 0.1 + */ + void useAudibilityRatio(bool use) {m_use_audibility_treshold=use;} + void setAudibilityRatio(double audib_ratio=0.1) {m_audib_ratio=audib_ratio;} + double getAudibilityRatio() {return m_audib_ratio;} + + virtual int getSampleAlgoLatency() const; + virtual double getFondamentalFreq() const; + virtual bool hasNoteRecognized() const {return m_f0>0.0;} + virtual int getMinSize() const; + virtual void apply(const deque& buff); + + ~CombedFT(); + }; +} + +#endif diff --git a/libs/Music/Convolution.cpp b/libs/Music/Convolution.cpp new file mode 100644 index 0000000..8d7c7a2 --- /dev/null +++ b/libs/Music/Convolution.cpp @@ -0,0 +1,56 @@ +// Copyright 2004 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#include "Convolution.h" +#include +using namespace std; +#include +#include "Music.h" +#include "SPWindow.h" + +namespace Music +{ + Convolution::Convolution(double latency_factor, double gauss_factor, double ht) + : m_ht(ht) + , m_freq(h2f(m_ht)) + , m_latency_factor(latency_factor) + , m_duration(m_latency_factor/m_freq) + , m_wave(int(m_duration*GetSamplingRate())) + { +// cerr << "Convolution::Convolution " << ht << endl; + double c = - 2.0*Math::Pi * m_freq / GetSamplingRate(); + + double u = Usefull(Win_Sinc(gauss_factor)); + + for(size_t j=0; j(0.0, c*j))*double(2.0/m_wave.size()) * win_sinc(j/double(m_wave.size()), gauss_factor)/u; + // m_wave[j] = exp(complex(0.0, c*j))*double(2.0*Math::Pi/m_wave.size()) * win_sinc(j/double(m_wave.size()), win_factor)/u; + } + + void Convolution::apply(const deque& buff, int start) + { + m_value = complex(0.0,0.0); + + if(buff.size()-start >= m_wave.size()) + { + for(size_t i=0; i +#include +#include +using namespace std; + +namespace Music +{ + //! do a convolution with a specfic wave for a desired note + struct Convolution + { + //! the desired semi-tone from A3 + const double m_ht; + //! the corresponding frequency + const double m_freq; + //! latency factor, used for statistical purpose (40.0) + const double m_latency_factor; + //! duration in seconds + const double m_duration; + + //! the wave: the signal is convolued with + vector< complex > m_wave; + + //! computed formant + complex m_value; + + //! unique ctor + /*! + * \param AFreq frequency of A3 (440.0) + * \param sampling_rate wave capture sampling rate (11khz;44khz) + * \param latency_factor latency factor [1;oo[ + * \param gauss_factor the factor for the window fonction applied on the analysed sample (2.0) + * \param ht analysed semi-tone (-48;+48) + */ + Convolution(double latency_factor, double gauss_factor, double ht); + + //! return the size of the analyse (the algorithmical N) + size_t size() {return m_wave.size();} + + //! compute a convolution + void apply(const deque& buff, int start=0); + }; +} + +#endif // _Convolution_h_ diff --git a/libs/Music/CumulativeDiff.cpp b/libs/Music/CumulativeDiff.cpp new file mode 100644 index 0000000..ef2685e --- /dev/null +++ b/libs/Music/CumulativeDiff.cpp @@ -0,0 +1,98 @@ +// Copyright 2004 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#include "CumulativeDiff.h" + +#include +#include "Music.h" +using namespace Music; + +CumulativeDiff::CumulativeDiff(double latency_factor, int ht) +: m_ht(ht) +, m_freq(h2f(m_ht)) +, m_s(size_t(GetSamplingRate()/m_freq)) +, m_latency_factor(latency_factor) +{ + m_error = 0.0; + +// cout << "CumulativeDiff::CumulativeDiff ht=" << ht << " AFreq="< +using namespace std; + +namespace Music +{ + //! do a Cumulative Diff with a specific wave-length of a desired note + struct CumulativeDiff + { + //! the analysed semi-tone from A3 + const int m_ht; + //! his corresponding frequency + const double m_freq; + //! the wave-length + const size_t m_s; + //! latency_factor + double m_latency_factor; + + //! unique ctor + /*! + * \param AFreq frequency of A3 (440.0) + * \param sampling_rate wave capture sampling rate (11khz;44khz) + * \param latency_factor latency factor [1;oo[ + * \param ht analysed semi-tone (-48;+48) + */ + CumulativeDiff(double latency_factor, int ht); + + //! compute the error + void receive(const deque& buff, size_t start=0); + + //! computed error for the desired semi-tone (m_ht) + double m_error; + //! + double m_best_s; + }; + + //! do a correlation with a specific range of wave-length around a desired note + struct RangedCumulativeDiff + { + //! the analysed semi-tone from A3 + const int m_ht; + //! his corresponding frequency + const double m_freq; + //! pitch tolerance for m_freq; + const double m_pitch_tolerance; + //! minimal to maximal scaned wave-length + const size_t m_smin, m_smax; + //! latency_factor + const double m_latency_factor; + + //! unique ctor + /*! + * \param AFreq frequency of A3 (440.0) + * \param sampling_rate wave capture sampling rate (11khz;44khz) + * \param latency_factor latency factor [1;oo[ + * \param pitch_tolerance ]0;0.5] + * \param ht analysed semi-tone (-48;+48) + */ + RangedCumulativeDiff(double pitch_tolerance, double latency_factor, int ht); + + //! compute the error + void receive(const deque& buff, size_t start=0); + + //! computed error for the desired semi-tone (m_ht) + double m_error; + + //! computed minimal error + double m_min_error; + + //! the wave length returning the minimal error; + int m_min_wave_length; + + static void GetMinWaveLength(double pitch_tolerance, int ht, double& error, double min_wave_length); + }; +} + +#endif // _CumulativeDiff_h_ diff --git a/libs/Music/CumulativeDiffAlgo.cpp b/libs/Music/CumulativeDiffAlgo.cpp new file mode 100644 index 0000000..7812d50 --- /dev/null +++ b/libs/Music/CumulativeDiffAlgo.cpp @@ -0,0 +1,178 @@ +// Copyright 2004 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#include "CumulativeDiffAlgo.h" + +#include +#include +#include +#include +#include +using namespace std; +#include +using namespace Math; + +#include "Music.h" + +//#define MUSIC_DEBUG +#ifdef MUSIC_DEBUG +#define LOG(a) a +#else +#define LOG(a) +#endif + +namespace Music +{ + void CumulativeDiffAlgo::init() + { + setMinMaxLength(int(GetSamplingRate()/h2f(GetSemitoneMax())), int(GetSamplingRate()/h2f(GetSemitoneMin()))); + } + + CumulativeDiffAlgo::CumulativeDiffAlgo(double noise_treshold) + : m_noise_threshold(noise_treshold) + , m_wave_length(0) + { + init(); + } + + //! return the average differance on the sample delimited by [0,size] + // - ne pas utiliser tout size + // - sauter des données + double diff(const deque& buff, size_t size, size_t s) + { + double r = 0.0; + for(size_t i=0; i& buff) + { + if(buff.size()<2*m_max_length) + { + m_wave_length = 0; + return; + } + + double max_vol = 0.0; + for(size_t i=0; i +#include +#include +using namespace std; +#include "Algorithm.h" +#include "CumulativeDiff.h" + +namespace Music +{ + //! Compute period with a "classical" auto-correlation algorithm + class CumulativeDiffAlgo : public Algorithm + { + protected: + double m_noise_threshold; + + size_t m_min_length; + size_t m_max_length; + + size_t m_wave_length; + + void init(); + virtual void AFreqChanged() {init();} + virtual void samplingRateChanged() {init();} + virtual void semitoneBoundsChanged() {init();} + + public: + CumulativeDiffAlgo(double noise_treshold); + + virtual int getSampleAlgoLatency() const {return 2*m_max_length;} + + double getNoiseThreshold() const {return m_noise_threshold;} + void setNoiseThreshold(double noise_threshold) {m_noise_threshold=noise_threshold;} + void setMinMaxLength(size_t min_length, size_t max_length) + {m_min_length=min_length; m_max_length=max_length;} + + void apply(const deque& buff); + + virtual bool hasNoteRecognized() const {return m_wave_length>0;} + virtual double getFondamentalWaveLength() const {return m_wave_length;} + + virtual ~CumulativeDiffAlgo(){} + }; +} + +#endif diff --git a/libs/Music/Filter.cpp b/libs/Music/Filter.cpp new file mode 100644 index 0000000..3a5434d --- /dev/null +++ b/libs/Music/Filter.cpp @@ -0,0 +1,167 @@ +// Copyright 2007 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + +#include "Filter.h" + +// #include +using namespace std; +#include +using namespace Math; +#include "Music.h" + +// b = fir1(32,[0.00001 0.23]); +vector Music::fir1_lowpass(int n, double cutoff) +{ + vector b(n); + + int d = (n-1)/2; + + for(size_t i=0; i Music::fir1_highpass(int n, double cutoff) +{ + vector b(n); + + int d = (n-1)/2; + + double s=0.0; + for(size_t i=0; i Music::fir1_bandpass(int n, double low_cutoff, double high_cutoff) +{ + vector b(n, 0.0); + + if(low_cutoff>high_cutoff) + return b; + + vector lowf = fir1_lowpass(n, low_cutoff); + vector highf = fir1_highpass(n, high_cutoff); + + return conv(lowf, highf); +} + +Music::FIRRTFilter::FIRRTFilter(std::vector& imp_res) +{ + assert(imp_res.size()>0); + + m_imp_res = imp_res; +// m_to_filter.reserve(imp_res.size()); +} + +double Music::FIRRTFilter::operator()(double v) +{ + double value = 0.0; + + m_to_filter.push_front(v); + + if(m_to_filter.size()>=m_imp_res.size()) + { + // convolve + for(size_t i=0; im_N) + { + m_sum -= m_summed_values.back(); + + m_summed_values.pop_back(); + } + + return m_summed_values[m_summed_values.size()/2] - m_sum/m_summed_values.size(); +} + +double Music::RectangularLowPassRTFilter::operator()(double v) +{ + return v; +} + +double Music::RectangularBandPassRTFilter::operator()(double v) +{ + return v; +} + +/* +LP and HP filter +Type : biquad, tweaked butterworthReferences : Posted by Patrice TarrabiaCode : www.musicdsp.org +r = rez amount, from sqrt(2) to ~ 0.1 +f = cutoff frequency +(from ~0 Hz to SampleRate/2 - though many +synths seem to filter only up to SampleRate/4) + +The filter algo: +out(n) = a1 * in + a2 * in(n-1) + a3 * in(n-2) - b1*out(n-1) - b2*out(n-2) + +Lowpass: + c = 1.0 / tan(pi * f / sample_rate); + + a1 = 1.0 / ( 1.0 + r * c + c * c); + a2 = 2* a1; + a3 = a1; + b1 = 2.0 * ( 1.0 - c*c) * a1; + b2 = ( 1.0 - r * c + c * c) * a1; + +Hipass: + c = tan(pi * f / sample_rate); + + a1 = 1.0 / ( 1.0 + r * c + c * c); + a2 = -2*a1; + a3 = a1; + b1 = 2.0 * ( c*c - 1.0) * a1; + b2 = ( 1.0 - r * c + c * c) * a1; +*/ diff --git a/libs/Music/Filter.h b/libs/Music/Filter.h new file mode 100644 index 0000000..b297a28 --- /dev/null +++ b/libs/Music/Filter.h @@ -0,0 +1,96 @@ +// Copyright 2007 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#ifndef _Filter_h_ +#define _Filter_h_ + +#include +#include +#include + +namespace Music +{ + std::vector fir1_lowpass(int n, double cutoff); + std::vector fir1_highpass(int n, double cutoff); + std::vector fir1_bandpass(int n, double low_cutoff, double high_cutoff); + + /* Real-Time Filter + */ + class RTFilter + { + public: + virtual double operator()(double v)=0; + + virtual int getLength()=0; + + virtual ~RTFilter(){} + }; + + class FIRRTFilter : public RTFilter + { + std::vector m_imp_res; + std::deque m_to_filter; + + public: + FIRRTFilter(){m_imp_res=std::vector(1, 1.0);} + FIRRTFilter(std::vector& imp_res); + void setImpulseResponse(std::vector& imp_res) {m_imp_res=imp_res;} + + virtual int getLength() {return m_imp_res.size();} + + virtual double operator()(double v); + }; + + class RectangularHighPassRTFilter : public RTFilter + { + int m_N; + std::deque m_summed_values; + double m_sum; + + public: + RectangularHighPassRTFilter(int N=0); + + void reset(int N); + virtual int getLength() {return m_N;} + + virtual double operator()(double v); + }; + class RectangularLowPassRTFilter : public RTFilter + { + public: + virtual double operator()(double v); + }; + class RectangularBandPassRTFilter : public RTFilter + { + public: + virtual double operator()(double v); + }; + + class DummyRTFilter : public RTFilter + { + public: + DummyRTFilter() {} + + virtual int getLength() {return 1;} + + virtual double operator()(double v) {return v;} + }; +} + +#endif // _Filter_h_ diff --git a/libs/Music/FreqAnalysis.cpp b/libs/Music/FreqAnalysis.cpp new file mode 100644 index 0000000..ed526dc --- /dev/null +++ b/libs/Music/FreqAnalysis.cpp @@ -0,0 +1,460 @@ +// Copyright 2004-07 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#include "FreqAnalysis.h" + +#include +#include +using namespace std; +using namespace Math; +#include "Music.h" +#include + +namespace Music +{ + double PeakRefinementLogParabola(const vector > spectrum, int peak_index) + { + assert(peak_index>0 && peak_index0 && is_peak(spectrum, peak_index-1)) + peak_index--; + } + + double a,b,c,xapex,yapex; + FitParabola(peak_index-1, log(mod(spectrum[peak_index-1])+numeric_limits::min()), + peak_index, log(mod(spectrum[peak_index])+numeric_limits::min()), + peak_index+1, log(mod(spectrum[peak_index+1])+numeric_limits::min()), + a, b, c, xapex, yapex); + + return xapex; + } + + /*! + * M. Abe and J. O. Smith III + * “Design Criteria for Simple Sinusoidal Parameter Estimation based on Quadratic + * Interpolation of FFT Magnitude Peaks AM/FM Rate Estimation and Bias Correction + * for Time-Varying Sinusoidal Modeling,” + * Convention Paper Audio Engineering Society, + * Dept. of Music, Stanford University, August, (2004). + */ + double PeakRefinementLogParabolaUnbiased(const vector > spectrum, int peak_index, double zp) + { + double f = PeakRefinementLogParabola(spectrum, peak_index); + + double df = f - peak_index; + + double c0 = 0.247560; // hann coefs + double c1 = 0.084372; + + double xi_zp = c0/(zp*zp) + c1/(zp*zp*zp*zp); + double df2 = xi_zp*(df-0.5)*(df+0.5)*df; + +// double c2 = −0.090608; +// double c3 = −0.055781; +// double nu_zp = c2/(zp*zp*zp*zp) + c3/(zp*zp*zp*zp*zp*zp); +// double da = nu_zp*df*df; + + return f+df2; + } + + vector GetHarmonicStruct(const vector >& spectrum, double approx_f0, int nb_harm, double used_zp, double offset_tresh) + { + double approx_f0_rel = approx_f0*spectrum.size()/double(GetSamplingRate()); + assert(approx_f0_rel>1 && approx_f0_rel<=spectrum.size()/2-1); + + vector harms; + + for(int h=1; h<=nb_harm && int(h*approx_f0_rel)llimit) + cl_is_peak = is_peak(spectrum, --cl); + + int cr = c; + bool cr_is_peak = false; + while(!cr_is_peak && cr+10) + { + Harmonic harm; + harm.mod = mod(spectrum[peak_index]); + harm.freq = PeakRefinementLogParabolaUnbiased(spectrum, peak_index, used_zp)*double(GetSamplingRate())/spectrum.size(); + harm.harm_number = h; + harms.push_back(harm); + } + } + + return harms; + } + + double FundFreqRefinementOfHarmonicStruct(const vector >& spectrum, double approx_f0, int nb_harm, double used_zp) + { + double approx_f0_rel = approx_f0*spectrum.size()/double(GetSamplingRate()); + assert(approx_f0_rel>1 && approx_f0_rel<=spectrum.size()/2-1); + + vector harms = GetHarmonicStruct(spectrum, approx_f0, nb_harm, used_zp, 0.2); + + if(harms.empty()) + return 0.0; + + double sum_f0 = 0.0; + + for(size_t i=0; i& buff) + { + for(size_t h=0; happly(buff); + m_harmonics[h] = m_convolutions[h]->m_value; + m_components[h] = mod(m_harmonics[h]); + } + } + SingleResConvolutionTransform::~SingleResConvolutionTransform() + { + for(size_t i=0; i& buff) + { +// cerr << "NeuralNetGaussAlgo::apply " << m_components_treshold << endl; + + m_components_max = 0.0; + for(size_t h=0; happly(buff); + m_harmonics[h] = m_convolutions[h]->m_value; + m_components[h] = mod(m_harmonics[h]); + m_components_max = max(m_components_max, m_components[h]); + } + + m_first_fond = UNDEFINED_SEMITONE; + for(size_t h=0; hm_components_treshold && m_first_fond==UNDEFINED_SEMITONE) + { + m_first_fond = h; + m_is_fondamental[h] = true; + } + } + } + + NeuralNetGaussAlgo::~NeuralNetGaussAlgo() + { + } + +// MonophonicAlgo + MonophonicAlgo::MonophonicAlgo(double latency_factor, double gauss_factor) + : SingleResConvolutionTransform(latency_factor, gauss_factor) + { + init(); + } + int MonophonicAlgo::getSampleAlgoLatency() const + { + return m_convolutions[0]->size(); + } + void MonophonicAlgo::apply(const deque& buff) + { + for(size_t h=0; h getComponentsTreshold()) + { +// m_components[h] = min(formant_mod, max_value); + m_components[h] = formant_mod; + m_components_max = max(m_components_max, m_components[h]); + m_first_fond = h; + } +// else m_components[h] = 0.0; + } + else m_components[h] = 0.0; + } + for(;h>=0; h--) + m_components[h] = 0.0; + + // smash all components below a treshold of the max component +// for(size_t h=0; h 0.0) +// m_first_fond = h; + + // correction: the note is the nearest maximum of m_note +// if(m_first_fond!=-1) +// while(m_first_fond+1 m_components[m_first_fond]) +// m_first_fond++; + +// cerr << "m_first_fond=" << m_first_fond << endl; + } + + TwoVoiceMHT::TwoVoiceMHT(double AFreq, int dataBySecond, double rep, double win_factor, int minHT, int maxHT) + : m_mht(new MHT(AFreq, dataBySecond, rep, win_factor, minHT, maxHT)) + , m_last_sol(m_mht->m_components.size()) + { + int nbHT = maxHT - minHT + 1; + m_components.resize(nbHT); + + for(size_t i=0; i(0.0,0.0); + } + void TwoVoiceMHT::apply(deque& buff) + { + // cout << "TwoVoiceMHT::apply" << endl; + + m_mht->apply(buff); + + // double earingTreshold = 0.05; + // double modArgTreshold = 0.2; + // double modModTreshold = 0.2; + // ComputeDiffs(m_mht->m_components, fp, argpfp, modfp); + + // int count = 0; + for(size_t h=0;hm_components[h]!=complex(0.0,0.0) && count<2) + { + m_components[h] = m_mht->m_components[h]; + + // count++; + // if(fabs(argpfp[0][h])>modArgTreshold) count++; + } + // else m_components[h] = complex(0.0,0.0); + } + + // m_last_sol = m_mht->m_components; + } + TwoVoiceMHT::~TwoVoiceMHT() + { + delete m_mht; + } + + RemoveSyncMHT::RemoveSyncMHT(double AFreq, int dataBySecond, double rep, double win_factor, int minHT, int maxHT) + : m_mht(new MHT(AFreq, dataBySecond, rep, win_factor, minHT, maxHT)) + , m_last_sol(m_mht->m_components.size()) + { + int nbHT = maxHT - minHT + 1; + m_components.resize(nbHT); + + for(size_t i=0; i(0.0,0.0); + } + void RemoveSyncMHT::apply(deque& buff) + { + m_mht->apply(buff); + + double earingTreshold = 0.05; + double syncArgTreshold = 0.3; // 0.02 0.25 0.2 + // double syncModTreshold = 0.2; // 0.05 0.1 0.3 + + double fourier_amplitude = 0.0; + for(size_t h=0; hm_components.size(); h++) + fourier_amplitude = max(fourier_amplitude, normm(m_mht->m_components[h])); + vector notes; + + for(size_t h=0; hm_components.size(); h++) // for each half tone + { + bool is_fond = false; + + if(normm(m_mht->m_components[h])>earingTreshold*fourier_amplitude) // if we can ear it + { + is_fond = true; + + // search for syncronisation with each discovered fondamentals + for(size_t i=0; im_convolutions[h]->m_freq/m_mht->m_convolutions[notes[i]]->m_freq; + int k = int(rk+0.5); + if(abs(k-rk)<0.05) // TODO // if k is nearly an integer, a potential harmonic + { + complex ft = m_mht->m_components[notes[i]] / normm(m_mht->m_components[notes[i]]); + complex ftm1 = m_last_sol[notes[i]] / normm(m_last_sol[notes[i]]); + complex rpt = m_mht->m_components[h]/pow(ft, k); + complex rptm1 = m_last_sol[h]/pow(ftm1, k); + // if(h==25 && k==4) + // cout << abs(log(normm(rpt))-log(normm(rptm1))) << " "; + // cout << k << "=(arg=" << abs(arg(rpt)-arg(rptm1)) << " mod=" << abs(log(normm(rpt))-log(normm(rptm1))) << ") "; + is_fond = abs(arg(rpt)-arg(rptm1)) > syncArgTreshold; + // is_fond = is_fond || abs(log(normm(rpt))-log(normm(rptm1))) > syncModTreshold; + } + + // is_fond = false; + } + + if(is_fond) notes.push_back(h); // it's a fondamentals + } + + // cout << endl; + + if(is_fond) m_components[h] = m_mht->m_components[h]; + else m_components[h] = complex(0.0,0.0); + } + + m_last_sol = m_mht->m_sol; + } + RemoveSyncMHT::~RemoveSyncMHT() + { + delete m_mht; + } + +#if 0 + NeuralNetMHT::NeuralNetMHT(double AFreq, int dataBySecond, double rep, double win_factor, int minHT, int maxHT, const string& file_name) + : m_mht(new MHT(AFreq, dataBySecond, rep, win_factor, minHT, maxHT)) + , m_nn(new LayeredNeuralNet()) + { + m_nbHT = maxHT - minHT + 1; + m_components.resize(m_nbHT); + + m_nn->load(file_name.c_str()); + + assert(m_nbHT==m_nn->getInputLayer()->getNeurons().size()); + assert(m_nbHT==m_nn->getOutputLayer()->getNeurons().size()); + + cout << "topology: " << m_nn->getInputLayer()->getNeurons().size(); + for(LayeredNeuralNet::LayerIterator it = ++(m_nn->m_layerList.begin()); it !=m_nn->m_layerList.end(); it++) + cout << " => " << (*it)->getNeurons().size(); + cout << " [" << m_nn->getNbWeights() << " weights]" << endl; + } + void NeuralNetMHT::apply(deque& buff) + { + // cout << "NeuralNetMHT::apply" << endl; + + m_mht->apply(buff); + + vector inputs(m_nbHT); + + for(int h=0; hm_components[h]); + + m_nn->computeOutputs(inputs); + + for(int h=0; h(m_nn->getOutputLayer()->getNeurons()[h].o); + } + NeuralNetMHT::~NeuralNetMHT() + { + delete m_nn; + delete m_mht; + } +#endif + +#endif +} diff --git a/libs/Music/FreqAnalysis.h b/libs/Music/FreqAnalysis.h new file mode 100644 index 0000000..5993309 --- /dev/null +++ b/libs/Music/FreqAnalysis.h @@ -0,0 +1,248 @@ +// Copyright 2004-07 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#ifndef _FreqAnalysis_h_ +#define _FreqAnalysis_h_ + +#include +#include +#include +#include +using namespace std; +#include +//#include + +#include "Music.h" +#include "Algorithm.h" +#include "Convolution.h" +#include + +namespace Music +{ + struct Partial + { + double mod; + double phase; + double freq; // Hz + double noise_lvl; // in [0,1] + }; + struct Harmonic : Partial + { + int harm_number; + }; + + inline bool is_peak(double p1, double p2, double p3) + { + return p1p3; + } + inline bool is_peak(const std::vector > spectrum, int c) + { + assert(c>0 && c > spectrum, int peak_index); + double PeakRefinementLogParabolaUnbiased(const std::vector > spectrum, int peak_index, double zp); + + std::vector GetHarmonicStruct(const std::vector >& spectrum, double approx_f0, int nb_harm, double used_zp, double offset_tresh=0.1); + double FundFreqRefinementOfHarmonicStruct(const std::vector >& spectrum, double approx_f0, int nb_harm, double used_zp); + + /*! the simpler: only one big convolution on the whole window + * O(N) + */ + class SingleResConvolutionTransform : public Transform + { + protected: + virtual void init(); + virtual void AFreqChanged() {init();} + virtual void samplingRateChanged() {init();} + virtual void semitoneBoundsChanged() {init();} + double m_latency_factor; + double m_gauss_factor; + + public: + std::vector m_convolutions; + + SingleResConvolutionTransform(double latency_factor, double gauss_factor); + + void setLatencyFactor(double latency) {m_latency_factor=latency; init();} + double getLatencyFactor() {return m_latency_factor;} + + void setGaussFactor(double g) {m_gauss_factor=g; init();} + double getGaussFactor() {return m_gauss_factor;} + + virtual void apply(const std::deque& buff); + + virtual ~SingleResConvolutionTransform(); + }; + + /*! extraction des fondamentales avec un r�aux de neurones + * entr�s avec la visualisation dans le plan de Gauss + */ + struct NeuralNetGaussAlgo : SingleResConvolutionTransform + { +// typedef Neuron TypeNeuron; +// LayeredNeuralNet* m_nn; + + virtual void init(); + + NeuralNetGaussAlgo(double latency_factor, double gauss_factor); + + virtual int getSampleAlgoLatency() const {return 0;} + + virtual void apply(const deque& buff); + + virtual ~NeuralNetGaussAlgo(); + }; + + /*! Monophonic Algorithm: algo for one voice + * O(nbHT) + */ + class MonophonicAlgo : public SingleResConvolutionTransform + { + protected: + double m_dominant_treshold; + + public: + MonophonicAlgo(double latency_factor, double gauss_factor); + //! in millis + virtual double getAlgoLatency() const {return 1000.0*m_convolutions[0]->size()/GetSamplingRate();} + virtual int getSampleAlgoLatency() const; + + inline double getDominantTreshold() {return m_dominant_treshold;} + inline void setDominantTreshold(double t) {m_dominant_treshold=t;} + + virtual void apply(const deque& buff); + + virtual ~MonophonicAlgo() {} + }; + +#if 0 + /*! algo for two voice + * O() + */ + struct TwoVoiceMHT : MultiHalfTone + { + // typedef RemoveSyncMHT MHT; + typedef SingleResMultiHalfTone MHT; + + MHT* m_mht; + vector< complex > m_last_sol; + + deque< vector > > fp; + deque< vector > argpfp; + deque< vector > modfp; + + TwoVoiceMHT(){} + TwoVoiceMHT(double AFreq, int dataBySecond, double maxRep, double win_factor, int minHT, int maxHT); + + virtual void apply(deque& buff); + + virtual ~TwoVoiceMHT(); + }; + + /*! multiply "usefull" data quantity + * O() + */ + struct OneDataMultiplierMHT : MultiHalfTone + { + vector< SingleHalfTone* > m_sht; + + rfftw_plan m_fwd_plan; + rfftw_plan m_bck_plan; + fftw_real* m_in; + fftw_real* m_out; + + int m_length; + int m_size; + int m_rep; + + OneDataMultiplierMHT(){} + OneDataMultiplierMHT(double AFreq, int dataBySecond, double rep, double win_factor, int minHT, int maxHT); + + virtual void apply(deque& buff); + + virtual ~OneDataMultiplierMHT(); + }; + + /*! une grande convolution qui couvre toute la fen�re et qui sert "d'indicateur" �la petit r�olution se trouvant au d�ut + * O(nbHT*2) + */ + struct IndicMultiHalfTone : SingleResMultiHalfTone + { + vector< SingleHalfTone* > m_small_sht; + + IndicMultiHalfTone(double AFreq, int dataBySecond, double maxRep, double win_factor, int minHT, int maxHT); + + virtual void apply(deque& buff); + }; + + /*! integration sur plusieurs r�olution (Ondelettes) + * racourcit consid�ablement la chute d'une note, mais pas l'entr� + * O(nbHT*maxRep/3) + */ + struct MultiResMultiHalfTone : MultiHalfTone + { + vector< vector > m_sht; + + MultiResMultiHalfTone(){} + MultiResMultiHalfTone(double AFreq, int dataBySecond, double maxRep, double win_factor, int minHT, int maxHT); + + virtual void apply(deque& buff); + + virtual ~MultiResMultiHalfTone(); + }; + + /*! minimum sur trois classes de r�olution + * - une grande qui couvre toute la fen�re (augmente la r�olution en fr�uence) + * - des progressivement plus petites qui commence au d�ut de la grande fen�re (augemente la r�olution en temps �la fin d'une note) + * - des progressivement plus petites qui finissent �la fin de la grande fen�re (augmente la r�olution en temps au d�ut d'une note) + * O(nbHT*maxRep/2) + */ + struct TriResMultiHalfTone : MultiResMultiHalfTone + { + TriResMultiHalfTone(double AFreq, int dataBySecond, double maxRep, double win_factor, int minHT, int maxHT); + + virtual void apply(deque& buff); + }; + + /*! supprime les fr�uences syncronis�s + * REDO + * O() + */ + struct RemoveSyncMHT : MultiHalfTone + { + typedef SingleResMultiHalfTone MHT; + + MHT* m_mht; + vector< complex > m_last_sol; + + RemoveSyncMHT(){} + RemoveSyncMHT(double AFreq, int dataBySecond, double maxRep, double win_factor, int minHT, int maxHT); + + virtual void apply(deque& buff); + + virtual ~RemoveSyncMHT(); + }; +#endif +} + +#endif // _FreqAnalysis_h_ + diff --git a/libs/Music/LPC.cpp b/libs/Music/LPC.cpp new file mode 100644 index 0000000..b7f9370 --- /dev/null +++ b/libs/Music/LPC.cpp @@ -0,0 +1,85 @@ +#include "LPC.h" + +// http://kbs.cs.tu-berlin.de/~jutta/gsm/lpc.html + +#define P_MAX 8 /* order p of LPC analysis, typically 8..14 */ + +/* Invented by N. Levinson in 1947, modified by J. Durbin in 1959. + */ +double /* returns minimum mean square error */ + levinson_durbin( + double const * ac, /* in: [0...p] autocorrelation values */ + double * ref, /* out: [0...p-1] reflection coef's */ + double * lpc) /* [0...p-1] LPC coefficients */ +{ + int i, j; double r, error = ac[0]; + + if (ac[0] == 0) { + for (i = 0; i < P_MAX; i++) ref[i] = 0; return 0; } + + for (i = 0; i < P_MAX; i++) { + + /* Sum up this iteration's reflection coefficient. + */ + r = -ac[i + 1]; + for (j = 0; j < i; j++) r -= lpc[j] * ac[i - j]; + ref[i] = r /= error; + + /* Update LPC coefficients and total error. + */ + lpc[i] = r; + for (j = 0; j < i/2; j++) { + double tmp = lpc[j]; + lpc[j] += r * lpc[i-1-j]; + lpc[i-1-j] += r * tmp; + } + if (i % 2) lpc[j] += lpc[j] * r; + + error *= 1.0 - r * r; + } + return error; +} + +/* I. Sch"ur's recursion from 1917 is related to the Levinson-Durbin + * method, but faster on parallel architectures; where Levinson-Durbin + * would take time proportional to p * log(p), Sch"ur only requires + * time proportional to p. The GSM coder uses an integer version of + * the Sch"ur recursion. + */ +double /* returns the minimum mean square error */ + schur( double const * ac, /* in: [0...p] autocorrelation c's */ + double * ref) /* out: [0...p-1] reflection c's */ +{ + int i, m; double r, error = ac[0], G[2][P_MAX]; + + if (ac[0] == 0.0) { + for (i = 0; i < P_MAX; i++) ref[i] = 0; + return 0; + } + + /* Initialize rows of the generator matrix G to ac[1...P] + */ + for (i = 0; i < P_MAX; i++) G[0][i] = G[1][i] = ac[i+1]; + + for (i = 0;;) { + + /* Calculate this iteration's reflection + * coefficient and error. + */ + ref[i] = r = -G[1][0] / error; + error += G[1][0] * r; + + if (++i >= P_MAX) return error; + + /* Update the generator matrix. + * + * Unlike the Levinson-Durbin summing of reflection + * coefficients, this loop could be distributed to + * p processors who each take only constant time. + */ + for (m = 0; m < P_MAX - i; m++) { + G[1][m] = G[1][m+1] + r * G[0][m]; + G[0][m] = G[1][m+1] * r + G[0][m]; + } + } +} diff --git a/libs/Music/LPC.h b/libs/Music/LPC.h new file mode 100644 index 0000000..e479bf7 --- /dev/null +++ b/libs/Music/LPC.h @@ -0,0 +1,31 @@ +#ifndef _LPC_h_ +#define _LPC_h_ + +// http://kbs.cs.tu-berlin.de/~jutta/gsm/lpc.html + +/* LPC- and Reflection Coefficients + * + * The next two functions calculate linear prediction coefficients + * and/or the related reflection coefficients from the first P_MAX+1 + * values of the autocorrelation function. + */ + +/* Invented by N. Levinson in 1947, modified by J. Durbin in 1959. + */ +double /* returns minimum mean square error */ + levinson_durbin( + double const * ac, /* in: [0...p] autocorrelation values */ + double * ref, /* out: [0...p-1] reflection coef's */ + double * lpc); /* [0...p-1] LPC coefficients */ + +/* I. Sch"ur's recursion from 1917 is related to the Levinson-Durbin + * method, but faster on parallel architectures; where Levinson-Durbin + * would take time proportional to p * log(p), Sch"ur only requires + * time proportional to p. The GSM coder uses an integer version of + * the Sch"ur recursion. + */ +double /* returns the minimum mean square error */ + schur( double const * ac, /* in: [0...p] autocorrelation c's */ + double * ref); /* out: [0...p-1] reflection c's */ + +#endif diff --git a/libs/Music/Makefile.am b/libs/Music/Makefile.am new file mode 100644 index 0000000..74e1786 --- /dev/null +++ b/libs/Music/Makefile.am @@ -0,0 +1,4 @@ +lib_LIBRARIES = libMusic.a +AM_CXXFLAGS = -Wall -I../../libs +libMusic_a_SOURCES = Algorithm.cpp Convolution.cpp CumulativeDiff.cpp FreqAnalysis.cpp Music.cpp TimeAnalysis.cpp CumulativeDiffAlgo.cpp MultiCumulativeDiffAlgo.cpp CombedFT.cpp CFFTW3.cpp SPWindow.cpp Filter.cpp Autocorrelation.cpp LPC.cpp +EXTRA_DIST = *.h diff --git a/libs/Music/Makefile.in b/libs/Music/Makefile.in new file mode 100644 index 0000000..d0d1829 --- /dev/null +++ b/libs/Music/Makefile.in @@ -0,0 +1,457 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = libs/Music +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in AUTHORS \ + COPYING TODO +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_cxx_exceptions.m4 \ + $(top_srcdir)/m4/ac_cxx_have_complex.m4 \ + $(top_srcdir)/m4/ac_cxx_have_numeric_limits.m4 \ + $(top_srcdir)/m4/ac_cxx_have_sstream.m4 \ + $(top_srcdir)/m4/ac_cxx_have_stl.m4 \ + $(top_srcdir)/m4/ac_cxx_namespaces.m4 \ + $(top_srcdir)/m4/ac_cxx_templates.m4 \ + $(top_srcdir)/m4/bnv_have_qt.m4 \ + $(top_srcdir)/m4/mdl_have_opengl.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLIBRARIES_INSTALL = $(INSTALL_DATA) +LIBRARIES = $(lib_LIBRARIES) +AR = ar +ARFLAGS = cru +libMusic_a_AR = $(AR) $(ARFLAGS) +libMusic_a_LIBADD = +am_libMusic_a_OBJECTS = Algorithm.$(OBJEXT) Convolution.$(OBJEXT) \ + CumulativeDiff.$(OBJEXT) FreqAnalysis.$(OBJEXT) \ + Music.$(OBJEXT) TimeAnalysis.$(OBJEXT) \ + CumulativeDiffAlgo.$(OBJEXT) MultiCumulativeDiffAlgo.$(OBJEXT) \ + CombedFT.$(OBJEXT) CFFTW3.$(OBJEXT) SPWindow.$(OBJEXT) \ + Filter.$(OBJEXT) Autocorrelation.$(OBJEXT) LPC.$(OBJEXT) +libMusic_a_OBJECTS = $(am_libMusic_a_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +SOURCES = $(libMusic_a_SOURCES) +DIST_SOURCES = $(libMusic_a_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QT_CXXFLAGS = @QT_CXXFLAGS@ +QT_DIR = @QT_DIR@ +QT_LIBS = @QT_LIBS@ +QT_MOC = @QT_MOC@ +QT_UIC = @QT_UIC@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_prefix = @ac_prefix@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +lib_LIBRARIES = libMusic.a +AM_CXXFLAGS = -Wall -I../../libs +libMusic_a_SOURCES = Algorithm.cpp Convolution.cpp CumulativeDiff.cpp FreqAnalysis.cpp Music.cpp TimeAnalysis.cpp CumulativeDiffAlgo.cpp MultiCumulativeDiffAlgo.cpp CombedFT.cpp CFFTW3.cpp SPWindow.cpp Filter.cpp Autocorrelation.cpp LPC.cpp +EXTRA_DIST = *.h +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libs/Music/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu libs/Music/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLIBRARIES: $(lib_LIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + @list='$(lib_LIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(libLIBRARIES_INSTALL) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(libLIBRARIES_INSTALL) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + @$(POST_INSTALL) + @list='$(lib_LIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + p=$(am__strip_dir) \ + echo " $(RANLIB) '$(DESTDIR)$(libdir)/$$p'"; \ + $(RANLIB) "$(DESTDIR)$(libdir)/$$p"; \ + else :; fi; \ + done + +uninstall-libLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLIBRARIES: + -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES) +libMusic.a: $(libMusic_a_OBJECTS) $(libMusic_a_DEPENDENCIES) + -rm -f libMusic.a + $(libMusic_a_AR) libMusic.a $(libMusic_a_OBJECTS) $(libMusic_a_LIBADD) + $(RANLIB) libMusic.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Algorithm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Autocorrelation.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CFFTW3.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CombedFT.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Convolution.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CumulativeDiff.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CumulativeDiffAlgo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Filter.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FreqAnalysis.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LPC.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MultiCumulativeDiffAlgo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Music.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SPWindow.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TimeAnalysis.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-libLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-libLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLIBRARIES ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-libLIBRARIES install-man install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-info-am uninstall-libLIBRARIES + +# 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: diff --git a/libs/Music/MultiCumulativeDiffAlgo.cpp b/libs/Music/MultiCumulativeDiffAlgo.cpp new file mode 100644 index 0000000..88569a5 --- /dev/null +++ b/libs/Music/MultiCumulativeDiffAlgo.cpp @@ -0,0 +1,222 @@ +// Copyright 2004 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#include "MultiCumulativeDiffAlgo.h" + +#include +#include +#include +#include +using namespace std; +#include +using namespace Math; + +#include "Music.h" + +//#define MUSIC_DEBUG +#ifdef MUSIC_DEBUG +#define LOG(a) a +#else +#define LOG(a) +#endif + +namespace Music +{ + void MultiCumulativeDiffAlgo::init() + { + for(size_t i=0; i0); + + m_test_complexity = test_complexity; + + m_diffs.resize(size()); + for(size_t i=0; i=0 && ih+1=0 && ih-1& buff) + { + assert(GetSamplingRate()>0); + for(size_t i=0; im_s) + return; + + double v = 0.0; + for(size_t i=0; im_s; i++) + v = max(v, abs(buff[i])); + + if(v>getAmplitudeTreshold()) + { + // compute all components + m_components_max = 0.0; + double min_comp = 1000000; + double max_sum = 0.0; + for(int ih=int(size())-1; ih>=0; ih--) + { + m_diffs[ih]->receive(buff, 0); + m_components[ih] = m_diffs[ih]->m_error; + m_components_max = max(m_components_max, m_components[ih]); + } + + // test components + for(int ih=int(size())-1; ih>=0; ih--) + { + bool ok = true; + + bool crit_min = true; + // criteria: the fond and his first harmonics are minimas + if(ok) ok = + is_minima(ih) && + is_minima(ih-12) && + (is_minima(ih-19) || is_minima(ih-19-1) || is_minima(ih-19+1)) && + is_minima(ih-24); + + crit_min = ok; + + bool crit_small_enough = true; + if(ok) + { + if(m_components[ih]/m_components_max>getComponentTreshold()) + crit_small_enough = false; + ok = crit_small_enough; + } + +// bool crit_cross_zero = true; + /* + // criteria: wave should cross the zero value + if(ok) + { + bool cross = true; + for(int s=0; cross && sm_s); s++) + { + double sg = Math::sgn(buff[s]); + bool same_side = true; + for(int i=0; same_side && im_s); i++) + same_side = Math::sgn(buff[s+i])==sg; + + cross = !same_side; + } + + ok = crit_cross_zero = cross; + } + */ + +// bool crit_integ_cst = true; + // criteria: integral should be nearly constant while shifting + // TODO + // (the previous criteria seems sufficient to remove high comp.) + +// LOG(if(crit_min) +// cerr << "ih=" << ih << +// " harm_min=(("<max_sum) + { + size_t step = size_t(m_diffs[ih]->m_s/m_test_complexity); + if(step<1) step = 1; + for(size_t s=0; ok && sm_s; s+=step) + { + if(ih-1>=0){ + m_diffs[ih-1]->receive(buff, s); + m_components[ih-1] = m_diffs[ih-1]->m_error; + } + if(ih+1receive(buff, s); + m_components[ih+1] = m_diffs[ih+1]->m_error; + } + m_diffs[ih]->receive(buff, s); + m_components[ih] = m_diffs[ih]->m_error; + ok = is_minima(ih); + } + + if(ok) + { + max_sum = sum; + min_comp = m_components[ih]; + m_first_fond = ih; + } + } + } + } + +// cerr << "ff: " << m_first_fond << endl; + + if(m_first_fond!=-1) + m_is_fondamental[m_first_fond] = true; + + LOG(cerr << "m_first_fond=" << m_first_fond << endl;) + } + } + MultiCumulativeDiffAlgo::~MultiCumulativeDiffAlgo() + { + for(size_t i=0; i +#include +using namespace std; +#include "Algorithm.h" +#include "CumulativeDiff.h" + +namespace Music +{ + //! Compute error for each possible freqs with correlation algorithm + class MultiCumulativeDiffAlgo : public Transform + { + double m_test_complexity; + int m_first_fond; + vector m_is_fondamental; + + protected: + void init(); + virtual void AFreqChanged() {init();} + virtual void samplingRateChanged() {init();} + virtual void semitoneBoundsChanged() {init();} + + public: + //! correlation filters + vector< CumulativeDiff* > m_diffs; + + bool is_minima(int ih); + + public: + double m_pitch_tolerance; + + void setTestComplexity(double test_complexity) {m_test_complexity = test_complexity;} + double getTestComplexity() {return m_test_complexity;} + + virtual int getSampleAlgoLatency() const {return int((getAlgoLatency()/1000.0)*GetSamplingRate());} + //! in millis + virtual double getAlgoLatency() const {return 1000.0*(2*m_diffs[0]->m_s)/GetSamplingRate();} + + //! unique ctor + /*! + * \param latency_factor latency factor for statistical purpose [1;oo[ + * \param test_complexity + */ + MultiCumulativeDiffAlgo(int latency_factor, double test_complexity); + + //! overwrited computing function + virtual void apply(const deque& buff); + + virtual double getFondamentalWaveLength() const; + + virtual ~MultiCumulativeDiffAlgo(); + }; +} + +#endif diff --git a/libs/Music/Music.cpp b/libs/Music/Music.cpp new file mode 100644 index 0000000..71847cd --- /dev/null +++ b/libs/Music/Music.cpp @@ -0,0 +1,92 @@ +// Copyright 2004 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#include "Music.h" + +#include +#include +using namespace std; + +Music::NotesName Music::s_notes_name = Music::LOCAL_ANGLO; +int Music::s_tonality = 0; +int Music::s_sampling_rate = -1; +double Music::s_AFreq = 440.0; +const int Music::UNDEFINED_SEMITONE = -1000; +int Music::s_semitone_min = -48; +int Music::s_semitone_max = +48; + +Music::SettingsListener::SettingsListener() +{ + s_settings_listeners.push_back(this); +} +Music::SettingsListener::~SettingsListener() +{ + s_settings_listeners.remove(this); +} + +list Music::s_settings_listeners; +void Music::AddSettingsListener(SettingsListener* l) +{ + if(find(s_settings_listeners.begin(), s_settings_listeners.end(), l)==s_settings_listeners.end()) + s_settings_listeners.push_back(l); +} +void Music::RemoveSettingsListener(SettingsListener* l) +{ + s_settings_listeners.remove(l); +} + +void Music::SetSamplingRate(int sampling_rate) +{ + s_sampling_rate = sampling_rate; + for(list::iterator it=s_settings_listeners.begin(); it!=s_settings_listeners.end(); ++it) + (*it)->samplingRateChanged(); +} + +void Music::SetAFreq(double AFreq) +{ + s_AFreq = AFreq; + for(list::iterator it=s_settings_listeners.begin(); it!=s_settings_listeners.end(); ++it) + (*it)->AFreqChanged(); +} + +void Music::SetSemitoneBounds(int semitone_min, int semitone_max) +{ +// cerr << "Music::SetSemitoneBounds" << endl; + + s_semitone_min = semitone_min; + s_semitone_max = semitone_max; + + for(list::iterator it=s_settings_listeners.begin(); it!=s_settings_listeners.end(); ++it) + (*it)->semitoneBoundsChanged(); +} + +vector Music::conv(const vector& u, const vector& v) +{ + vector w(v.size()); + + for(size_t i=0; i=0) + w[i] += u[j]*v[i-j]; + } + + return w; +} diff --git a/libs/Music/Music.h b/libs/Music/Music.h new file mode 100644 index 0000000..18bbd4e --- /dev/null +++ b/libs/Music/Music.h @@ -0,0 +1,182 @@ +// Copyright 2004 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#ifndef _Music_h_ +#define _Music_h_ + +#include +#include +#include +#include +#include +using namespace std; +#include +#include + +namespace Music +{ + enum NotesName{LOCAL_ANGLO, LOCAL_LATIN}; + extern NotesName s_notes_name; + inline NotesName GetNotesName() {return s_notes_name;} + inline void SetNotesName(NotesName type) {s_notes_name = type;} + + extern int s_tonality; + inline int GetTonality() {return s_tonality;} + inline void SetTonality(int tonality) {s_tonality = tonality;} + + extern int s_sampling_rate; + inline int GetSamplingRate() {return s_sampling_rate;} + void SetSamplingRate(int sampling_rate); + + extern double s_AFreq; + inline double GetAFreq() {return s_AFreq;} + void SetAFreq(double AFreq); + + extern const int UNDEFINED_SEMITONE; + extern int s_semitone_min; + extern int s_semitone_max; + inline int GetSemitoneMin() {return s_semitone_min;} + inline int GetSemitoneMax() {return s_semitone_max;} + inline int GetNbSemitones() {return s_semitone_max-s_semitone_min+1;} + void SetSemitoneBounds(int semitone_min, int semitone_max); + + struct SettingsListener + { + virtual void samplingRateChanged() {} + virtual void AFreqChanged() {} + virtual void semitoneBoundsChanged() {} + + SettingsListener(); + virtual ~SettingsListener(); + }; + + extern list s_settings_listeners; + void AddSettingsListener(SettingsListener* l); + void RemoveSettingsListener(SettingsListener* l); + +//! convert frequency to a float number of half-tones from A3 +/*! + * \param freq the frequency to convert to \f$\in R+\f$ {Hz} + * \param AFreq tuning frequency of the A3 (Usualy 440) {Hz} + * \return the float number of half-tones from A3 \f$\in R\f$ + */ +inline double f2hf(double freq, double AFreq=GetAFreq()) {return 12.0*(log(freq)-log(AFreq))/log(2.0);} +// TODO VERIF +// le ht doit �re le ht le plus proche de freq !! et pas un simple arrondi en dessous de la valeur r�l !! +//! convert frequency to number of half-tones from A3 +/*! + * \param freq the frequency to convert to \f$\in R+\f$ {Hz} + * \param AFreq tuning frequency of the A3 (Usualy 440) {Hz} + * \return the number of half-tones from A3. Rounded to the nearest half-tones( + * not a simple integer convertion of \ref f2hf ) \f$\in R\f$ + */ +inline int f2h(double freq, double AFreq=GetAFreq()) +{ + double ht = f2hf(freq, AFreq); + if(ht>0) return int(ht+0.5); + if(ht<0) return int(ht-0.5); + return 0; +} +//! convert number of half-tones to frequency +/*! + * \param ht number of half-tones to convert to \f$\in Z\f$ + * \param AFreq tuning frequency of the A3 (Usualy 440) {Hz} + * \return the converted frequency + */ +inline double h2f(double ht, double AFreq=GetAFreq()) {return AFreq * pow(2.0, ht/12.0);} + +//! convert half-tones from A3 to the corresponding note name +/*! + * \param ht number of half-tones to convert to \f$\in Z\f$ + * \param local + * \return his name (Do, Re, Mi, Fa, Sol, La, Si; with '#' if needed) + */ +inline string h2n(int ht, NotesName local=GetNotesName(), int tonality=GetTonality(), bool show_oct=true) +{ + ht += tonality; + + int oct = 4; + while(ht<0) + { + ht += 12; + oct--; + } + while(ht>11) + { + ht -= 12; + oct++; + } + + if(ht>2) oct++; // octave start from C +// if(oct<=0) oct--; // skip 0-octave in occidental notations ?? + +// char coct[3]; +// sprintf(coct, "%d", oct); +// string soct = coct; + + string soct; + if(show_oct) + soct = StringAddons::toString(oct); + + if(local==LOCAL_ANGLO) + { + if(ht==0) return "A"+soct; + else if(ht==1) return "A#"+soct; + else if(ht==2) return "B"+soct; + else if(ht==3) return "C"+soct; + else if(ht==4) return "C#"+soct; + else if(ht==5) return "D"+soct; + else if(ht==6) return "D#"+soct; + else if(ht==7) return "E"+soct; + else if(ht==8) return "F"+soct; + else if(ht==9) return "F#"+soct; + else if(ht==10) return "G"+soct; + else if(ht==11) return "G#"+soct; + } + else + { + if(ht==0) return "La"+soct; + else if(ht==1) return "La#"+soct; + else if(ht==2) return "Si"+soct; + else if(ht==3) return "Do"+soct; + else if(ht==4) return "Do#"+soct; + else if(ht==5) return "Re"+soct; + else if(ht==6) return "Re#"+soct; + else if(ht==7) return "Mi"+soct; + else if(ht==8) return "Fa"+soct; + else if(ht==9) return "Fa#"+soct; + else if(ht==10) return "Sol"+soct; + else if(ht==11) return "Sol#"+soct; + } + + return "Th#1138"; +} + +inline int n2h(const std::string& note, NotesName local=LOCAL_ANGLO, int tonality=GetTonality()) +{ + // TODO + return -1; +} + +std::vector conv(const std::vector& u, const std::vector& v); + + // TODO freq reffinement +} + +#endif // _Music_h_ diff --git a/libs/Music/Note.h b/libs/Music/Note.h new file mode 100644 index 0000000..1a63aaa --- /dev/null +++ b/libs/Music/Note.h @@ -0,0 +1,47 @@ +// Copyright 2007 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + +#ifndef _Note_h_ +#define _Note_h_ + +class Note +{ + public: + int ht; + QString factor; + + // error to ht + float min_err; + float max_err; + float avg_err; + deque errors; + + // volume + deque volumes; + + // ctor + void init(); + Note(int h); + Note(int h, int num, int den); + Note(int h, float cents); + + void addAnalysis(float err, float volume); + QString getName() const; +}; + +#endif diff --git a/libs/Music/SPWindow.cpp b/libs/Music/SPWindow.cpp new file mode 100644 index 0000000..31111fd --- /dev/null +++ b/libs/Music/SPWindow.cpp @@ -0,0 +1,47 @@ +// Copyright 2007 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#include "SPWindow.h" +using namespace std; + +vector Music::hann(int n) +{ + vector win(n); + + for(size_t n=0; n Music::hamming(int n) +{ + vector win(n); + + double s = 0.0; + for(size_t n=0; n +#include + +namespace Music +{ + std::vector hann(int n); + std::vector hamming(int n); + + inline double win_sinc(double x, double f) + { + if(x==0.5) return 1.0; + double s = Math::sinc((x-0.5)*f); + return s*s; + } + + struct Win_Sinc + { + double m_f; + + Win_Sinc(double f) : m_f(f) {} + + double operator()(double x) {return win_sinc(x, m_f);} + }; + + //! usefull gauss fonction + /*! + * \param x \f$\approx\in [0,1]\f$ + * \param f width factor + */ + inline double win_gauss(double x, double f) + { + return Math::gauss((x-0.5)*f); + } + + //! object fonction of \ref win_gauss + struct Win_Gauss + { + double m_g; + + Win_Gauss(double g) : m_g(g) {} + + double operator()(double x) {return win_gauss(x, m_g);} + }; + + //! compute integrale of fn \f$\in [0,1]\f$ + /*! with a Simpson algorithm + */ + template + inline double Usefull(Fn fn, double simpsonStep=0.001) + { + return Math::Simpson(0.0, 1.0, fn, simpsonStep); + } +} + +#endif // _SPWindow_h_ diff --git a/libs/Music/TODO b/libs/Music/TODO new file mode 100644 index 0000000..b686d50 --- /dev/null +++ b/libs/Music/TODO @@ -0,0 +1,6 @@ +omidistream + tempo change + +voc + component + fondamental diff --git a/libs/Music/TimeAnalysis.cpp b/libs/Music/TimeAnalysis.cpp new file mode 100644 index 0000000..3090e0c --- /dev/null +++ b/libs/Music/TimeAnalysis.cpp @@ -0,0 +1,285 @@ +// Copyright 2004 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#include "TimeAnalysis.h" + +#include +#include +#include +#include +#include +using namespace std; +#include +using namespace Math; + +#include "Music.h" + +namespace Music +{ + double InterpolatedPeriod(const std::deque& queue, int left, int right) + { + double l = left - queue[left]/(queue[left+1]-queue[left]); + + double r = right - queue[right]/(queue[right+1]-queue[right]); + + return r - l; + } + + /* + * on peut imaginer des cas qui mettent en échec cette procédure: + * on selectionne un zéro qui n'en n'est pas un une periode plus + * tard et si un autre zéro se trouve dans la zone de tolérance la longeur + * ainsi calculée entre ces deux zéro (qui ne se correspondent donc pas) sera fausse. + * example: une fréquence très basse avec une seule harmonique très très + * haute. + * - il faut utiliser des zéros significatifs ... et ... et ... et voilà . + * - ou encore écarter les solutions trop élognées de la moyenne + */ + double GetAveragePeriodFromApprox(const std::deque& queue, int approx, int n) + { + if(GetAFreq()<=0.0 || GetSamplingRate()<=0.0 || int(queue.size()) ups; // the upper peeks + + // parse the whole buffer, for n zeros + for(int i=0; int(ups.size())0) // if it cross the axis + ups.push_back(i); + +// cerr << "approx=" << approx << " ups.size()=" << ups.size(); + if(ups.empty()) + return 0.0; + + double ht = f2hf(double(GetSamplingRate())/approx); + int period_low_bound = int(GetSamplingRate()/h2f(ht+1))-2; + int period_high_bound = int(GetSamplingRate()/h2f(ht-1))+2; + +// cerr << " ht=" << ht << " lb=" << period_low_bound << " rb=" << period_high_bound; + +// cerr << " periods=("; + + double period = 0.0; + int count = 0; + + for(int i=0; i=int(queue.size())) + i = ups.size(); // stop loop + else + { + if(!(queue[i_seek]<=0.0 && queue[i_seek+1]>0.0)) + { + while(lower_i_seek>low_bound && + !(queue[lower_i_seek]<=0.0 && queue[lower_i_seek+1]>0.0)) + lower_i_seek--; + + while(higher_i_seek0.0)) + higher_i_seek++; + + if(i_seek-lower_i_seek < higher_i_seek-i_seek) // take the nearest to i_seek + i_seek = lower_i_seek; + else + i_seek = higher_i_seek; + } + +// cerr << i_seek << "=>"; + + if(low_bound& queue, size_t wave_length, std::deque& sample) + { + assert(wave_length>0); + if(queue.size()<2*wave_length) return; + + // find the highest peek in the second period + int left = 0; + double min_vol = 0; + for(int i=int(wave_length); i=int(queue.size())) + return; + + min_vol = 0.0; + for(int i=left_right; i<=right_right; i++) + { + if(queue[i]& queue, double approx, int n) + { + assert(GetSamplingRate()>0); + + if(queue.size()" << approx << " n=" << n << endl; + + double wave_length = 0.0; + int count = 0; + int seek = 0; + while(count en; + for(int i=0; ien_max) + { + en_max = en[i]; + i_max = i; + } + } + seek += i_max; + +// cerr << "max-seek=" << seek << " " << flush; + + int old_seek=seek; + // go back to the previous zero + while(seek>=0 && !(queue[seek]<=0 && queue[seek+1]>0) && seek>old_seek-approx/2) + seek--; + +// cerr << "zero-seek=" << seek << " " << flush; + + if(seek<0 || seek<=old_seek-approx/2) + { + seek += int(approx); +// cerr << endl; + continue; + } + + int left = seek; + int right = int(left + approx); + int sright = right; + int downlimit = int(left + 0.75*approx); + int bright = right; + int uplimit = int(left + 1.25*approx); + + // look for the nearest zero of right + while(sright+1downlimit && + !(queue[sright]<=0 && queue[sright+1]>0)) + sright--; + while(bright+10)) + bright++; + + if(sright>=int(queue.size()) || bright>=int(queue.size())) + { + seek = -1; +// cerr << endl; + continue; + } + + double sw = InterpolatedPeriod(queue, left, sright); + double bw = InterpolatedPeriod(queue, left, bright); + // keep the nearest one after approx + double wl = 0.0; + if(abs(sw-approx) +#include +#include +#include +#include +using namespace std; +#include "Algorithm.h" +#include "CumulativeDiff.h" + +namespace Music +{ + //! Seek for the period (relative to sampling rate) + double GetAverageWaveLengthFromApproxEnergy(const std::deque& queue, double approx, int n); + + //! Seek for the period (relative to sampling rate) + double GetAveragePeriodFromApprox(const std::deque& queue, int approx, int n); + + //! Get a sample of the wave form (relative to sampling rate) + void GetWaveSample(const std::deque& queue, size_t wave_length, std::deque& sample); +} + +#endif // _TimeAnalysis_h_ + diff --git a/m4/Makefile.am b/m4/Makefile.am new file mode 100644 index 0000000..7bcfad9 --- /dev/null +++ b/m4/Makefile.am @@ -0,0 +1 @@ +EXTRA_DIST = *.m4 diff --git a/m4/Makefile.in b/m4/Makefile.in new file mode 100644 index 0000000..9489834 --- /dev/null +++ b/m4/Makefile.in @@ -0,0 +1,303 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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. + +@SET_MAKE@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = m4 +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_cxx_exceptions.m4 \ + $(top_srcdir)/m4/ac_cxx_have_complex.m4 \ + $(top_srcdir)/m4/ac_cxx_have_numeric_limits.m4 \ + $(top_srcdir)/m4/ac_cxx_have_sstream.m4 \ + $(top_srcdir)/m4/ac_cxx_have_stl.m4 \ + $(top_srcdir)/m4/ac_cxx_namespaces.m4 \ + $(top_srcdir)/m4/ac_cxx_templates.m4 \ + $(top_srcdir)/m4/bnv_have_qt.m4 \ + $(top_srcdir)/m4/mdl_have_opengl.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QT_CXXFLAGS = @QT_CXXFLAGS@ +QT_DIR = @QT_DIR@ +QT_LIBS = @QT_LIBS@ +QT_MOC = @QT_MOC@ +QT_UIC = @QT_UIC@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_prefix = @ac_prefix@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +EXTRA_DIST = *.m4 +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu m4/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +uninstall-info-am: +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \ + uninstall-info-am + +# 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: diff --git a/m4/ac_cxx_exceptions.m4 b/m4/ac_cxx_exceptions.m4 new file mode 100644 index 0000000..c604efc --- /dev/null +++ b/m4/ac_cxx_exceptions.m4 @@ -0,0 +1,21 @@ +dnl @synopsis AC_CXX_EXCEPTIONS +dnl +dnl If the C++ compiler supports exceptions handling (try, +dnl throw and catch), define HAVE_EXCEPTIONS. +dnl +dnl @version $Id: ac_cxx_exceptions.m4,v 1.1 2005/01/07 02:52:49 norwin Exp $ +dnl @author Todd Veldhuizen and Luc Maisonobe +dnl +AC_DEFUN([AC_CXX_EXCEPTIONS], +[AC_CACHE_CHECK(whether the compiler supports exceptions, +ac_cv_cxx_exceptions, +[AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE(,[try { throw 1; } catch (int i) { return i; }], + ac_cv_cxx_exceptions=yes, ac_cv_cxx_exceptions=no) + AC_LANG_RESTORE +]) +if test "$ac_cv_cxx_exceptions" = yes; then + AC_DEFINE(HAVE_EXCEPTIONS,,[define if the compiler supports exceptions]) +fi +]) diff --git a/m4/ac_cxx_have_complex.m4 b/m4/ac_cxx_have_complex.m4 new file mode 100644 index 0000000..85d5b7e --- /dev/null +++ b/m4/ac_cxx_have_complex.m4 @@ -0,0 +1,24 @@ +dnl @synopsis AC_CXX_HAVE_COMPLEX +dnl +dnl If the compiler has complex, define HAVE_COMPLEX. +dnl +dnl @version $Id: ac_cxx_have_complex.m4,v 1.1 2005/01/07 02:52:49 norwin Exp $ +dnl @author Todd Veldhuizen and Luc Maisonobe +dnl +AC_DEFUN([AC_CXX_HAVE_COMPLEX], +[AC_CACHE_CHECK(whether the compiler has complex, +ac_cv_cxx_have_complex, +[AC_REQUIRE([AC_CXX_NAMESPACES]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include +#ifdef HAVE_NAMESPACES +using namespace std; +#endif],[complex a; complex b; return 0;], + ac_cv_cxx_have_complex=yes, ac_cv_cxx_have_complex=no) + AC_LANG_RESTORE +]) +if test "$ac_cv_cxx_have_complex" = yes; then + AC_DEFINE(HAVE_COMPLEX,,[define if the compiler has complex]) +fi +]) diff --git a/m4/ac_cxx_have_numeric_limits.m4 b/m4/ac_cxx_have_numeric_limits.m4 new file mode 100644 index 0000000..617857a --- /dev/null +++ b/m4/ac_cxx_have_numeric_limits.m4 @@ -0,0 +1,24 @@ +dnl @synopsis AC_CXX_HAVE_NUMERIC_LIMITS +dnl +dnl If the compiler has numeric_limits, define HAVE_NUMERIC_LIMITS. +dnl +dnl @version $Id: ac_cxx_have_numeric_limits.m4,v 1.1 2005/01/07 02:52:49 norwin Exp $ +dnl @author Todd Veldhuizen and Luc Maisonobe +dnl +AC_DEFUN([AC_CXX_HAVE_NUMERIC_LIMITS], +[AC_CACHE_CHECK(whether the compiler has numeric_limits, +ac_cv_cxx_have_numeric_limits, +[AC_REQUIRE([AC_CXX_NAMESPACES]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include +#ifdef HAVE_NAMESPACES +using namespace std; +#endif],[double e = numeric_limits::epsilon(); return 0;], + ac_cv_cxx_have_numeric_limits=yes, ac_cv_cxx_have_numeric_limits=no) + AC_LANG_RESTORE +]) +if test "$ac_cv_cxx_have_numeric_limits" = yes; then + AC_DEFINE(HAVE_NUMERIC_LIMITS,,[define if the compiler has numeric_limits]) +fi +]) diff --git a/m4/ac_cxx_have_sstream.m4 b/m4/ac_cxx_have_sstream.m4 new file mode 100644 index 0000000..3e58b19 --- /dev/null +++ b/m4/ac_cxx_have_sstream.m4 @@ -0,0 +1,24 @@ +dnl @synopsis AC_CXX_HAVE_SSTREAM +dnl +dnl If the C++ library has a working stringstream, define HAVE_SSTREAM. +dnl +dnl @author Ben Stanley +dnl @version $Id: ac_cxx_have_sstream.m4,v 1.1 2005/01/07 02:52:49 norwin Exp $ +dnl +AC_DEFUN([AC_CXX_HAVE_SSTREAM], +[AC_CACHE_CHECK(whether the compiler has stringstream, +ac_cv_cxx_have_sstream, +[AC_REQUIRE([AC_CXX_NAMESPACES]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include +#ifdef HAVE_NAMESPACES +using namespace std; +#endif],[stringstream message; message << "Hello"; return 0;], + ac_cv_cxx_have_sstream=yes, ac_cv_cxx_have_sstream=no) + AC_LANG_RESTORE +]) +if test "$ac_cv_cxx_have_sstream" = yes; then + AC_DEFINE(HAVE_SSTREAM,,[define if the compiler has stringstream]) +fi +]) diff --git a/m4/ac_cxx_have_stl.m4 b/m4/ac_cxx_have_stl.m4 new file mode 100644 index 0000000..c27cada --- /dev/null +++ b/m4/ac_cxx_have_stl.m4 @@ -0,0 +1,26 @@ +dnl @synopsis AC_CXX_HAVE_STL +dnl +dnl If the compiler supports the Standard Template Library, define HAVE_STL. +dnl +dnl @version $Id: ac_cxx_have_stl.m4,v 1.1 2005/01/07 02:52:49 norwin Exp $ +dnl @author Todd Veldhuizen and Luc Maisonobe +dnl +AC_DEFUN([AC_CXX_HAVE_STL], +[AC_CACHE_CHECK(whether the compiler supports Standard Template Library, +ac_cv_cxx_have_stl, +[AC_REQUIRE([AC_CXX_NAMESPACES]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include +#include +#ifdef HAVE_NAMESPACES +using namespace std; +#endif],[list x; x.push_back(5); +list::iterator iter = x.begin(); if (iter != x.end()) ++iter; return 0;], + ac_cv_cxx_have_stl=yes, ac_cv_cxx_have_stl=no) + AC_LANG_RESTORE +]) +if test "$ac_cv_cxx_have_stl" = yes; then + AC_DEFINE(HAVE_STL,,[define if the compiler supports Standard Template Library]) +fi +]) diff --git a/m4/ac_cxx_namespaces.m4 b/m4/ac_cxx_namespaces.m4 new file mode 100644 index 0000000..d915b0b --- /dev/null +++ b/m4/ac_cxx_namespaces.m4 @@ -0,0 +1,22 @@ +dnl @synopsis AC_CXX_NAMESPACES +dnl +dnl If the compiler can prevent names clashes using namespaces, define +dnl HAVE_NAMESPACES. +dnl +dnl @version $Id: ac_cxx_namespaces.m4,v 1.1 2005/01/07 02:52:49 norwin Exp $ +dnl @author Todd Veldhuizen and Luc Maisonobe +dnl +AC_DEFUN([AC_CXX_NAMESPACES], +[AC_CACHE_CHECK(whether the compiler implements namespaces, +ac_cv_cxx_namespaces, +[AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}], + [using namespace Outer::Inner; return i;], + ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no) + AC_LANG_RESTORE +]) +if test "$ac_cv_cxx_namespaces" = yes; then + AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces]) +fi +]) diff --git a/m4/ac_cxx_templates.m4 b/m4/ac_cxx_templates.m4 new file mode 100644 index 0000000..6743abe --- /dev/null +++ b/m4/ac_cxx_templates.m4 @@ -0,0 +1,22 @@ +dnl @synopsis AC_CXX_TEMPLATES +dnl +dnl If the compiler supports basic templates, define HAVE_TEMPLATES. +dnl +dnl @version $Id: ac_cxx_templates.m4,v 1.1 2005/01/07 02:52:49 norwin Exp $ +dnl @author Todd Veldhuizen and Luc Maisonobe +dnl +AC_DEFUN([AC_CXX_TEMPLATES], +[AC_CACHE_CHECK(whether the compiler supports basic templates, +ac_cv_cxx_templates, +[AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([template class A {public:A(){}}; +template void f(const A& ){}],[ +A d; A i; f(d); f(i); return 0;], + ac_cv_cxx_templates=yes, ac_cv_cxx_templates=no) + AC_LANG_RESTORE +]) +if test "$ac_cv_cxx_templates" = yes; then + AC_DEFINE(HAVE_TEMPLATES,,[define if the compiler supports basic templates]) +fi +]) diff --git a/m4/bnv_have_qt.m4 b/m4/bnv_have_qt.m4 new file mode 100644 index 0000000..51d2b95 --- /dev/null +++ b/m4/bnv_have_qt.m4 @@ -0,0 +1,431 @@ +dnl Copyright (C) 2001, 2002, 2003, 2005, 2006 Bastiaan Veelo + +dnl THANKS! This code includes bug fixes and contributions made by: +dnl Tim McClarren, +dnl Dennis R. Weilert, +dnl Qingning Huo, +dnl Brian Mingus, +dnl Jens Hannemann, +dnl Pavel Roskin, +dnl Scott J. Bertin. + +dnl ChangeLog +dnl 2006-03-12 * Hide output of ls and fix an m4 quoting problem (due to Scott J. Bertin). +dnl 2006-02-13 * Check compiler return value instead of parsing the error stream, +dnl which detected warnings as false negatives (due to Jens Hannemann). +dnl 2006-02-02 * Spelling of "Success". +dnl * Fixed unsave test for $bnv_qt_lib without quotes. +dnl * Put dnl in front of all comments. +dnl * Changed -l$bnv_qt_lib_dir into -L$bnv_qt_lib_dir (all due to Pavel Roskin). +dnl 2006-01-19 * Support for 64bit architectures. +dnl * Updated documentation. +dnl 2006-01-18: * Fix "cat: bnv_qt_test.c: No such file or directory" (due to Jens Hannemann). +dnl * Hide output of failing ls. +dnl 2006-01-11: * Check in /Developer on Mac OS X; Check in $QTDIR (due to Brian Mingus). + +dnl Calls BNV_PATH_QT_DIRECT (contained in this file) as a subroutine. +AC_DEFUN([BNV_HAVE_QT], +[ + AC_REQUIRE([AC_PROG_CXX]) + AC_REQUIRE([AC_PATH_X]) + AC_REQUIRE([AC_PATH_XTRA]) + + AC_MSG_CHECKING(for Qt) + + AC_ARG_WITH([Qt-dir], + [ --with-Qt-dir=DIR DIR is equal to $QTDIR if you have followed the + installation instructions of Trolltech. Header + files are in DIR/include, binary utilities are + in DIR/bin. The library is in DIR/lib, unless + --with-Qt-lib-dir is also set.]) + AC_ARG_WITH([Qt-include-dir], + [ --with-Qt-include-dir=DIR + Qt header files are in DIR]) + AC_ARG_WITH([Qt-bin-dir], + [ --with-Qt-bin-dir=DIR Qt utilities such as moc and uic are in DIR]) + AC_ARG_WITH([Qt-lib-dir], + [ --with-Qt-lib-dir=DIR The Qt library is in DIR]) + AC_ARG_WITH([Qt-lib], + [ --with-Qt-lib=LIB Use -lLIB to link with the Qt library]) + if test x"$with_Qt_dir" = x"no" || + test x"$with_Qt_include-dir" = x"no" || + test x"$with_Qt_bin_dir" = x"no" || + test x"$with_Qt_lib_dir" = x"no" || + test x"$with_Qt_lib" = x"no"; then + # user disabled Qt. Leave cache alone. + have_qt="User disabled Qt." + else + # "yes" is a bogus option + if test x"$with_Qt_dir" = xyes; then + with_Qt_dir= + fi + if test x"$with_Qt_include_dir" = xyes; then + with_Qt_include_dir= + fi + if test x"$with_Qt_bin_dir" = xyes; then + with_Qt_bin_dir= + fi + if test x"$with_Qt_lib_dir" = xyes; then + with_Qt_lib_dir= + fi + if test x"$with_Qt_lib" = xyes; then + with_Qt_lib= + fi + # No Qt unless we discover otherwise + have_qt=no + # Check whether we are requested to link with a specific version + if test x"$with_Qt_lib" != x; then + bnv_qt_lib="$with_Qt_lib" + fi + # Check whether we were supplied with an answer already + if test x"$with_Qt_dir" != x; then + have_qt=yes + bnv_qt_dir="$with_Qt_dir" + bnv_qt_include_dir="$with_Qt_dir/include" + bnv_qt_bin_dir="$with_Qt_dir/bin" + bnv_qt_lib_dir="$with_Qt_dir/lib" + # Only search for the lib if the user did not define one already + if test x"$bnv_qt_lib" = x; then + bnv_qt_lib="`ls $bnv_qt_lib_dir/libqt* | sed -n 1p | + sed s@$bnv_qt_lib_dir/lib@@ | [sed s@[.].*@@]`" + fi + bnv_qt_LIBS="-L$bnv_qt_lib_dir -l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS" + else + # Use cached value or do search, starting with suggestions from + # the command line + AC_CACHE_VAL(bnv_cv_have_qt, + [ + # We are not given a solution and there is no cached value. + bnv_qt_dir=NO + bnv_qt_include_dir=NO + bnv_qt_lib_dir=NO + if test x"$bnv_qt_lib" = x; then + bnv_qt_lib=NO + fi + BNV_PATH_QT_DIRECT + if test "$bnv_qt_dir" = NO || + test "$bnv_qt_include_dir" = NO || + test "$bnv_qt_lib_dir" = NO || + test "$bnv_qt_lib" = NO; then + # Problem with finding complete Qt. Cache the known absence of Qt. + bnv_cv_have_qt="have_qt=no" + else + # Record where we found Qt for the cache. + bnv_cv_have_qt="have_qt=yes \ + bnv_qt_dir=$bnv_qt_dir \ + bnv_qt_include_dir=$bnv_qt_include_dir \ + bnv_qt_bin_dir=$bnv_qt_bin_dir \ + bnv_qt_LIBS=\"$bnv_qt_LIBS\"" + fi + ])dnl + eval "$bnv_cv_have_qt" + fi # all $bnv_qt_* are set + fi # $have_qt reflects the system status + if test x"$have_qt" = xyes; then + QT_CXXFLAGS="-I$bnv_qt_include_dir" + if test x"$bnv_qt_lib" = xqt-mt; then + QT_CXXFLAGS="$QT_CXXFLAGS -DQT_THREAD_SUPPORT" + fi + QT_DIR="$bnv_qt_dir" + QT_LIBS="$bnv_qt_LIBS" + # If bnv_qt_dir is defined, utilities are expected to be in the + # bin subdirectory + if test x"$bnv_qt_dir" != x; then + if test -x "$bnv_qt_dir/bin/uic"; then + QT_UIC="$bnv_qt_dir/bin/uic" + else + # Old versions of Qt don't have uic + QT_UIC= + fi + QT_MOC="$bnv_qt_dir/bin/moc" + else + # Or maybe we are told where to look for the utilities + if test x"$bnv_qt_bin_dir" != x; then + if test -x "$bnv_qt_bin_dir/uic"; then + QT_UIC="$bnv_qt_bin_dir/uic" + else + # Old versions of Qt don't have uic + QT_UIC= + fi + QT_MOC="$bnv_qt_bin_dir/moc" + else + # Last possibility is that they are in $PATH + QT_UIC="`which uic`" + QT_MOC="`which moc`" + fi + fi + # All variables are defined, report the result + AC_MSG_RESULT([$have_qt: + QT_CXXFLAGS=$QT_CXXFLAGS + QT_DIR=$QT_DIR + QT_LIBS=$QT_LIBS + QT_UIC=$QT_UIC + QT_MOC=$QT_MOC]) + else + # Qt was not found + QT_CXXFLAGS= + QT_DIR= + QT_LIBS= + QT_UIC= + QT_MOC= + AC_MSG_RESULT($have_qt) + fi + AC_SUBST(QT_CXXFLAGS) + AC_SUBST(QT_DIR) + AC_SUBST(QT_LIBS) + AC_SUBST(QT_UIC) + AC_SUBST(QT_MOC) + + #### Being paranoid: + if test x"$have_qt" = xyes; then + AC_MSG_CHECKING(correct functioning of Qt installation) + AC_CACHE_VAL(bnv_cv_qt_test_result, + [ + cat > bnv_qt_test.h << EOF +#include +class Test : public QObject +{ +Q_OBJECT +public: + Test() {} + ~Test() {} +public slots: + void receive() {} +signals: + void send(); +}; +EOF + + cat > bnv_qt_main.$ac_ext << EOF +#include "bnv_qt_test.h" +#include +int main( int argc, char **argv ) +{ + QApplication app( argc, argv ); + Test t; + QObject::connect( &t, SIGNAL(send()), &t, SLOT(receive()) ); +} +EOF + + bnv_cv_qt_test_result="failure" + bnv_try_1="$QT_MOC bnv_qt_test.h -o moc_bnv_qt_test.$ac_ext >/dev/null 2>/dev/null" + AC_TRY_EVAL(bnv_try_1) + if test x"$ac_status" != x0; then + echo "$bnv_err_1" >&AC_FD_CC + echo "configure: could not run $QT_MOC on:" >&AC_FD_CC + cat bnv_qt_test.h >&AC_FD_CC + else + bnv_try_2="$CXX $QT_CXXFLAGS -c $CXXFLAGS -o moc_bnv_qt_test.o moc_bnv_qt_test.$ac_ext >/dev/null 2>/dev/null" + AC_TRY_EVAL(bnv_try_2) + if test x"$ac_status" != x0; then + echo "$bnv_err_2" >&AC_FD_CC + echo "configure: could not compile:" >&AC_FD_CC + cat moc_bnv_qt_test.$ac_ext >&AC_FD_CC + else + bnv_try_3="$CXX $QT_CXXFLAGS -c $CXXFLAGS -o bnv_qt_main.o bnv_qt_main.$ac_ext >/dev/null 2>/dev/null" + AC_TRY_EVAL(bnv_try_3) + if test x"$ac_status" != x0; then + echo "$bnv_err_3" >&AC_FD_CC + echo "configure: could not compile:" >&AC_FD_CC + cat bnv_qt_main.$ac_ext >&AC_FD_CC + else + bnv_try_4="$CXX $LIBS -o bnv_qt_main bnv_qt_main.o moc_bnv_qt_test.o $QT_LIBS >/dev/null 2>/dev/null" + AC_TRY_EVAL(bnv_try_4) + if test x"$ac_status" != x0; then + echo "$bnv_err_4" >&AC_FD_CC + else + bnv_cv_qt_test_result="success" + fi + fi + fi + fi + ])dnl AC_CACHE_VAL bnv_cv_qt_test_result + AC_MSG_RESULT([$bnv_cv_qt_test_result]); + if test x"$bnv_cv_qt_test_result" = "xfailure"; then + AC_MSG_ERROR([Failed to find matching components of a complete + Qt installation. Try using more options, + see ./configure --help.]) + fi + + rm -f bnv_qt_test.h moc_bnv_qt_test.$ac_ext moc_bnv_qt_test.o \ + bnv_qt_main.$ac_ext bnv_qt_main.o bnv_qt_main + fi +]) + +dnl Internal subroutine of BNV_HAVE_QT +dnl Set bnv_qt_dir bnv_qt_include_dir bnv_qt_bin_dir bnv_qt_lib_dir bnv_qt_lib +AC_DEFUN([BNV_PATH_QT_DIRECT], +[ + ## Binary utilities ## + if test x"$with_Qt_bin_dir" != x; then + bnv_qt_bin_dir=$with_Qt_bin_dir + fi + ## Look for header files ## + if test x"$with_Qt_include_dir" != x; then + bnv_qt_include_dir="$with_Qt_include_dir" + else + # The following header file is expected to define QT_VERSION. + qt_direct_test_header=qglobal.h + # Look for the header file in a standard set of common directories. + bnv_include_path_list=" + /usr/include + `ls -dr ${QTDIR}/include 2>/dev/null` + `ls -dr /usr/include/qt* 2>/dev/null` + `ls -dr /usr/lib/qt*/include 2>/dev/null` + `ls -dr /usr/local/qt*/include 2>/dev/null` + `ls -dr /opt/qt*/include 2>/dev/null` + `ls -dr /Developer/qt*/include 2>/dev/null` + " + for bnv_dir in $bnv_include_path_list; do + if test -r "$bnv_dir/$qt_direct_test_header"; then + bnv_dirs="$bnv_dirs $bnv_dir" + fi + done + # Now look for the newest in this list + bnv_prev_ver=0 + for bnv_dir in $bnv_dirs; do + bnv_this_ver=`egrep -w '#define QT_VERSION' $bnv_dir/$qt_direct_test_header | sed s/'#define QT_VERSION'//` + if expr $bnv_this_ver '>' $bnv_prev_ver > /dev/null; then + bnv_qt_include_dir=$bnv_dir + bnv_prev_ver=$bnv_this_ver + fi + done + fi dnl Found header files. + + # Are these headers located in a traditional Trolltech installation? + # That would be $bnv_qt_include_dir stripped from its last element: + bnv_possible_qt_dir=`dirname $bnv_qt_include_dir` + if (test -x $bnv_possible_qt_dir/bin/moc) && + ((ls $bnv_possible_qt_dir/lib/libqt* > /dev/null 2>/dev/null) || + (ls $bnv_possible_qt_dir/lib64/libqt* > /dev/null 2>/dev/null)); then + # Then the rest is a piece of cake + bnv_qt_dir=$bnv_possible_qt_dir + bnv_qt_bin_dir="$bnv_qt_dir/bin" + if test x"$with_Qt_lib_dir" != x; then + bnv_qt_lib_dir="$with_Qt_lib_dir" + else + if (test -d $bnv_qt_dir/lib64); then + bnv_qt_lib_dir="$bnv_qt_dir/lib64" + else + bnv_qt_lib_dir="$bnv_qt_dir/lib" + fi + fi + # Only look for lib if the user did not supply it already + if test x"$bnv_qt_lib" = xNO; then + bnv_qt_lib="`ls $bnv_qt_lib_dir/libqt* | sed -n 1p | + sed s@$bnv_qt_lib_dir/lib@@ | [sed s@[.].*@@]`" + fi + bnv_qt_LIBS="-L$bnv_qt_lib_dir -l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS" + else + # There is no valid definition for $QTDIR as Trolltech likes to see it + bnv_qt_dir= + ## Look for Qt library ## + if test x"$with_Qt_lib_dir" != x; then + bnv_qt_lib_dir="$with_Qt_lib_dir" + # Only look for lib if the user did not supply it already + if test x"$bnv_qt_lib" = xNO; then + bnv_qt_lib="`ls $bnv_qt_lib_dir/libqt* | sed -n 1p | + sed s@$bnv_qt_lib_dir/lib@@ | [sed s@[.].*@@]`" + fi + bnv_qt_LIBS="-L$bnv_qt_lib_dir -l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS" + else + # Normally, when there is no traditional Trolltech installation, + # the library is installed in a place where the linker finds it + # automatically. + # If the user did not define the library name, try with qt + if test x"$bnv_qt_lib" = xNO; then + bnv_qt_lib=qt + fi + qt_direct_test_header=qapplication.h + qt_direct_test_main=" + int argc; + char ** argv; + QApplication app(argc,argv); + " + # See if we find the library without any special options. + # Don't add top $LIBS permanently yet + bnv_save_LIBS="$LIBS" + LIBS="-l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS" + bnv_qt_LIBS="$LIBS" + bnv_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="-I$bnv_qt_include_dir" + AC_TRY_LINK([#include <$qt_direct_test_header>], + $qt_direct_test_main, + [ + # Success. + # We can link with no special library directory. + bnv_qt_lib_dir= + ], [ + # That did not work. Try the multi-threaded version + echo "Non-critical error, please neglect the above." >&AC_FD_CC + bnv_qt_lib=qt-mt + LIBS="-l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS" + AC_TRY_LINK([#include <$qt_direct_test_header>], + $qt_direct_test_main, + [ + # Success. + # We can link with no special library directory. + bnv_qt_lib_dir= + ], [ + # That did not work. Try the OpenGL version + echo "Non-critical error, please neglect the above." >&AC_FD_CC + bnv_qt_lib=qt-gl + LIBS="-l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS" + AC_TRY_LINK([#include <$qt_direct_test_header>], + $qt_direct_test_main, + [ + # Success. + # We can link with no special library directory. + bnv_qt_lib_dir= + ], [ + # That did not work. Maybe a library version I don't know about? + echo "Non-critical error, please neglect the above." >&AC_FD_CC + # Look for some Qt lib in a standard set of common directories. + bnv_dir_list=" + `echo $bnv_qt_includes | sed ss/includess` + /lib + /usr/lib64 + /usr/lib + /usr/local/lib64 + /usr/local/lib + /opt/lib64 + /opt/lib + `ls -dr /usr/lib64/qt* 2>/dev/null` + `ls -dr /usr/lib64/qt*/lib64 2>/dev/null` + `ls -dr /usr/lib/qt* 2>/dev/null` + `ls -dr /usr/local/qt* 2>/dev/null` + `ls -dr /opt/qt* 2>/dev/null` + " + for bnv_dir in $bnv_dir_list; do + if ls $bnv_dir/libqt* >/dev/null 2>/dev/null; then + # Gamble that it's the first one... + bnv_qt_lib="`ls $bnv_dir/libqt* | sed -n 1p | + sed s@$bnv_dir/lib@@ | sed s/[[.]].*//`" + bnv_qt_lib_dir="$bnv_dir" + break + fi + done + # Try with that one + LIBS="-l$bnv_qt_lib $X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS" + AC_TRY_LINK([#include <$qt_direct_test_header>], + $qt_direct_test_main, + [ + # Success. + # We can link with no special library directory. + bnv_qt_lib_dir= + ], [ + # Leave bnv_qt_lib_dir defined + ]) + ]) + ]) + ]) + if test x"$bnv_qt_lib_dir" != x; then + bnv_qt_LIBS="-L$bnv_qt_lib_dir $LIBS" + else + bnv_qt_LIBS="$LIBS" + fi + LIBS="$bnv_save_LIBS" + CXXFLAGS="$bnv_save_CXXFLAGS" + fi dnl $with_Qt_lib_dir was not given + fi dnl Done setting up for non-traditional Trolltech installation +]) \ No newline at end of file diff --git a/m4/mdl_have_opengl.m4 b/m4/mdl_have_opengl.m4 new file mode 100644 index 0000000..cda023b --- /dev/null +++ b/m4/mdl_have_opengl.m4 @@ -0,0 +1,97 @@ +dnl Available from the GNU Autoconf Macro Archive at: +dnl http://www.gnu.org/software/ac-archive/htmldoc/mdl_have_opengl.html +dnl +AC_DEFUN([MDL_HAVE_OPENGL], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_PATH_X]) + AC_REQUIRE([AC_PATH_XTRA]) + + AC_CACHE_CHECK([for OpenGL], mdl_cv_have_OpenGL, + [ +dnl Check for Mesa first, unless we were asked not to. +dnl AC_ARG_WITH(Mesa, AC_HELP_STRING([--with-Mesa],[Prefer the Mesa library over a vendors native OpenGL library (default=yes)])) + AC_ARG_ENABLE(Mesa, + AC_HELP_STRING([--enable-Mesa],[Prefer the Mesa library + over a vendors native OpenGL library (default=yes)]), + [use_Mesa=$enableval], [use_Mesa=yes]) + + if test x"$use_Mesa" = xyes; then + GL_search_list="MesaGL GL" + GLU_search_list="MesaGLU GLU" + GLX_search_list="MesaGLX GLX" + else + GL_search_list="GL MesaGL" + GLU_search_list="GLU MesaGLU" + GLX_search_list="GLX MesaGLX" + fi + + AC_LANG_SAVE + AC_LANG_C + +dnl If we are running under X11 then add in the appropriate libraries. +if test x"$no_x" != xyes; then +dnl Add everything we need to compile and link X programs to GL_X_CFLAGS +dnl and GL_X_LIBS. + GL_CFLAGS="$X_CFLAGS" + GL_X_LIBS="$X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS" +fi + GL_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$GL_CFLAGS" + + GL_save_LIBS="$LIBS" + LIBS="$GL_X_LIBS" + + + # Save the "AC_MSG_RESULT file descriptor" to FD 8. + exec 8>&AC_FD_MSG + + # Temporarily turn off AC_MSG_RESULT so that the user gets pretty + # messages. + exec AC_FD_MSG>/dev/null + + AC_SEARCH_LIBS(glAccum, $GL_search_list, have_GL=yes, have_GL=no) + AC_SEARCH_LIBS(gluBeginCurve, $GLU_search_list, have_GLU=yes, have_GLU=no) + AC_SEARCH_LIBS(glXChooseVisual, $GLX_search_list, have_GLX=yes, have_GLX=no) + AC_SEARCH_LIBS(glutInit, glut, have_glut=yes, have_glut=no) + + + + # Restore pretty messages. + exec AC_FD_MSG>&8 + + if test -n "$LIBS"; then + mdl_cv_have_OpenGL=yes + GL_LIBS="$LIBS" + AC_SUBST(GL_CFLAGS) + AC_SUBST(GL_LIBS) + else + mdl_cv_have_OpenGL=no + GL_CFLAGS= + fi + +dnl Reset GL_X_LIBS regardless, since it was just a temporary variable +dnl and we don't want to be global namespace polluters. + GL_X_LIBS= + + LIBS="$GL_save_LIBS" + CPPFLAGS="$GL_save_CPPFLAGS" + + AC_LANG_RESTORE + +dnl bugfix: dont forget to cache this variables, too + mdl_cv_GL_CFLAGS="$GL_CFLAGS" + mdl_cv_GL_LIBS="$GL_LIBS" + mdl_cv_have_GL="$have_GL" + mdl_cv_have_GLU="$have_GLU" + mdl_cv_have_GLX="$have_GLX" + mdl_cv_have_glut="$have_glut" + ]) + GL_CFLAGS="$mdl_cv_GL_CFLAGS" + GL_LIBS="$mdl_cv_GL_LIBS" + have_GL="$mdl_cv_have_GL" + have_GLU="$mdl_cv_have_GLU" + have_GLX="$mdl_cv_have_GLX" + have_glut="$mdl_cv_have_glut" +]) +dnl endof bugfix -ainan diff --git a/missing b/missing new file mode 100755 index 0000000..894e786 --- /dev/null +++ b/missing @@ -0,0 +1,360 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2005-06-08.21 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# Originally by Fran,cois 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., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case "$1" in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -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 + --run try to run the given command, and emulate it if it fails + +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 + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). +case "$1" in + lex|yacc) + # Not GNU programs, they don't have --version. + ;; + + tar) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case "$1" in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. 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 $msg. You should only need it if + you modified \`${configure_ac}'. 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 $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. 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_ac}` + 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 $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + 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 + ;; + + autom4te) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` + test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' $msg. 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 $msg. 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 + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` + fi + if [ -f "$file" ]; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is $msg. 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." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case "$firstarg" in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case "$firstarg" in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + 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 prerequisites 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 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/src/AutoQSettings.cpp b/src/AutoQSettings.cpp new file mode 100644 index 0000000..6725b02 --- /dev/null +++ b/src/AutoQSettings.cpp @@ -0,0 +1,103 @@ +// Copyright 2007 "Gilles Degottex" + +// This file is part of "fmit" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + +using namespace std; +#include +#include "AutoQSettings.h" + +AutoQSettings::AutoQSettings(const QString& domain, const QString& product, const QString& setting_version) +{ + setPath(domain, product); + beginGroup(QString("/")+product+setting_version+"/"); +} + +void AutoQSettings::save(QCheckBox* el) +{ + writeEntry(el->name(), el->isChecked()); +} +void AutoQSettings::load(QCheckBox* el) +{ + el->setChecked(readBoolEntry(el->name(), el->isChecked())); +} + +void AutoQSettings::save() +{ + beginGroup("Auto/"); + + for(list::iterator it=m_elements_checkbox.begin(); it!=m_elements_checkbox.end(); it++) + writeEntry((*it)->name(), (*it)->isChecked()); + + for(list::iterator it=m_elements_spinbox.begin(); it!=m_elements_spinbox.end(); it++) + writeEntry((*it)->name(), (*it)->value()); + + for(list::iterator it=m_elements_lineedit.begin(); it!=m_elements_lineedit.end(); it++) + writeEntry((*it)->name(), (*it)->text()); + + for(list::iterator it=m_elements_combobox.begin(); it!=m_elements_combobox.end(); it++) + writeEntry((*it)->name(), (*it)->currentItem()); + + for(list::iterator it=m_elements_qgroupbox.begin(); it!=m_elements_qgroupbox.end(); it++) + writeEntry((*it)->name(), (*it)->isChecked()); + + for(list::iterator it=m_elements_qradiobutton.begin(); it!=m_elements_qradiobutton.end(); it++) + writeEntry((*it)->name(), (*it)->isChecked()); + + endGroup(); +} +void AutoQSettings::load() +{ + beginGroup("Auto/"); + + for(list::iterator it=m_elements_checkbox.begin(); it!=m_elements_checkbox.end(); it++) + (*it)->setChecked(readBoolEntry((*it)->name(), (*it)->isChecked())); + + for(list::iterator it=m_elements_spinbox.begin(); it!=m_elements_spinbox.end(); it++) + (*it)->setValue(readNumEntry((*it)->name(), (*it)->value())); + + for(list::iterator it=m_elements_lineedit.begin(); it!=m_elements_lineedit.end(); it++) + (*it)->setText(readEntry((*it)->name(), ((*it)->text()))); + + for(list::iterator it=m_elements_combobox.begin(); it!=m_elements_combobox.end(); it++) + (*it)->setCurrentItem(readNumEntry((*it)->name(), (*it)->currentItem())); + + for(list::iterator it=m_elements_qgroupbox.begin(); it!=m_elements_qgroupbox.end(); it++) + (*it)->setChecked(readBoolEntry((*it)->name(), (*it)->isChecked())); + + for(list::iterator it=m_elements_qradiobutton.begin(); it!=m_elements_qradiobutton.end(); it++) + (*it)->setChecked(readBoolEntry((*it)->name(), (*it)->isChecked())); + + endGroup(); +} +void AutoQSettings::clear() +{ + beginGroup("Auto/"); + + for(list::iterator it=m_elements_checkbox.begin(); it!=m_elements_checkbox.end(); it++) + removeEntry((*it)->name()); + + for(list::iterator it=m_elements_spinbox.begin(); it!=m_elements_spinbox.end(); it++) + removeEntry((*it)->name()); + + for(list::iterator it=m_elements_lineedit.begin(); it!=m_elements_lineedit.end(); it++) + removeEntry((*it)->name()); + + for(list::iterator it=m_elements_combobox.begin(); it!=m_elements_combobox.end(); it++) + removeEntry((*it)->name()); + + endGroup(); +} diff --git a/src/AutoQSettings.h b/src/AutoQSettings.h new file mode 100644 index 0000000..99ebcc6 --- /dev/null +++ b/src/AutoQSettings.h @@ -0,0 +1,54 @@ +// Copyright 2007 "Gilles Degottex" + +// This file is part of "fmit" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class AutoQSettings : public QSettings +{ + std::list m_elements_checkbox; + std::list m_elements_spinbox; + std::list m_elements_lineedit; + std::list m_elements_combobox; + std::list m_elements_qgroupbox; + std::list m_elements_qradiobutton; + + public: + AutoQSettings(const QString& domain, const QString& product, const QString& setting_version); + + void add(QCheckBox* el) {assert(el->name()!=""); m_elements_checkbox.push_back(el);} + void add(QSpinBox* el) {assert(el->name()!=""); m_elements_spinbox.push_back(el);} + void add(QLineEdit* el) {assert(el->name()!=""); m_elements_lineedit.push_back(el);} + void add(QComboBox* el) {assert(el->name()!=""); m_elements_combobox.push_back(el);} + void add(QGroupBox* el) {assert(el->name()!=""); m_elements_qgroupbox.push_back(el);} + void add(QRadioButton* el) {assert(el->name()!=""); m_elements_qradiobutton.push_back(el);} + + void save(QCheckBox* el); + void load(QCheckBox* el); + + void save(); + void load(); + void clear(); +}; diff --git a/src/CaptureThread.cpp b/src/CaptureThread.cpp new file mode 100644 index 0000000..5c6f86b --- /dev/null +++ b/src/CaptureThread.cpp @@ -0,0 +1,1544 @@ +// Copyright 2004 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#include "CaptureThread.h" + +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; +#include + +double DecodeUnsigned8Bits(void* buffer, int i) {return 2*(((unsigned char*)buffer)[i])/256.0 - 1;} +double DecodeSigned8Bits(void* buffer, int i) {return (((signed char*)buffer)[i])/128.0;} +double DecodeUnsigned16Bits(void* buffer, int i){return 2*((unsigned short*)buffer)[i]/65536.0 - 1;} +double DecodeSigned16Bits(void* buffer, int i) {return ((signed short*)buffer)[i]/32768.0;} +void AddValue2ChannelFirst(CaptureThreadImpl* impl, double value, int i) +{ + if(i%2==0) + impl->m_capture_thread->m_values.push_front(value); +} +void AddValue2ChannelMix(CaptureThreadImpl* impl, double value, int i) +{ + if(i%2==0) + impl->m_capture_thread->m_values.push_front(value); + else + impl->m_capture_thread->m_values[0] = (impl->m_capture_thread->m_values[0]+value)/2.0; +} +void AddValue1Channel(CaptureThreadImpl* impl, double value, int i) +{ + impl->m_capture_thread->m_values.push_front(value); +} + +CaptureThread::CaptureThread(const QString& name) +{ + m_current_impl = NULL; + + m_capturing = false; + m_packet_size = 0; + m_ext_lock = false; + m_packet_size_sll = 0; + + m_pause = false; + m_mix_multiple_channel = false; + + m_name = name; + +#ifdef CAPTURE_JACK + m_impls.push_back(new CaptureThreadImplJACK(this)); +#endif +#ifdef CAPTURE_ALSA + m_impls.push_back(new CaptureThreadImplALSA(this)); +#endif +#ifdef CAPTURE_OSS + m_impls.push_back(new CaptureThreadImplOSS(this)); +#endif +#ifdef CAPTURE_PORTAUDIO + m_impls.push_back(new CaptureThreadImplPortAudio(this)); +#endif + + listTransports(); +} + +void CaptureThread::autoDetectTransport() +{ + bool was_capturing = isCapturing(); + if(was_capturing) + stopCapture(); + + QString old_name; + if(m_current_impl!=NULL) + old_name = m_current_impl->m_name; + + cerr << "CaptureThread: INFO: Auto detecting a working transport ... " << flush; + + CaptureThreadImpl* impl = NULL; + for(vector::iterator it=m_impls.begin(); impl==NULL && it!=m_impls.end(); it++) + if((*it)->is_available()) + impl = *it; + + if(impl!=NULL) + { + m_current_impl = impl; + + cerr << "using " << m_current_impl->m_name << endl; + + if(m_current_impl->m_name!=old_name) + emit(transportChanged(m_current_impl->m_name)); + + if(was_capturing) + startCapture(); + } + else + { + cerr << "no working transport !" << endl; + + if(old_name!="") + emit(transportChanged("")); + } +} +void CaptureThread::selectTransport(const QString& name) +{ + cerr << "CaptureThread: INFO: using " << name << " transport" << endl; + if(getCurrentTransport() && name==getCurrentTransport()->getName()) return; + + bool was_capturing = isCapturing(); + if(was_capturing) + stopCapture(); + + QString old_name; + if(m_current_impl!=NULL) + old_name = m_current_impl->m_name; + + CaptureThreadImpl* impl = NULL; + for(vector::iterator it=m_impls.begin(); impl==NULL && it!=m_impls.end(); it++) + if((*it)->m_name==name) + impl = *it; + + if(impl==NULL) + { + cerr << "CaptureThread: ERROR: unknown transport '" << name << "'" << endl; + throw QString("CaptureThread: ERROR: unknown transport '")+name+"'"; + } + + m_current_impl = impl; + + if(m_current_impl->m_name!=old_name) + emit(transportChanged(m_current_impl->m_name)); + + if(was_capturing) + startCapture(); +} +void CaptureThread::selectTransport(int index) +{ + assert(index>=0 && indexgetName() << " transport" << endl; + + bool was_capturing = isCapturing(); + if(was_capturing) + stopCapture(); + + m_current_impl = m_impls[index]; + + emit(transportChanged(m_current_impl->m_name)); + + if(was_capturing) + startCapture(); +} +const vector& CaptureThread::getTransports() const +{ + return m_impls; +} +void CaptureThread::listTransports() +{ + cerr << "CaptureThread: INFO: Built in transports" << endl; + for(vector::iterator it=m_impls.begin(); it!=m_impls.end(); it++) + cerr << "CaptureThread: INFO: " << (*it)->getStatus() << " " << (*it)->m_name << " " << (*it)->m_descr << endl; +} +const CaptureThreadImpl* CaptureThread::getCurrentTransport() const +{ + return m_current_impl; +} +int CaptureThread::getCurrentTransportIndex() const +{ + for(int i=0; im_descr; +} +const CaptureThreadImpl* CaptureThread::getTransport(const QString& name) const +{ + for(vector::const_iterator it=m_impls.begin(); it!=m_impls.end(); it++) + if((*it)->m_name==name) + return *it; + + return NULL; +} +QString CaptureThread::getFormatDescr() const +{ + if(m_current_impl==NULL) + return ""; + + return ""; // TODO +} + +void CaptureThread::emitError(const QString& error) +{ + emit(errorRaised(error)); +} +void CaptureThread::emitSamplingRateChanged() +{ + if(m_current_impl->m_sampling_rate>0) + emit(samplingRateChanged(m_current_impl->m_sampling_rate)); +} +void CaptureThread::emitCaptureStarted() +{ + emit(captureStarted()); +} +void CaptureThread::emitCaptureStoped() +{ + emit(captureStoped()); +} +void CaptureThread::emitCaptureToggled(bool value) +{ + emit(captureToggled(value)); +} + +void CaptureThread::startCapture() +{ + if(m_current_impl==NULL) return; + + m_current_impl->startCapture(); +} +void CaptureThread::stopCapture() +{ + // cerr << "CaptureThread::stopCapture" << endl; + + if(m_current_impl==NULL) return; + + m_current_impl->stopCapture(); + + // cerr << "/CaptureThread::stopCapture" << endl; +} + +void CaptureThread::toggleCapture(bool run) +{ + if(run && !m_capturing) startCapture(); + if(!run && m_capturing) stopCapture(); +} + +void CaptureThread::reset() +{ + stopCapture(); + startCapture(); +} + +void CaptureThread::togglePause(bool pause) +{ + m_pause = pause; +} + +int CaptureThread::getSamplingRate() const +{ + if(m_current_impl==NULL) return SAMPLING_RATE_UNKNOWN; + + return m_current_impl->m_sampling_rate; +} +void CaptureThread::setSamplingRate(int rate) +{ + if(m_current_impl!=NULL) + m_current_impl->setSamplingRate(rate); +} +void CaptureThread::setSource(const QString& name) +{ + if(m_current_impl==NULL) + { + cerr << "CaptureThread: setSource: ERROR: select a transport first" << endl; + return; + } + + if(name!=m_current_impl->m_source) + { + m_current_impl->m_source = name; + if(isCapturing()) + { + stopCapture(); + startCapture(); + } + + emit(sourceChanged(m_current_impl->m_source)); + } +} + +void CaptureThread::setMixMultipleChannels(bool mix) +{ + m_mix_multiple_channel = mix; +} + +CaptureThread::~CaptureThread() +{ + stopCapture(); + + for(vector::iterator it=m_impls.begin(); it!=m_impls.end(); it++) + delete *it; +} + +// -------------------------------- implementation ------------------------------ + +CaptureThreadImpl::CaptureThreadImpl(CaptureThread* capture_thread, const QString& name, const QString& descr) +: m_capture_thread(capture_thread) +{ + m_name = name; + m_descr = descr; + m_status = ""; + + m_sampling_rate = CaptureThread::SAMPLING_RATE_UNKNOWN; + m_format_size = 0; + m_format_signed = true; + m_channel_count = 0; + m_source = ""; +} + +const QString& CaptureThreadImpl::getStatus() +{ + if(m_status=="") + is_available(); + + return m_status; +} + +void CaptureThreadImpl::setFormatDescrsAndFns(int format_size, bool format_signed, bool format_float, int channel_count) +{ + m_format_size = format_size; + m_format_signed = format_signed; + m_format_float = format_float; + m_channel_count = channel_count; + + if(m_format_size==2) // 16bits + { + if(m_format_signed) decodeValue = DecodeSigned16Bits; + else decodeValue = DecodeUnsigned16Bits; + } + else // 8bits + { + if(m_format_signed) decodeValue = DecodeSigned8Bits; + else decodeValue = DecodeUnsigned8Bits; + } + + if(m_channel_count==1) + addValue = AddValue1Channel; + else if(m_channel_count==2) + { + if(m_capture_thread->m_mix_multiple_channel) + addValue = AddValue2ChannelMix; + else + addValue = AddValue2ChannelFirst; + } + + cerr << "CaptureThread: INFO: format is " << (m_format_signed?"signed":"unsigned") << " " << (m_format_float?"float":"integer") << " " << m_format_size*8 << "bits with " << m_channel_count << " channel(s)" << endl; +} + +// ------------------------------ ALSA implementation ---------------------------- +#ifdef CAPTURE_ALSA + +#define ALSA_BUFF_SIZE 1024 + +void alsa_error_handler(const char *file, int line, const char *function, int err, const char *fmt, ...) +{ + cerr << "alsa_error_handler: " << file << ":" << line << " " << function << " err=" << err << endl; +} + +CaptureThreadImplALSA::CaptureThreadImplALSA(CaptureThread* capture_thread) + : CaptureThreadImpl(capture_thread, "ALSA", QString("Advanced Linux Sound Architecture (lib:")+snd_asoundlib_version()+")") +{ + m_alsa_capture_handle = NULL; + m_alsa_hw_params = NULL; + m_alsa_buffer = NULL; + m_format = SND_PCM_FORMAT_UNKNOWN; + + m_source = "hw:0"; + + m_alive = true; + m_in_run = false; + m_loop = false; + +// snd_lib_error_set_handler(alsa_error_handler); +} + +bool CaptureThreadImplALSA::is_available() +{ + if(m_alsa_capture_handle==NULL) + { + try + { + int err = -1; + if((err=snd_pcm_open(&m_alsa_capture_handle, m_source.latin1(), SND_PCM_STREAM_CAPTURE, SND_PCM_NONBLOCK)) < 0) + { + if(err==-19) // TODO risks of changes for the error code + throw QString("invalid source '")+m_source+"'"; + else if(err==-16) + throw QString("device '")+m_source+"' busy"; + else + throw QString("cannot open pcm: ")+QString(snd_strerror(err)); + } + } + catch(QString error) + { + m_alsa_capture_handle = NULL; + + m_status = "N/A ("+error+")"; + + return false; + } + + if(m_alsa_capture_handle!=NULL) + { + snd_pcm_close(m_alsa_capture_handle); + m_alsa_capture_handle = NULL; + } + } + + m_status = "OK"; + + // cerr << "CaptureThread: INFO: ALSA seems available" << endl; + + return true; +} + +void CaptureThreadImplALSA::startCapture() +{ + if(!running()) + start(); + + m_loop = true; + + m_wait_for_start = true; + while(m_wait_for_start) // some implementations take a long time to start + msleep(10); +} +void CaptureThreadImplALSA::stopCapture() +{ + m_loop = false; + + while(m_in_run) + msleep(10); +} + +void CaptureThreadImplALSA::set_params(bool test) +{ +// cerr << "ALSA: Recognized sample formats are" << endl; +// for (int k = 0; k < SND_PCM_FORMAT_LAST; ++(unsigned long) k) { +// const char *s = snd_pcm_format_name((snd_pcm_format_t)k); +// if (s) cerr << s << endl; +// } + int err=0; + + if(m_source=="") + throw QString("ALSA: set the source first"); + if((err=snd_pcm_open(&m_alsa_capture_handle, m_source.latin1(), SND_PCM_STREAM_CAPTURE, SND_PCM_NONBLOCK)) < 0) + { + // cerr << "err=" << err << ":" << snd_strerror(err) << endl; + + if(err==-19) // TODO risks of changes for the error code + throw QString("ALSA: Invalid Source '")+m_source+"'"; + else if(err==-16) + throw QString("ALSA: Device '")+m_source+"' busy"; + else + throw QString("ALSA: Cannot open pcm: ")+QString(snd_strerror(err)); + } + + snd_pcm_hw_params_alloca(&m_alsa_hw_params); + + if((err=snd_pcm_hw_params_any(m_alsa_capture_handle, m_alsa_hw_params)) < 0) + throw QString("ALSA: cannot initialize hardware parameter structure (")+QString(snd_strerror(err))+")"; + + if((err=snd_pcm_hw_params_set_access(m_alsa_capture_handle, m_alsa_hw_params, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) + throw QString("ALSA: cannot set access type (")+QString(snd_strerror(err))+")"; + + if(!test) + { + // Formats + if(m_format==-1) + { + list formats; + formats.push_back(SND_PCM_FORMAT_S16); formats.push_back(SND_PCM_FORMAT_U16); + formats.push_back(SND_PCM_FORMAT_S8); formats.push_back(SND_PCM_FORMAT_U8); + + err = -1; + while(err<0) + { + if(formats.empty()) + throw QString("ALSA: cannot set any format (")+QString(snd_strerror(err))+")"; + + m_format = formats.front(); + cerr << "CaptureThread: INFO: ALSA: try to set format to " << snd_pcm_format_description(m_format) << flush; + err=snd_pcm_hw_params_set_format(m_alsa_capture_handle, m_alsa_hw_params, m_format); + + if(err<0) cerr << " failed" << endl; + else cerr << " success" << endl; + + formats.pop_front(); + } + } + else + { + if((err=snd_pcm_hw_params_set_format(m_alsa_capture_handle, m_alsa_hw_params, m_format))<0) + { + QString err_msg = QString("ALSA: cannot set format (")+QString(snd_strerror(err))+")"; + cerr << "CaptureThread: ERROR: " << err_msg << endl; + } + } + + // Channel count + unsigned int channel_count = 1; + if((err=snd_pcm_hw_params_set_channels_near(m_alsa_capture_handle, m_alsa_hw_params, &channel_count)) < 0) + { + QString err_msg = QString("ALSA: cannot set channel count (")+QString(snd_strerror(err))+")"; + cerr << "CaptureThread: WARNING: " << err_msg << endl; + } + if(channel_count>1) + { + QString err_msg = QString("ALSA: cannot set channel count to one (")+QString::number(channel_count)+" instead)"; + cerr << "CaptureThread: WARNING: " << err_msg << endl; + } + + setFormatDescrsAndFns(snd_pcm_format_width(m_format)/8, snd_pcm_format_signed(m_format), false, channel_count); + } + + if(m_sampling_rate==CaptureThread::SAMPLING_RATE_MAX || m_sampling_rate==CaptureThread::SAMPLING_RATE_UNKNOWN) + { + int old_sampling_rate = m_sampling_rate; + + cerr << "CaptureThread: INFO: ALSA: sampling rate set to max or undefined, try to determinate it." << endl; + + list sampling_rates; + sampling_rates.push_front(8000); sampling_rates.push_front(11025); sampling_rates.push_front(16000); + sampling_rates.push_front(22050); sampling_rates.push_front(24000); sampling_rates.push_front(32000); + sampling_rates.push_front(44100); sampling_rates.push_front(48000); sampling_rates.push_front(96000); + + err = -1; + while(err<0) + { + if(sampling_rates.empty()) + throw QString("ALSA: cannot set any sample rate (")+QString(snd_strerror(err))+")"; + + m_sampling_rate = sampling_rates.front(); + cerr << "CaptureThread: INFO: ALSA: try to set sampling rate to " << m_sampling_rate << flush; + unsigned int rrate = m_sampling_rate; + err = snd_pcm_hw_params_set_rate(m_alsa_capture_handle, m_alsa_hw_params, rrate, 0); + + if(err<0) cerr << " failed" << endl; + else cerr << " success" << endl; + + sampling_rates.pop_front(); + } + + if(old_sampling_rate!=m_sampling_rate) + m_capture_thread->emitSamplingRateChanged(); + } + else + { + int err; + int dir = 0; + unsigned int rrate = m_sampling_rate; + if((err = snd_pcm_hw_params_set_rate_near(m_alsa_capture_handle, m_alsa_hw_params, &rrate, &dir))<0) + throw QString("ALSA: cannot set sampling rate (")+QString(snd_strerror(err))+")"; + if(m_sampling_rate!=rrate) + m_capture_thread->emitSamplingRateChanged(); + m_sampling_rate = rrate; + } + + if((err=snd_pcm_hw_params(m_alsa_capture_handle, m_alsa_hw_params)) < 0) + throw QString("ALSA: cannot set parameters (")+QString(snd_strerror(err))+")"; +} + +void CaptureThreadImplALSA::setSamplingRate(int value) +{ +// cerr << "CaptureThreadImplALSA::setSamplingRate " << value << endl; + + assert(value>0 || value==CaptureThread::SAMPLING_RATE_MAX); + + if(m_sampling_rate!=value || value==CaptureThread::SAMPLING_RATE_MAX) + { + bool was_running = m_capture_thread->isCapturing(); + if(was_running) m_capture_thread->stopCapture(); + + m_sampling_rate = value; + + if(m_sampling_rate==CaptureThread::SAMPLING_RATE_MAX) + { + try + { + set_params(true); + } + catch(QString error) + { + cerr << "CaptureThread: ERROR: " << error << endl; + m_capture_thread->emitError(error); + } + + // it was just for testing + capture_finished(); + } + else + m_capture_thread->emitSamplingRateChanged(); + + if(was_running) m_capture_thread->startCapture(); + } + +// cerr << "~CaptureThreadImplALSA::setSamplingRate" << endl; +} + +void CaptureThreadImplALSA::capture_init() +{ + set_params(); + + snd_pcm_nonblock(m_alsa_capture_handle, 0); + + m_alsa_buffer = new char[m_channel_count*ALSA_BUFF_SIZE*snd_pcm_format_width(m_format)/8]; + + int err=0; + + if((err=snd_pcm_prepare(m_alsa_capture_handle)) < 0) + throw QString("ALSA: cannot prepare audio interface for use (")+QString(snd_strerror(err))+")"; +} +void CaptureThreadImplALSA::capture_loop() +{ +// cerr << "CaptureThreadImplALSA::capture_loop" << endl; + + m_wait_for_start = false; + while(m_loop) + { + int ret_val = snd_pcm_readi(m_alsa_capture_handle, m_alsa_buffer, ALSA_BUFF_SIZE); + if(ret_val<0) + { + cerr << "CaptureThread: WARNING: ALSA: " << snd_strerror(ret_val) << endl; + while((ret_val = snd_pcm_prepare(m_alsa_capture_handle)) < 0) + { + msleep(1000); + cerr << QString("ALSA: cannot prepare audio interface (")+QString(snd_strerror(ret_val))+")" << endl; +// throw QString("ALSA: cannot prepare audio interface (")+QString(snd_strerror(ret_val))+")"; + } + } + else + { + if(!m_capture_thread->m_pause) + { + m_capture_thread->m_lock.lock(); + +// cerr << "CaptureThreadImplALSA::capture_loop " << m_capture_thread->m_values.size() << endl; + + for(int i=0; im_packet_size = ret_val; + if(m_capture_thread->m_ext_lock) + { + m_capture_thread->m_packet_size_sll = 0; + m_capture_thread->m_ext_lock = false; + } + m_capture_thread->m_packet_size_sll += ret_val; + + m_capture_thread->m_lock.unlock(); + } + } + } + +// cerr << "~CaptureThreadImplALSA::capture_loop" << endl; +} +void CaptureThreadImplALSA::capture_finished() +{ + if(m_alsa_buffer!=NULL) + { + delete[] m_alsa_buffer; + m_alsa_buffer = NULL; + } + + if(m_alsa_capture_handle!=NULL) + { + snd_pcm_hw_free(m_alsa_capture_handle); + snd_pcm_close(m_alsa_capture_handle); + m_alsa_capture_handle = NULL; + } +} + +void CaptureThreadImplALSA::run() +{ +// cerr << "CaptureThread: INFO: ALSA: capture thread entered" << endl; + +// while(m_alive) // TODO need to keep alsa thread alive to let PortAudio working after ALSA !! + { + while(m_alive && !m_loop) + msleep(10); + + m_in_run = true; + + try + { + // cerr << "CaptureThread: INFO: capture thread running" << endl; + + capture_init(); + + m_capture_thread->m_capturing = true; + m_capture_thread->emitCaptureStarted(); + m_capture_thread->emitCaptureToggled(true); + + capture_loop(); + + m_capture_thread->m_capturing = false; + m_capture_thread->emitCaptureStoped(); + m_capture_thread->emitCaptureToggled(false); + } + catch(QString error) + { + m_loop = false; + cerr << "CaptureThread: ERROR: " << error << endl; + m_capture_thread->emitError(error); + } + m_wait_for_start = false; + + capture_finished(); + + m_in_run = false; + + // cerr << "CaptureThread: INFO: capture thread stop running" << endl; + } + +// cerr << "CaptureThread: INFO: ALSA: capture thread exited" << endl; +} + +CaptureThreadImplALSA::~CaptureThreadImplALSA() +{ +// cerr << "CaptureThreadImplALSA::~CaptureThreadImplALSA" << endl; + + m_alive = false; + + stopCapture(); + + while(running()) + msleep(10); + +// cerr << "~CaptureThreadImplALSA::~CaptureThreadImplALSA" << endl; +} + +#endif + +// ------------------------------ JACK implementation ---------------------------- +#ifdef CAPTURE_JACK +CaptureThreadImplJACK::CaptureThreadImplJACK(CaptureThread* capture_thread) +: CaptureThreadImpl(capture_thread, "JACK", "Jack Audio Connection Kit") +{ + m_jack_client = NULL; + m_jack_port = NULL; +} + +bool CaptureThreadImplJACK::is_available() +{ + if(m_jack_client==NULL) + { + try + { + m_jack_client = jack_client_new((m_capture_thread->m_name+"_test").latin1()); + if(m_jack_client==NULL) + throw QString("unknown reason"); + } + catch(QString error) + { + m_jack_client = NULL; + m_status = "N/A"; + return false; + } + capture_finished(); + } + + m_status = "available"; + + return true; +} + +void CaptureThreadImplJACK::setSamplingRate(int value) +{ + cerr << "CaptureThread: ERROR: JACK: setSamplingRate not available with JACK ! change the JACK server sampling rate instead" << endl; +} + +void CaptureThreadImplJACK::startCapture() +{ + try + { + capture_init(); + } + catch(QString error) + { + capture_finished(); + cerr << "CaptureThread: ERROR: " << error << endl; + m_capture_thread->emitError(error); + } +} +void CaptureThreadImplJACK::stopCapture() +{ + try + { + capture_finished(); + } + catch(QString error) + { + cerr << "CaptureThread: ERROR: " << error << endl; + m_capture_thread->emitError(error); + } +} + +void CaptureThreadImplJACK::JackShutdown(void* arg){((CaptureThreadImplJACK*)arg)->jackShutdown();} +void CaptureThreadImplJACK::jackShutdown() +{ + m_jack_client = NULL; + + m_capture_thread->emitError("JACK: server shutdown !"); +} + +int CaptureThreadImplJACK::JackSampleRate(jack_nframes_t nframes, void* arg){return ((CaptureThreadImplJACK*)arg)->jackSampleRate(nframes);} +int CaptureThreadImplJACK::jackSampleRate(jack_nframes_t nframes) +{ + if(m_sampling_rate!=int(nframes)) + { + m_sampling_rate = nframes; + m_capture_thread->emitSamplingRateChanged(); + } + + return 0; +} + +int CaptureThreadImplJACK::JackProcess(jack_nframes_t nframes, void* arg){return ((CaptureThreadImplJACK*)arg)->jackProcess(nframes);} +int CaptureThreadImplJACK::jackProcess(jack_nframes_t nframes) +{ +// cerr << "'" << nframes << "'" << endl; + + if(m_capture_thread->m_pause || !m_capture_thread->m_capturing || nframes<=0) return 0; + + void* pin = jack_port_get_buffer(m_jack_port, nframes); + + if(!pin) return 0; + + jack_default_audio_sample_t* in = (jack_default_audio_sample_t*)pin; + + m_capture_thread->m_lock.lock(); + + for(jack_nframes_t i=0; im_values.push_front(in[i]); + + m_capture_thread->m_lock.unlock(); + + m_capture_thread->m_packet_size = nframes; + if(m_capture_thread->m_ext_lock) + { + m_capture_thread->m_packet_size_sll = 0; + m_capture_thread->m_ext_lock = false; + } + m_capture_thread->m_packet_size_sll += nframes; + + return 0; +} + +void CaptureThreadImplJACK::capture_init() +{ + m_jack_client = jack_client_new(m_capture_thread->m_name.latin1()); + if(!m_jack_client) + throw QString("JACK: cannot create client, JACK deamon is running ?"); + + jack_set_process_callback(m_jack_client, JackProcess, (void*)this); + jack_on_shutdown(m_jack_client, JackShutdown, (void*)this); + jack_set_error_function(jack_error_callback); + jack_set_sample_rate_callback(m_jack_client, JackSampleRate, (void*)this); + + int err=0; + if((err=jack_activate(m_jack_client))!=0) + throw QString("JACK: cannot activate client"); + + setFormatDescrsAndFns(sizeof(jack_default_audio_sample_t), true, true, 1); + + m_jack_port = jack_port_register(m_jack_client, "input", JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput,0); + + if(m_source!="") + if((err=jack_connect(m_jack_client, m_source.latin1(), (m_capture_thread->m_name+":input").latin1()))!=0) + m_capture_thread->emitError(QString("JACK: Invalid source '")+m_source+"'"); + + int old_sampling_rate = m_sampling_rate; + m_sampling_rate = jack_get_sample_rate(m_jack_client); + if(m_sampling_rate!=old_sampling_rate) + m_capture_thread->emitSamplingRateChanged(); + + m_capture_thread->m_capturing = true; + m_capture_thread->emitCaptureStarted(); + m_capture_thread->emitCaptureToggled(true); +} +void CaptureThreadImplJACK::capture_finished() +{ +// cerr << "CaptureThreadImplJACK::capture_finished" << endl; + + if(m_jack_client!=NULL) + { + jack_client_close(m_jack_client); + m_jack_client = NULL; + + m_capture_thread->m_capturing = false; + m_capture_thread->emitCaptureStoped(); + m_capture_thread->emitCaptureToggled(false); + } +} +#endif + +// ------------------------------ PortAudio implementation ---------------------------- +#ifdef CAPTURE_PORTAUDIO +CaptureThreadImplPortAudio::CaptureThreadImplPortAudio(CaptureThread* capture_thread) + : CaptureThreadImpl(capture_thread, "PortAudio", QString("Portable cross-platform Audio API (lib:")+Pa_GetVersionText()+"["+QString::number(Pa_GetVersion())+"])") +{ + m_stream = NULL; + + m_source = "default"; +} + +bool CaptureThreadImplPortAudio::is_available() +{ + if(!m_stream) + { + try + { + m_err = Pa_Initialize(); + if(m_err != paNoError) throw QString("PortAudio: is_available:Pa_Initialize ")+Pa_GetErrorText(m_err); + + PaError err; + int numDevices; + + numDevices = Pa_GetDeviceCount(); + if(numDevices < 0) + throw QString("PortAudio: is_available:Pa_GetDeviceCount ")+Pa_GetErrorText(numDevices); + else if(numDevices == 0) + throw QString("PortAudio: is_available:Pa_GetDeviceCount no devices available")+Pa_GetErrorText(numDevices); + +/* const PaDeviceInfo *deviceInfo; + + for(int i=0; iname << endl; + cerr << deviceInfo->defaultSampleRate << endl; + }*/ + } + catch(QString error) + { + Pa_Terminate(); + m_stream = NULL; + m_status = "N/A"; + return false; + } + capture_finished(); + } + + m_status = "OK"; + + return true; +} + +void CaptureThreadImplPortAudio::setSamplingRate(int value) +{ +// cerr << "CaptureThreadImplPortAudio::setSamplingRate " << value << endl; + + assert(value>0 || value==CaptureThread::SAMPLING_RATE_MAX); + + if(m_sampling_rate!=value || value==CaptureThread::SAMPLING_RATE_MAX) + { + bool was_running = m_capture_thread->isCapturing(); + if(was_running) m_capture_thread->stopCapture(); + + m_sampling_rate = value; + + if(m_sampling_rate==CaptureThread::SAMPLING_RATE_MAX) + { + try + { + set_params(true); + } + catch(QString error) + { + cerr << "CaptureThread: ERROR: " << error << endl; + m_capture_thread->emitError(error); + } + + try{ + // it was just for testing + capture_finished(); + } + catch(QString error) + { + cerr << "CaptureThread: ERROR: " << error << endl; + m_capture_thread->emitError(error); + } + } + else + m_capture_thread->emitSamplingRateChanged(); + + if(was_running) m_capture_thread->startCapture(); + } + +// cerr << "~CaptureThreadImplPortAudio::setSamplingRate" << endl; +} + +int CaptureThreadImplPortAudio::PortAudioCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{((CaptureThreadImplPortAudio*)userData)->portAudioCallback(inputBuffer, framesPerBuffer, timeInfo, statusFlags);} +int CaptureThreadImplPortAudio::portAudioCallback(const void *inputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags) +{ + if(m_capture_thread->m_pause) + return 0; + + m_capture_thread->m_lock.lock(); + + float *in = (float*)inputBuffer; + + for(unsigned long i=0; im_values.push_front(*in++); +// addValue(*in++, i, m_channel_count); // TODO + + m_capture_thread->m_packet_size = framesPerBuffer; + if(m_capture_thread->m_ext_lock) + { + m_capture_thread->m_packet_size_sll = 0; + m_capture_thread->m_ext_lock = false; + } + m_capture_thread->m_packet_size_sll += framesPerBuffer; + + m_capture_thread->m_lock.unlock(); + + return 0; +} + +void CaptureThreadImplPortAudio::set_params(bool test) +{ + m_err = Pa_Initialize(); + if(m_err != paNoError) throw QString("PortAudio: set_params:Pa_Initialize ")+Pa_GetErrorText(m_err); + + PaStreamParameters params; + params.device = paNoDevice; + params.channelCount = 1; + params.sampleFormat = paFloat32; + params.suggestedLatency = 0; + params.hostApiSpecificStreamInfo = NULL; + + if(m_source!="default") // TODO hum hum + { + int numDevices = Pa_GetDeviceCount(); + const PaDeviceInfo* deviceInfo; + int index = -1; + for(int i=0; params.device==paNoDevice && iname)==m_source) + params.device = i; + } + + if(params.device==paNoDevice) + cerr << "CaptureThread: INFO: PortAudio: cannot determine selected source \"" << m_source << "\"" << endl; + } + + if(!test) + { + if(params.device==paNoDevice) + cerr << "CaptureThread: INFO: PortAudio: using default device" << endl; + else + cerr << "CaptureThread: INFO: PortAudio: using \"" << m_source << "\"" << endl; + + setFormatDescrsAndFns(4, true, true, 1); + } + + if(m_sampling_rate==CaptureThread::SAMPLING_RATE_MAX || m_sampling_rate==CaptureThread::SAMPLING_RATE_UNKNOWN) + { + int old_sampling_rate = m_sampling_rate; + + cerr << "CaptureThread: INFO: PortAudio: sampling rate set to max or undefined, try to determinate it." << endl; + + list sampling_rates; + sampling_rates.push_front(8000); sampling_rates.push_front(11025); sampling_rates.push_front(16000); + sampling_rates.push_front(22050); sampling_rates.push_front(24000); sampling_rates.push_front(32000); + sampling_rates.push_front(44100); sampling_rates.push_front(48000); sampling_rates.push_front(96000); + + m_err = -1; + while(m_err!=paNoError) + { + if(sampling_rates.empty()) + throw QString("PortAudio: cannot set any sample rate (")+Pa_GetErrorText(m_err)+")"; + + m_err = Pa_Initialize(); + if(m_err != paNoError) throw QString("PortAudio: set_params:Pa_Initialize ")+Pa_GetErrorText(m_err); + + m_sampling_rate = sampling_rates.front(); + cerr << "CaptureThread: INFO: PortAudio: try to set sampling rate to " << m_sampling_rate << flush; + +// cerr << "nbc1 " << params.channelCount << endl; + + if(params.device==paNoDevice) + m_err = Pa_OpenDefaultStream(&m_stream, 1, 0, paFloat32, m_sampling_rate, 0, PortAudioCallback, this); + else + m_err = Pa_OpenStream(&m_stream, ¶ms, NULL, m_sampling_rate, 0, paNoFlag, PortAudioCallback, this); + + if(m_err != paNoError) cerr << " failed" << endl; + else cerr << " success" << endl; + + sampling_rates.pop_front(); + } + + if(old_sampling_rate!=m_sampling_rate) + m_capture_thread->emitSamplingRateChanged(); + } + else + { +// cerr << "nbc2 " << params.channelCount << endl; +// cerr << "dev2 " << params.device << "/" << paNoDevice << endl; + + if(params.device==paNoDevice) + { + m_err = Pa_OpenDefaultStream(&m_stream, 1, 0, paFloat32, m_sampling_rate, 0, PortAudioCallback, this); + if(m_err != paNoError) + throw QString("PortAudio: set_params:Pa_OpenDefaultStream ")+Pa_GetErrorText(m_err); + } + else + { + m_err = Pa_OpenStream(&m_stream, ¶ms, NULL, m_sampling_rate, 0, paNoFlag, PortAudioCallback, this); + if(m_err != paNoError) + throw QString("PortAudio: set_params:Pa_OpenStream ")+Pa_GetErrorText(m_err); + } + } +} + +void CaptureThreadImplPortAudio::capture_init() +{ + set_params(false); + + m_err = Pa_StartStream(m_stream); + if(m_err != paNoError) + throw QString("PortAudio: capture_init:Pa_StartStream ")+Pa_GetErrorText(m_err); + + m_capture_thread->m_capturing = true; + m_capture_thread->emitCaptureStarted(); + m_capture_thread->emitCaptureToggled(true); +} +void CaptureThreadImplPortAudio::capture_finished() +{ + if(m_stream) + { + if(!Pa_IsStreamStopped(m_stream)) + { + m_err = Pa_StopStream(m_stream); + if(m_err != paNoError) throw QString("PortAudio: capture_finished: ")+Pa_GetErrorText(m_err); + } + + if(m_stream) + { + m_err = Pa_CloseStream(m_stream); + if(m_err != paNoError) throw QString("PortAudio: capture_finished: ")+Pa_GetErrorText(m_err); + } + + m_stream = NULL; + + m_capture_thread->m_capturing = false; + m_capture_thread->emitCaptureStoped(); + m_capture_thread->emitCaptureToggled(false); + } + + m_err = Pa_Terminate(); +// if(m_err != paNoError) throw QString("PortAudio: capture_finished: ")+Pa_GetErrorText(m_err); +} +void CaptureThreadImplPortAudio::startCapture() +{ + try + { + capture_init(); + } + catch(QString error) + { + capture_finished(); + cerr << "CaptureThread: ERROR: " << error << endl; + m_capture_thread->emitError(error); + } +} +void CaptureThreadImplPortAudio::stopCapture() +{ + try + { + capture_finished(); + } + catch(QString error) + { + cerr << "CaptureThread: ERROR: " << error << endl; + m_capture_thread->emitError(error); + } +} +CaptureThreadImplPortAudio::~CaptureThreadImplPortAudio() +{ + stopCapture(); +} + +#endif + +// ------------------------------ OSS implementation ---------------------------- +#ifdef CAPTURE_OSS +#include +#include +#include +#include +#include +#include +#include + + +#define OSS_BUFF_SIZE 1024 + +CaptureThreadImplOSS::CaptureThreadImplOSS(CaptureThread* capture_thread) + : CaptureThreadImpl(capture_thread, "OSS", QString("Open Sound System")) +{ + m_fd_in = 0; + m_oss_buffer = NULL; + m_format = -1; + + m_source = "/dev/dsp"; + + // oss_sysinfo si; // definition ?? +// ioctl(m_fd_in, OSS_SYSINFO, &si); +// m_fd_in = open(m_source, O_RDONLY, 0)); +// m_descr = QString("Open Sound System (")+QString::number(SOUND_VERSION, 16)+":"+si.version+")"); +// close(m_fd_in); +// m_fd_in = 0; + m_descr = QString("Open Sound System (lib:")+QString::number(SOUND_VERSION, 16)+")"; + + m_alive = true; + m_in_run = false; + m_loop = false; +} + +bool CaptureThreadImplOSS::is_available() +{ + if(m_fd_in==0) + { + try + { + if((m_fd_in = open (m_source.latin1(), O_RDONLY, 0)) == -1) + throw QString(strerror(errno)); + } + catch(QString error) + { + m_fd_in = 0; + + m_status = "N/A ("+error+")"; + + return false; + } + + capture_finished(); + } + + m_status = "OK"; + + // cerr << "CaptureThread: INFO: OSS seems available" << endl; + + return true; +} + +void CaptureThreadImplOSS::startCapture() +{ + if(!running()) + start(); + + m_loop = true; + + m_wait_for_start = true; + while(m_wait_for_start) // some implementations take a long time to start + msleep(10); +} +void CaptureThreadImplOSS::stopCapture() +{ + m_loop = false; + + while(m_in_run) + msleep(10); +} + +void CaptureThreadImplOSS::set_params(bool test) +{ + if(m_source=="") + throw QString("OSS: set the source first"); + if((m_fd_in = open (m_source.latin1(), O_RDONLY, 0))==-1) + throw QString("OSS: ")+QString(strerror(errno)); + + if(!test) + { + if(m_format==-1) + { + // Formats + m_format = AFMT_S16_NE; /* Native 16 bits */ + if(ioctl(m_fd_in, SNDCTL_DSP_SETFMT, &m_format)==-1) + throw QString("OSS: cannot set format (")+strerror(errno)+")"; + + if(m_format != AFMT_S16_NE) + throw QString("OSS: cannot set format to signed 16bits"); + } + else + { + if(ioctl(m_fd_in, SNDCTL_DSP_SETFMT, &m_format)==-1) + throw QString("OSS: cannot set format (")+strerror(errno)+")"; + } + + m_format_size = 2; + m_format_signed = true; + m_format_float = false; + + // Channel count + unsigned int channel_count = 1; + if(ioctl(m_fd_in, SNDCTL_DSP_CHANNELS, &channel_count)==-1) + throw QString("OSS: cannot set channel count to 1 (")+strerror(errno)+")"; + + if(channel_count != 1) + throw QString("OSS: the device doesn't support mono mode"); + + /* if(m_channel_count>1) // TODO + { + QString err_msg = QString("OSS: cannot set channel count to one (")+QString::number(m_channel_count)+" instead)"; + cerr << "CaptureThread: WARNING: " << err_msg << endl; + }*/ + + setFormatDescrsAndFns(2, true, false, channel_count); + } + + if(m_sampling_rate==CaptureThread::SAMPLING_RATE_MAX || m_sampling_rate==CaptureThread::SAMPLING_RATE_UNKNOWN) + { + int old_sampling_rate = m_sampling_rate; + + cerr << "CaptureThread: INFO: OSS: sampling rate set to max or undefined, try to determinate it." << endl; + + list sampling_rates; + sampling_rates.push_front(8000); sampling_rates.push_front(11025); sampling_rates.push_front(16000); + sampling_rates.push_front(22050); sampling_rates.push_front(24000); sampling_rates.push_front(32000); + sampling_rates.push_front(44100); sampling_rates.push_front(48000); sampling_rates.push_front(96000); + + int err = -1; + while(err<0) + { + if(sampling_rates.empty()) + throw QString("OSS: cannot set any sample rate (")+strerror(errno)+")"; + + m_sampling_rate = sampling_rates.front(); + cerr << "CaptureThread: INFO: OSS: try to set sampling rate to " << m_sampling_rate << flush; + err = ioctl(m_fd_in, SNDCTL_DSP_SPEED, &m_sampling_rate); + + if(err==-1) cerr << " failed" << endl; + else cerr << " success" << endl; + + sampling_rates.pop_front(); + } + + if(old_sampling_rate!=m_sampling_rate) + m_capture_thread->emitSamplingRateChanged(); + } + else + { + if(ioctl(m_fd_in, SNDCTL_DSP_SPEED, &m_sampling_rate)==-1) + throw QString("OSS: cannot set sampling rate (")+QString(strerror(errno))+")"; + } +} + +void CaptureThreadImplOSS::setSamplingRate(int value) +{ +// cerr << "CaptureThreadImplOSS::setSamplingRate " << value << endl; + + assert(value>0 || value==CaptureThread::SAMPLING_RATE_MAX); + + if(m_sampling_rate!=value || value==CaptureThread::SAMPLING_RATE_MAX) + { + bool was_running = m_capture_thread->isCapturing(); + if(was_running) m_capture_thread->stopCapture(); + + m_sampling_rate = value; + + if(m_sampling_rate==CaptureThread::SAMPLING_RATE_MAX) + { + try + { + set_params(true); + } + catch(QString error) + { + cerr << "CaptureThread: ERROR: " << error << endl; + m_capture_thread->emitError(error); + } + + // it was just for testing + capture_finished(); + } + else + m_capture_thread->emitSamplingRateChanged(); + + if(was_running) m_capture_thread->startCapture(); + } + +// cerr << "~CaptureThreadImplOSS::setSamplingRate" << endl; +} + +void CaptureThreadImplOSS::capture_init() +{ + set_params(false); + + m_oss_buffer = new char[m_channel_count*OSS_BUFF_SIZE*16/8]; +} +void CaptureThreadImplOSS::capture_loop() +{ +// cerr << "CaptureThreadImplOSS::capture_loop" << endl; + + bool format_signed = true; + int l=0; + + m_wait_for_start = false; + while(m_loop) + { + int ret_val = read(m_fd_in, m_oss_buffer, sizeof(m_oss_buffer)); + + if(ret_val==-1) + { + cerr << "CaptureThread: WARNING: OSS: " << strerror(errno) << endl; + msleep(1000); // TODO which behavior ? +// m_loop = false;// TODO which behavior ? + } + else + { + ret_val /= m_format_size; + + if(!m_capture_thread->m_pause) + { + m_capture_thread->m_lock.lock(); + + for(int i=0; im_packet_size = ret_val; + if(m_capture_thread->m_ext_lock) + { + m_capture_thread->m_packet_size_sll = 0; + m_capture_thread->m_ext_lock = false; + } + m_capture_thread->m_packet_size_sll += ret_val; + + m_capture_thread->m_lock.unlock(); + } + } + } + +// cerr << "~CaptureThreadImplOSS::capture_loop" << endl; +} +void CaptureThreadImplOSS::capture_finished() +{ + if(m_oss_buffer!=NULL) + { + delete[] m_oss_buffer; + m_oss_buffer = NULL; + } + + if(m_fd_in!=0) + { + close(m_fd_in); + m_fd_in = 0; + } +} + +void CaptureThreadImplOSS::run() +{ +// cerr << "CaptureThread: INFO: OSS: capture thread entered" << endl; + +// while(m_alive) // TODO ?? need to keep oss thread alive to let PortAudio working after ALSA ?? + { + while(m_alive && !m_loop) + msleep(10); + + m_in_run = true; + + try + { + // cerr << "CaptureThread: INFO: capture thread running" << endl; + + capture_init(); + + m_capture_thread->m_capturing = true; + m_capture_thread->emitCaptureStarted(); + m_capture_thread->emitCaptureToggled(true); + + capture_loop(); + + m_capture_thread->m_capturing = false; + m_capture_thread->emitCaptureStoped(); + m_capture_thread->emitCaptureToggled(false); + } + catch(QString error) + { + m_loop = false; + cerr << "CaptureThread: ERROR: " << error << endl; + m_capture_thread->emitError(error); + } + m_wait_for_start = false; + + capture_finished(); + + m_in_run = false; + + // cerr << "CaptureThread: INFO: capture thread stop running" << endl; + } + +// cerr << "CaptureThread: INFO: OSS: capture thread exited" << endl; +} + +CaptureThreadImplOSS::~CaptureThreadImplOSS() +{ +// cerr << "CaptureThreadImplOSS::~CaptureThreadImplOSS" << endl; + + m_alive = false; + + stopCapture(); + + while(running()) + msleep(10); + +// cerr << "~CaptureThreadImplOSS::~CaptureThreadImplOSS" << endl; +} + +#endif diff --git a/src/CaptureThread.h b/src/CaptureThread.h new file mode 100644 index 0000000..ea7f707 --- /dev/null +++ b/src/CaptureThread.h @@ -0,0 +1,333 @@ +// Copyright 2004 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#ifndef _CaptureThread_h_ +#define _CaptureThread_h_ + +#include +#include +using namespace std; +#include +#include +#include + +class CaptureThread; + +// ----------------------- the implementations ---------------------- + +class CaptureThreadImpl; + +void AddValue2ChannelFirst(CaptureThreadImpl* impl, double value, int i); +void AddValue2ChannelMix(CaptureThreadImpl* impl, double value, int i); +void AddValue1Channel(CaptureThreadImpl* impl, double value, int i); + +class CaptureThreadImpl +{ + friend class CaptureThread; + friend void AddValue2ChannelFirst(CaptureThreadImpl* impl, double value, int i); + friend void AddValue2ChannelMix(CaptureThreadImpl* impl, double value, int i); + friend void AddValue1Channel(CaptureThreadImpl* impl, double value, int i); + + protected: + CaptureThread* m_capture_thread; + QString m_name; + QString m_descr; + + int m_sampling_rate; + QString m_source; + QString m_status; + + int m_format_size; + bool m_format_signed; + bool m_format_float; + int m_channel_count; + + virtual void setSamplingRate(int rate)=0; + virtual void startCapture()=0; + virtual void stopCapture()=0; + virtual bool is_available()=0; + + double (*decodeValue)(void* buffer, int i); + void (*addValue)(CaptureThreadImpl* impl, double value, int i); + void setFormatDescrsAndFns(int format_size, bool format_signed, bool format_float, int channel_count); + + public: + CaptureThreadImpl(CaptureThread* capture_thread, const QString& name, const QString& descr); + + const QString& getStatus(); + + const QString& getName() const {return m_name;} + const QString& getDescription() const {return m_descr;} + const QString& getSource() const {return m_source;} + + virtual ~CaptureThreadImpl(){} +}; + +// ---------------------- the ALSA implementation --------------------- + +#ifdef CAPTURE_ALSA +#include +class CaptureThreadImplALSA : public CaptureThreadImpl, public QThread +{ + snd_pcm_t* m_alsa_capture_handle; + snd_pcm_hw_params_t* m_alsa_hw_params; + char* m_alsa_buffer; + snd_pcm_format_t m_format; + + // view + volatile bool m_alive; + volatile bool m_in_run; + + // control + volatile bool m_loop; + volatile bool m_wait_for_start; + + void set_params(bool test=false); + void capture_init(); + void capture_loop(); + void capture_finished(); + + virtual void run(); + + public: + CaptureThreadImplALSA(CaptureThread* capture_thread); + + virtual void setSamplingRate(int rate); + virtual void startCapture(); + virtual void stopCapture(); + virtual bool is_available(); + + ~CaptureThreadImplALSA(); +}; +#endif + +// ---------------------- the JACK implementation --------------------- + +#ifdef CAPTURE_JACK +#include +class CaptureThreadImplJACK : public CaptureThreadImpl +{ + static int JackProcess(jack_nframes_t nframes, void* arg); + static void JackShutdown(void* arg); + static int JackSampleRate(jack_nframes_t nframes, void* arg); + + jack_client_t* m_jack_client; + jack_port_t* m_jack_port; + int jackSampleRate(jack_nframes_t nframes); + int jackProcess(jack_nframes_t nframes); + void jackShutdown(); + + void capture_init(); + void capture_finished(); + + public: + CaptureThreadImplJACK(CaptureThread* capture_thread); + + virtual void setSamplingRate(int rate); + virtual void startCapture(); + virtual void stopCapture(); + virtual bool is_available(); +}; +#endif + +// ---------------------- the PortAudio implementation --------------------- + +#ifdef CAPTURE_PORTAUDIO +#include +class CaptureThreadImplPortAudio : public CaptureThreadImpl +{ + static int PortAudioCallback( const void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ); + + int portAudioCallback(const void *inputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags); + + PaStream* m_stream; + PaError m_err; + + void set_params(bool test=false); + virtual void capture_init(); + virtual void capture_finished(); + + public: + CaptureThreadImplPortAudio(CaptureThread* capture_thread); + + virtual void setSamplingRate(int rate); + virtual void startCapture(); + virtual void stopCapture(); + virtual bool is_available(); + + virtual ~CaptureThreadImplPortAudio(); +}; +#endif + +// ---------------------- the OSS implementation --------------------- + +#ifdef CAPTURE_OSS +class CaptureThreadImplOSS : public CaptureThreadImpl, public QThread +{ + int m_fd_in; + char* m_oss_buffer; + int m_format; + + // view + volatile bool m_alive; + volatile bool m_in_run; + + // control + volatile bool m_loop; + volatile bool m_wait_for_start; + + void set_params(bool test=false); + void capture_init(); + void capture_loop(); + void capture_finished(); + + virtual void run(); + + public: + CaptureThreadImplOSS(CaptureThread* capture_thread); + + virtual void setSamplingRate(int rate); + virtual void startCapture(); + virtual void stopCapture(); + virtual bool is_available(); + + ~CaptureThreadImplOSS(); +}; +#endif + +// --------------------- the real accessible thread ------------------------- + +class CaptureThread : public QObject +{ + Q_OBJECT + + friend class CaptureThreadImpl; +#ifdef CAPTURE_ALSA + friend class CaptureThreadImplALSA; +#endif +#ifdef CAPTURE_JACK + friend class CaptureThreadImplJACK; +#endif +#ifdef CAPTURE_PORTAUDIO + friend class CaptureThreadImplPortAudio; +#endif +#ifdef CAPTURE_OSS + friend class CaptureThreadImplOSS; +#endif + + vector m_impls; + CaptureThreadImpl* m_current_impl; + + void emitError(const QString& error); + void emitSamplingRateChanged(); + void emitCaptureStarted(); + void emitCaptureStoped(); + void emitCaptureToggled(bool value); + + bool m_capturing; + + int m_packet_size; + int m_packet_size_sll; + QString m_name; + + // control + volatile bool m_pause; + bool m_mix_multiple_channel; + + QMutex m_lock; + bool m_ext_lock; + + public: + + deque m_values; + + enum {SAMPLING_RATE_UNKNOWN=-1, SAMPLING_RATE_MAX=0}; + + CaptureThread(const QString& name="bastard_thread"); + + void lock() {m_lock.lock(); m_ext_lock=true;} + void unlock() {m_lock.unlock();} + + bool isCapturing() const {return m_capturing;} + int getSamplingRate() const; + int getPacketSize() const {return m_packet_size;} + int getPacketSizeSinceLastLock() const {return m_packet_size_sll;} + int getNbPendingData() const {return m_values.size();} + const CaptureThreadImpl* getCurrentTransport() const; + int getCurrentTransportIndex() const; + QString getCurrentTransportDescr() const; + QString getFormatDescr() const; + const vector& getTransports() const; + const CaptureThreadImpl* getTransport(const QString& name) const; + void listTransports(); + + virtual ~CaptureThread(); + + signals: + void samplingRateChanged(int sampling_rate); + void portNameChanged(const QString& name); + void sourceChanged(const QString& src); + void transportChanged(const QString& name); + void captureStarted(); + void captureStoped(); + void captureToggled(bool run); + void errorRaised(const QString& error); + + public slots: + //! auto detect a working transport + void autoDetectTransport(); + //! select a specific transport + void selectTransport(const QString& name); + //! select a specific transport + void selectTransport(int index); + //! reset capture (stop/start) + void reset(); + //! start capture + void startCapture(); + //! stop capture + void stopCapture(); + //! set capture status + void toggleCapture(bool run); + //! set pause status + /*! keep capture system connected, but throw away all incoming data + */ + void togglePause(bool pause); + + //! set the sampling rate + /*! not always available, depending on the implementation + * (reset the capture system !) + */ + void setSamplingRate(int value); + //! the source name + /*! 'hw:0' for example for ALSA, something like alsa_pcm:capture_1 for JACK + * (reset the capture system !) + */ + void setSource(const QString& src); + + void setMixMultipleChannels(bool mix); +}; + +#endif // _CaptureThread_h_ diff --git a/src/CustomInstrumentTunerForm.cpp b/src/CustomInstrumentTunerForm.cpp new file mode 100644 index 0000000..2c776e4 --- /dev/null +++ b/src/CustomInstrumentTunerForm.cpp @@ -0,0 +1,981 @@ +// Copyright 2004 "Gilles Degottex" + +// This file is part of "fmit" + +// "fmit" 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. +// +// "fmit" 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 + +#include "CustomInstrumentTunerForm.h" + +#include +#include +using namespace std; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +using namespace Music; +#include "modules/View.h" + +CustomInstrumentTunerForm::CustomInstrumentTunerForm() +: m_capture_thread("fmit") +, m_timer_refresh(this, "m_timer_refresh") +, m_algo_combedfft(NULL) +, m_range_filter(&m_dummy_range_filter) +, m_quantizer(&m_latency_quantizer) +, m_settings("gillesdegottex.ch", "fmit", "009700") // not necessarily equal to the soft version +{ + View::s_settings = &m_settings; + m_settings.add(m_config_form.ui_chkFullScreen); + m_settings.add(m_config_form.ui_chkAutoSaveOnExit); + m_settings.add(m_config_form.ui_chkShowA4Offset); + + m_settings.add(m_config_form.ui_cbTonality); + m_settings.add(m_config_form.ui_cbNotesName); + m_settings.add(ui_spinAFreq); + m_settings.add(ui_spinA3Offset); + + m_settings.add(m_config_form.ui_chkAutoDetect); +#ifdef CAPTURE_JACK + m_settings.add(m_config_form.ui_chkJACKAutoConnect); + m_settings.add(m_config_form.ui_txtJACKSourcePort); +#endif +#ifdef CAPTURE_ALSA + m_settings.add(m_config_form.ui_chkALSASamplingRateMax); + m_settings.add(m_config_form.ui_spinALSASamplingRate); + m_settings.add(m_config_form.ui_chkALSAMixMultipleChannels); + m_settings.add(m_config_form.ui_txtALSAPCMName); +#endif +#ifdef CAPTURE_OSS + m_settings.add(m_config_form.ui_chkOSSSamplingRateMax); + m_settings.add(m_config_form.ui_spinOSSSamplingRate); + m_settings.add(m_config_form.ui_chkOSSMixMultipleChannels); + m_settings.add(m_config_form.ui_txtOSSPCMName); +#endif +#ifdef CAPTURE_PORTAUDIO + m_settings.add(m_config_form.ui_chkPortAudioSamplingRateMax); + m_settings.add(m_config_form.ui_spinPortAudioSamplingRate); + m_settings.add(m_config_form.ui_chkPortAudioMixMultipleChannels); +#endif + + m_settings.add(m_config_form.ui_spinRefreshTime); + m_settings.add(m_config_form.ui_spinMinHT); + m_settings.add(m_config_form.ui_spinMaxHT); + + m_settings.add(m_config_form.ui_grpRangeFiltering); + m_settings.add(m_config_form.ui_rdRangeFilteringRectangular); + m_settings.add(m_config_form.ui_rdRangeFilteringFIR); + + m_settings.add(m_config_form.ui_spinVolumeTreshold); + m_settings.add(m_config_form.ui_spinWindowSizeFactor); + m_settings.add(m_config_form.ui_chkAlgoUseSubHarmTresh); + m_settings.add(m_config_form.ui_spinCombedFFTAudibilityRatio); + + m_settings.add(m_config_form.up_grpFreqRefinement); + m_settings.add(m_config_form.ui_rdUseFreqRefinement); + m_settings.add(m_config_form.ui_spinFreqRefinMaxHarm); + m_settings.add(m_config_form.ui_rdUseTimeRefinement); + m_settings.add(m_config_form.ui_spinTimeRefinMaxPeriod); + + m_settings.add(m_config_form.ui_grpQuantizer); + m_settings.add(m_config_form.ui_spinErrorLatency); + + m_algo_combedfft = new CombedFT(); + + for(int i=0; iinsertItem(m_capture_thread.getTransports()[i]->getName()); + + if(m_capture_thread.getTransports().empty()) + QMessageBox::critical(this, "Error", "Please compile me with a capture system ..."); + if(m_capture_thread.getTransports().size()==1) + { + m_config_form.ui_lblSelectedCaptureSystem->hide(); + m_config_form.ui_btnAutoDetect->hide(); + m_config_form.ui_chkAutoDetect->hide(); + m_config_form.ui_cbTransports->hide(); + } + m_config_form.ui_grpALSA->hide(); + m_config_form.ui_grpJACK->hide(); + m_config_form.ui_grpPortAudio->hide(); + m_config_form.ui_grpOSS->hide(); + + ui_lblA3Offset->hide(); + ui_spinA3Offset->hide(); + + connect(&m_capture_thread, SIGNAL(samplingRateChanged(int)), this, SLOT(samplingRateChanged(int))); + connect(&m_capture_thread, SIGNAL(errorRaised(const QString&)), this, SLOT(errorRaised(const QString&))); + connect(&m_capture_thread, SIGNAL(transportChanged(const QString&)), this, SLOT(transportChanged(const QString&))); + + connect(&m_latency_quantizer, SIGNAL(noteStarted(double,double)), this, SLOT(noteStarted(double,double))); + connect(&m_latency_quantizer, SIGNAL(noteFinished(double,double)), this, SLOT(noteFinished(double,double))); + connect(&m_dummy_quantizer, SIGNAL(noteStarted(double,double)), this, SLOT(noteStarted(double,double))); + connect(&m_dummy_quantizer, SIGNAL(noteFinished(double,double)), this, SLOT(noteFinished(double,double))); + + m_dialTune = new DialView(centralWidget()); + ui_dialTuneLayout->addWidget(m_dialTune); + + m_glGraph = new GLGraph("Graph", centralWidget()); + connect(m_glGraph->setting_show, SIGNAL(toggled(bool)), this, SLOT(update_views())); + connect(m_glGraph->setting_spinMaxHeight, SIGNAL(valueChanged(int)), this, SLOT(update_views())); + m_glGraph->setting_show->addTo(ui_tbViews); + ui_graphLayout->addWidget(m_glGraph); + + m_glErrorHistory = new GLErrorHistory(centralWidget()); + connect(m_glErrorHistory->setting_show, SIGNAL(toggled(bool)), this, SLOT(update_views())); + m_glErrorHistory->setting_show->addTo(ui_tbViews); + ui_errorLayout->addWidget(m_glErrorHistory); + + // link scales + connect(m_dialTune->setting_spinScale, SIGNAL(valueChanged(int)), m_glErrorHistory->setting_spinScale, SLOT(setValue(int))); + connect(m_glErrorHistory->setting_spinScale, SIGNAL(valueChanged(int)), m_dialTune->setting_spinScale, SLOT(setValue(int))); + connect(m_dialTune->setting_useCents, SIGNAL(toggled(bool)), m_glErrorHistory->setting_useCents, SLOT(setOn(bool))); + connect(m_glErrorHistory->setting_useCents, SIGNAL(toggled(bool)), m_dialTune->setting_useCents, SLOT(setOn(bool))); + + m_glVolumeHistory = new GLVolumeHistory(centralWidget()); + connect(m_config_form.ui_spinVolumeTreshold, SIGNAL(valueChanged(int)), m_glVolumeHistory, SLOT(setVolumeTreshold(int))); + connect(m_glVolumeHistory->setting_show, SIGNAL(toggled(bool)), this, SLOT(update_views())); + m_glVolumeHistory->setting_show->addTo(ui_tbViews); + ui_volumeLayout->addWidget(m_glVolumeHistory); + + // link keep settings + connect(ui_btnKeepErrorHistory, SIGNAL(toggled(bool)), m_glErrorHistory->setting_keep, SLOT(setOn(bool))); + connect(m_glErrorHistory->setting_keep, SIGNAL(toggled(bool)), m_glVolumeHistory->setting_keep, SLOT(setOn(bool))); + connect(m_glErrorHistory->setting_keep, SIGNAL(toggled(bool)), ui_btnKeepErrorHistory, SLOT(setOn(bool))); + + m_glSample = new GLSample(centralWidget()); + connect(m_glSample->setting_show, SIGNAL(toggled(bool)), this, SLOT(update_views())); + m_glSample->setting_show->addTo(ui_tbViews); + ui_sampleLayout->addWidget(m_glSample); + + m_glFreqStruct = new GLFreqStruct(centralWidget()); + connect(m_glFreqStruct->setting_show, SIGNAL(toggled(bool)), this, SLOT(update_views())); + m_glFreqStruct->setting_show->addTo(ui_tbViews); + ui_formantsLayout->addWidget(m_glFreqStruct); + + m_glFT = new GLFT(centralWidget()); + connect(m_glFT->setting_show, SIGNAL(toggled(bool)), this, SLOT(update_views())); + m_glFT->setting_show->addTo(ui_tbViews); + ui_FT->addWidget(m_glFT); + + m_microtonalView = new MicrotonalView(centralWidget()); + connect(m_microtonalView->setting_show, SIGNAL(toggled(bool)), this, SLOT(update_views())); + connect(m_microtonalView, SIGNAL(tuningFreqChanged(float)), this, SLOT(tuningFreqChanged(float))); + m_microtonalView->setting_show->addTo(ui_tbViews); + ui_microtonalLayout->addWidget(m_microtonalView); + + m_glStatistics = new GLStatistics(centralWidget()); + connect(m_glStatistics->setting_show, SIGNAL(toggled(bool)), this, SLOT(update_views())); + m_glStatistics->setting_show->addTo(ui_tbViews); + ui_microtonalLayout->addWidget(m_glStatistics); + + connect(m_dialTune->setting_spinScale, SIGNAL(valueChanged(int)), m_glStatistics->setting_spinScale, SLOT(setValue(int))); + connect(m_glStatistics->setting_spinScale, SIGNAL(valueChanged(int)), m_dialTune->setting_spinScale, SLOT(setValue(int))); + connect(m_dialTune->setting_useCents, SIGNAL(toggled(bool)), m_glStatistics->setting_useCents, SLOT(setOn(bool))); + connect(m_glStatistics->setting_useCents, SIGNAL(toggled(bool)), m_dialTune->setting_useCents, SLOT(setOn(bool))); + + connect(m_dialTune->setting_showTolerance, SIGNAL(toggled(bool)), m_glStatistics->setting_showTolerance, SLOT(setOn(bool))); + connect(m_glStatistics->setting_showTolerance, SIGNAL(toggled(bool)), m_dialTune->setting_showTolerance, SLOT(setOn(bool))); + + connect(m_config_form.buttonOk, SIGNAL(clicked()), this, SLOT(configure_ok())); + connect(m_config_form.ui_btnRestoreFactorySettings, SIGNAL(clicked()), this, SLOT(restoreFactorySettings())); + connect(m_config_form.ui_spinMinHT, SIGNAL(valueChanged(int)), this, SLOT(noteRangeChanged())); + connect(m_config_form.ui_spinMaxHT, SIGNAL(valueChanged(int)), this, SLOT(noteRangeChanged())); + connect(m_config_form.ui_cbTonality, SIGNAL(highlighted(int)), this, SLOT(noteRangeChanged())); + connect(m_config_form.ui_cbNotesName, SIGNAL(highlighted(int)), this, SLOT(noteRangeChanged())); + connect(m_config_form.ui_btnAutoDetect, SIGNAL(clicked()), this, SLOT(autoDetectTransport())); + connect(m_config_form.ui_cbTransports, SIGNAL(activated(const QString&)), this, SLOT(selectTransport(const QString&))); + connect(m_config_form.ui_chkALSAMixMultipleChannels, SIGNAL(toggled(bool)), &m_capture_thread, SLOT(setMixMultipleChannels(bool))); + connect(m_config_form.ui_chkOSSMixMultipleChannels, SIGNAL(toggled(bool)), &m_capture_thread, SLOT(setMixMultipleChannels(bool))); + connect(m_config_form.ui_chkPortAudioMixMultipleChannels, SIGNAL(toggled(bool)), &m_capture_thread, SLOT(setMixMultipleChannels(bool))); + + loadSettings(); + + if(m_config_form.ui_chkAutoDetect->isChecked()) + m_capture_thread.autoDetectTransport(); + + configure_ok(); + + if(m_config_form.ui_chkFullScreen->isChecked()) + toggleFullScreen(); + + m_time_refresh_views.start(); + m_time_refresh.start(); + m_time.start(); + connect((QObject*)&m_timer_refresh, SIGNAL(timeout()), this, SLOT(refresh())); + m_timer_refresh.start(m_config_form.ui_spinRefreshTime->value()); +} + +void CustomInstrumentTunerForm::transportChanged(const QString& name) +{ + selectTransport(name); + + if(m_capture_thread.getCurrentTransportIndex()!=m_config_form.ui_cbTransports->currentItem()) + m_config_form.ui_cbTransports->setCurrentItem(m_capture_thread.getCurrentTransportIndex()); +} +void CustomInstrumentTunerForm::selectTransport(const QString& name) +{ + m_config_form.ui_grpALSA->hide(); + m_config_form.ui_grpJACK->hide(); + m_config_form.ui_grpPortAudio->hide(); + m_config_form.ui_grpOSS->hide(); + + if(name=="ALSA") m_config_form.ui_grpALSA->show(); + else if(name=="JACK") m_config_form.ui_grpJACK->show(); + else if(name=="PortAudio") m_config_form.ui_grpPortAudio->show(); + else if(name=="OSS") m_config_form.ui_grpOSS->show(); +} +void CustomInstrumentTunerForm::autoDetectTransport() +{ + m_capture_thread.autoDetectTransport(); + + // here transportChanged will be called +} + +void CustomInstrumentTunerForm::toggleFullScreen() +{ + static bool fs = true; + if(fs) + { + m_config_form.ui_chkFullScreen->setChecked(true); + showFullScreen(); + } + else + { + m_config_form.ui_chkFullScreen->setChecked(false); + showNormal(); + } + fs = !fs; +} + +void CustomInstrumentTunerForm::noteRangeChanged() +{ + // cerr << "CustomInstrumentTunerForm::noteRangeChanged" << endl; + + m_config_form.ui_txtMinHT->setText(h2n(m_config_form.ui_spinMinHT->value())+" = "+QString::number(h2f(m_config_form.ui_spinMinHT->value()))+" hz"); + m_config_form.ui_txtMaxHT->setText(h2n(m_config_form.ui_spinMaxHT->value())+" = "+QString::number(h2f(m_config_form.ui_spinMaxHT->value()))+" hz"); +} + +void CustomInstrumentTunerForm::errorRaised(const QString& error) +{ + // cerr << "CustomInstrumentTunerForm::errorRaised " << error << endl; + + statusBar()->message(QString("ERROR: ")+error); + + ui_lblSoundStability->setBackgroundColor(QColor(180,74,74)); +} + +void CustomInstrumentTunerForm::samplingRateChanged(int sampling_rate) +{ +// cerr << "CustomInstrumentTunerForm::samplingRateChanged " << sampling_rate << endl; + + Music::SetSamplingRate(sampling_rate); + + m_rect_range_filter.reset(int(GetSamplingRate()/h2f(GetSemitoneMin()))); + + if(m_config_form.ui_cbTransports->currentText()=="JACK") + m_config_form.ui_lblJACKSamplingRate->setText(QString::number(sampling_rate)); +} + +void CustomInstrumentTunerForm::ui_spinAFreq_valueChanged(int AFreq) +{ + double A = AFreq; + if(m_config_form.ui_chkShowA4Offset->isOn()) + A = h2f(ui_spinA3Offset->value()*1/100.0f, A); + Music::SetAFreq(A); +// cerr << A << endl; +} +void CustomInstrumentTunerForm::ui_spinAOffset_valueChanged(int offset) +{ + double A = ui_spinAFreq->value(); + if(m_config_form.ui_chkShowA4Offset->isOn()) + A = h2f(offset*1/100.0f, ui_spinAFreq->value()); + Music::SetAFreq(A); +// cerr << A << endl; +} + +void CustomInstrumentTunerForm::tuningFreqChanged(float freq) +{ + // cerr << "CustomInstrumentTunerForm::tuningFreqChanged " << freq << endl; + + if(freq==0.0f) + { + if(m_compared_freq!=0.0f) + { + ui_txtNoteFreq->display(m_compared_freq); + ui_txtNote->setText(h2n(f2h(m_compared_freq))); + } + } + else + { + m_compared_freq = freq; + ui_txtNoteFreq->display(int(freq*100)/100.0f); + ui_txtNote->setText(m_microtonalView->getTuningNoteName()); + } + + m_quantizer->reset(); + + // m_dialTune->setError(-10.0f); +} + +void CustomInstrumentTunerForm::pause(bool on) +{ + m_capture_thread.togglePause(on); + + if(on) m_timer_refresh.stop(); + else m_timer_refresh.start(m_config_form.ui_spinRefreshTime->value()); +} + +void CustomInstrumentTunerForm::refresh() +{ + double elapsed_time = m_time_refresh.elapsed(); + m_time_refresh.start(); + + QColor capture_failed_color(180,74,74); + QColor prb_color(208,146,0); + QColor empty_color(128,128,128); + QColor ok_color(83,165,105); + + // 1/{time between refresh} = {nb refresh by seconds} + // limit the nb new data by fs/{nb refresh by seconds} + // add 1 to {nb refresh by second} to eventualy recover lags + int limit = int( m_capture_thread.getSamplingRate() / + (1.0/(m_config_form.ui_spinRefreshTime->value()/1000.0) - 1)); + +// cerr << "REFRESH "; + + m_capture_thread.lock(); + double max_amplitude = 0.0; + int nb_new_data = 0; + while(!m_capture_thread.m_values.empty() && + (m_capture_thread.m_values.size()>m_capture_thread.getPacketSizeSinceLastLock() || nb_new_dataaddValue(value); + if(m_glFT) m_glFT->buff.push_front(value); + + nb_new_data++; + } + m_capture_thread.unlock(); + +// cerr << endl; + + int max_size = max(m_range_filter->getLength(), max(m_glGraph->getLength(), m_algo_combedfft->getMinSize())); + while(!m_queue.empty() && int(m_queue.size())>max_size) + m_queue.pop_back(); + + // refresh graph data + m_glGraph->refreshGraph(); // TODO refresh the view each time ?? + m_glFT->refreshGraph(); + + // ------- Analysis stage ------- + + // if something goes wrong in the capture system + if(nb_new_data==0 || m_algo_combedfft==NULL + || elapsed_time>8*m_config_form.ui_spinRefreshTime->value()) + ui_lblSoundStability->setBackgroundColor(capture_failed_color); + else + { + m_algo_combedfft->apply(m_queue); + + double max_component = 20*log10(m_algo_combedfft->getComponentsMax()); + ui_pgbVolume->setProgress(100+int(max_component)); + + double freq = 0.0; + if(m_algo_combedfft->hasNoteRecognized()) + freq = m_algo_combedfft->getFondamentalFreq(); + + double freq_rel = freq*m_algo_combedfft->m_plan.in.size()/double(GetSamplingRate()); + if(freq_rel<1 || freq_rel>(m_algo_combedfft->m_plan.out.size()/2)) + freq = 0.0; + + // frequency refinement + if(freq>0.0 && m_config_form.up_grpFreqRefinement->isChecked()) + { + if(m_config_form.ui_rdUseFreqRefinement->isChecked()) + { + freq = FundFreqRefinementOfHarmonicStruct(m_algo_combedfft->m_plan.out, freq, m_config_form.ui_spinFreqRefinMaxHarm->value(), m_algo_combedfft->getZeroPaddingFactor()); + + } + else if(m_config_form.ui_rdUseTimeRefinement->isChecked()) + { + double period = GetAveragePeriodFromApprox(m_queue, int(GetSamplingRate()/freq), m_config_form.ui_spinTimeRefinMaxPeriod->value()); + if(period>0.0) + freq = GetSamplingRate()/period; + } + } + +// cerr << "2) test freq=" << m_test_freq <quantize(freq); + + if(!m_quantizer->isPlaying()) + ui_lblSoundStability->setBackgroundColor(empty_color); + else + { + if(max_amplitude>=1.0) + ui_lblSoundStability->setBackgroundColor(prb_color); + else + ui_lblSoundStability->setBackgroundColor(ok_color); + + m_freq = m_quantizer->getAverageFrequency(); + m_error = f2hf(m_freq, m_compared_freq); + + // refresh error + m_glErrorHistory->addError(m_error); + m_dialTune->setError(m_error); + m_dialTune->m_avg_error = m_glErrorHistory->m_notes.back().avg_err; + m_dialTune->m_min_error = m_glErrorHistory->m_notes.back().min_err; + m_dialTune->m_max_error = m_glErrorHistory->m_notes.back().max_err; + ui_txtFreq->display(m_freq); + + // refresh intonal tuning cursor + m_microtonalView->setAFreq(Music::GetAFreq()); + m_microtonalView->updateCursor(m_freq); + + // volume + m_glVolumeHistory->addVolume(max_component); + + // refresh sample data + refresh_data_sample(); + + // refresh formants data + refresh_data_harmonics(); + + m_glStatistics->addNote(f2h(m_compared_freq), m_error); + } + } + + if(m_time_refresh_views.elapsed()>50) // 20 images/second max + refresh_views(); +} + +void CustomInstrumentTunerForm::noteStarted(double freq, double dt) +{ +// cerr << "CustomInstrumentTunerForm::noteStarted " << freq << "," << dt << endl; + + // set the compared freq + if(m_microtonalView->setting_show->isOn() && m_microtonalView->hasTuningFreqSelected()) + m_compared_freq = m_microtonalView->getTuningFreq(); + else + m_compared_freq = m_quantizer->getCenterFrequency(); // h2f(f2h(freq)); + + if(m_microtonalView->setting_show->isOn() && m_microtonalView->hasTuningFreqSelected()) + { + ui_txtNoteFreq->display(int(m_microtonalView->getTuningFreq()*100)/100.0); + ui_txtNote->setText(m_microtonalView->getTuningNoteName()); + if(m_microtonalView->m_selected_jivalue->is_ratio) + { + m_glErrorHistory->addNote(GLErrorHistory::Note(m_microtonalView->setting_selectedRoot, m_microtonalView->m_selected_jivalue->num, m_microtonalView->m_selected_jivalue->den)); + m_glVolumeHistory->addNote(GLVolumeHistory::Note(m_microtonalView->setting_selectedRoot, m_microtonalView->m_selected_jivalue->num, m_microtonalView->m_selected_jivalue->den)); + } + else + { + m_glErrorHistory->addNote(GLErrorHistory::Note(m_microtonalView->setting_selectedRoot, m_microtonalView->m_selected_jivalue->cents)); + m_glVolumeHistory->addNote(GLVolumeHistory::Note(m_microtonalView->setting_selectedRoot, m_microtonalView->m_selected_jivalue->cents)); + } + } + else + { + ui_txtNoteFreq->display(m_compared_freq); + ui_txtNote->setText(h2n(f2h(m_compared_freq))); + m_glErrorHistory->addNote(GLErrorHistory::Note(f2h(m_compared_freq))); + m_glVolumeHistory->addNote(GLVolumeHistory::Note(f2h(m_compared_freq))); + } +} +void CustomInstrumentTunerForm::noteFinished(double freq, double dt) +{ + m_compared_freq = 0.0; +// cerr << "CustomInstrumentTunerForm::noteFinished " << freq << "," << dt << endl; +} + +void CustomInstrumentTunerForm::refresh_data_sample() +{ + if(m_freq==0.0f || !m_glSample->setting_show->isOn()) + { + m_glSample->clear(); + return; + } + + deque sample; + GetWaveSample(m_queue, size_t(m_capture_thread.getSamplingRate()/m_freq), sample); + m_glSample->add(m_time.elapsed(), sample); +} + +void CustomInstrumentTunerForm::refresh_data_harmonics() +{ + if(!(m_algo_combedfft!=NULL && + m_freq>0.0f && + m_glFreqStruct->setting_show->isOn())) + return; + + vector harms = GetHarmonicStruct(m_algo_combedfft->m_plan.out, m_freq, m_glFreqStruct->m_components.size(), m_algo_combedfft->getZeroPaddingFactor()); + + m_glFreqStruct->m_components_max = 0.0; + for(int i=0; im_components.size()) + { + m_glFreqStruct->m_components[harms[i].harm_number-1] = 20*log10(harms[i].mod/0.001); + + m_glFreqStruct->m_components_max = max(m_glFreqStruct->m_components_max, m_glFreqStruct->m_components[i]); + } + } +} + +void CustomInstrumentTunerForm::refresh_views() +{ +// cerr << "CustomInstrumentTunerForm::refresh_views " << endl; + +// m_dialTune->repaint(); + + if(m_glGraph->setting_show->isOn()) + m_glGraph->updateGL(); + + if(m_glErrorHistory->setting_show->isOn()) + m_glErrorHistory->updateGL(); + + if(m_glVolumeHistory->setting_show->isOn()) + m_glVolumeHistory->updateGL(); + + if(m_microtonalView->setting_show->isOn()) + m_microtonalView->update(); + + if(m_glSample->setting_show->isOn()) + m_glSample->updateGL(); + + if(m_glFreqStruct->setting_show->isOn()) + m_glFreqStruct->updateGL(); + + if(m_glFT->setting_show->isOn()) + m_glFT->updateGL(); + + if(m_glStatistics->setting_show->isOn()) + m_glStatistics->updateGL(); + + m_time_refresh_views.start(); +} + +void CustomInstrumentTunerForm::keyPressEvent(QKeyEvent * e) +{ + if(e->key()==Key_F) + toggleFullScreen(); +} + +void CustomInstrumentTunerForm::resizeEvent(QResizeEvent* e) +{ + update_views(); + + InstrumentTunerForm::resizeEvent(e); +} + +void CustomInstrumentTunerForm::update_views() +{ + if( !m_glGraph->setting_show->isOn() && + !m_glErrorHistory->setting_show->isOn() && + !m_glVolumeHistory->setting_show->isOn() && + !m_glSample->setting_show->isOn() && + !m_glFreqStruct->setting_show->isOn() && + !m_glFT->setting_show->isOn()) + m_dialTune->setMaximumWidth(size().width()); + else + m_dialTune->setMaximumWidth(ui_rightLayout->minimumSize().width()); + + if(m_glGraph->setting_show->isOn() && + !m_glErrorHistory->setting_show->isOn() && + !m_glVolumeHistory->setting_show->isOn() && + !m_glSample->setting_show->isOn() && + !m_glFreqStruct->setting_show->isOn() && + !m_glFT->setting_show->isOn()) + m_glGraph->setMaximumHeight(size().height()); + else + m_glGraph->setMaximumHeight(m_glGraph->setting_spinMaxHeight->value()); + + if(!m_glErrorHistory->setting_show->isOn() && !m_glVolumeHistory->setting_show->isOn()) + ui_btnKeepErrorHistory->hide(); + else + ui_btnKeepErrorHistory->show(); +} + +void CustomInstrumentTunerForm::configure() +{ + noteRangeChanged(); + + if(m_capture_thread.getCurrentTransportIndex()count()); + m_config_form.ui_cbTransports->setCurrentItem(m_capture_thread.getCurrentTransportIndex()); + +#ifdef CAPTURE_JACK + // TODO set descr + m_config_form.ui_grpJACK->setTitle(m_capture_thread.getTransport("JACK")->getDescription()); + m_config_form.ui_lblJACKSamplingRate->setText(QString::number(m_capture_thread.getSamplingRate())); +#endif +#ifdef CAPTURE_PORTAUDIO + m_config_form.ui_grpPortAudio->setTitle(m_capture_thread.getTransport("PortAudio")->getDescription()); + m_config_form.ui_spinPortAudioSamplingRate->setValue(m_capture_thread.getSamplingRate()); + if(m_capture_thread.getTransport("PortAudio")) + { + try + { + PaError err; + err = Pa_Initialize(); + if(err != paNoError) + throw QString("PortAudio: CustomInstrumentTunerForm::configure:Pa_Initialize ")+Pa_GetErrorText(err); + int numDevices = Pa_GetDeviceCount(); + + int current_index = -1; + m_config_form.ui_cbPortAudioDeviceName->clear(); + m_config_form.ui_cbPortAudioDeviceName->insertItem("default"); + const PaDeviceInfo* deviceInfo; + for(int i=0; iinsertItem(QString(deviceInfo->name)); + if(QString(deviceInfo->name)==m_capture_thread.getTransport("PortAudio")->getSource()) + current_index = i+1; + } + m_config_form.ui_cbPortAudioDeviceName->setCurrentItem(current_index); + } + catch(QString error) + { + cerr << "CustomInstrumentTunerForm: ERROR: " << error << endl; + } + Pa_Terminate(); + } +#endif +#ifdef CAPTURE_ALSA + m_config_form.ui_grpALSA->setTitle(m_capture_thread.getTransport("ALSA")->getDescription()); + m_config_form.ui_spinALSASamplingRate->setValue(m_capture_thread.getSamplingRate()); +#endif +#ifdef CAPTURE_OSS + m_config_form.ui_grpOSS->setTitle(m_capture_thread.getTransport("OSS")->getDescription()); + m_config_form.ui_spinOSSSamplingRate->setValue(m_capture_thread.getSamplingRate()); +#endif + + m_config_form.adjustSize(); + m_config_form.show(); +} +void CustomInstrumentTunerForm::configure_ok() +{ + if(m_config_form.ui_cbTonality->currentItem()==0) SetTonality(0); + else if(m_config_form.ui_cbTonality->currentItem()==1) SetTonality(+2); + else SetTonality(-3); + + if(m_config_form.ui_cbNotesName->currentItem()==0) SetNotesName(LOCAL_ANGLO); + else SetNotesName(LOCAL_LATIN); + m_microtonalView->notesNameChanged(); + m_microtonalView->setAFreq(Music::GetAFreq()); + + SetSemitoneBounds(m_config_form.ui_spinMinHT->value(), m_config_form.ui_spinMaxHT->value()); + + ui_spinA3Offset->setShown(m_config_form.ui_chkShowA4Offset->isOn()); + ui_lblA3Offset->setShown(m_config_form.ui_chkShowA4Offset->isOn()); + + // if(m_note!=-1000) + // ui_txtNote->setText(h2n(m_note)); + + // m_dialTune->setError(-10.0f); + +// cerr << "b" << endl; + + // Capture +#ifdef CAPTURE_ALSA + if(m_config_form.ui_cbTransports->currentText()=="ALSA") + { + m_capture_thread.selectTransport("ALSA"); + m_capture_thread.setSource(m_config_form.ui_txtALSAPCMName->text()); + if(m_config_form.ui_chkALSASamplingRateMax->isChecked()) + m_capture_thread.setSamplingRate(CaptureThread::SAMPLING_RATE_MAX); + else + m_capture_thread.setSamplingRate(m_config_form.ui_spinALSASamplingRate->value()); + } +#endif +#ifdef CAPTURE_JACK + if(m_config_form.ui_cbTransports->currentText()=="JACK") + { + m_capture_thread.selectTransport("JACK"); + if(m_config_form.ui_chkJACKAutoConnect->isChecked()) + m_capture_thread.setSource(m_config_form.ui_txtJACKSourcePort->text()); + else + m_capture_thread.setSource(""); + m_config_form.ui_lblJACKSamplingRate->setText(QString::number(m_capture_thread.getSamplingRate())); + } +#endif +#ifdef CAPTURE_PORTAUDIO + if(m_config_form.ui_cbTransports->currentText()=="PortAudio") + { + m_capture_thread.selectTransport("PortAudio"); + m_capture_thread.setSource(m_config_form.ui_cbPortAudioDeviceName->currentText()); + if(m_config_form.ui_chkPortAudioSamplingRateMax->isChecked()) + m_capture_thread.setSamplingRate(CaptureThread::SAMPLING_RATE_MAX); + else + m_capture_thread.setSamplingRate(m_config_form.ui_spinPortAudioSamplingRate->value()); + } +#endif +#ifdef CAPTURE_OSS + if(m_config_form.ui_cbTransports->currentText()=="OSS") + { + m_capture_thread.selectTransport("OSS"); + m_capture_thread.setSource(m_config_form.ui_txtOSSPCMName->text()); + if(m_config_form.ui_chkOSSSamplingRateMax->isChecked()) + m_capture_thread.setSamplingRate(CaptureThread::SAMPLING_RATE_MAX); + else + m_capture_thread.setSamplingRate(m_config_form.ui_spinOSSSamplingRate->value()); + } +#endif + m_timer_refresh.changeInterval(m_config_form.ui_spinRefreshTime->value()); + + // Views + m_glGraph->m_treshold = pow(10, m_config_form.ui_spinVolumeTreshold->value()/20.0); + m_glGraph->clearValues(); + +// cerr << "c" << endl; + + if(m_config_form.ui_grpRangeFiltering->isChecked()) + { + m_rect_range_filter.reset(int(GetSamplingRate()/h2f(GetSemitoneMin()))); +// m_fir_range_filter.setImpulseResponse(fir1_highpass(int(GetSamplingRate()/h2f(GetSemitoneMin())), )); + + if(m_config_form.ui_rdRangeFilteringRectangular->isChecked()) + m_range_filter = &m_rect_range_filter; + else if(m_config_form.ui_rdRangeFilteringFIR->isChecked()) + m_range_filter = &m_fir_range_filter; + } + else + m_range_filter = &m_dummy_range_filter; + + m_algo_combedfft->setWindowFactor(m_config_form.ui_spinWindowSizeFactor->value()); +// m_glFT->m_zp_factor = m_config_form.ui_spinWindowSizeFactor->value(); + m_algo_combedfft->useAudibilityRatio(m_config_form.ui_chkAlgoUseSubHarmTresh->isChecked()); + m_algo_combedfft->setAudibilityRatio(pow(10, -m_config_form.ui_spinCombedFFTAudibilityRatio->value()/20.0)); + m_algo_combedfft->setAmplitudeTreshold(pow(10, m_config_form.ui_spinVolumeTreshold->value()/20.0)); + m_algo_combedfft->setComponentTreshold(pow(10, m_config_form.ui_spinVolumeTreshold->value()/20.0)); + +// cerr << "d" << endl; + + // Quantizers + m_quantizer->reset(); + if(m_config_form.ui_grpQuantizer->isChecked()) + { + m_latency_quantizer.setLatency(m_config_form.ui_spinErrorLatency->value()); + m_quantizer = &m_latency_quantizer; + } + else + m_quantizer = &m_dummy_quantizer; + +// cerr << pow(10, -m_config_form.ui_spinCombedFFTAudibilityRatio->value()/20.0) << endl; + + if(!pauseAction->isOn() && !m_capture_thread.isCapturing()) + m_capture_thread.startCapture(); +} + +void CustomInstrumentTunerForm::saveSettings() +{ + m_settings.save(); + View::saveAll(); + + // views + m_settings.writeEntry("width", width()); + m_settings.writeEntry("height", height()); + m_settings.writeEntry("ui_tbViews", ui_tbViews->isShown()); + m_settings.writeEntry("ui_tbButtons", ui_tbButtons->isShown()); + + // sound capture + m_settings.writeEntry(m_config_form.ui_cbTransports->name(), m_config_form.ui_cbTransports->currentText()); +#ifdef CAPTURE_PORTAUDIO + m_settings.writeEntry(m_config_form.ui_cbPortAudioDeviceName->name(), m_config_form.ui_cbPortAudioDeviceName->currentText()); +#endif +} +void CustomInstrumentTunerForm::loadSettings() +{ + m_settings.load(); + View::loadAll(); + + // views + resize(m_settings.readNumEntry("width", 800), m_settings.readNumEntry("height", 600)); + ui_tbViews->setShown(m_settings.readBoolEntry("ui_tbViews", ui_tbViews->isShown())); + ui_tbButtons->setShown(m_settings.readBoolEntry("ui_tbButtons", ui_tbButtons->isShown())); + + // sound capture + QString saved_transport = m_settings.readEntry(m_config_form.ui_cbTransports->name(), ""); + if(saved_transport!="") + for(int i=0; icount(); i++) + if(m_config_form.ui_cbTransports->text(i)==saved_transport) + m_config_form.ui_cbTransports->setCurrentItem(i); +#ifdef CAPTURE_PORTAUDIO +// cerr << "read: " << m_settings.readEntry("ui_cbPortAudioDeviceName", "default") << endl; + QString saved_device = m_settings.readEntry(m_config_form.ui_cbPortAudioDeviceName->name(), "default"); + try + { + PaError err; + err = Pa_Initialize(); + if(err != paNoError) + throw QString("PortAudio: CustomInstrumentTunerForm::loadSettings:Pa_Initialize ")+Pa_GetErrorText(err); + int numDevices = Pa_GetDeviceCount(); + + int current_index = 0; + m_config_form.ui_cbPortAudioDeviceName->clear(); + m_config_form.ui_cbPortAudioDeviceName->insertItem("default"); + const PaDeviceInfo* deviceInfo; + for(int i=0; iinsertItem(QString(deviceInfo->name)); + if(QString(deviceInfo->name)==saved_device) + current_index = i+1; + } + if(current_indexcount()) + m_config_form.ui_cbPortAudioDeviceName->setCurrentItem(current_index); + } + catch(QString error) + { + cerr << "CustomInstrumentTunerForm: ERROR: " << error << endl; + } + Pa_Terminate(); +#endif +} + +void CustomInstrumentTunerForm::restoreFactorySettings() +{ + if(QMessageBox::question(this, tr("Restore Factory Settings"), tr("This operation is NOT reversible.\nAre you sure you want to lose all your current settings ?"), QMessageBox::Yes, QMessageBox::No)==QMessageBox::Yes) + { + m_settings.clear(); + View::clearAllSettings(); + + m_settings.removeEntry("width"); + m_settings.removeEntry("height"); + m_settings.removeEntry("ui_tbViews"); + m_settings.removeEntry("ui_tbButtons"); + + m_settings.removeEntry(m_config_form.ui_cbPortAudioDeviceName->name()); + + QMessageBox::information(this, tr("Restore Factory Settings"), tr("You can now restart FMIT to get back factory settings"), QMessageBox::Ok, QMessageBox::NoButton); + } +} + +void CustomInstrumentTunerForm::helpAbout() +{ + QString text; + text = "

Free Music Instrument Tuner

"; + text += tr("

Version ")+PACKAGE_VERSION; + text += tr("

Website:

homepage: http://home.gna.org/fmit"); + text += tr("

development site: http://gna.org/projects/fmit"); + text += tr("

donation link: http://home.gna.org/fmit/donation.html"); + text += tr("

Author:

Gilles Degottex [gilles.degottex@net2000.ch]"); +#ifdef PACKAGER_STRING + if(PACKAGER_STRING!="") + text += tr("

Packager:

")+QString(PACKAGER_STRING).replace(QChar('<'),"[").replace(QChar('>'),"]"); +#endif + + QDialog about_dlg(this); + + QTextEdit* textEdit1; + QPushButton* pushButton1; + QVBoxLayout* Form2Layout; + QHBoxLayout* layout1; + QSpacerItem* spacer1; + QSpacerItem* spacer2; + + about_dlg.setName( tr("about_box") ); + about_dlg.setCaption( tr("About Free Music Instrument Tuner") ); + Form2Layout = new QVBoxLayout( &about_dlg, 11, 6, "Form2Layout"); + + textEdit1 = new QTextEdit( &about_dlg, "textEdit1" ); + textEdit1->setText(text); + textEdit1->setReadOnly(true); + Form2Layout->addWidget( textEdit1 ); + + layout1 = new QHBoxLayout( 0, 0, 6, "layout1"); + spacer1 = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + layout1->addItem( spacer1 ); + + pushButton1 = new QPushButton( &about_dlg, "pushButton1" ); + pushButton1->setText( tr( "OK" ) ); + layout1->addWidget( pushButton1 ); + connect(pushButton1, SIGNAL(clicked()), &about_dlg, SLOT(close())); + spacer2 = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + layout1->addItem( spacer2 ); + Form2Layout->addLayout( layout1 ); + about_dlg.resize( QSize(400, textEdit1->heightForWidth(400)+100) ); +// about_dlg.clearWState( WState_Polished ); + + about_dlg.exec(); +} + +CustomInstrumentTunerForm::~CustomInstrumentTunerForm() +{ + if(m_config_form.ui_chkAutoSaveOnExit->isChecked()) + saveSettings(); + else + { + m_settings.beginGroup("Auto/"); + m_settings.save(m_config_form.ui_chkAutoSaveOnExit); + m_settings.endGroup(); + } +} + +/* +bool displayInBrowser(const QString& theURL) +{ +#ifdef _WIN32 + //TODO replace with less buggy ShellExecuteEx? + if ((unsigned +int)::ShellExecute(qApp->mainWidget()->winId(),NULL,theURL,NULL,NULL,SW_SHOW) +<= 32) +{ + OFMessageBox::criticalMessageOK(QMessageBox::tr("Unable to display a +web browser. Ensure that you have a web browser installed.")); +} +#else + //TODO warn if netscape not installed + QString aCommand("netscape "); + aCommand += theURL; + aCommand += " &"; + if (system(aCommand) != 0) +{ + OFMessageBox::criticalMessageOK(QMessageBox::tr("Unable to display a +netscape browser. You need to have netscape installed and in the +path.")); +} + +return true; +} +*/ diff --git a/src/CustomInstrumentTunerForm.h b/src/CustomInstrumentTunerForm.h new file mode 100644 index 0000000..13d696a --- /dev/null +++ b/src/CustomInstrumentTunerForm.h @@ -0,0 +1,137 @@ +// Copyright 2004 "Gilles Degottex" + +// This file is part of "fmit" + +// "fmit" 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. +// +// "fmit" 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 + + + +#ifndef _CustomInstrumentTunerForm_h_ +#define _CustomInstrumentTunerForm_h_ + +#include "InstrumentTunerForm.h" + +#include "config.h" + +#include +using namespace std; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +using namespace Music; +#include "AutoQSettings.h" +#include "CaptureThread.h" +#include "ConfigForm.h" +#include "LatencyMonoQuantizer.h" +#include "DummyMonoQuantizer.h" +#include "modules/DialView.h" +#include "modules/GLGraph.h" +#include "modules/GLErrorHistory.h" +#include "modules/GLVolumeHistory.h" +#include "modules/MicrotonalView.h" +#include "modules/GLSample.h" +#include "modules/GLFreqStruct.h" +#include "modules/GLFT.h" +#include "modules/GLStatistics.h" + +class CustomInstrumentTunerForm : public InstrumentTunerForm +{ + Q_OBJECT + + public: + ConfigForm m_config_form; + + CaptureThread m_capture_thread; + virtual void pause(bool on); + CombedFT* m_algo_combedfft; + + DialView* m_dialTune; + GLGraph* m_glGraph; + GLErrorHistory* m_glErrorHistory; + GLVolumeHistory* m_glVolumeHistory; + GLSample* m_glSample; + GLFreqStruct* m_glFreqStruct; + GLFT* m_glFT; + MicrotonalView* m_microtonalView; + GLStatistics* m_glStatistics; + + deque m_queue; + double m_freq; + double m_compared_freq; + double m_error; + + QTime m_time; + + CustomInstrumentTunerForm(); + AutoQSettings m_settings; + void loadSettings(); + virtual void saveSettings(); + virtual void restoreFactorySettings(); + + virtual void resizeEvent(QResizeEvent* e); + virtual void keyPressEvent(QKeyEvent * e); + + virtual void update_views(); + virtual void configure(); + virtual void configure_ok(); + virtual void errorRaised(const QString& error); + virtual void samplingRateChanged(int sampling_rate); + virtual void noteRangeChanged(); + virtual void transportChanged(const QString& name); + virtual void selectTransport(const QString & name); + virtual void autoDetectTransport(); + virtual void tuningFreqChanged(float); + virtual void ui_spinAFreq_valueChanged(int); + virtual void ui_spinAOffset_valueChanged(int); + + void toggleFullScreen(); + + QTime m_time_refresh; + QTime m_time_refresh_views; + void refresh(); + QTimer m_timer_refresh; + double m_last_refresh; + + // Range filters + RectangularHighPassRTFilter m_rect_range_filter; + FIRRTFilter m_fir_range_filter; + DummyRTFilter m_dummy_range_filter; + RTFilter* m_range_filter; + + // Time quantizers + LatencyMonoQuantizer m_latency_quantizer; + DummyMonoQuantizer m_dummy_quantizer; + MonoQuantizer* m_quantizer; + virtual void noteStarted(double freq, double dt); + virtual void noteFinished(double freq, double dt); + + virtual void refresh_views(); + void refresh_data_sample(); + void refresh_data_harmonics(); + + // the main function + virtual void helpAbout(); + + ~CustomInstrumentTunerForm(); +}; + +#endif // _CustomInstrumentTunerForm_h_ diff --git a/src/DummyMonoQuantizer.cpp b/src/DummyMonoQuantizer.cpp new file mode 100644 index 0000000..323ddce --- /dev/null +++ b/src/DummyMonoQuantizer.cpp @@ -0,0 +1,72 @@ +// Copyright 2005 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#include "MonoQuantizer.h" + +#include +using namespace std; +#include +using namespace Music; +#include "DummyMonoQuantizer.h" + +DummyMonoQuantizer::DummyMonoQuantizer() +{ + m_confidence = 1.0; +} + +void DummyMonoQuantizer::quantize(double freq) +{ +// cerr << "DummyMonoQuantizer::quantize " << freq << endl; + + double current_time = m_time.elapsed(); + + double current_center_freq = h2f(f2h(freq)); + m_avg_freq = freq; + + if(m_current_center_freq==0.0) + { + if(current_center_freq>0.0) + { + m_current_center_freq = current_center_freq; + m_duration.start(); + emit(noteStarted(m_current_center_freq, 0.0)); + } + } + else + { + if(current_center_freq==0.0) + { + m_current_center_freq = current_center_freq; + emit(noteFinished(m_current_center_freq, 0.0)); + } + else if(m_current_center_freq != current_center_freq) + { + emit(noteFinished(m_current_center_freq, 0.0)); + m_current_center_freq = current_center_freq; + m_duration.start(); + emit(noteStarted(m_current_center_freq, 0.0)); + } + } +} + +void DummyMonoQuantizer::reset() +{ + quantize(0.0); + m_avg_freq = 0.0; +} diff --git a/src/DummyMonoQuantizer.h b/src/DummyMonoQuantizer.h new file mode 100644 index 0000000..472c440 --- /dev/null +++ b/src/DummyMonoQuantizer.h @@ -0,0 +1,45 @@ +// Copyright 2005 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#ifndef _DUMMYMONOQUANTIZER_H_ +#define _DUMMYMONOQUANTIZER_H_ + +#include +using namespace std; +#include +#include +#include +using namespace Music; +#include "MonoQuantizer.h" + +class DummyMonoQuantizer : public MonoQuantizer +{ + QTime m_time; + QTime m_duration; + + public: + DummyMonoQuantizer(); + + virtual void quantize(double freq); + virtual void reset(); + + virtual ~DummyMonoQuantizer(){} +}; + +#endif // _DUMMYMONOQUANTIZER_H_ diff --git a/src/LatencyMonoQuantizer.cpp b/src/LatencyMonoQuantizer.cpp new file mode 100644 index 0000000..b9624a8 --- /dev/null +++ b/src/LatencyMonoQuantizer.cpp @@ -0,0 +1,122 @@ +// Copyright 2005 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#include "MonoQuantizer.h" + +#include +using namespace std; +#include +using namespace Music; +#include "LatencyMonoQuantizer.h" + +LatencyMonoQuantizer::LatencyMonoQuantizer() +{ + m_latency = 125; // ms + + m_time.start(); +} + +void LatencyMonoQuantizer::quantize(double freq) +{ +// cerr << "LatencyMonoQuantizer::quantize " << freq << " m_states=" << m_states.size() << endl; + + double current_time = m_time.elapsed(); + + m_states.push_front(State(current_time, freq)); + + double current_center_freq = h2f(f2h(freq)); + int max_dens = 1; + m_avg_freq = freq; + map densities; + for(int i=0; i::iterator it=densities.find(cf); + if(it==densities.end()) + densities.insert(make_pair(cf,Note(m_states[i].m_freq))); + else + { + it->second.m_avg_freq *= it->second.m_dens; + it->second.m_avg_freq += m_states[i].m_freq; + it->second.m_dens++; + it->second.m_avg_freq /= it->second.m_dens; + if(it->second.m_dens>max_dens) + { + max_dens = it->second.m_dens; + current_center_freq = it->first; + m_avg_freq = it->second.m_avg_freq; + } + } + } + +// cerr << m_current_center_freq << ", " << current_center_freq << ", " << m_avg_freq << ", max_dens=" << max_dens << ", m_states.size()=" << m_states.size() << endl; + + m_confidence = double(max_dens)/m_states.size(); + + // if a density is strong enough + if(m_confidence>m_min_confidence) + { + if(m_current_center_freq==0.0) + { + if(current_center_freq>0.0) + { + m_current_center_freq = current_center_freq; + m_duration.start(); + double lag = (current_time-m_states.back().m_time)*m_min_confidence; + m_duration.addMSecs(int(lag)); + emit(noteStarted(m_current_center_freq, -lag)); + } + } + else + { + if(current_center_freq==0.0) + { + m_current_center_freq = current_center_freq; + double lag = (current_time-m_states.back().m_time)*m_min_confidence; + emit(noteFinished(m_current_center_freq, -lag)); + } + else if(m_current_center_freq != current_center_freq) + { + double lag = (current_time-m_states.back().m_time)/2.0; // TODO pas forcément a fait 2 ~bruit + emit(noteFinished(m_current_center_freq, -lag)); + m_current_center_freq = current_center_freq; + m_duration.start(); + m_duration.addMSecs(int(lag)); + emit(noteStarted(m_current_center_freq, -lag)); + } + } + } + else if(m_current_center_freq>0.0) + { + m_current_center_freq = 0.0; + double lag = (current_time-m_states.back().m_time)*m_min_confidence; + emit(noteFinished(m_current_center_freq, -lag)); + } + + while(!m_states.empty() && (current_time-m_states.back().m_time>m_latency)) + m_states.pop_back(); +} + +void LatencyMonoQuantizer::reset() +{ + quantize(0.0); + m_avg_freq = 0.0; + m_states.clear(); + m_confidence = 1.0; +} diff --git a/src/LatencyMonoQuantizer.h b/src/LatencyMonoQuantizer.h new file mode 100644 index 0000000..f32f5e8 --- /dev/null +++ b/src/LatencyMonoQuantizer.h @@ -0,0 +1,66 @@ +// Copyright 2005 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#ifndef _LATENCYMONOQUANTIZER_H_ +#define _LATENCYMONOQUANTIZER_H_ + +#include +using namespace std; +#include +#include +#include +using namespace Music; +#include "MonoQuantizer.h" + +class LatencyMonoQuantizer : public MonoQuantizer +{ + QTime m_time; + + //! in millis + float m_latency; + + struct State{ + double m_time; + double m_freq; + double m_confidence; + State(double t, double f, double c=1.0) : m_time(t), m_freq(f), m_confidence(c) {} + }; + deque m_states; + + struct Note{ + int m_dens; + double m_avg_freq; + Note(double f) : m_dens(1), m_avg_freq(f) {} + }; + + QTime m_duration; + + public: + LatencyMonoQuantizer(); + + void setLatency(float latency) {m_latency=latency;} + double getLatency() {return m_latency;} + + virtual void quantize(double freq); + virtual void reset(); + + virtual ~LatencyMonoQuantizer(){} +}; + +#endif // _LATENCYMONOQUANTIZER_H_ diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..c88dc2b --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,12 @@ +SUBDIRS = modules + +bin_PROGRAMS = fmit +fmit_SOURCES = CaptureThread.cpp main.cpp CustomInstrumentTunerForm.cpp MonoQuantizer.cpp LatencyMonoQuantizer.cpp DummyMonoQuantizer.cpp AutoQSettings.cpp +nodist_fmit_SOURCES = CaptureThread_moc.cpp CustomInstrumentTunerForm_moc.cpp MonoQuantizer_moc.cpp ../ui/ConfigForm_moc.cpp ../ui/InstrumentTunerForm_moc.cpp ../ui/ConfigForm.cpp ../ui/InstrumentTunerForm.cpp +AM_CXXFLAGS = -I../libs -I../ui -DQT_THREAD_SUPPORT $(GL_CFLAGS) +fmit_LDADD = modules/libmodules.a ../libs/Music/libMusic.a ../libs/CppAddons/libCppAddons.a $(GL_LIBS) $(LD_LIBRARY) -lm -lfftw3 +EXTRA_DIST = *.h +CLEANFILES = *_moc.cpp *_moc.o + +%_moc.cpp: %.h + $(QT_MOC) $< > $@ diff --git a/src/Makefile.in b/src/Makefile.in new file mode 100644 index 0000000..bfd5e5c --- /dev/null +++ b/src/Makefile.in @@ -0,0 +1,621 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +bin_PROGRAMS = fmit$(EXEEXT) +subdir = src +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_cxx_exceptions.m4 \ + $(top_srcdir)/m4/ac_cxx_have_complex.m4 \ + $(top_srcdir)/m4/ac_cxx_have_numeric_limits.m4 \ + $(top_srcdir)/m4/ac_cxx_have_sstream.m4 \ + $(top_srcdir)/m4/ac_cxx_have_stl.m4 \ + $(top_srcdir)/m4/ac_cxx_namespaces.m4 \ + $(top_srcdir)/m4/ac_cxx_templates.m4 \ + $(top_srcdir)/m4/bnv_have_qt.m4 \ + $(top_srcdir)/m4/mdl_have_opengl.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_fmit_OBJECTS = CaptureThread.$(OBJEXT) main.$(OBJEXT) \ + CustomInstrumentTunerForm.$(OBJEXT) MonoQuantizer.$(OBJEXT) \ + LatencyMonoQuantizer.$(OBJEXT) DummyMonoQuantizer.$(OBJEXT) \ + AutoQSettings.$(OBJEXT) +nodist_fmit_OBJECTS = CaptureThread_moc.$(OBJEXT) \ + CustomInstrumentTunerForm_moc.$(OBJEXT) \ + MonoQuantizer_moc.$(OBJEXT) ConfigForm_moc.$(OBJEXT) \ + InstrumentTunerForm_moc.$(OBJEXT) ConfigForm.$(OBJEXT) \ + InstrumentTunerForm.$(OBJEXT) +fmit_OBJECTS = $(am_fmit_OBJECTS) $(nodist_fmit_OBJECTS) +am__DEPENDENCIES_1 = +fmit_DEPENDENCIES = modules/libmodules.a ../libs/Music/libMusic.a \ + ../libs/CppAddons/libCppAddons.a $(am__DEPENDENCIES_1) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +SOURCES = $(fmit_SOURCES) $(nodist_fmit_SOURCES) +DIST_SOURCES = $(fmit_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QT_CXXFLAGS = @QT_CXXFLAGS@ +QT_DIR = @QT_DIR@ +QT_LIBS = @QT_LIBS@ +QT_MOC = @QT_MOC@ +QT_UIC = @QT_UIC@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_prefix = @ac_prefix@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +SUBDIRS = modules +fmit_SOURCES = CaptureThread.cpp main.cpp CustomInstrumentTunerForm.cpp MonoQuantizer.cpp LatencyMonoQuantizer.cpp DummyMonoQuantizer.cpp AutoQSettings.cpp +nodist_fmit_SOURCES = CaptureThread_moc.cpp CustomInstrumentTunerForm_moc.cpp MonoQuantizer_moc.cpp ../ui/ConfigForm_moc.cpp ../ui/InstrumentTunerForm_moc.cpp ../ui/ConfigForm.cpp ../ui/InstrumentTunerForm.cpp +AM_CXXFLAGS = -I../libs -I../ui -DQT_THREAD_SUPPORT $(GL_CFLAGS) +fmit_LDADD = modules/libmodules.a ../libs/Music/libMusic.a ../libs/CppAddons/libCppAddons.a $(GL_LIBS) $(LD_LIBRARY) -lm -lfftw3 +EXTRA_DIST = *.h +CLEANFILES = *_moc.cpp *_moc.o +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .cpp .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +fmit$(EXEEXT): $(fmit_OBJECTS) $(fmit_DEPENDENCIES) + @rm -f fmit$(EXEEXT) + $(CXXLINK) $(fmit_LDFLAGS) $(fmit_OBJECTS) $(fmit_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AutoQSettings.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CaptureThread.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CaptureThread_moc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ConfigForm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ConfigForm_moc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CustomInstrumentTunerForm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CustomInstrumentTunerForm_moc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DummyMonoQuantizer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/InstrumentTunerForm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/InstrumentTunerForm_moc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LatencyMonoQuantizer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MonoQuantizer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MonoQuantizer_moc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +ConfigForm_moc.o: ../ui/ConfigForm_moc.cpp +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ConfigForm_moc.o -MD -MP -MF "$(DEPDIR)/ConfigForm_moc.Tpo" -c -o ConfigForm_moc.o `test -f '../ui/ConfigForm_moc.cpp' || echo '$(srcdir)/'`../ui/ConfigForm_moc.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/ConfigForm_moc.Tpo" "$(DEPDIR)/ConfigForm_moc.Po"; else rm -f "$(DEPDIR)/ConfigForm_moc.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='../ui/ConfigForm_moc.cpp' object='ConfigForm_moc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ConfigForm_moc.o `test -f '../ui/ConfigForm_moc.cpp' || echo '$(srcdir)/'`../ui/ConfigForm_moc.cpp + +ConfigForm_moc.obj: ../ui/ConfigForm_moc.cpp +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ConfigForm_moc.obj -MD -MP -MF "$(DEPDIR)/ConfigForm_moc.Tpo" -c -o ConfigForm_moc.obj `if test -f '../ui/ConfigForm_moc.cpp'; then $(CYGPATH_W) '../ui/ConfigForm_moc.cpp'; else $(CYGPATH_W) '$(srcdir)/../ui/ConfigForm_moc.cpp'; fi`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/ConfigForm_moc.Tpo" "$(DEPDIR)/ConfigForm_moc.Po"; else rm -f "$(DEPDIR)/ConfigForm_moc.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='../ui/ConfigForm_moc.cpp' object='ConfigForm_moc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ConfigForm_moc.obj `if test -f '../ui/ConfigForm_moc.cpp'; then $(CYGPATH_W) '../ui/ConfigForm_moc.cpp'; else $(CYGPATH_W) '$(srcdir)/../ui/ConfigForm_moc.cpp'; fi` + +InstrumentTunerForm_moc.o: ../ui/InstrumentTunerForm_moc.cpp +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT InstrumentTunerForm_moc.o -MD -MP -MF "$(DEPDIR)/InstrumentTunerForm_moc.Tpo" -c -o InstrumentTunerForm_moc.o `test -f '../ui/InstrumentTunerForm_moc.cpp' || echo '$(srcdir)/'`../ui/InstrumentTunerForm_moc.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/InstrumentTunerForm_moc.Tpo" "$(DEPDIR)/InstrumentTunerForm_moc.Po"; else rm -f "$(DEPDIR)/InstrumentTunerForm_moc.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='../ui/InstrumentTunerForm_moc.cpp' object='InstrumentTunerForm_moc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o InstrumentTunerForm_moc.o `test -f '../ui/InstrumentTunerForm_moc.cpp' || echo '$(srcdir)/'`../ui/InstrumentTunerForm_moc.cpp + +InstrumentTunerForm_moc.obj: ../ui/InstrumentTunerForm_moc.cpp +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT InstrumentTunerForm_moc.obj -MD -MP -MF "$(DEPDIR)/InstrumentTunerForm_moc.Tpo" -c -o InstrumentTunerForm_moc.obj `if test -f '../ui/InstrumentTunerForm_moc.cpp'; then $(CYGPATH_W) '../ui/InstrumentTunerForm_moc.cpp'; else $(CYGPATH_W) '$(srcdir)/../ui/InstrumentTunerForm_moc.cpp'; fi`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/InstrumentTunerForm_moc.Tpo" "$(DEPDIR)/InstrumentTunerForm_moc.Po"; else rm -f "$(DEPDIR)/InstrumentTunerForm_moc.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='../ui/InstrumentTunerForm_moc.cpp' object='InstrumentTunerForm_moc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o InstrumentTunerForm_moc.obj `if test -f '../ui/InstrumentTunerForm_moc.cpp'; then $(CYGPATH_W) '../ui/InstrumentTunerForm_moc.cpp'; else $(CYGPATH_W) '$(srcdir)/../ui/InstrumentTunerForm_moc.cpp'; fi` + +ConfigForm.o: ../ui/ConfigForm.cpp +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ConfigForm.o -MD -MP -MF "$(DEPDIR)/ConfigForm.Tpo" -c -o ConfigForm.o `test -f '../ui/ConfigForm.cpp' || echo '$(srcdir)/'`../ui/ConfigForm.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/ConfigForm.Tpo" "$(DEPDIR)/ConfigForm.Po"; else rm -f "$(DEPDIR)/ConfigForm.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='../ui/ConfigForm.cpp' object='ConfigForm.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ConfigForm.o `test -f '../ui/ConfigForm.cpp' || echo '$(srcdir)/'`../ui/ConfigForm.cpp + +ConfigForm.obj: ../ui/ConfigForm.cpp +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ConfigForm.obj -MD -MP -MF "$(DEPDIR)/ConfigForm.Tpo" -c -o ConfigForm.obj `if test -f '../ui/ConfigForm.cpp'; then $(CYGPATH_W) '../ui/ConfigForm.cpp'; else $(CYGPATH_W) '$(srcdir)/../ui/ConfigForm.cpp'; fi`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/ConfigForm.Tpo" "$(DEPDIR)/ConfigForm.Po"; else rm -f "$(DEPDIR)/ConfigForm.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='../ui/ConfigForm.cpp' object='ConfigForm.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ConfigForm.obj `if test -f '../ui/ConfigForm.cpp'; then $(CYGPATH_W) '../ui/ConfigForm.cpp'; else $(CYGPATH_W) '$(srcdir)/../ui/ConfigForm.cpp'; fi` + +InstrumentTunerForm.o: ../ui/InstrumentTunerForm.cpp +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT InstrumentTunerForm.o -MD -MP -MF "$(DEPDIR)/InstrumentTunerForm.Tpo" -c -o InstrumentTunerForm.o `test -f '../ui/InstrumentTunerForm.cpp' || echo '$(srcdir)/'`../ui/InstrumentTunerForm.cpp; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/InstrumentTunerForm.Tpo" "$(DEPDIR)/InstrumentTunerForm.Po"; else rm -f "$(DEPDIR)/InstrumentTunerForm.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='../ui/InstrumentTunerForm.cpp' object='InstrumentTunerForm.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o InstrumentTunerForm.o `test -f '../ui/InstrumentTunerForm.cpp' || echo '$(srcdir)/'`../ui/InstrumentTunerForm.cpp + +InstrumentTunerForm.obj: ../ui/InstrumentTunerForm.cpp +@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT InstrumentTunerForm.obj -MD -MP -MF "$(DEPDIR)/InstrumentTunerForm.Tpo" -c -o InstrumentTunerForm.obj `if test -f '../ui/InstrumentTunerForm.cpp'; then $(CYGPATH_W) '../ui/InstrumentTunerForm.cpp'; else $(CYGPATH_W) '$(srcdir)/../ui/InstrumentTunerForm.cpp'; fi`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/InstrumentTunerForm.Tpo" "$(DEPDIR)/InstrumentTunerForm.Po"; else rm -f "$(DEPDIR)/InstrumentTunerForm.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='../ui/InstrumentTunerForm.cpp' object='InstrumentTunerForm.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o InstrumentTunerForm.obj `if test -f '../ui/InstrumentTunerForm.cpp'; then $(CYGPATH_W) '../ui/InstrumentTunerForm.cpp'; else $(CYGPATH_W) '$(srcdir)/../ui/InstrumentTunerForm.cpp'; fi` +uninstall-info-am: + +# 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. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + 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) \ + || eval $$failcom; \ + 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: + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + 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) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(mkdir_p) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(PROGRAMS) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: install-binPROGRAMS + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ + clean clean-binPROGRAMS clean-generic clean-recursive ctags \ + ctags-recursive distclean distclean-compile distclean-generic \ + distclean-recursive distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-exec install-exec-am \ + install-info install-info-am install-man install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-recursive pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-info-am + + +%_moc.cpp: %.h + $(QT_MOC) $< > $@ +# 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: diff --git a/src/MonoQuantizer.cpp b/src/MonoQuantizer.cpp new file mode 100644 index 0000000..0e687db --- /dev/null +++ b/src/MonoQuantizer.cpp @@ -0,0 +1,38 @@ +// Copyright 2006,2007 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#include "MonoQuantizer.h" + +#include +using namespace std; +#include +using namespace Music; + +MonoQuantizer::MonoQuantizer() +{ + m_min_confidence = 0.0; + + m_confidence = 1.0; + m_current_center_freq = 0.0; + m_avg_freq = 0.0; +} + +MonoQuantizer::~MonoQuantizer() +{ +} diff --git a/src/MonoQuantizer.h b/src/MonoQuantizer.h new file mode 100644 index 0000000..5babe72 --- /dev/null +++ b/src/MonoQuantizer.h @@ -0,0 +1,65 @@ +// Copyright 2005 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#ifndef _MONOQUANTIZER_H_ +#define _MONOQUANTIZER_H_ + +#include +using namespace std; +#include +#include +#include +using namespace Music; + +class MonoQuantizer : public QObject +{ + Q_OBJECT + + protected: + double m_min_confidence; + + double m_confidence; + double m_current_center_freq; // nearest semi-tone + double m_avg_freq; // precise frequency + + public: + MonoQuantizer(); + + double getMinConfidence() {return m_min_confidence;} + void setMinConfidence(float min_confidence) {m_min_confidence=min_confidence;} + double getConfidence() {return m_confidence;} +// int getMinStoredRecon() {return m_min_stored_recon;} + bool isPlaying() {return m_current_center_freq>0.0;} + double getCenterFrequency() {return m_current_center_freq;} + double getAverageFrequency() {return m_avg_freq;} + + virtual void quantize(double freq)=0; + virtual void reset()=0; + + virtual ~MonoQuantizer(); + + signals: + void noteStarted(double freq, double dt); + void noteFinished(double freq, double dt); +// void notePlayed(double freq, double duration, double dt); + +// public slots: +}; + +#endif // _MONOQUANTIZER_H_ diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..fc565bb --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,88 @@ +// Copyright 2004 "Gilles Degottex" + +// This file is part of "fmit" + +// "fmit" 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. +// +// "fmit" 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 + + +#include "config.h" + +#include +using namespace std; +#include +#include +#include +#include + +#include + +#include "CustomInstrumentTunerForm.h" +CustomInstrumentTunerForm* g_main_form = NULL; + +void signal_interrupt(int sig) +{ + cerr << "Interrupt" << endl; + + delete g_main_form; + + exit(sig); +} +void signal_term(int sig) +{ + cerr << "No No ! Pleeeeeease ... *argl*" << endl; + cerr << endl; + cerr << PACKAGE_NAME << " nastily killed with signal " << sig << endl; + + exit(sig); +} + +int main(int argc, char** argv) +{ + cerr << "Free Music Instrument Tuner version " << PACKAGE_VERSION << " built at " << __DATE__ << " " << __TIME__ << endl; + cerr << "Install directory '" << PREFIX << "'" << endl; + + signal(SIGINT, signal_interrupt); + signal(SIGTERM, signal_term); + + QApplication a(argc, argv, true); + + glutInit(&argc, argv); + +// if(a.argc()>1) +// { +// if(a.argc()>2 && (QString(a.argv()[1])=="-d" || QString(a.argv()[1])=="--device")) +// { +// cerr << "used device: " << a.argv()[2] << endl; +// } +// } + +// cerr << "LANG=" << QTextCodec::locale() << endl; + + QTranslator tr_fmit(0); + tr_fmit.load(QString(PACKAGE_NAME)+"_"+QTextCodec::locale(), QString(PREFIX)+"/"+PACKAGE_NAME+"/tr"); + a.installTranslator(&tr_fmit); + + g_main_form = new CustomInstrumentTunerForm(); + + g_main_form->show(); + + a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); + a.exec(); + + delete g_main_form; + + return 0; +} + diff --git a/src/modules/DialView.cpp b/src/modules/DialView.cpp new file mode 100644 index 0000000..0119731 --- /dev/null +++ b/src/modules/DialView.cpp @@ -0,0 +1,289 @@ +#include "DialView.h" + +#include +using namespace std; +#include +#include +#include +#include +#include + +DialView::DialView(QWidget* parent) +: QFrame(parent, "DialView") +, View("Dial", this) +{ + m_error = 0.0f; + m_min_error = 0.0f; + m_max_error = 0.0f; + + // settings + setting_showTolerance = new QAction(this); + setting_showTolerance->setMenuText(tr("Show tolerance")); + setting_showTolerance->setToggleAction(true); + setting_showTolerance->setOn(true); + connect(setting_showTolerance, SIGNAL(toggled(bool)), this, SLOT(update())); + setting_showTolerance->addTo(&m_popup_menu); + + setting_showTrace = new QAction(this); + setting_showTrace->setMenuText(tr("Show trace")); + setting_showTrace->setToggleAction(true); + setting_showTrace->setOn(true); + connect(setting_showTrace, SIGNAL(toggled(bool)), this, SLOT(update())); + setting_showTrace->addTo(&m_popup_menu); + + setting_useCents = new QAction(this); + setting_useCents->setMenuText(tr("Use cents")); + setting_useCents->setToggleAction(true); + setting_useCents->setOn(true); + connect(setting_useCents, SIGNAL(toggled(bool)), this, SLOT(update())); + setting_useCents->addTo(&m_popup_menu); + + m_popup_menu.insertItem(new Title(tr("Scale range"), &m_popup_menu)); + setting_spinScale = new QSpinBox(5, 50, 1, &m_popup_menu); + setting_spinScale->setValue(50); + QToolTip::add(setting_spinScale, tr("Scale range (in cents)")); + connect(setting_spinScale, SIGNAL(valueChanged(int)), this, SLOT(update())); + m_popup_menu.insertItem(setting_spinScale); +} + +void DialView::save() +{ + s_settings->writeEntry("showTolerance", setting_showTolerance->isOn()); + s_settings->writeEntry("showTrace", setting_showTrace->isOn()); + s_settings->writeEntry("useCents", setting_useCents->isOn()); + s_settings->writeEntry("spinScale", setting_spinScale->value()); +} +void DialView::load() +{ + setting_showTolerance->setOn(s_settings->readBoolEntry("showTolerance", setting_showTolerance->isOn())); + setting_showTrace->setOn(s_settings->readBoolEntry("showTrace", setting_showTrace->isOn())); + setting_useCents->setOn(s_settings->readBoolEntry("useCents", setting_useCents->isOn())); + + setting_spinScale->setValue(s_settings->readNumEntry("spinScale", setting_spinScale->value())); +} +void DialView::clearSettings() +{ + s_settings->removeEntry("showTolerance"); + s_settings->removeEntry("showTrace"); + s_settings->removeEntry("useCents"); + s_settings->removeEntry("spinScale"); +} + +void DialView::drawTextTickCent(QPainter& p, int bigw, int bigh, int r) +{ + QString txt; +// double deg = 0.0; + + int bw = bigw/2-p.fontMetrics().height()+p.fontMetrics().height()/2+2; + int bh = bigh-p.fontMetrics().height()+p.fontMetrics().height()/2+2; + + // only work within range that is a pure multiple of r + int range = int(setting_spinScale->value()/r)*r; + + float scale = 50.0f/setting_spinScale->value()/100.0f; + for(int i=-range; i<=range; i+=r) + { + txt = QString::number(i); + float angle = (150.0f/180.0f)*i*scale*Math::Pi + Math::Pi/2; + QPoint pos(int(-bw*cos(angle)),int(-bh*sin(angle))); + + p.translate(pos.x(), pos.y()); + + if(height()>width()) p.rotate(90); + p.drawText(-p.fontMetrics().width(txt)/2,p.fontMetrics().height()/2, txt); + if(height()>width()) p.rotate(-90); + + p.translate(-pos.x(), -pos.y()); + } +} +void DialView::drawTicksCent(QPainter& p, int bigw, int bigh, int r, int ticks_size, int h) +{ + int sw = int(bigw/2.0f-p.fontMetrics().height()-ticks_size); + int sh = bigh-p.fontMetrics().height()-ticks_size; + int bw = sw + h; + int bh = sh + h; + + // only work within range that is a pure multiple of r + float range = int(setting_spinScale->value()/r)*r; + + float scale = 50.0f/setting_spinScale->value()/100.0f; + for(float i=-range; i<=range; i+=r) + { + float angle = (150.0f/180.0f)*i*scale*Math::Pi + Math::Pi/2; + p.drawLine(-QPoint(int(sw*cos(angle)),int(sh*sin(angle))), -QPoint(int(bw*cos(angle)),int(bh*sin(angle)))); + } +} +void DialView::drawTextTickFrac(QPainter& p, int bigw, int bigh, int num, int den) +{ + QString txt; + double deg = 0.0; + if(num==0 || den==0) + txt = "0"; + else + { + deg = num*150/den; + txt = QString::number(den*(50/setting_spinScale->value())); + } + + int bw = bigw/2-p.fontMetrics().height()+p.fontMetrics().height()/2+2; + int bh = bigh-p.fontMetrics().height()+p.fontMetrics().height()/2+2; + float angle = deg/180.0f*Math::Pi + Math::Pi/2; + QPoint pos(int(-bw*cos(angle)),int(-bh*sin(angle))); + + p.translate(pos.x(), pos.y()); + + if(height()>width()) p.rotate(90); + p.drawText(-p.fontMetrics().width(txt)/2,p.fontMetrics().height()/2, txt); + if(height()>width()) p.rotate(-90); + + p.translate(-pos.x(), -pos.y()); +} +void DialView::drawTicksFrac(QPainter& p, int bigw, int bigh, float r, int ticks_size, int h) +{ + int sw = bigw/2-p.fontMetrics().height()-ticks_size; + int sh = bigh-p.fontMetrics().height()-ticks_size; + int bw = sw + h; + int bh = sh + h; + for(float i=-0.5f+r; i<0.5f; i+=2*r) + { + float angle = (150.0f/180.0f)*i*Math::Pi + Math::Pi/2; + p.drawLine(-QPoint(int(sw*cos(angle)),int(sh*sin(angle))), -QPoint(int(bw*cos(angle)),int(bh*sin(angle)))); + } +} + +void DialView::setError(float error) +{ + m_error = error; + repaint(); +} + +void DialView::drawContents(QPainter* pp) +{ + QPainter& p = *pp; + + float human_tol = Music::f2hf(441.0,440.0); // TODO + float scale; + if(setting_useCents->isOn()) + scale = 50.0f/setting_spinScale->value(); + else + scale = int(50/setting_spinScale->value()); + + int bigw = width(); + int bigh = height(); + + QPoint c(width()/2,height()); + QPoint unity_center = c+QPoint(p.fontMetrics().width("cent"),0); + QString unity; + if(setting_useCents->isOn()) unity = "cents"; + else unity = "1/x"; + if(height()>width()) + { + c = QPoint(width(), height()/2); + bigw = height(); + bigh = width(); + unity_center = c+QPoint(-p.fontMetrics().width(unity),-p.fontMetrics().height()); + } + int ticks_size = bigh/10; + + // draw unity + p.setPen(QColor(0,0,0)); + p.drawText(unity_center, unity); + + p.translate(c.x(), c.y()); + + if(height()>width()) + p.rotate(-90); + + // draw pie + int pie_width = bigw/2-p.fontMetrics().height()-ticks_size-2; + int pie_height = bigh-p.fontMetrics().height()-ticks_size-2; + p.setBrush(QColor(123,205,145)); + QPen pen1 = p.pen(); + pen1.setColor(QColor(83,165,105)); +// pen1.setStyle(Qt::DashLine); +// pen1.setWidth(2); + p.setPen(pen1); + if(setting_showTolerance->isOn()) + { + float pie_deg = (150.0f/180.0f)*scale*human_tol*180; + p.drawPie(-pie_width,-pie_height,2*pie_width,2*pie_height, int((90-pie_deg)*16),int(2*pie_deg*16)); + } + + // draw min max + if((m_error>-1.0f && m_error<1.0f) && setting_showTrace->isOn() && m_max_error-m_min_error>0.0) + { + int line_width = ticks_size/4; + int mm_height = pie_height - line_width/2; + int mm_width = pie_width - line_width/2; + QPen pen3 = p.pen(); + pen3.setColor(QColor(128,128,128)); + pen3.setWidth(line_width); + p.setPen(pen3); + + float mm_degf = (150.0f/180.0f)*scale*180; + p.drawArc(-mm_width,-mm_height,2*mm_width,2*mm_height,int((90-mm_degf*m_min_error)*16),int((-mm_degf*(m_max_error-m_min_error))*16)); + } + + // draw text marks + p.setPen(QColor(0,0,0)); + if(setting_useCents->isOn()) + { + int grad = 10; + if(setting_spinScale->value() <= 25) grad=5; + if(setting_spinScale->value() <= 10) grad=1; + drawTextTickCent(p, bigw, bigh, grad); + } + else + { + drawTextTickFrac(p, bigw, bigh, 0,1); + drawTextTickFrac(p, bigw, bigh, 1,2); + drawTextTickFrac(p, bigw, bigh, -1,2); + drawTextTickFrac(p, bigw, bigh, 1,4); + drawTextTickFrac(p, bigw, bigh, -1,4); + drawTextTickFrac(p, bigw, bigh, 1,8); + drawTextTickFrac(p, bigw, bigh, -1,8); + drawTextTickFrac(p, bigw, bigh, 1,16); + drawTextTickFrac(p, bigw, bigh, -1,16); + } + + // draw ticks + int sw = bigw/2-p.fontMetrics().height()-ticks_size; + int sh = bigh-p.fontMetrics().height()-ticks_size; + int bw = sw + ticks_size; + int bh = sh + ticks_size; + if(setting_useCents->isOn()) + { + drawTicksCent(p, bigw, bigh, 10, ticks_size, ticks_size); + drawTicksCent(p, bigw, bigh, 5, ticks_size, int(ticks_size * 0.6)); + drawTicksCent(p, bigw, bigh, 1, ticks_size, int(ticks_size * 0.3)); + } + else + { + for(float i=-1.0f; i<=1.0f; i+=0.25f) + { + float angle = (150.0f/360.0f)*i*Math::Pi + Math::Pi/2; + p.drawLine(-QPoint(int(sw*cos(angle)),int(sh*sin(angle))), -QPoint(int(bw*cos(angle)),int(bh*sin(angle)))); + } + drawTicksFrac(p, bigw, bigh, 0.125f, ticks_size, 2*ticks_size/3); + drawTicksFrac(p, bigw, bigh, 0.0625f, ticks_size, ticks_size/2); + drawTicksFrac(p, bigw, bigh, 0.03125f, ticks_size, ticks_size/3); + } + + // draw arrow + if(m_error>-1.0f && m_error<1.0f) + { + float angle = (150.0f/180.0f)*scale*m_error*Math::Pi + Math::Pi/2; + QPoint final_point = -QPoint(int((pie_width-2)*cos(angle)),int((pie_height-2)*sin(angle))); + QPoint mid_point = 9*final_point/10; + QPen pen2 = p.pen(); + pen2.setWidth(3); + pen2.setColor(QColor(64,64,64)); + p.setPen(pen2); + p.drawLine(QPoint(0,0), mid_point); + pen2.setWidth(1); + p.setPen(pen2); + p.drawLine(mid_point, final_point); + } + + p.flush(); +} diff --git a/src/modules/DialView.h b/src/modules/DialView.h new file mode 100644 index 0000000..35ebbf7 --- /dev/null +++ b/src/modules/DialView.h @@ -0,0 +1,61 @@ +// Copyright 2004 "Gilles Degottex" + +// This file is part of "fmit" + +// "fmit" 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. +// +// "fmit" 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 + +#ifndef _DialView_h_ +#define _DialView_h_ + +#include +#include +#include +#include +#include "View.h" + +class DialView : public QFrame, public View +{ + Q_OBJECT + + virtual void drawContents(QPainter* p); + virtual void mouseReleaseEvent(QMouseEvent* e){View::mouseReleaseEvent(e);} + void drawTextTickCent(QPainter& p, int bigw, int bigh, int r); + void drawTicksCent(QPainter& p, int bigw, int bigh, int r, int ticks_size, int h); + void drawTextTickFrac(QPainter& p, int bigw, int bigh, int num, int den); + void drawTicksFrac(QPainter& p, int bigw, int bigh, float r, int ticks_size, int h); + + float m_error; + + public: + DialView(QWidget* parent); + + void setError(float error); + + float m_min_error; + float m_max_error; + float m_avg_error; + + // settings + QAction* setting_showTolerance; + QAction* setting_showTrace; + QAction* setting_useCents; + QSpinBox* setting_spinScale; + virtual void save(); + virtual void load(); + virtual void clearSettings(); +}; + +#endif // _DialView_h_ + diff --git a/src/modules/GLErrorHistory.cpp b/src/modules/GLErrorHistory.cpp new file mode 100644 index 0000000..3ae6b23 --- /dev/null +++ b/src/modules/GLErrorHistory.cpp @@ -0,0 +1,534 @@ +// Copyright 2004 "Gilles Degottex" + +// This file is part of "fmit" + +// "fmit" 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. +// +// "fmit" 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 + +#include "GLErrorHistory.h" + +static const unsigned char g_icon_error_graph[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, + 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7a, 0x7a, 0xf4, 0x00, 0x00, 0x06, + 0xa7, 0x49, 0x44, 0x41, 0x54, 0x78, 0x9c, 0xad, 0x96, 0x6b, 0x6c, 0x14, + 0xe7, 0x15, 0x86, 0x9f, 0x99, 0xd9, 0x9d, 0xdd, 0xf1, 0xda, 0x2c, 0xbe, + 0xc6, 0x18, 0x63, 0x9b, 0xa4, 0x4d, 0x7c, 0x81, 0x60, 0x70, 0x1a, 0x1b, + 0x5a, 0xe3, 0xc4, 0x24, 0xa4, 0xa2, 0x11, 0x25, 0x40, 0x12, 0x88, 0x94, + 0x0b, 0xa9, 0x22, 0x15, 0xa5, 0x37, 0x45, 0x95, 0xaa, 0x26, 0x52, 0x2a, + 0x35, 0x45, 0x55, 0xd3, 0x4a, 0xa1, 0x6d, 0x54, 0x1a, 0xa9, 0x09, 0x71, + 0x83, 0x52, 0xe4, 0x34, 0x8d, 0x9a, 0x90, 0xd0, 0x48, 0x34, 0xa9, 0xb9, + 0xd8, 0x01, 0x92, 0x62, 0xa8, 0xb9, 0x18, 0xb1, 0x06, 0xdb, 0x05, 0x7b, + 0xd7, 0x7b, 0xf1, 0xee, 0xec, 0xce, 0xee, 0xec, 0xee, 0xcc, 0xf4, 0x87, + 0xed, 0x05, 0x5f, 0xb0, 0x37, 0xd0, 0xf7, 0xdf, 0x9c, 0xf9, 0xbe, 0xf3, + 0x3e, 0x73, 0xe6, 0x3b, 0x67, 0x06, 0xbe, 0xbc, 0x5c, 0xc0, 0x36, 0xa0, + 0x43, 0x90, 0x65, 0x43, 0x94, 0xe5, 0xa4, 0x20, 0x49, 0x1a, 0xa0, 0x02, + 0x67, 0x81, 0xe7, 0x80, 0x82, 0x6c, 0x93, 0x09, 0x5f, 0xd2, 0xfc, 0x6b, + 0x40, 0x7b, 0xcd, 0x13, 0x4f, 0x56, 0x55, 0xaf, 0x5b, 0x4f, 0x61, 0xe9, + 0x02, 0xf2, 0x9d, 0x06, 0x05, 0x8e, 0x34, 0x45, 0x4e, 0x0b, 0x77, 0xca, + 0x45, 0xe7, 0xfe, 0x7f, 0xf1, 0xfa, 0xcb, 0xbf, 0x4a, 0xa8, 0x81, 0xe0, + 0x5e, 0xe0, 0x79, 0x60, 0xe8, 0xff, 0x05, 0xf0, 0x03, 0xa5, 0xa8, 0xf8, + 0xd7, 0x6b, 0x7f, 0xfb, 0xaa, 0x5c, 0x52, 0x5e, 0x01, 0xc0, 0x7c, 0x47, + 0x3a, 0x63, 0xde, 0x50, 0xb4, 0x98, 0x65, 0x85, 0x95, 0xf4, 0x45, 0xbc, + 0x9c, 0x09, 0x0d, 0xb1, 0xe7, 0xbd, 0x7d, 0xbc, 0xf3, 0xdc, 0x8b, 0x17, + 0x80, 0x35, 0xc0, 0xc0, 0xcd, 0x00, 0xb8, 0x81, 0x37, 0x16, 0x36, 0xb7, + 0x6c, 0xbc, 0xf7, 0x85, 0x9f, 0xa1, 0x28, 0xca, 0xac, 0xe6, 0x1e, 0xd5, + 0x47, 0x5f, 0x64, 0x04, 0x35, 0x25, 0xf2, 0xf9, 0x17, 0xbd, 0xbc, 0xf3, + 0xcc, 0xb3, 0x03, 0x98, 0xe6, 0x1a, 0xe0, 0xc2, 0x8d, 0x00, 0x34, 0x00, + 0xed, 0x4d, 0x3f, 0x79, 0xfe, 0xd6, 0x87, 0xb7, 0x3c, 0x46, 0xb1, 0x53, + 0xc6, 0xb2, 0xc0, 0x69, 0x33, 0x71, 0xd9, 0x41, 0x92, 0x12, 0x94, 0x2a, + 0xf3, 0xb9, 0xb3, 0xb0, 0x62, 0x9a, 0x79, 0x34, 0x25, 0xa1, 0x26, 0x25, + 0x3c, 0x17, 0x06, 0xd8, 0xf7, 0xf4, 0xe3, 0x43, 0x96, 0x61, 0x54, 0x03, + 0x91, 0xa9, 0x06, 0xd2, 0x2c, 0xe6, 0xad, 0x39, 0xf9, 0xf9, 0x9f, 0x7c, + 0xf7, 0xf5, 0xdd, 0xc5, 0x77, 0x35, 0x36, 0xd2, 0xd9, 0x77, 0x81, 0xfd, + 0xbd, 0xe7, 0xe8, 0xea, 0xbf, 0xc4, 0xa1, 0x8b, 0xfd, 0x7c, 0xe2, 0xe9, + 0x27, 0x9e, 0x80, 0xa5, 0x45, 0x65, 0xa4, 0x2c, 0x9d, 0x8b, 0xaa, 0x0f, + 0xcf, 0x14, 0xf3, 0x68, 0x4a, 0xc4, 0x12, 0x20, 0x21, 0x8a, 0x79, 0xc1, + 0x53, 0x27, 0x83, 0x40, 0x67, 0xb6, 0x15, 0xa8, 0x05, 0x3a, 0x1f, 0xf8, + 0xc5, 0x0e, 0x77, 0xb4, 0xac, 0x8c, 0x68, 0x32, 0x49, 0x5a, 0x55, 0x89, + 0x75, 0x9f, 0xc2, 0x8a, 0x69, 0x98, 0x9a, 0x86, 0x63, 0x71, 0x25, 0xca, + 0x92, 0x3a, 0x44, 0xbb, 0x9d, 0x62, 0x45, 0xe1, 0xd1, 0xea, 0x0a, 0xc2, + 0x76, 0x83, 0xb0, 0x61, 0xcb, 0x98, 0xab, 0xe1, 0x51, 0xd4, 0x48, 0x98, + 0x50, 0xc0, 0x4f, 0xd7, 0x8f, 0xbe, 0x7f, 0x19, 0x58, 0x0c, 0xa4, 0xb2, + 0xa9, 0xc0, 0xde, 0x82, 0xe6, 0xe6, 0x1a, 0xa9, 0xa9, 0x89, 0x78, 0x2c, + 0x46, 0xe8, 0xc3, 0x7f, 0xe0, 0xfa, 0xfc, 0x2c, 0x1b, 0x97, 0xad, 0xa5, + 0xb1, 0xe2, 0x4e, 0x56, 0xd7, 0x34, 0x92, 0x3b, 0x12, 0xe7, 0xd2, 0x81, + 0xfd, 0xa8, 0x97, 0x2e, 0x62, 0xdc, 0x5a, 0x45, 0xb7, 0x2f, 0x44, 0xa9, + 0x6e, 0x92, 0xb0, 0xe7, 0xa0, 0x9a, 0xf6, 0x8c, 0xb9, 0x1a, 0x09, 0xa3, + 0x45, 0x55, 0xd2, 0x02, 0xf3, 0xb4, 0xbe, 0x3e, 0x0f, 0x70, 0x72, 0x2e, + 0x80, 0x66, 0xb9, 0xa8, 0xf8, 0xe7, 0x55, 0xdb, 0xb7, 0x23, 0x88, 0x22, + 0xe1, 0xdd, 0x7b, 0xd8, 0xd6, 0xb2, 0x95, 0xef, 0x3c, 0xb1, 0x9d, 0x15, + 0x2b, 0x6a, 0x39, 0x7a, 0xf4, 0x63, 0x62, 0xb1, 0x00, 0x0f, 0x7e, 0xeb, + 0x51, 0x9a, 0xef, 0xbe, 0x8f, 0x5c, 0x4d, 0xe2, 0x8b, 0xf7, 0xdf, 0xc6, + 0x56, 0x57, 0xcd, 0x25, 0x3d, 0x85, 0xe3, 0xca, 0x30, 0xba, 0xcd, 0x8e, + 0x1a, 0x8b, 0xa2, 0x46, 0xc2, 0x44, 0xc7, 0x41, 0x8c, 0xbc, 0x3c, 0xa2, + 0xc7, 0x8f, 0xbb, 0x81, 0xb6, 0x6b, 0xcd, 0x6c, 0x33, 0x00, 0x7c, 0xbb, + 0x60, 0xd5, 0x4a, 0x24, 0x87, 0x03, 0x7f, 0xfb, 0x5f, 0x79, 0x7c, 0xcd, + 0x56, 0x36, 0x6d, 0x5e, 0xc7, 0x6d, 0xb7, 0x15, 0xe2, 0x70, 0xd8, 0x40, + 0xd8, 0x4a, 0x30, 0x10, 0xa7, 0xb8, 0x30, 0x07, 0x3d, 0x21, 0x73, 0x4f, + 0xeb, 0x7d, 0xb8, 0xdd, 0xf9, 0xbc, 0xf6, 0xa7, 0x9d, 0x14, 0x3e, 0xb3, + 0x8d, 0x5e, 0x01, 0xf2, 0x7b, 0x4e, 0x91, 0x2c, 0x2e, 0xce, 0x98, 0xab, + 0x91, 0x30, 0xa6, 0x69, 0xc2, 0xd8, 0xa1, 0x16, 0x00, 0x6b, 0xc2, 0x4c, + 0x9c, 0x01, 0xe0, 0xeb, 0xae, 0xaf, 0x7c, 0x95, 0x64, 0x28, 0x44, 0x55, + 0x5a, 0x61, 0xf3, 0xa6, 0x0d, 0xd4, 0x2d, 0x29, 0xc5, 0x66, 0x13, 0x39, + 0x77, 0xda, 0xcb, 0xe5, 0xc1, 0x20, 0xa1, 0x40, 0x00, 0x41, 0x10, 0x70, + 0x2a, 0x76, 0x4a, 0x0a, 0x73, 0x58, 0xde, 0xd0, 0xc0, 0xa6, 0x96, 0xc7, + 0x88, 0x1e, 0x3c, 0x82, 0x21, 0xcb, 0xf8, 0xbc, 0x43, 0x44, 0x02, 0xfe, + 0x8c, 0xb9, 0x91, 0x4e, 0x63, 0x99, 0x26, 0x82, 0x2c, 0xcf, 0x03, 0x1c, + 0xd7, 0x9a, 0x4d, 0x05, 0x70, 0x22, 0x49, 0x2b, 0x72, 0xaa, 0xaa, 0xd0, + 0x4f, 0xf5, 0xf0, 0xc0, 0xbd, 0x0f, 0x72, 0x7b, 0x4d, 0x09, 0x96, 0x05, + 0x9e, 0xf3, 0x7e, 0xd2, 0x69, 0x93, 0xe1, 0xe1, 0xcb, 0x78, 0x2e, 0x9e, + 0x07, 0x40, 0x10, 0xa0, 0xe4, 0x96, 0x3c, 0xf2, 0xdd, 0x4e, 0x56, 0x35, + 0xad, 0xc1, 0x3a, 0x77, 0x01, 0x33, 0x99, 0xc4, 0x28, 0x2f, 0xc7, 0x77, + 0xba, 0x27, 0x63, 0x9e, 0x91, 0x30, 0xfd, 0xcc, 0x4f, 0x05, 0x58, 0xa6, + 0x2c, 0x2c, 0x97, 0x45, 0x59, 0xc6, 0x3c, 0xdf, 0xc7, 0x82, 0x85, 0xb7, + 0xf0, 0xca, 0xce, 0x97, 0x09, 0x87, 0xe2, 0x24, 0x93, 0x06, 0x00, 0xf1, + 0xb8, 0x86, 0xaa, 0x8e, 0xb5, 0xb3, 0x53, 0xb1, 0x53, 0x54, 0xe2, 0x42, + 0x71, 0xda, 0xc8, 0xcd, 0x93, 0x59, 0xd7, 0xfc, 0x30, 0x91, 0x23, 0x9d, + 0xd8, 0x0b, 0x0b, 0x11, 0xe7, 0xcf, 0x9f, 0x6c, 0x7e, 0x1d, 0x4d, 0x05, + 0x50, 0x44, 0xe7, 0x58, 0x85, 0x72, 0x45, 0x99, 0x25, 0xb5, 0xb7, 0x53, + 0x5f, 0x5f, 0x4f, 0x28, 0xa8, 0x65, 0x16, 0x24, 0x12, 0xf1, 0x0c, 0x40, + 0x5c, 0x4b, 0xe1, 0x39, 0xef, 0x47, 0x92, 0x44, 0x72, 0x5d, 0x32, 0xf5, + 0x4b, 0x57, 0x62, 0xf6, 0xff, 0x17, 0x80, 0x9c, 0xca, 0xca, 0x39, 0xcd, + 0x67, 0x02, 0xc8, 0x28, 0x6d, 0x99, 0xe4, 0xe5, 0xb9, 0x59, 0xbf, 0x7e, + 0x3d, 0xb1, 0xa8, 0x3e, 0x19, 0x20, 0x3a, 0x6d, 0xa0, 0x61, 0xb3, 0x09, + 0x28, 0x2e, 0x17, 0x42, 0x72, 0xec, 0xa9, 0x45, 0x69, 0xb6, 0x19, 0x97, + 0x05, 0x80, 0x6e, 0xa5, 0xd1, 0xb4, 0x24, 0xa9, 0x94, 0x81, 0x65, 0x5d, + 0x8d, 0xcb, 0x0e, 0x07, 0x47, 0x8f, 0x1d, 0xe2, 0x44, 0xf7, 0xb1, 0x49, + 0xeb, 0xaf, 0x5c, 0x19, 0xa0, 0xa7, 0xa7, 0x13, 0x9b, 0x38, 0x66, 0x6c, + 0x61, 0x91, 0x8d, 0x66, 0x6a, 0x43, 0x00, 0xd2, 0x36, 0x89, 0xe1, 0xe1, + 0x20, 0x91, 0xd1, 0xa2, 0x49, 0xf1, 0x75, 0xdf, 0x7c, 0x88, 0xbb, 0x56, + 0x34, 0xb1, 0xef, 0xa3, 0xbf, 0xf1, 0xf7, 0x0f, 0xda, 0x69, 0x59, 0x7d, + 0x3f, 0xf7, 0xac, 0x5e, 0x4b, 0x34, 0x16, 0x65, 0x68, 0x68, 0x80, 0xb4, + 0x31, 0xfe, 0xde, 0xb3, 0xf3, 0xbf, 0x3e, 0x80, 0xdc, 0xd8, 0xc0, 0x5f, + 0xda, 0xdb, 0xa8, 0xac, 0xfc, 0xf1, 0xb4, 0x7b, 0x25, 0x25, 0x0b, 0x78, + 0xfa, 0xa9, 0x67, 0x01, 0xe8, 0x39, 0x7d, 0x82, 0xbd, 0xed, 0xbb, 0x51, + 0x72, 0x0a, 0xa9, 0xaa, 0x5c, 0x8a, 0x18, 0xe8, 0x1d, 0x07, 0xc8, 0x8e, + 0xe0, 0xba, 0xaf, 0x20, 0xb7, 0xb6, 0x86, 0xce, 0xb3, 0x9f, 0x31, 0xe2, + 0x0b, 0xcf, 0x9a, 0x60, 0x49, 0xdd, 0x72, 0x36, 0x6f, 0x7c, 0x92, 0xba, + 0xda, 0x55, 0x1c, 0x39, 0xf6, 0x31, 0xf6, 0x65, 0x75, 0x59, 0x19, 0xcf, + 0x09, 0x00, 0x60, 0xfb, 0x46, 0x23, 0x3b, 0xff, 0xf0, 0x0a, 0x09, 0xfd, + 0x6a, 0x3b, 0xf9, 0x46, 0x86, 0x09, 0x06, 0xfd, 0x99, 0x6b, 0xcb, 0xb4, + 0x08, 0x8c, 0xc6, 0xf1, 0x0e, 0x07, 0x38, 0x3d, 0xf8, 0x1f, 0x94, 0xf1, + 0xd3, 0x6f, 0xdd, 0x6c, 0x05, 0x00, 0x72, 0x97, 0xd4, 0x71, 0xc6, 0xa5, + 0xf3, 0xcb, 0xdf, 0xec, 0x40, 0xd3, 0x92, 0x58, 0x16, 0xec, 0xfb, 0xf0, + 0x5d, 0xfe, 0xf9, 0xe9, 0x7e, 0x00, 0x52, 0x29, 0x83, 0x40, 0x48, 0xc3, + 0x3b, 0x1c, 0xe6, 0x77, 0x6f, 0xbc, 0x88, 0xfb, 0x91, 0x87, 0x10, 0x66, + 0x18, 0x36, 0xb3, 0x3e, 0xe4, 0x5c, 0x0b, 0xf2, 0x5a, 0x9a, 0x39, 0xdd, + 0x75, 0x94, 0x1f, 0xfe, 0xf4, 0x7b, 0x6c, 0xd9, 0xb0, 0x8d, 0xd6, 0xd6, + 0x8d, 0x88, 0xa2, 0x88, 0x2f, 0x10, 0x23, 0x12, 0xd1, 0xe9, 0x3e, 0xf1, + 0x6f, 0xde, 0xde, 0xb7, 0x0b, 0xdb, 0xea, 0x26, 0x9c, 0x65, 0x65, 0x57, + 0x37, 0x66, 0x59, 0x81, 0xa9, 0x00, 0x96, 0xee, 0xf5, 0xa2, 0x9e, 0x3b, + 0x4b, 0x5e, 0x75, 0x4d, 0x26, 0x98, 0xbb, 0xb2, 0x91, 0xd8, 0x1d, 0x41, + 0x7e, 0xff, 0xe9, 0x5b, 0x88, 0x7b, 0xbc, 0x28, 0x0e, 0x17, 0xa6, 0x65, + 0x92, 0x36, 0xd3, 0xe8, 0xc5, 0xf3, 0x99, 0xf7, 0xd4, 0x16, 0x6c, 0x2e, + 0xd7, 0xe4, 0x44, 0x59, 0xb6, 0xc1, 0xd4, 0x7a, 0x09, 0xc0, 0x26, 0xe0, + 0xa5, 0xdc, 0x3b, 0xaa, 0xab, 0x4b, 0x37, 0x6c, 0xc0, 0xb5, 0x78, 0xf1, + 0xe4, 0xc4, 0xa6, 0x89, 0x65, 0x18, 0x88, 0x76, 0xfb, 0xac, 0x89, 0x63, + 0x7e, 0x3f, 0xa3, 0x03, 0xfd, 0x93, 0x62, 0x81, 0xb6, 0x36, 0x2c, 0x5d, + 0x57, 0x80, 0xc4, 0x44, 0x6c, 0xa6, 0x71, 0x75, 0x06, 0xf8, 0x63, 0x32, + 0xe0, 0xbf, 0x14, 0x3c, 0x72, 0x78, 0x79, 0x7c, 0x70, 0xd0, 0xed, 0x2c, + 0x2b, 0xc3, 0x3e, 0x6f, 0xde, 0x18, 0xa1, 0x20, 0x20, 0x64, 0x31, 0xe5, + 0x52, 0x5a, 0x8c, 0x44, 0x78, 0x72, 0x07, 0xc5, 0x4f, 0x9e, 0x04, 0xc3, + 0xd8, 0x01, 0x64, 0x4e, 0xf5, 0xf5, 0x32, 0x59, 0x40, 0x37, 0xb0, 0x4b, + 0xf7, 0x7a, 0x47, 0x02, 0x87, 0x0e, 0x36, 0xe8, 0x3e, 0x9f, 0x4b, 0x29, + 0x2f, 0x9f, 0x56, 0xea, 0xeb, 0x29, 0x19, 0xd3, 0xd0, 0x23, 0x57, 0x01, + 0x04, 0x49, 0x22, 0x76, 0xfc, 0xb8, 0x85, 0x65, 0xbd, 0x04, 0x18, 0x73, + 0x01, 0x4c, 0xc8, 0x00, 0x8e, 0x02, 0xbb, 0x12, 0x97, 0x2f, 0x6b, 0xfe, + 0x83, 0x1d, 0x0d, 0xe9, 0x70, 0xd8, 0xa9, 0x2c, 0x5a, 0x84, 0xe4, 0x74, + 0xce, 0x0e, 0xa0, 0xc5, 0xd0, 0x23, 0xe3, 0xdf, 0x0c, 0x41, 0x20, 0xd1, + 0xd5, 0x45, 0x72, 0x68, 0xe8, 0x05, 0xa0, 0xe3, 0xda, 0x75, 0xd9, 0x7d, + 0x31, 0xc6, 0x7e, 0x24, 0x0f, 0x61, 0x59, 0xaf, 0xc5, 0xfb, 0xfb, 0xf1, + 0x77, 0x74, 0xac, 0x30, 0xe2, 0x71, 0xbb, 0x52, 0x59, 0x89, 0x28, 0xcb, + 0x33, 0x03, 0xc4, 0xae, 0x02, 0x18, 0x7d, 0x17, 0x89, 0x74, 0x75, 0xb6, + 0x01, 0xd3, 0xc6, 0x6a, 0xb6, 0x00, 0x13, 0x4a, 0x00, 0x07, 0x30, 0xcd, + 0xdd, 0x5a, 0x9f, 0x47, 0x09, 0x1c, 0xec, 0xa8, 0xb7, 0x0c, 0x53, 0x52, + 0x2a, 0x2a, 0x10, 0x6d, 0x93, 0x1b, 0x2a, 0x19, 0x8d, 0xa2, 0xab, 0x11, + 0x84, 0x70, 0x84, 0xc0, 0x07, 0xef, 0x1f, 0x04, 0x1e, 0xe1, 0x9a, 0xd2, + 0xdf, 0x28, 0xc0, 0x84, 0xa2, 0xc0, 0x47, 0x56, 0x3a, 0xbd, 0x27, 0x76, + 0xbe, 0xb7, 0x20, 0x70, 0xf8, 0xf0, 0x52, 0x41, 0x94, 0x04, 0x65, 0xd1, + 0xa2, 0xcc, 0x01, 0xd5, 0x63, 0x51, 0xd2, 0xe1, 0x30, 0xbe, 0xb7, 0xfe, + 0xec, 0x01, 0xee, 0x1f, 0xdf, 0x33, 0x4d, 0x37, 0x0a, 0x30, 0xa1, 0x51, + 0xe0, 0x3d, 0x2b, 0x99, 0x7c, 0x57, 0x3d, 0x73, 0xa6, 0x2c, 0xf4, 0x59, + 0x57, 0xb5, 0xe8, 0x74, 0x22, 0x17, 0x14, 0x10, 0x1f, 0x1c, 0x60, 0xe8, + 0xcd, 0x37, 0x47, 0x31, 0x8c, 0x56, 0x60, 0xf0, 0x26, 0x7d, 0xb2, 0xd6, + 0xdd, 0xc0, 0x81, 0x71, 0xb0, 0x6e, 0xa0, 0x75, 0xae, 0x0d, 0xff, 0x03, + 0xed, 0xb9, 0xfb, 0x1d, 0x80, 0xeb, 0x9a, 0x91, 0x00, 0x00, 0x00, 0x00, + 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 +}; + +#include +#include +using namespace std; +#include +#include +#include +#include +#include + +void GLErrorHistory::Note::init() +{ + min_err = numeric_limits::max(); + max_err = -numeric_limits::max(); + avg_err = 0.0f; +} +GLErrorHistory::Note::Note(int h) + : ht(h) +{ + init(); +} +GLErrorHistory::Note::Note(int h, int num, int den) + : ht(h) +{ + init(); + factor = QString::number(num)+"/"+QString::number(den); +} +GLErrorHistory::Note::Note(int h, float cents) + : ht(h) +{ + init(); + factor = QString::number(cents); +} +QString GLErrorHistory::Note::getName() const +{ + return Music::h2n(ht)+factor; +} +void GLErrorHistory::Note::addError(float err) +{ + min_err = (errmax_err)?err:max_err; + + if(!errors.empty()) + avg_err *= errors.size(); + + errors.push_back(err); + + avg_err += err; + avg_err /= errors.size(); +} + +GLErrorHistory::GLErrorHistory(QWidget* parent) +: QGLWidget(parent, "GLErrorHistory") +, View("Error history", this) +{ + // settings + QImage img; + img.loadFromData(g_icon_error_graph, sizeof(g_icon_error_graph), "PNG"); + setting_show->setIconSet(QIconSet(QImage(img))); + setting_show->setOn(true); + + setting_keep = new QAction(this); + setting_keep->setMenuText(tr("Keep previous notes")); + setting_keep->setToggleAction(true); + setting_keep->setOn(false); + connect(setting_keep, SIGNAL(toggled(bool)), this, SLOT(keepPreviousNotes(bool))); +// setting_keep->addTo(&m_popup_menu); + + ui_notesNameMenu = new QPopupMenu(this); + ui_notesNameMenu->insertItem(tr("Anglo-saxon"), Music::LOCAL_ANGLO); + ui_notesNameMenu->connectItem(int(Music::LOCAL_ANGLO), this, SLOT(selectNotesNames(int))); + ui_notesNameMenu->insertItem(tr("Latin"), Music::LOCAL_LATIN); + ui_notesNameMenu->connectItem(int(Music::LOCAL_LATIN), this, SLOT(selectNotesNames(int))); + ui_notesNameMenu->setCheckable(true); + ui_notesNameMenu->setItemChecked(int(Music::GetNotesName()), true); +// m_popup_menu.insertItem("Notes names", ui_notesNameMenu); + + setting_useCents = new QAction(this); + setting_useCents->setMenuText(tr("Use cents")); + setting_useCents->setToggleAction(true); + setting_useCents->setOn(true); + connect(setting_useCents, SIGNAL(toggled(bool)), this, SLOT(update())); + setting_useCents->addTo(&m_popup_menu); + + m_popup_menu.insertItem(new Title(tr("Scale range"), &m_popup_menu)); + setting_spinScale = new QSpinBox(5, 50, 1, &m_popup_menu); + setting_spinScale->setValue(50); + QToolTip::add(setting_spinScale, tr("Scale range (in cents)")); + connect(setting_spinScale, SIGNAL(valueChanged(int)), this, SLOT(update())); + m_popup_menu.insertItem(setting_spinScale); +} + +void GLErrorHistory::save() +{ + s_settings->writeEntry("keep", setting_keep->isOn()); +// s_settings->writeEntry("notesNames", int(Music::GetNotesName())); + s_settings->writeEntry("useCents", setting_useCents->isOn()); + s_settings->writeEntry("spinScale", setting_spinScale->value()); +} +void GLErrorHistory::load() +{ + setting_keep->setOn(s_settings->readBoolEntry("keep", setting_keep->isOn())); +// selectNotesNames(s_settings->readNumEntry("notesNames", int(Music::GetNotesName()))); + setting_useCents->setOn(s_settings->readBoolEntry("useCents", setting_useCents->isOn())); + setting_spinScale->setValue(s_settings->readNumEntry("spinScale", setting_spinScale->value())); +} +void GLErrorHistory::clearSettings() +{ +// cerr << "GLErrorHistory::clearSettings" << endl; + s_settings->removeEntry("keep"); + s_settings->removeEntry("notesNames"); + s_settings->removeEntry("useCents"); + s_settings->removeEntry("spinScale"); +} + +void GLErrorHistory::addNote(GLErrorHistory::Note note) +{ + m_notes.push_back(note); + + if(!setting_keep->isOn()) + while(m_notes.size()>1) + m_notes.pop_front(); +} +void GLErrorHistory::addError(float err) +{ + m_notes.back().addError(err); +} + +void GLErrorHistory::keepPreviousNotes(bool keep) +{ + if(!keep) + while(m_notes.size()>1) + m_notes.pop_front(); +} + +void GLErrorHistory::selectNotesNames(int id) +{ + for(int i=0; icount()); i++) + ui_notesNameMenu->setItemChecked(ui_notesNameMenu->idAt(i), id==ui_notesNameMenu->idAt(i)); + + Music::SetNotesName((Music::NotesName)id); + + updateGL(); +} + +void GLErrorHistory::initializeGL() +{ + // Set the clear color to black + glClearColor(1.0, 1.0, 1.0, 0.0); + + // glShadeModel( GL_FLAT ); + glShadeModel( GL_SMOOTH ); + + glLoadIdentity(); +} + +void GLErrorHistory::drawTicksCent(int r, int ticks_size) +{ + // only work within range that is a pure multiple of r + float range = int(setting_spinScale->value()/r)*r; + + float scale = 50.0f/setting_spinScale->value(); + if((height()-ticks_size)*r/100.0f*scale>2) + { + for(float i=-range; i<=range; i+=r) + { + int y = int(height()*i/100.0f*scale) + height()/2; + glVertex2i(ticks_size, y); + glVertex2i(width(), y); + } + } +} +void GLErrorHistory::drawTextTickCent(int r, int dy) +{ + // only work within range that is a pure multiple of r + int range = int(setting_spinScale->value()/r)*r; + + float scale = 50.0f/setting_spinScale->value(); + QString txt; + for(int i=-range; i=0) txt = QString(" ")+txt; + if(i==0) txt = QString(" ")+txt; + glRasterPos2i(2, int(height()*i/100.0f*scale) + height()/2 - dy); + for(size_t i=0; iisOn()) + { + glBegin(GL_LINES); + float gray = 0.87; +// glColor3f(gray, gray, gray); +// drawTicksCent(1, ticks_size); + gray = 0.875; + glColor3f(gray, gray, gray); + drawTicksCent(2, ticks_size); + gray = 0.75; + glColor3f(gray, gray, gray); + drawTicksCent(10, ticks_size); + glEnd(); + } + else + { + glBegin(GL_LINES); + float gray = 0.5; + glColor3f(gray, gray, gray); + glVertex2i(ticks_size, height()/2); + glVertex2i(width(), height()/2); + gray = 0.75; + glColor3f(gray, gray, gray); + glVertex2i(ticks_size, height()/4); + glVertex2i(width(), height()/4); + glVertex2i(ticks_size, 3*height()/4); + glVertex2i(width(), 3*height()/4); + gray = 0.87; + glColor3f(gray, gray, gray); + glVertex2i(ticks_size, height()/8); + glVertex2i(width(), height()/8); + glVertex2i(ticks_size, 7*height()/8); + glVertex2i(width(), 7*height()/8); + glVertex2i(ticks_size, 3*height()/8); + glVertex2i(width(), 3*height()/8); + glVertex2i(ticks_size, 5*height()/8); + glVertex2i(width(), 5*height()/8); + glEnd(); + } + + // text marks + float gray = 0.5; + glColor3f(gray, gray, gray); + if(setting_useCents->isOn()) + { + int grad = 10; + if(setting_spinScale->value() <= 25) grad=5; + if(setting_spinScale->value() <= 10) grad=1; + drawTextTickCent(grad, dy); + } + else + { + string sfraq, sufraq; + sufraq = string("1/")+QString::number(int(50/setting_spinScale->value())*2).latin1(); + sfraq = string("+")+sufraq; + glRasterPos2i(2, 3*height()/4-dy); + for(size_t i = 0; i < sfraq.size(); i++) + glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, sfraq[i]); + sfraq = string("-")+sufraq; + glRasterPos2i(2, height()/4-dy); + for(size_t i = 0; i < sfraq.size(); i++) + glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, sfraq[i]); + + sufraq = string("1/")+QString::number(int(50/setting_spinScale->value())*4).latin1(); + sfraq = string("+")+sufraq; + glRasterPos2i(2, 5*height()/8-dy); + for(size_t i = 0; i < sfraq.size(); i++) + glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, sfraq[i]); + sfraq = string("-")+sufraq; + glRasterPos2i(2, 3*height()/8-dy); + for(size_t i = 0; i < sfraq.size(); i++) + glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, sfraq[i]); + } + + // errors + if(!m_notes.empty()) + { + int total_size = 0; + for(size_t i=0; i +using namespace std; +#include +#include +#include +#include +class QTimer; +#include +#include "View.h" + +class GLErrorHistory : public QGLWidget, public View +{ + Q_OBJECT + + virtual void mouseReleaseEvent(QMouseEvent* e){View::mouseReleaseEvent(e);} + + void drawTicksCent(int r, int ticks_size); + void drawTextTickCent(int r, int dy); + + public: + GLErrorHistory(QWidget* parent); + + struct Note + { + int ht; + QString factor; + float min_err; + float max_err; + float avg_err; + deque errors; + void init(); + Note(int h); + Note(int h, int num, int den); + Note(int h, float cents); + void addError(float err); + QString getName() const; + }; + deque m_notes; + void addNote(GLErrorHistory::Note note); + void addError(float err); + + // settings + QAction* setting_keep; + QAction* setting_useCents; + QSpinBox* setting_spinScale; + QPopupMenu* ui_notesNameMenu; + virtual void save(); + virtual void load(); + virtual void clearSettings(); + + public slots: + void initializeGL(); + void paintGL(); + void resizeGL( int w, int h ); + void keepPreviousNotes(bool keep); + void selectNotesNames(int id); +}; + +#endif // _GLErrorHistory_h_ + diff --git a/src/modules/GLFT.cpp b/src/modules/GLFT.cpp new file mode 100644 index 0000000..bbde0d6 --- /dev/null +++ b/src/modules/GLFT.cpp @@ -0,0 +1,411 @@ +// Copyright 2004 "Gilles Degottex" + +// This file is part of "fmit" + +// "fmit" 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. +// +// "fmit" 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 + +#include "GLFT.h" + +static const unsigned char g_icon_FT[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, + 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7a, 0x7a, 0xf4, 0x00, 0x00, 0x06, + 0x77, 0x49, 0x44, 0x41, 0x54, 0x58, 0x85, 0xb5, 0x97, 0x6b, 0x6c, 0x9b, + 0x57, 0x19, 0xc7, 0x7f, 0xe7, 0xf5, 0xe5, 0x75, 0xec, 0xdc, 0xec, 0xdc, + 0x5a, 0x27, 0x69, 0x9c, 0x5b, 0xd3, 0xac, 0x6d, 0xda, 0xa8, 0x59, 0x27, + 0x51, 0x79, 0x43, 0x30, 0x09, 0x56, 0x90, 0xcb, 0x84, 0x26, 0x04, 0x15, + 0x6c, 0x1f, 0x80, 0x08, 0x89, 0x0f, 0xa8, 0x20, 0x4d, 0x9a, 0x26, 0xa1, + 0xed, 0x0b, 0xda, 0x47, 0xd6, 0x0f, 0x93, 0x25, 0x10, 0xeb, 0xb6, 0x0a, + 0x06, 0xa2, 0x13, 0x06, 0x15, 0x16, 0x28, 0x2c, 0x58, 0x29, 0xbb, 0xa4, + 0x4b, 0xda, 0xa6, 0x49, 0xb3, 0xdc, 0x1a, 0xc7, 0x4d, 0x9a, 0xe6, 0x1e, + 0xdb, 0x89, 0xef, 0x87, 0x0f, 0xf6, 0xeb, 0xbc, 0x71, 0xec, 0xad, 0x0c, + 0xf5, 0x2f, 0x1d, 0xbd, 0xe7, 0x7d, 0x7c, 0xce, 0xf3, 0xff, 0xbf, 0xcf, + 0xf3, 0x9c, 0xe3, 0x73, 0x04, 0x0f, 0x01, 0x6e, 0x4f, 0xaf, 0x05, 0xd8, + 0x07, 0x54, 0x01, 0x95, 0xc0, 0x1a, 0x30, 0xe4, 0xf7, 0x79, 0x65, 0xfe, + 0x58, 0xf1, 0x39, 0x9c, 0x2b, 0x40, 0x3d, 0xd0, 0x0c, 0xb8, 0x80, 0x03, + 0x40, 0x43, 0xd6, 0xd6, 0x90, 0x6d, 0x55, 0x05, 0x7c, 0x8f, 0x00, 0x67, + 0xfc, 0x3e, 0xef, 0xb4, 0xde, 0x68, 0x2c, 0x42, 0x62, 0x07, 0xda, 0xb3, + 0x24, 0x5a, 0x73, 0x65, 0x9f, 0x4d, 0x80, 0xb9, 0x98, 0x40, 0xd5, 0x6c, + 0xa6, 0xd4, 0x56, 0x82, 0xcd, 0x56, 0x42, 0xa9, 0xb5, 0x04, 0xd5, 0x6c, + 0x62, 0x7c, 0x2a, 0xc0, 0xd6, 0x76, 0xf4, 0x08, 0x70, 0x0e, 0xf8, 0x71, + 0x41, 0x01, 0x6e, 0x4f, 0xaf, 0x0d, 0xf8, 0x29, 0x70, 0x36, 0x4b, 0x2e, + 0x00, 0x0c, 0x06, 0x85, 0xba, 0x1a, 0x07, 0x35, 0x0e, 0x3b, 0x95, 0x15, + 0xa5, 0x54, 0x56, 0x94, 0x61, 0xaf, 0x28, 0xcb, 0x3d, 0x2b, 0x2a, 0xca, + 0xb0, 0xd9, 0x6c, 0x58, 0xad, 0x36, 0x4c, 0xaa, 0x85, 0x94, 0x54, 0x88, + 0x25, 0xd2, 0xa4, 0x25, 0x18, 0x15, 0x41, 0x53, 0x8d, 0xca, 0xe5, 0x2b, + 0x03, 0xbc, 0x72, 0xfe, 0x4d, 0xb2, 0x1f, 0xc0, 0x1e, 0x01, 0x59, 0xf2, + 0x01, 0xe0, 0x98, 0xa2, 0x28, 0x9c, 0x7a, 0xf4, 0x28, 0x5f, 0x38, 0xd9, + 0x45, 0x57, 0x67, 0x1b, 0xfb, 0xea, 0xaa, 0x49, 0xa4, 0x04, 0x5b, 0xb1, + 0x14, 0x91, 0x58, 0x9a, 0xad, 0x78, 0x9a, 0xad, 0x98, 0xd6, 0x52, 0xcc, + 0x6e, 0xa5, 0x49, 0x85, 0x25, 0x92, 0x14, 0x52, 0x46, 0x90, 0x12, 0x24, + 0x20, 0xa5, 0x44, 0x4a, 0x70, 0x94, 0x19, 0x39, 0xd8, 0x72, 0x40, 0xe3, + 0x6b, 0x2c, 0x28, 0x00, 0xf8, 0x01, 0x70, 0xcc, 0xa0, 0x28, 0x9c, 0xff, + 0xc5, 0xcf, 0x38, 0xd8, 0xd6, 0xcc, 0x9d, 0xfb, 0x31, 0x02, 0x9b, 0x09, + 0xc6, 0x96, 0xc3, 0xa4, 0xd3, 0x32, 0xeb, 0x58, 0xea, 0x08, 0x32, 0x4d, + 0x51, 0x04, 0x42, 0xb0, 0xdb, 0xae, 0xfb, 0x3d, 0x1c, 0x4d, 0xe1, 0xb0, + 0x97, 0x6b, 0x7c, 0xad, 0x6e, 0x4f, 0xaf, 0xd0, 0x17, 0xa3, 0x26, 0xa0, + 0x05, 0xe0, 0x50, 0x7b, 0x13, 0x1d, 0x6d, 0xcd, 0x0c, 0x4e, 0x87, 0x89, + 0xc6, 0x33, 0x61, 0x34, 0x28, 0xa0, 0x08, 0xb1, 0xc7, 0x71, 0xee, 0x2b, + 0x01, 0x29, 0xc5, 0x2e, 0x3b, 0x40, 0x5a, 0x02, 0x12, 0x62, 0x71, 0xc9, + 0xfe, 0xda, 0x72, 0x2c, 0xaa, 0x99, 0x68, 0x2c, 0x6e, 0x05, 0x9c, 0xc0, + 0x5d, 0x4d, 0x80, 0xa2, 0x17, 0xb2, 0xaf, 0xae, 0x9a, 0xf9, 0xb5, 0x38, + 0xc9, 0x54, 0x26, 0x7f, 0xb9, 0x66, 0x10, 0x18, 0x0d, 0xe8, 0xfa, 0x3a, + 0x7b, 0xa1, 0x31, 0xca, 0xce, 0xfc, 0x58, 0x32, 0x8d, 0x10, 0x82, 0x06, + 0x67, 0xad, 0xc6, 0xd9, 0xa1, 0x4f, 0x81, 0xa2, 0x7f, 0xb1, 0x5a, 0x54, + 0x92, 0x29, 0x99, 0x71, 0x64, 0xd0, 0x93, 0xb1, 0x97, 0xb8, 0x98, 0xa0, + 0xbc, 0xb9, 0x89, 0x64, 0x26, 0x26, 0xae, 0xc6, 0xfd, 0x1a, 0x4d, 0x67, + 0xa1, 0x1a, 0x88, 0x03, 0x58, 0x54, 0x73, 0x6e, 0x22, 0x32, 0x1b, 0xc6, + 0x3d, 0x61, 0x2f, 0x9e, 0xef, 0x42, 0x29, 0x48, 0x66, 0x9d, 0xb4, 0x34, + 0x39, 0x35, 0xce, 0x43, 0x85, 0x04, 0x6c, 0x02, 0xa4, 0xd2, 0x69, 0x4c, + 0xc6, 0xcc, 0xd7, 0xec, 0x12, 0x50, 0x28, 0xf7, 0x52, 0x14, 0x16, 0x24, + 0xf5, 0x02, 0x24, 0x26, 0x43, 0x26, 0xc8, 0xcd, 0x07, 0xea, 0x3f, 0x5b, + 0x40, 0x3c, 0x9e, 0xc0, 0x6c, 0x54, 0x74, 0x11, 0x90, 0x40, 0xb1, 0x02, + 0xcc, 0xef, 0x4b, 0x64, 0x76, 0x2c, 0x40, 0x79, 0x89, 0x81, 0xfa, 0x2a, + 0x33, 0x8e, 0xd2, 0x0c, 0x45, 0xf3, 0x83, 0x44, 0x20, 0x9e, 0x48, 0x62, + 0xca, 0xa6, 0xe0, 0xb7, 0xaf, 0xbf, 0xc3, 0x5c, 0x60, 0x01, 0x00, 0x83, + 0xc1, 0x40, 0xeb, 0x41, 0x17, 0x5f, 0x7e, 0xea, 0x71, 0x54, 0x55, 0x45, + 0x4a, 0xc1, 0xf5, 0xa1, 0x51, 0xae, 0xfc, 0xb5, 0x3f, 0x17, 0x72, 0x8d, + 0xd8, 0xfd, 0x78, 0x37, 0xd1, 0x8d, 0x55, 0x82, 0x81, 0x79, 0x3d, 0x0f, + 0x52, 0x42, 0x70, 0x62, 0x91, 0x86, 0xf6, 0xba, 0x7a, 0xb7, 0xa7, 0xb7, + 0xcc, 0xef, 0xf3, 0x86, 0xf4, 0x02, 0x96, 0x01, 0x22, 0x91, 0x6d, 0x4c, + 0x06, 0x81, 0x90, 0x69, 0x5e, 0xfb, 0xe5, 0x1b, 0x84, 0x42, 0x61, 0xaa, + 0xab, 0x1d, 0x6c, 0x6f, 0x47, 0x59, 0x5d, 0x59, 0xe7, 0xe4, 0xef, 0x2f, + 0xf3, 0xda, 0x85, 0x57, 0x30, 0xab, 0x2a, 0x57, 0x2e, 0xbf, 0xc7, 0x9b, + 0xbf, 0xfe, 0x03, 0x35, 0xb5, 0x55, 0x28, 0x06, 0x05, 0x45, 0x08, 0x0c, + 0x0a, 0x7c, 0xe5, 0x89, 0x47, 0xf8, 0xcd, 0xc5, 0xcb, 0xcc, 0xcf, 0x2f, + 0xb1, 0xb1, 0x11, 0x61, 0x73, 0x33, 0x42, 0x6d, 0xad, 0x1d, 0x55, 0x35, + 0x21, 0x0d, 0x02, 0x32, 0x3b, 0xec, 0x21, 0xe0, 0x23, 0xd8, 0x59, 0x05, + 0xf7, 0x01, 0x36, 0x42, 0x11, 0x8c, 0x06, 0xc1, 0xf2, 0xe2, 0x32, 0xcb, + 0x4b, 0xab, 0x9c, 0xf6, 0x7c, 0x89, 0xbf, 0x0f, 0x5c, 0xe4, 0x5f, 0x1f, + 0xbc, 0xcd, 0xd9, 0xe7, 0xbe, 0xc1, 0x87, 0xff, 0x19, 0xa6, 0xff, 0x1f, + 0x57, 0x31, 0x1a, 0x04, 0xa3, 0x37, 0xc7, 0x29, 0xaf, 0x28, 0xe5, 0x9f, + 0x03, 0x17, 0x98, 0x9c, 0xbc, 0xc4, 0xcc, 0xf4, 0x25, 0x26, 0x27, 0x2f, + 0x71, 0xf6, 0xec, 0x57, 0xe9, 0xef, 0xf7, 0x32, 0x31, 0x71, 0x89, 0xa7, + 0x9f, 0xfe, 0x22, 0x40, 0xee, 0xfd, 0x47, 0x3f, 0xf9, 0xa6, 0x16, 0x90, + 0xc3, 0x5a, 0x47, 0x13, 0xb0, 0x04, 0xb0, 0x19, 0x8e, 0x60, 0x34, 0xc0, + 0xe8, 0xc8, 0x38, 0x00, 0xdd, 0xdd, 0x9d, 0x58, 0x4b, 0xcc, 0x94, 0x97, + 0x59, 0xf9, 0xd6, 0x77, 0xbe, 0x06, 0xc0, 0x8d, 0xa1, 0x51, 0xe2, 0xb1, + 0x28, 0x33, 0x53, 0x01, 0x5a, 0x5b, 0x1b, 0x38, 0x50, 0x6b, 0x25, 0x9d, + 0x4c, 0x10, 0x8b, 0xc5, 0x49, 0x26, 0x53, 0x28, 0x8a, 0x82, 0xaa, 0x9a, + 0x51, 0x55, 0x33, 0xc3, 0xc3, 0x9f, 0x50, 0x5b, 0x6b, 0xa7, 0xb5, 0xb5, + 0x01, 0x55, 0x35, 0xeb, 0xb7, 0xe4, 0x23, 0xf9, 0x35, 0x90, 0x89, 0xc0, + 0x46, 0x18, 0x45, 0x08, 0x46, 0xae, 0x67, 0x04, 0x1c, 0xeb, 0xee, 0xc0, + 0xa8, 0x08, 0x24, 0x12, 0xd5, 0x9c, 0x19, 0x9a, 0x4e, 0x25, 0x89, 0xad, + 0x2f, 0xb3, 0xb6, 0xba, 0x4e, 0x68, 0x33, 0x84, 0xcb, 0x75, 0x26, 0x97, + 0xe7, 0xd3, 0xa7, 0x4f, 0xf1, 0xd6, 0x5b, 0x2f, 0xa3, 0xf9, 0x9a, 0x98, + 0x08, 0x70, 0xea, 0xd4, 0x31, 0x4c, 0xa6, 0xcc, 0xdc, 0x96, 0xa6, 0xdc, + 0x4a, 0xd8, 0x2d, 0xc0, 0xef, 0xf3, 0xae, 0xb9, 0x3d, 0xbd, 0x91, 0x8d, + 0x50, 0xd8, 0x16, 0x8b, 0x27, 0xb8, 0x39, 0x7c, 0x1b, 0x55, 0x35, 0x73, + 0xf4, 0x48, 0x2b, 0x46, 0xa3, 0x40, 0x4a, 0xc1, 0xed, 0xd1, 0x29, 0x00, + 0xba, 0x0e, 0x37, 0x31, 0x36, 0xf2, 0x09, 0x52, 0xc2, 0x33, 0xcf, 0x3c, + 0xc9, 0xe1, 0xc3, 0x2d, 0x39, 0x01, 0x8f, 0x3d, 0x96, 0x8b, 0x2c, 0xb7, + 0x6e, 0x4d, 0xb3, 0xbd, 0x1d, 0xa3, 0xa7, 0x67, 0x67, 0xdf, 0x69, 0x71, + 0x15, 0x11, 0x90, 0x45, 0x10, 0xe8, 0xb8, 0xb7, 0xb8, 0xcc, 0x8d, 0xeb, + 0xe3, 0xb4, 0x1f, 0x6c, 0xa2, 0xb2, 0xc2, 0x46, 0x5a, 0xc2, 0x76, 0x34, + 0xc6, 0xeb, 0xbf, 0xfa, 0x23, 0x16, 0x8b, 0xca, 0x19, 0x8f, 0x9b, 0x57, + 0x5f, 0x7d, 0x1b, 0x21, 0xe0, 0xf9, 0xe7, 0xbf, 0x47, 0x57, 0x57, 0x3b, + 0x85, 0x70, 0xed, 0xda, 0x18, 0x52, 0x42, 0x4f, 0xcf, 0x23, 0x39, 0x5b, + 0x65, 0x79, 0x29, 0x55, 0xf6, 0x0a, 0x56, 0xd6, 0x36, 0xea, 0xdd, 0x9e, + 0x5e, 0xbb, 0xdf, 0xe7, 0x5d, 0xd3, 0x6f, 0xc5, 0x73, 0x00, 0xc3, 0x37, + 0x27, 0x58, 0x5d, 0xdd, 0xc4, 0xe9, 0xac, 0x61, 0xf8, 0xe3, 0x51, 0xde, + 0xbb, 0xf2, 0x3e, 0xdf, 0x7f, 0xf6, 0x45, 0x86, 0x3e, 0x1e, 0xe3, 0xdc, + 0xb9, 0x6f, 0xd3, 0xd6, 0xd6, 0xc8, 0xe0, 0xe0, 0x18, 0x0e, 0x47, 0x05, + 0x2d, 0x2d, 0xf5, 0xf9, 0xbc, 0x39, 0x0c, 0x0e, 0x8e, 0x21, 0x04, 0x9c, + 0x38, 0xb1, 0x6b, 0xd9, 0xe3, 0x3a, 0x90, 0xdb, 0x92, 0x8f, 0xe4, 0x47, + 0x60, 0x0e, 0xe0, 0x83, 0xf7, 0x47, 0x00, 0xe8, 0x7b, 0xf7, 0x2a, 0x7d, + 0xef, 0x5e, 0x45, 0x08, 0x81, 0xdd, 0x5e, 0xc6, 0x4b, 0x2f, 0xfd, 0x90, + 0x17, 0x5e, 0x78, 0x8e, 0x50, 0x28, 0xc2, 0xf8, 0xf8, 0x2c, 0x9d, 0x9d, + 0x2e, 0x4a, 0x4b, 0xad, 0x9f, 0x2a, 0x60, 0xff, 0xfe, 0x6a, 0x9c, 0xce, + 0x9a, 0x5d, 0xf6, 0x46, 0x67, 0x2d, 0xd7, 0xae, 0xdf, 0x06, 0x38, 0x0a, + 0xf8, 0xf3, 0x53, 0x80, 0xb3, 0xb1, 0x86, 0x0f, 0x3f, 0xba, 0x90, 0x3b, + 0x03, 0x94, 0x94, 0xa8, 0xb4, 0xb5, 0x3a, 0xb1, 0xd9, 0x4a, 0x00, 0xb0, + 0x58, 0xa0, 0xaf, 0xef, 0x3c, 0x0e, 0x47, 0x39, 0xc5, 0x20, 0xa5, 0xe4, + 0xe2, 0xc5, 0x97, 0x51, 0x55, 0x73, 0xae, 0x00, 0x35, 0x34, 0x38, 0xeb, + 0xb4, 0xee, 0xf1, 0x82, 0x11, 0x88, 0x25, 0x13, 0x3c, 0xda, 0xd3, 0x99, + 0xdb, 0x66, 0x95, 0xbc, 0xa3, 0xa5, 0xc9, 0x64, 0xe4, 0xc4, 0x89, 0x4e, + 0x3e, 0x0d, 0x42, 0x08, 0x8e, 0x1f, 0xef, 0x28, 0xf8, 0x5b, 0xe3, 0xce, + 0xdf, 0x72, 0x77, 0x41, 0x01, 0x8b, 0x4b, 0xab, 0x59, 0x27, 0x9f, 0xe3, + 0xc8, 0xfc, 0x00, 0xa8, 0xa9, 0xb2, 0x6b, 0xdd, 0x2e, 0xb7, 0xa7, 0xd7, + 0xaa, 0x2f, 0xc2, 0x00, 0xc0, 0x6c, 0xf0, 0xde, 0x43, 0xa0, 0xdd, 0x81, + 0xaa, 0x9a, 0xb4, 0xae, 0x19, 0x68, 0xd6, 0x0b, 0x98, 0x06, 0xd2, 0xf7, + 0xee, 0xaf, 0x10, 0x8b, 0xc5, 0x1f, 0x0a, 0xf9, 0x76, 0x34, 0xc6, 0x5f, + 0xfa, 0x06, 0xf4, 0xa6, 0xf5, 0x5c, 0x0a, 0xfc, 0x3e, 0x6f, 0xd4, 0xed, + 0xe9, 0x0d, 0x48, 0x29, 0x5d, 0x81, 0xbb, 0x8b, 0xb4, 0xb7, 0xec, 0x39, + 0xc0, 0xfe, 0x4f, 0x58, 0x5a, 0x59, 0x67, 0x72, 0x26, 0xc8, 0xe4, 0xcc, + 0x1c, 0x93, 0x77, 0x82, 0x4c, 0xce, 0x04, 0xb9, 0xbb, 0x70, 0x9f, 0xb4, + 0x76, 0xc8, 0x80, 0x3f, 0xfb, 0x7d, 0xde, 0xbb, 0xf9, 0x17, 0x93, 0x31, + 0xc0, 0x35, 0x3b, 0xb7, 0xf0, 0xc0, 0x02, 0x92, 0xc9, 0x14, 0xb3, 0xc1, + 0x7b, 0x19, 0xb2, 0x3b, 0x73, 0x59, 0xd2, 0x20, 0x1b, 0x9b, 0xe1, 0x62, + 0x53, 0x66, 0x81, 0x77, 0x80, 0x9f, 0xc3, 0xde, 0x9b, 0xd1, 0x35, 0xe0, + 0xa9, 0xf1, 0xa9, 0x00, 0x4f, 0x3e, 0x71, 0x72, 0xcf, 0xcc, 0x50, 0x78, + 0x6b, 0x0f, 0xd1, 0x9d, 0xb9, 0x05, 0x12, 0x89, 0x64, 0x21, 0xa2, 0x34, + 0x30, 0x05, 0xdc, 0x04, 0x86, 0x81, 0x21, 0x60, 0xd0, 0xef, 0xf3, 0xee, + 0x2a, 0xb2, 0x7c, 0x01, 0xfd, 0xc0, 0x8b, 0x7f, 0xfa, 0xdb, 0xbf, 0xb1, + 0x96, 0x58, 0x28, 0x2f, 0xb3, 0xb1, 0xb2, 0xb6, 0xc1, 0x4c, 0x60, 0x9e, + 0xc9, 0x99, 0x60, 0x6e, 0x85, 0x14, 0xc0, 0x0a, 0x99, 0xbb, 0xdf, 0x8d, + 0x2c, 0xe1, 0x0d, 0x60, 0xc4, 0xef, 0xf3, 0x46, 0x8a, 0x4d, 0xd0, 0xb0, + 0x67, 0xa5, 0xb9, 0x3d, 0xbd, 0x6f, 0x00, 0xdf, 0x2d, 0x32, 0x3e, 0x04, + 0x8c, 0x66, 0xc9, 0x6e, 0x65, 0x9f, 0x23, 0x7e, 0x9f, 0x77, 0xe1, 0xb3, + 0x88, 0x8a, 0xa1, 0xd0, 0xe5, 0xf4, 0x59, 0xe0, 0x77, 0xc0, 0xd7, 0x81, + 0x52, 0x1d, 0xe1, 0x08, 0x30, 0x5b, 0xe8, 0x8a, 0xfd, 0xff, 0xe0, 0xbf, + 0x87, 0xf6, 0xdb, 0x8f, 0xf0, 0x17, 0xa5, 0xe8, 0x00, 0x00, 0x00, 0x00, + 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 +}; + +#include +using namespace std; +#include +#include +#include +#include +#include +using namespace Music; +#include +using namespace Math; + +GLFT::GLFT(QWidget* parent) +: QGLWidget(parent, "GLFT") +, View("Fourier Transform", this) +, m_components_max(1.0) +{ + m_start_move_mouse = true; + m_x = 0; + m_y = 0; + m_z = 0.0; + + m_zp_factor = 4; // actually, actuellement, not zero-padding but win-size-factor + + // settings + QImage img; + img.loadFromData(g_icon_FT, sizeof(g_icon_FT), "PNG"); + setting_show->setIconSet(QIconSet(QImage(img))); + setting_show->setOn(false); + hide(); + + setting_autoScale = new QAction(this); + setting_autoScale->setMenuText(tr("Auto scale")); + setting_autoScale->setToggleAction(true); + connect(setting_autoScale, SIGNAL(toggled(bool)), this, SLOT(update())); + setting_autoScale->setOn(true); + setting_autoScale->addTo(&m_popup_menu); + + setting_db_scale = new QAction(this); + setting_db_scale->setMenuText(tr("dB scale")); + setting_db_scale->setToggleAction(true); + connect(setting_db_scale, SIGNAL(toggled(bool)), this, SLOT(update())); + setting_db_scale->setOn(true); + setting_db_scale->addTo(&m_popup_menu); + + m_popup_menu.insertItem(new Title(tr("Size"), &m_popup_menu)); + setting_spinNumComponents = new QSpinBox(1, 65536, 1, &m_popup_menu); + setting_spinNumComponents->setValue(8192); + m_components.resize(setting_spinNumComponents->value()); + QToolTip::add(setting_spinNumComponents, tr("Size")); + connect(setting_spinNumComponents, SIGNAL(valueChanged(int)), this, SLOT(spinNumComponentsChanged(int))); + m_popup_menu.insertItem(setting_spinNumComponents); + m_popup_menu.insertItem(new Title(tr("- Press left mouse button and move mouse to zoom"), &m_popup_menu)); + m_popup_menu.insertItem(new Title(tr("- Press SHIFT key, left mouse button and move mouse to move view"), &m_popup_menu)); + m_popup_menu.insertItem(new Title(tr("- Double-click to reset view"), &m_popup_menu)); + + m_plan.resize(setting_spinNumComponents->value()); + m_components.resize(m_plan.size()/2, 0.0); + win = hann(m_plan.size()); +} + +void GLFT::save() +{ + s_settings->writeEntry("spinNumComponents", setting_spinNumComponents->value()); +} +void GLFT::load() +{ + setting_spinNumComponents->setValue(s_settings->readNumEntry("spinNumComponents", setting_spinNumComponents->value())); +} +void GLFT::clearSettings() +{ + s_settings->removeEntry("spinNumComponents"); +} + +void GLFT::refreshGraph() +{ + while(int(buff.size())>m_plan.size()) + buff.pop_back(); +} + +void GLFT::spinNumComponentsChanged(int num) +{ + m_plan.resize(int(m_zp_factor*num)); + m_components.resize(m_plan.size()/2); + win = hann(num); + + cerr << "GLFT: INFO: window size=" << win.size() << " FFT size=" << m_plan.size() << endl; +} + +void GLFT::initializeGL() +{ + // Set the clear color to black + glClearColor(1.0, 1.0, 1.0, 0.0); + + glShadeModel( GL_FLAT ); +// glShadeModel( GL_SMOOTH ); + + glLoadIdentity(); +} + +void GLFT::mousePressEvent(QMouseEvent* e) +{ + m_start_move_mouse = true; + m_press_x = e->x(); + m_press_y = e->y(); +} +void GLFT::mouseDoubleClickEvent(QMouseEvent* e) +{ + m_start_move_mouse = true; + m_x = 0; + m_y = 0; +// m_z = 0.0; + m_z = 1.0; + + updateGL(); +} +void GLFT::mouseMoveEvent(QMouseEvent* e) +{ + static int old_x; + static int old_y; + if(m_start_move_mouse) + { + old_x = e->x(); + old_y = e->y(); + m_start_move_mouse = false; + } + int dx = e->x() - old_x; + int dy = e->y() - old_y; + + if(Qt::LeftButton & e->state()) + { + if(Qt::ShiftButton & e->state()) + { + m_x += dx; + m_y -= dy; + } + else + { + m_z += dx/100.0; + if(m_z<0.0) m_z = 0.0; + } + + updateGL(); + } + + old_x = e->x(); + old_y = e->y(); +} + +void GLFT::paintGL() +{ + glClear(GL_COLOR_BUFFER_BIT); + + if(int(buff.size())>=m_plan.size()) + { + while(int(buff.size())>m_plan.size()) + buff.pop_back(); + + // name + string str = tr("Fourier Transform"); + glColor3f(0.75,0.75,0.75); + glRasterPos2i(2, height()-20); + for(size_t i = 0; i < str.size(); i++) + glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, str[i]); + + int scale_height = 0; + + for(int i=0; iisOn()) + m_components[i] = 100+20*log10(m_components[i]); + m_components_max = max(m_components_max, m_components[i]); + } + +// cerr << m_components_max << endl; + + double scale_factor = 1.0; + if(setting_autoScale->isOn() && m_components_max>0.0) + scale_factor = 1.0/m_components_max; + +// cerr << scale_factor << endl; + + // bars + glBegin(GL_QUADS); + float step = float(width())/m_components.size() + m_z; + int space = (step>2)?1:0; + for(size_t i=0; i=0) + { + glVertex2i(m_x+x, m_y+scale_height); + glVertex2i(m_x+x, m_y+y); + glVertex2i(m_x+int((i+1)*step)-space, m_y+y); + glVertex2i(m_x+int((i+1)*step)-space, m_y+scale_height); + } + } + glEnd(); + + // scale +/* glColor3f(0,0,0); + for(size_t i=0; i +using namespace std; +#include +// using namespace Music; +#include +#include +#include +#include "View.h" + +class GLFT : public QGLWidget, public View +{ + Q_OBJECT + + virtual void mouseReleaseEvent(QMouseEvent* e){View::mouseReleaseEvent(e);} + virtual void mousePressEvent(QMouseEvent* e); + virtual void mouseDoubleClickEvent(QMouseEvent* e); + virtual void mouseMoveEvent(QMouseEvent* e); + + vector win; + CFFTW3 m_plan; + vector m_components; + double m_components_max; + + bool m_start_move_mouse; + int m_press_x, m_press_y; + int m_x, m_y; + double m_z; + + public: + GLFT(QWidget* parent); + ~GLFT(){} + + deque buff; + + void refreshGraph(); + + double m_zp_factor; + + // settings + QAction* setting_autoScale; + QAction* setting_db_scale; + QSpinBox* setting_spinNumComponents; + virtual void save(); + virtual void load(); + virtual void clearSettings(); + + public slots: + void spinNumComponentsChanged(int num); + void initializeGL(); + void paintGL(); + void resizeGL( int w, int h ); +}; + +#endif // _GLFT_h_ + diff --git a/src/modules/GLFreqStruct.cpp b/src/modules/GLFreqStruct.cpp new file mode 100644 index 0000000..ca8464f --- /dev/null +++ b/src/modules/GLFreqStruct.cpp @@ -0,0 +1,304 @@ +// Copyright 2004 "Gilles Degottex" + +// This file is part of "fmit" + +// "fmit" 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. +// +// "fmit" 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 + +#include "GLFreqStruct.h" + +static const unsigned char g_icon_formants[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, + 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7a, 0x7a, 0xf4, 0x00, 0x00, 0x06, + 0x99, 0x49, 0x44, 0x41, 0x54, 0x78, 0x9c, 0xb5, 0x97, 0xdd, 0x6f, 0x9b, + 0x57, 0x1d, 0xc7, 0x3f, 0xe7, 0x3c, 0x8f, 0xed, 0x38, 0x4e, 0xec, 0xf8, + 0x35, 0x4e, 0xf3, 0xd2, 0x34, 0x6b, 0xa6, 0x35, 0x81, 0x86, 0x56, 0x5b, + 0xa1, 0xa0, 0x08, 0x84, 0xb8, 0x98, 0x76, 0x91, 0xb1, 0x3f, 0x81, 0x0b, + 0x14, 0xb8, 0xe2, 0x1e, 0xb8, 0xed, 0x0d, 0x48, 0x20, 0xb8, 0x58, 0x15, + 0x10, 0xd3, 0x98, 0x34, 0x81, 0xb6, 0xd2, 0x89, 0x44, 0x53, 0xb7, 0xc1, + 0x5a, 0x90, 0xa7, 0xad, 0xa8, 0x9b, 0x96, 0x76, 0xe9, 0x92, 0x9a, 0xa6, + 0x69, 0xb3, 0xbc, 0xf8, 0x35, 0x49, 0xf3, 0x66, 0x3b, 0xb6, 0xcf, 0xe1, + 0xe2, 0x79, 0x1e, 0xc7, 0xb1, 0xdd, 0xae, 0x42, 0x70, 0xa4, 0x23, 0x9f, + 0xe7, 0xf7, 0x1c, 0x9f, 0xef, 0xe7, 0xf7, 0xfd, 0x1d, 0x9f, 0xc7, 0x8f, + 0xe0, 0xff, 0xd4, 0xc6, 0x27, 0x26, 0x25, 0x10, 0x06, 0x62, 0x00, 0x89, + 0xe9, 0xa9, 0xdb, 0xad, 0xe6, 0x89, 0xff, 0x72, 0xe1, 0x63, 0xc0, 0x09, + 0x60, 0xd0, 0x1e, 0xc7, 0x80, 0x6e, 0xbb, 0x3b, 0xe3, 0x08, 0x60, 0xd4, + 0x7d, 0xf5, 0x06, 0xf0, 0xbd, 0xc4, 0xf4, 0xd4, 0x76, 0xfd, 0x7a, 0xe6, + 0x23, 0x44, 0x02, 0xc0, 0xa9, 0x3a, 0x91, 0xfa, 0xcf, 0x01, 0xc0, 0xfd, + 0x38, 0xc8, 0x0e, 0x9f, 0x97, 0x40, 0x67, 0x07, 0x7e, 0xbf, 0x0f, 0x43, + 0x1a, 0x24, 0xef, 0x2d, 0x73, 0x70, 0x50, 0x7e, 0x0e, 0xf8, 0x01, 0xf0, + 0x9b, 0x96, 0x00, 0xe3, 0x13, 0x93, 0x6e, 0xe0, 0xc7, 0xc0, 0x8b, 0xc0, + 0x78, 0xfd, 0xbd, 0x48, 0xa8, 0x8b, 0x78, 0x2c, 0x44, 0xc0, 0xdf, 0x81, + 0xbf, 0xd3, 0x47, 0x97, 0xbf, 0x03, 0x7f, 0x67, 0x07, 0x01, 0xbf, 0x8f, + 0x40, 0x67, 0x07, 0xed, 0x3e, 0x1f, 0xde, 0x76, 0x1f, 0x1e, 0x8f, 0x17, + 0xd3, 0xed, 0xa5, 0xa2, 0xc0, 0x30, 0x04, 0x5e, 0xb7, 0x24, 0x16, 0x70, + 0xf1, 0xe7, 0xb7, 0xde, 0xe3, 0xe2, 0xab, 0x97, 0x01, 0x5e, 0x6a, 0x09, + 0x60, 0x8b, 0xbf, 0x09, 0x4c, 0x00, 0x9c, 0x3b, 0x33, 0xc2, 0xb9, 0xb3, + 0xa3, 0x9c, 0x1c, 0xec, 0x63, 0xe8, 0x78, 0x2f, 0x6d, 0xed, 0xed, 0x14, + 0x0f, 0x14, 0x85, 0x03, 0x45, 0xe1, 0x40, 0xb3, 0x5f, 0xaa, 0x52, 0x28, + 0x29, 0xf6, 0x4a, 0x8a, 0x9d, 0x83, 0x2a, 0x9b, 0x45, 0x50, 0x05, 0x8d, + 0xd6, 0x1a, 0xa5, 0xf6, 0x50, 0x1a, 0xab, 0x2b, 0xcd, 0x8b, 0xe7, 0x42, + 0x9c, 0x3b, 0x33, 0xea, 0x00, 0x8c, 0x36, 0xba, 0xe5, 0x64, 0xf9, 0x7d, + 0x47, 0xfc, 0xc2, 0x4f, 0x7f, 0xc4, 0xf9, 0x67, 0xc7, 0xc8, 0x6e, 0x97, + 0xc9, 0x6d, 0x57, 0x58, 0x48, 0x2b, 0x6b, 0x51, 0x40, 0x6b, 0x8d, 0x56, + 0xa0, 0xb4, 0x46, 0x69, 0xd0, 0x1a, 0x5c, 0x86, 0xc4, 0x10, 0x1a, 0x8d, + 0xb0, 0x85, 0xeb, 0xe7, 0x08, 0x8a, 0x07, 0x8a, 0xfe, 0xde, 0x18, 0x52, + 0x0a, 0x94, 0xd2, 0x91, 0xf1, 0x89, 0xc9, 0x58, 0x62, 0x7a, 0x2a, 0xd3, + 0x08, 0x10, 0x06, 0xe8, 0xec, 0x68, 0xe7, 0x9b, 0xcf, 0x8d, 0x71, 0x37, + 0x55, 0xa4, 0x50, 0x52, 0x68, 0xc0, 0x65, 0x0a, 0xb4, 0x16, 0x76, 0x76, + 0x02, 0x2d, 0x35, 0xca, 0x16, 0x3b, 0x04, 0x12, 0x96, 0xb0, 0x06, 0x8d, + 0xa0, 0xaa, 0x34, 0x5a, 0x5b, 0x73, 0x8a, 0x15, 0x45, 0xc8, 0xe5, 0x26, + 0x1e, 0x0b, 0xb3, 0x96, 0xca, 0x01, 0x8c, 0x00, 0x4d, 0x00, 0x21, 0x80, + 0xee, 0x68, 0x88, 0xad, 0xbd, 0x2a, 0x4a, 0x81, 0xdb, 0x94, 0x68, 0x38, + 0x5c, 0xd8, 0x16, 0x51, 0x5a, 0xd8, 0xd7, 0xba, 0x2e, 0x76, 0x78, 0xbf, + 0x36, 0x57, 0x69, 0x14, 0x50, 0xae, 0x68, 0x00, 0x06, 0x7a, 0xe3, 0x0e, + 0xc0, 0x28, 0xf0, 0x8f, 0x96, 0x00, 0xb1, 0x48, 0x10, 0xa5, 0x34, 0x2e, + 0x43, 0xa0, 0xc1, 0x5e, 0x0c, 0xdb, 0xfe, 0x16, 0x22, 0x36, 0x84, 0x76, + 0xac, 0xaf, 0x1b, 0x2b, 0xdb, 0xb5, 0x4a, 0xd5, 0x02, 0xe8, 0xef, 0xed, + 0xe6, 0xfa, 0x27, 0x73, 0x8e, 0x03, 0x4d, 0x7b, 0xc0, 0x00, 0x88, 0x86, + 0xbb, 0x70, 0x99, 0xc2, 0xb6, 0xbd, 0x51, 0xbc, 0x35, 0x90, 0xb6, 0x81, + 0x1c, 0x41, 0xd5, 0x00, 0x57, 0x55, 0x8e, 0x03, 0xdd, 0x8e, 0xe6, 0x68, + 0x2b, 0x80, 0x0d, 0x80, 0x6a, 0x55, 0x61, 0x1a, 0x02, 0x97, 0x61, 0xd7, + 0xb8, 0x85, 0xb8, 0x55, 0x96, 0xe6, 0x58, 0xa3, 0x43, 0x0e, 0x50, 0x9b, + 0x5b, 0x36, 0x02, 0x1c, 0x71, 0x40, 0xd6, 0x03, 0xec, 0x17, 0x8a, 0x98, + 0x86, 0xc0, 0x90, 0x16, 0x84, 0x4b, 0x62, 0x7d, 0xda, 0xdd, 0x34, 0x45, + 0x0d, 0xb0, 0xd6, 0x4d, 0x59, 0x37, 0xb6, 0xae, 0xdd, 0xa6, 0x20, 0xd2, + 0x69, 0xf2, 0x4c, 0xaf, 0x97, 0x81, 0x88, 0xc7, 0x2e, 0x41, 0xdc, 0xd1, + 0x8c, 0x8e, 0x4f, 0x4c, 0x46, 0x5b, 0x3a, 0xb0, 0x5f, 0x28, 0x61, 0x48, + 0x4b, 0x44, 0x03, 0x34, 0x66, 0xc8, 0x61, 0x9d, 0x0f, 0xe3, 0x87, 0x31, + 0x04, 0xb4, 0x7b, 0x24, 0x5d, 0xed, 0x26, 0x2e, 0xf3, 0xe8, 0x29, 0x1f, + 0x09, 0x05, 0x68, 0xf7, 0xb6, 0xb1, 0x5f, 0x28, 0x3a, 0x2e, 0xfc, 0xb3, + 0xa5, 0x03, 0x52, 0x80, 0x69, 0x80, 0x29, 0xad, 0xd3, 0xcc, 0xb0, 0x1d, + 0x31, 0x0d, 0x81, 0x29, 0x25, 0xa6, 0x33, 0x36, 0x84, 0x35, 0xcf, 0xce, + 0x3c, 0xe0, 0x33, 0xe9, 0x0b, 0xbb, 0x89, 0xfa, 0x5d, 0x4d, 0xe2, 0x4e, + 0x6b, 0xb5, 0x0f, 0x1a, 0x1c, 0x28, 0x22, 0x85, 0x25, 0xe8, 0x64, 0x48, + 0x2d, 0x73, 0x27, 0x63, 0x3b, 0x5b, 0x7b, 0xec, 0x71, 0x09, 0xda, 0x3d, + 0x12, 0x43, 0x7e, 0xf9, 0x73, 0x6d, 0xb0, 0xbf, 0x87, 0x85, 0xbb, 0x0f, + 0x1c, 0x07, 0x5a, 0x03, 0x08, 0x41, 0x03, 0x80, 0x75, 0xca, 0x35, 0x02, + 0x99, 0x52, 0xd0, 0xe6, 0x7e, 0x32, 0xe1, 0x1a, 0xc0, 0x40, 0x8f, 0x33, + 0x6c, 0x02, 0xc8, 0x03, 0xec, 0xec, 0xee, 0x03, 0x20, 0x05, 0x68, 0x61, + 0x8b, 0x09, 0x61, 0x67, 0x7b, 0x08, 0xe4, 0x32, 0x0d, 0xdc, 0x8f, 0xb0, + 0xf9, 0xb1, 0x00, 0xfd, 0x35, 0x80, 0x5a, 0x09, 0x24, 0x40, 0x62, 0x7a, + 0x6a, 0x13, 0xd8, 0xdd, 0xd9, 0xdd, 0x67, 0x6f, 0xbf, 0x80, 0x21, 0x05, + 0x86, 0x10, 0x48, 0x29, 0x90, 0xd2, 0x02, 0x92, 0x12, 0x0c, 0x09, 0x5e, + 0xb7, 0x6c, 0x29, 0xae, 0xb5, 0x66, 0x65, 0x3d, 0xdb, 0x14, 0x57, 0x4e, + 0xbd, 0x8e, 0x02, 0xc4, 0xc6, 0x27, 0x26, 0xc3, 0x35, 0x00, 0xbb, 0xdd, + 0x03, 0x58, 0x4f, 0xe7, 0x10, 0x02, 0x84, 0xb0, 0x85, 0x6d, 0x10, 0x43, + 0x0a, 0x3c, 0xa6, 0x44, 0x4a, 0xc1, 0xee, 0xde, 0x7e, 0x93, 0xd0, 0x8d, + 0xd9, 0x79, 0x7e, 0x76, 0xe1, 0xe5, 0xa6, 0xf8, 0x85, 0x5f, 0xbd, 0xc2, + 0xe7, 0x77, 0x96, 0x00, 0x88, 0xc7, 0xc2, 0xb8, 0xdd, 0xae, 0x23, 0x2e, + 0xd4, 0x03, 0x2c, 0x01, 0xac, 0xa5, 0x72, 0x96, 0xe8, 0x11, 0x08, 0x30, + 0xa5, 0x40, 0x08, 0x58, 0x5e, 0x49, 0xf1, 0x93, 0x9f, 0xff, 0xfa, 0x48, + 0x66, 0x00, 0x91, 0x70, 0x17, 0xd9, 0x8d, 0x2d, 0xb2, 0xf9, 0xad, 0x23, + 0xf1, 0x42, 0xa9, 0xc4, 0x3b, 0xd7, 0x3e, 0x02, 0x40, 0x4a, 0xc9, 0xf1, + 0xbe, 0xda, 0x79, 0x30, 0xf2, 0x08, 0x07, 0xf2, 0x20, 0x40, 0x08, 0xc1, + 0xec, 0x5c, 0x92, 0x77, 0xaf, 0x5d, 0x47, 0x0a, 0x4b, 0x1c, 0xc0, 0xe5, + 0x32, 0x49, 0x65, 0xf2, 0xac, 0x5b, 0x0f, 0x96, 0x5a, 0x3b, 0xde, 0x1b, + 0xc7, 0xdb, 0xe6, 0xe1, 0xb3, 0xf9, 0xbb, 0x00, 0xcc, 0x27, 0xef, 0x03, + 0x10, 0x0d, 0x87, 0xc8, 0xe4, 0x36, 0x6b, 0xf3, 0x1a, 0xf7, 0x41, 0xb3, + 0x03, 0xe9, 0xac, 0xf5, 0x47, 0x51, 0xc0, 0x8d, 0xd9, 0xcf, 0x79, 0xfb, + 0xef, 0x1f, 0xd6, 0xc4, 0x1d, 0x1b, 0x03, 0x9d, 0x3e, 0x3e, 0xfd, 0x2c, + 0x79, 0x04, 0xc0, 0x30, 0x24, 0xf1, 0x58, 0x98, 0xbb, 0x4b, 0x2b, 0x00, + 0xfc, 0xf6, 0x0f, 0x6f, 0x90, 0xcd, 0x6f, 0x12, 0x8f, 0x86, 0xc9, 0xe6, + 0x0e, 0x5d, 0xf9, 0x52, 0x07, 0xec, 0x47, 0x26, 0x02, 0x78, 0x66, 0x68, + 0x80, 0x54, 0x3a, 0x47, 0xa5, 0x5a, 0x25, 0x93, 0xdb, 0xe4, 0xca, 0xd5, + 0x0f, 0x11, 0x42, 0xd0, 0x1d, 0x8b, 0xb0, 0xbc, 0xba, 0x0e, 0xc0, 0xcc, + 0x7b, 0x1f, 0x90, 0x5c, 0x5c, 0xb6, 0xb3, 0x0d, 0x92, 0xcd, 0x5b, 0xd9, + 0xf6, 0x44, 0x23, 0x7c, 0x3c, 0xbb, 0xc0, 0x57, 0x4f, 0x9d, 0x20, 0x93, + 0xdf, 0xac, 0xed, 0x9b, 0xc7, 0x39, 0x50, 0xdb, 0x84, 0x4e, 0x3b, 0x3d, + 0x3a, 0x4c, 0xb1, 0x58, 0x62, 0xf9, 0x8b, 0x14, 0x2b, 0xeb, 0x19, 0xde, + 0xbd, 0xf6, 0x2f, 0x00, 0x62, 0x91, 0xae, 0x5a, 0xad, 0xb7, 0x77, 0xf7, + 0x78, 0xff, 0x83, 0x8f, 0xed, 0x78, 0x90, 0x8c, 0x9d, 0x6d, 0x6f, 0x4f, + 0x84, 0xb5, 0x54, 0x96, 0x93, 0x43, 0x03, 0x18, 0x52, 0x30, 0xff, 0xef, + 0x07, 0x00, 0x84, 0x43, 0x01, 0x67, 0xf9, 0xee, 0xf1, 0x89, 0xc9, 0x50, + 0x3d, 0xc0, 0x7d, 0x40, 0xaf, 0xa7, 0xf3, 0x68, 0x7b, 0x83, 0x85, 0x82, + 0x7e, 0x82, 0x41, 0x3f, 0x9f, 0xdc, 0x5a, 0xe0, 0xd4, 0xf0, 0x20, 0xf9, + 0x8d, 0x87, 0x96, 0x50, 0x38, 0x58, 0xab, 0x6b, 0xff, 0xb1, 0x18, 0xab, + 0x6b, 0xd6, 0xcf, 0x6f, 0x68, 0xb0, 0x8f, 0x54, 0x26, 0x8f, 0xd2, 0x9a, + 0x63, 0xf1, 0x28, 0xeb, 0x99, 0x0d, 0xda, 0x3c, 0x6e, 0x62, 0xd1, 0x30, + 0xb7, 0xec, 0xbd, 0xd1, 0xe6, 0xf1, 0xd4, 0x57, 0xae, 0xad, 0x06, 0x90, + 0x98, 0x9e, 0x2a, 0x00, 0xa9, 0x72, 0xa5, 0x42, 0x6e, 0xe3, 0xb0, 0x66, + 0xdd, 0xb1, 0x10, 0x6b, 0xe9, 0x1c, 0xde, 0x36, 0x0f, 0x86, 0x21, 0xd9, + 0xde, 0xd9, 0xe3, 0xe9, 0xa7, 0x06, 0x48, 0x65, 0xf2, 0x94, 0x2b, 0x15, + 0xc6, 0x46, 0x86, 0x59, 0xb3, 0x5d, 0xfb, 0xda, 0xe8, 0x30, 0xbb, 0x7b, + 0x05, 0x56, 0xd7, 0x32, 0x8c, 0x8d, 0x0e, 0xb3, 0xbc, 0x9a, 0xaa, 0x39, + 0x93, 0xcd, 0x6e, 0x52, 0x28, 0x96, 0x78, 0xe5, 0x4f, 0x33, 0xce, 0xd2, + 0x55, 0x20, 0xdd, 0xf8, 0x5e, 0x70, 0x0f, 0xe8, 0x59, 0x4b, 0xe5, 0x88, + 0x86, 0x83, 0xb5, 0x6c, 0xd3, 0x99, 0x4d, 0xdb, 0xd6, 0x18, 0x9f, 0xce, + 0x25, 0x39, 0x3d, 0x72, 0x92, 0x83, 0x83, 0x32, 0xf7, 0x97, 0x53, 0x0c, + 0x0f, 0xf5, 0xa1, 0x94, 0xa2, 0x58, 0x2c, 0xd1, 0x1d, 0x0d, 0x12, 0xe8, + 0x6c, 0x67, 0x76, 0x2e, 0xc9, 0x37, 0x9e, 0xfd, 0x0a, 0x1b, 0x9b, 0x0f, + 0x79, 0xed, 0x8d, 0xb7, 0x59, 0xbc, 0xbf, 0x42, 0x2e, 0xbf, 0xc5, 0x95, + 0xab, 0x1f, 0xd5, 0xdc, 0x05, 0x2e, 0x27, 0xa6, 0xa7, 0xaa, 0x8d, 0x00, + 0x4b, 0xc0, 0xb7, 0xd6, 0xd3, 0x39, 0xc6, 0x46, 0x87, 0x01, 0x88, 0x47, + 0xc3, 0x24, 0x17, 0xad, 0xfa, 0x1d, 0x8b, 0x47, 0xf8, 0x62, 0x35, 0xc5, + 0xb7, 0xcf, 0x9f, 0x21, 0x14, 0xec, 0xe2, 0xe6, 0xed, 0x24, 0x27, 0x8e, + 0xf7, 0xe0, 0x6d, 0x73, 0xf3, 0xda, 0x9b, 0x57, 0x28, 0x97, 0x2b, 0x94, + 0x95, 0xe6, 0xe2, 0x1f, 0xdf, 0xe2, 0x97, 0x2f, 0xbf, 0x8e, 0xd6, 0x9a, + 0xdf, 0xbf, 0x3e, 0x83, 0x7d, 0x88, 0x23, 0x10, 0x15, 0xe0, 0x0e, 0xf0, + 0x17, 0xe0, 0x17, 0xd0, 0xfc, 0x66, 0xb4, 0x08, 0x70, 0xfb, 0xce, 0x12, + 0xcf, 0x7f, 0xf7, 0x3c, 0x00, 0x67, 0x4f, 0x3f, 0xcd, 0xa5, 0x99, 0xf7, + 0xd9, 0xdb, 0x2f, 0x10, 0xea, 0xf2, 0x33, 0x3b, 0x97, 0xe4, 0xd2, 0xcc, + 0x55, 0x94, 0x56, 0x5c, 0x9a, 0xb9, 0xca, 0xc5, 0x57, 0x2f, 0x53, 0xae, + 0x94, 0x99, 0x5b, 0x58, 0x3a, 0xf2, 0x73, 0x05, 0xb2, 0x02, 0x31, 0x07, + 0xcc, 0x82, 0xb8, 0xa9, 0x94, 0x58, 0x14, 0x52, 0xdf, 0x48, 0x4c, 0x4f, + 0x95, 0xea, 0x27, 0x1d, 0xf9, 0xca, 0xf8, 0xc4, 0xe4, 0xd7, 0x81, 0xeb, + 0x6e, 0x97, 0xc9, 0x4b, 0x2f, 0x7c, 0x07, 0xbf, 0xdf, 0xc7, 0xc3, 0x87, + 0x3b, 0xfc, 0xf5, 0x9d, 0x04, 0x9d, 0x1d, 0x3e, 0x72, 0xf9, 0x2d, 0xb4, + 0x68, 0x7a, 0xa1, 0x2c, 0x83, 0x5e, 0x52, 0x82, 0x07, 0x52, 0x8b, 0xbf, + 0x01, 0xb7, 0x80, 0x5b, 0x89, 0xe9, 0xa9, 0x75, 0x9e, 0xa0, 0x35, 0x3d, + 0x55, 0xc6, 0x27, 0x26, 0x7f, 0x07, 0xfc, 0xb0, 0x3e, 0xa6, 0x35, 0x4e, + 0x76, 0x69, 0xe0, 0xa6, 0x23, 0x62, 0xf7, 0xf9, 0xc4, 0xf4, 0xd4, 0xc1, + 0x93, 0x88, 0x3d, 0x11, 0x80, 0x0d, 0x71, 0x16, 0x78, 0x01, 0x78, 0x0a, + 0x98, 0x73, 0x44, 0xeb, 0xdf, 0x68, 0xfe, 0x57, 0xed, 0x3f, 0x3b, 0xa5, + 0x53, 0x06, 0x63, 0xf4, 0x8e, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, + 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 +}; + +#include +using namespace std; +#include +#include +#include +#include +using namespace Music; + +GLFreqStruct::GLFreqStruct(QWidget* parent) +: QGLWidget(parent, "GLFreqStruct") +, View("Harmonics", this) +, m_components_max(1.0) +{ + // settings + QImage img; + img.loadFromData(g_icon_formants, sizeof(g_icon_formants), "PNG"); + setting_show->setIconSet(QIconSet(QImage(img))); + setting_show->setOn(false); + hide(); + + m_popup_menu.insertItem(new Title(tr("Number of harmonics"), &m_popup_menu)); + setting_spinNumComponents = new QSpinBox(1, 128, 1, &m_popup_menu); + setting_spinNumComponents->setValue(16); + m_components.resize(setting_spinNumComponents->value()); + QToolTip::add(setting_spinNumComponents, tr("Number of harmonics")); + connect(setting_spinNumComponents, SIGNAL(valueChanged(int)), this, SLOT(spinNumComponentsChanged(int))); + m_popup_menu.insertItem(setting_spinNumComponents); + + for(size_t i=0; iwriteEntry("spinNumComponents", setting_spinNumComponents->value()); +} +void GLFreqStruct::load() +{ + setting_spinNumComponents->setValue(s_settings->readNumEntry("spinNumComponents", setting_spinNumComponents->value())); +} +void GLFreqStruct::clearSettings() +{ + s_settings->removeEntry("spinNumComponents"); +} + +void GLFreqStruct::spinNumComponentsChanged(int num) +{ + m_components.resize(num); +} + +void GLFreqStruct::initializeGL() +{ + // Set the clear color to black + glClearColor(1.0, 1.0, 1.0, 0.0); + + glShadeModel( GL_FLAT ); +// glShadeModel( GL_SMOOTH ); + + glLoadIdentity(); +} + +void GLFreqStruct::paintGL() +{ + if(m_components_max==0.0) return; + + glClear(GL_COLOR_BUFFER_BIT); + + // name + string str = tr("Harmonics"); + glColor3f(0.75,0.75,0.75); + glRasterPos2i(2, height()-20); + for(size_t i = 0; i < str.size(); i++) + glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, str[i]); + + int scale_height = 12; + + double scale_factor = 1.0; + if(m_components_max>0.0) + scale_factor = 1.0/m_components_max; + + // bars + glBegin(GL_QUADS); + float step = float(width())/m_components.size(); + int space = (step>2)?1:0; + for(size_t i=0; i0) + { + glVertex2i(x, scale_height); + glVertex2i(x, y); + glVertex2i(int((i+1)*step)-space, y); + glVertex2i(int((i+1)*step)-space, scale_height); + } + } + glEnd(); + + // scale + glColor3f(0,0,0); + for(size_t i=0; i +using namespace std; +#include +#include +#include +#include "View.h" + +class GLFreqStruct : public QGLWidget, public View +{ + Q_OBJECT + + virtual void mouseReleaseEvent(QMouseEvent* e){View::mouseReleaseEvent(e);} + + public: + GLFreqStruct(QWidget* parent); + ~GLFreqStruct(){} + + vector m_components; + double m_components_max; + + // settings + QSpinBox* setting_spinNumComponents; + virtual void save(); + virtual void load(); + virtual void clearSettings(); + + public slots: + void spinNumComponentsChanged(int num); + void initializeGL(); + void paintGL(); + void resizeGL( int w, int h ); +}; + +#endif // _GLFreqStruct_h_ + diff --git a/src/modules/GLGraph.cpp b/src/modules/GLGraph.cpp new file mode 100644 index 0000000..e3e5086 --- /dev/null +++ b/src/modules/GLGraph.cpp @@ -0,0 +1,479 @@ +// Copyright 2004 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#include "GLGraph.h" + +static const unsigned char g_icon_graph[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, + 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7a, 0x7a, 0xf4, 0x00, 0x00, 0x07, + 0xa8, 0x49, 0x44, 0x41, 0x54, 0x78, 0x9c, 0xad, 0x97, 0x6b, 0x6c, 0x14, + 0xd7, 0x15, 0xc7, 0x7f, 0x33, 0x3b, 0x3b, 0x6b, 0xef, 0xfa, 0xbd, 0xeb, + 0xe7, 0x62, 0x13, 0xec, 0xb5, 0x8d, 0x63, 0xb0, 0x0d, 0xc8, 0x50, 0x88, + 0x81, 0xa4, 0x22, 0x98, 0x12, 0x20, 0x69, 0xd2, 0x22, 0x85, 0xa6, 0x4a, + 0xda, 0xa8, 0x1f, 0xac, 0x44, 0x0a, 0x1f, 0x88, 0x54, 0x91, 0x22, 0x5a, + 0xb5, 0x11, 0x52, 0x95, 0x3e, 0x48, 0x9b, 0x5a, 0xad, 0x1a, 0xa5, 0x2d, + 0xb4, 0x5f, 0xa2, 0x96, 0x52, 0x68, 0x8b, 0x6d, 0x5e, 0x06, 0x1b, 0x53, + 0xbc, 0x7e, 0x61, 0x83, 0xb1, 0xc1, 0x76, 0xfc, 0xc0, 0xe0, 0xc7, 0xda, + 0xde, 0x5d, 0x7b, 0xbd, 0xbb, 0xde, 0x99, 0xdb, 0x0f, 0x6b, 0x90, 0x31, + 0x36, 0x21, 0x88, 0x23, 0x8d, 0xae, 0x34, 0x9a, 0x7b, 0xfe, 0xbf, 0x7b, + 0xce, 0x3d, 0xf7, 0x9e, 0x91, 0x78, 0x0c, 0xb3, 0x95, 0x94, 0xa5, 0x03, + 0xdf, 0x04, 0x26, 0x81, 0x11, 0xa0, 0x6e, 0xb4, 0xa6, 0x7c, 0xf4, 0x71, + 0xe6, 0x7e, 0x99, 0x49, 0x8f, 0x21, 0xfe, 0x36, 0x50, 0x0e, 0x18, 0xe7, + 0xbc, 0x16, 0x40, 0x33, 0x70, 0x7a, 0xf6, 0xb9, 0x38, 0x5a, 0x53, 0x3e, + 0xfd, 0xd4, 0x01, 0x6c, 0x25, 0x65, 0xd1, 0x40, 0x37, 0x60, 0x7b, 0xef, + 0x8d, 0x52, 0x36, 0xae, 0xc9, 0x65, 0xca, 0xe7, 0xa7, 0xf5, 0xe6, 0x00, + 0x57, 0x3b, 0xfb, 0x68, 0x6a, 0xef, 0x65, 0x64, 0xdc, 0x0b, 0x10, 0x00, + 0x2e, 0xcd, 0x01, 0xaa, 0x1f, 0xad, 0x29, 0x17, 0x4f, 0x03, 0xe0, 0x20, + 0xf0, 0xe3, 0x6f, 0x6c, 0x2c, 0xe4, 0xf0, 0x07, 0x6f, 0xd3, 0x75, 0x37, + 0x80, 0xa6, 0x0b, 0x22, 0x8c, 0x12, 0xb6, 0x18, 0x23, 0xd6, 0x28, 0x03, + 0x4d, 0xed, 0x3d, 0x1c, 0x3f, 0xdb, 0xc0, 0xc9, 0xea, 0x26, 0x86, 0x5c, + 0x9e, 0x7b, 0x53, 0xef, 0x00, 0xff, 0x04, 0x8e, 0x01, 0xe7, 0x47, 0x6b, + 0xca, 0x67, 0xbe, 0x32, 0x80, 0xad, 0xa4, 0x2c, 0x01, 0xf8, 0x42, 0x35, + 0x2a, 0xd1, 0x15, 0x9f, 0x1e, 0x60, 0x64, 0xca, 0x84, 0xa6, 0x0b, 0x74, + 0x5d, 0xa0, 0x0b, 0xd0, 0x05, 0x08, 0x01, 0x31, 0x91, 0x32, 0xd6, 0x68, + 0x23, 0xd6, 0x68, 0x99, 0x5b, 0xdd, 0xbd, 0x9c, 0xa8, 0x6e, 0xe2, 0xc4, + 0xf9, 0x26, 0x86, 0xc7, 0xee, 0xc3, 0x8c, 0x03, 0x27, 0x67, 0x61, 0x2a, + 0x46, 0x6b, 0xca, 0x7d, 0x8f, 0x0b, 0xb0, 0x17, 0xf8, 0xd5, 0xde, 0xef, + 0x96, 0xf2, 0xf2, 0xb6, 0x17, 0x99, 0xf0, 0x69, 0x08, 0x21, 0x10, 0x3a, + 0xe8, 0x22, 0x0c, 0x31, 0x13, 0x0a, 0xd1, 0xd1, 0xd3, 0x48, 0x63, 0xdb, + 0x19, 0x84, 0x26, 0x78, 0xe5, 0xc5, 0x77, 0x49, 0x4b, 0x8e, 0x27, 0x29, + 0xc6, 0x40, 0xff, 0x40, 0x3f, 0xff, 0xae, 0x6e, 0xe4, 0x64, 0x75, 0xf3, + 0x5c, 0x18, 0x1f, 0x70, 0x70, 0xb4, 0xa6, 0xfc, 0xa3, 0xc7, 0x01, 0x68, + 0x31, 0xa9, 0x4a, 0x41, 0xe3, 0xe7, 0x87, 0xe8, 0x1f, 0x0f, 0x8b, 0x0a, + 0x01, 0xb7, 0x87, 0x7b, 0xa8, 0x6f, 0x3d, 0xc7, 0x95, 0x96, 0x2a, 0x6e, + 0x0e, 0x3a, 0x29, 0x7c, 0x21, 0x85, 0x8c, 0x3c, 0x1b, 0xc7, 0x7e, 0xd7, + 0xcc, 0x81, 0xd7, 0x3f, 0x27, 0x2b, 0x6f, 0x15, 0xba, 0x1e, 0x4e, 0x7f, + 0x7c, 0x94, 0x42, 0x6a, 0xbc, 0x42, 0x5f, 0x7f, 0x1f, 0xff, 0x38, 0xed, + 0xe4, 0xc8, 0x89, 0x5a, 0x74, 0x5d, 0x17, 0x7a, 0x60, 0x32, 0x67, 0xdc, + 0x79, 0xf4, 0x16, 0x80, 0xb2, 0x88, 0xf8, 0x2a, 0xa0, 0x60, 0xd7, 0x0b, + 0xab, 0x99, 0x0a, 0x04, 0xb8, 0xdc, 0x72, 0x96, 0xba, 0xc6, 0x4a, 0x2e, + 0xb7, 0x9d, 0x25, 0x7e, 0x99, 0x46, 0xd1, 0xc6, 0x65, 0xe4, 0xbd, 0x6e, + 0x24, 0xdb, 0x9c, 0x4f, 0x47, 0xd7, 0x38, 0x75, 0x93, 0x5d, 0x88, 0xf4, + 0x20, 0x2d, 0xd7, 0xab, 0x58, 0xbe, 0xa2, 0x08, 0x49, 0x91, 0xd1, 0x75, + 0x81, 0x77, 0x5a, 0xc3, 0x33, 0xad, 0x11, 0x13, 0x95, 0xc6, 0x2f, 0xde, + 0xdf, 0xc3, 0x90, 0xcb, 0x4d, 0x45, 0x6d, 0xab, 0x34, 0xd5, 0x53, 0xbb, + 0x12, 0xe8, 0x01, 0xb4, 0x05, 0x01, 0x80, 0xef, 0x01, 0xbc, 0xb9, 0x6b, + 0x23, 0xdb, 0xdf, 0x59, 0xcf, 0x92, 0x62, 0x23, 0x39, 0x9b, 0x53, 0x79, + 0xe9, 0x15, 0x07, 0xb7, 0x3d, 0x6e, 0x1a, 0xda, 0x5d, 0x84, 0x9a, 0x55, + 0x42, 0x9e, 0x19, 0x3c, 0x2e, 0x17, 0x5f, 0x7b, 0x35, 0x15, 0x77, 0x9e, + 0x87, 0xab, 0x97, 0x6b, 0xd9, 0xe5, 0xfe, 0x3e, 0x71, 0xb6, 0x24, 0x74, + 0x21, 0x21, 0x66, 0x53, 0x65, 0x36, 0xc9, 0x00, 0x74, 0xf5, 0x0f, 0x23, + 0x74, 0xcd, 0x1b, 0x1c, 0xeb, 0xd5, 0x00, 0x0b, 0xe0, 0x79, 0x08, 0xc0, + 0x56, 0x52, 0xa6, 0x02, 0x7b, 0x72, 0x9f, 0x49, 0xa5, 0x30, 0x6f, 0x19, + 0x2b, 0xb2, 0x56, 0xe3, 0xd8, 0xe0, 0xe3, 0xd4, 0xdd, 0x56, 0x66, 0xaa, + 0xac, 0x04, 0xbd, 0xd3, 0xb8, 0x07, 0x87, 0x98, 0x1e, 0xf3, 0x12, 0x63, + 0x8e, 0x23, 0x2e, 0xca, 0xc6, 0xc8, 0x35, 0x0f, 0x11, 0xf9, 0x46, 0x3a, + 0x27, 0x9a, 0x19, 0x19, 0xea, 0x21, 0x29, 0x35, 0x05, 0x21, 0x08, 0x03, + 0xe8, 0x90, 0x12, 0xa7, 0x72, 0x7b, 0x68, 0x8c, 0x5b, 0x7d, 0x43, 0xe8, + 0x01, 0x6f, 0x03, 0x42, 0x17, 0x84, 0x4b, 0x77, 0xc1, 0x14, 0xec, 0x04, + 0xac, 0x6f, 0xbe, 0x5c, 0xc2, 0x74, 0x50, 0xa7, 0x64, 0xf5, 0x16, 0xfe, + 0x73, 0xf9, 0x30, 0xc9, 0xb9, 0x16, 0x2e, 0xd5, 0xb5, 0x62, 0xb7, 0x3e, + 0xc3, 0xd6, 0x9c, 0x9d, 0x14, 0xe7, 0x6f, 0x62, 0x65, 0xee, 0x5a, 0x50, + 0x65, 0x76, 0xff, 0xb0, 0x98, 0x95, 0x05, 0x4b, 0x18, 0x77, 0xf8, 0xb8, + 0xdc, 0x7c, 0x8a, 0x82, 0x55, 0xeb, 0x90, 0x0d, 0x06, 0x84, 0x90, 0x00, + 0x41, 0x42, 0x94, 0xc2, 0x9f, 0xcf, 0xb4, 0x01, 0x30, 0xe3, 0x1d, 0x6e, + 0x00, 0xa6, 0x1e, 0x05, 0xf0, 0x56, 0x84, 0x6a, 0xe4, 0xdb, 0xa5, 0xeb, + 0x98, 0x09, 0x09, 0x36, 0x15, 0x7f, 0x9d, 0x9f, 0xfd, 0xe5, 0x3d, 0x76, + 0x3c, 0xbf, 0x1a, 0x29, 0x52, 0x62, 0x55, 0x66, 0x31, 0x3f, 0xdd, 0xf7, + 0x5b, 0x64, 0xd9, 0x10, 0x5e, 0x25, 0xf0, 0xdc, 0xca, 0x52, 0xfa, 0xda, + 0xeb, 0x31, 0x2f, 0x57, 0x69, 0xac, 0xae, 0xc5, 0x3b, 0x36, 0x4c, 0x62, + 0x4a, 0x1a, 0x42, 0x40, 0x74, 0xa4, 0x82, 0x2c, 0x43, 0x45, 0xed, 0x55, + 0x84, 0x10, 0xba, 0x7f, 0xf0, 0x6a, 0x23, 0x30, 0x74, 0x4f, 0x4c, 0x9e, + 0x17, 0xfe, 0x58, 0x60, 0x6b, 0xe9, 0x73, 0x2b, 0x31, 0x47, 0x46, 0x22, + 0xcb, 0x12, 0xe9, 0xc9, 0xe9, 0xc4, 0x9b, 0x92, 0x71, 0x0f, 0xfb, 0x30, + 0xd9, 0x15, 0xba, 0xee, 0xde, 0x40, 0x0f, 0x05, 0x51, 0x0c, 0x12, 0x48, + 0x1a, 0xdd, 0x03, 0xed, 0x64, 0xa6, 0x67, 0x33, 0xe4, 0x74, 0x63, 0x4a, + 0x32, 0x72, 0x6b, 0xaa, 0x8d, 0xfe, 0xde, 0x0e, 0x8c, 0x06, 0x09, 0xa3, + 0x41, 0x22, 0xce, 0x62, 0x60, 0x6a, 0x3a, 0x40, 0x4d, 0x53, 0x27, 0x22, + 0xe4, 0xef, 0x08, 0x4d, 0x8e, 0x78, 0x81, 0xe1, 0x7b, 0x9a, 0xf3, 0x23, + 0xb0, 0x13, 0x50, 0x5f, 0xda, 0x5c, 0x44, 0x48, 0x13, 0x28, 0x86, 0xf0, + 0x61, 0xb3, 0x36, 0x7f, 0x3d, 0x5f, 0x74, 0x5f, 0x21, 0x22, 0xdd, 0x48, + 0x4f, 0x4d, 0x17, 0x53, 0x9e, 0x71, 0x24, 0x49, 0xe3, 0x8d, 0x1f, 0xed, + 0xa4, 0xb5, 0xbb, 0x91, 0x88, 0x25, 0x46, 0x88, 0x80, 0x19, 0xb7, 0x4e, + 0x44, 0x8e, 0x81, 0x0b, 0x8d, 0xff, 0xa5, 0xa4, 0x64, 0x33, 0x26, 0x55, + 0xc5, 0x62, 0x32, 0x70, 0xaa, 0xa6, 0x8d, 0x40, 0x30, 0x84, 0xe6, 0x1b, + 0x73, 0x02, 0x21, 0xc0, 0xb5, 0x18, 0xc0, 0x6b, 0xaa, 0x51, 0x61, 0xcb, + 0xfa, 0x15, 0x08, 0x21, 0xe8, 0xbf, 0xdb, 0xc3, 0x2f, 0x8f, 0x1c, 0xa2, + 0xfe, 0x7a, 0x1d, 0x21, 0x97, 0x17, 0xd3, 0x1a, 0x85, 0x89, 0x19, 0x0f, + 0x6d, 0x9d, 0x8d, 0xc4, 0x26, 0xc6, 0xd1, 0x3e, 0xdc, 0xcc, 0x89, 0xbf, + 0x9e, 0xe4, 0xba, 0xf7, 0x2a, 0x9f, 0xdc, 0xf8, 0x08, 0x81, 0xc0, 0x9c, + 0xa7, 0xd2, 0x54, 0x55, 0x83, 0xec, 0x77, 0x91, 0x9c, 0x94, 0x01, 0x40, + 0x45, 0x6d, 0x2b, 0x00, 0x81, 0xd1, 0x6e, 0x27, 0x30, 0x0a, 0xe8, 0x0f, + 0xa5, 0xc0, 0x56, 0x52, 0x16, 0x05, 0x6c, 0x7b, 0xbe, 0x38, 0x0f, 0x73, + 0x84, 0x09, 0x59, 0x96, 0xf8, 0xc1, 0x4f, 0xbe, 0x43, 0xde, 0xba, 0x2c, + 0xf6, 0xec, 0xdb, 0x8d, 0x65, 0x83, 0x19, 0xd5, 0x66, 0x40, 0x8e, 0x90, + 0xb8, 0x7e, 0xab, 0x01, 0x2d, 0x34, 0x89, 0x21, 0x56, 0xa6, 0x72, 0xe8, + 0x04, 0x7f, 0xef, 0xfd, 0x1b, 0x02, 0x81, 0xd0, 0x20, 0xe4, 0xd1, 0xb8, + 0x31, 0xdc, 0x4e, 0xcb, 0xf5, 0x16, 0x20, 0x5c, 0x09, 0x55, 0x75, 0x6d, + 0x08, 0x2d, 0xe4, 0xf2, 0xdf, 0x69, 0xeb, 0x99, 0x9b, 0xff, 0xf9, 0x11, + 0xd8, 0x0e, 0x44, 0xec, 0xd8, 0x5c, 0x84, 0x10, 0x00, 0x1a, 0x7d, 0xee, + 0x6e, 0x32, 0x97, 0x2f, 0xe3, 0xfc, 0x50, 0x15, 0x22, 0x26, 0x7c, 0x9f, + 0x98, 0xec, 0x06, 0x5a, 0xbb, 0x9b, 0xd9, 0xff, 0xce, 0x01, 0x62, 0x7f, + 0x1e, 0xcf, 0x1f, 0x0f, 0x7f, 0x8a, 0x92, 0xa8, 0x30, 0xe3, 0xd2, 0x08, + 0xf6, 0x87, 0x88, 0x56, 0x62, 0xd8, 0x9a, 0x5f, 0xca, 0xf8, 0x98, 0x8b, + 0x60, 0x30, 0xc8, 0xb5, 0xae, 0x41, 0x86, 0xc7, 0x3c, 0x68, 0x01, 0x8f, + 0x73, 0x56, 0x67, 0x78, 0x31, 0x80, 0x6f, 0x19, 0x0c, 0x32, 0xdb, 0x4a, + 0x0a, 0x00, 0x30, 0x1a, 0x14, 0xb2, 0x13, 0x72, 0x79, 0xff, 0x0f, 0x7b, + 0x51, 0x57, 0x4a, 0xc8, 0xaa, 0x44, 0x60, 0x20, 0x44, 0xc8, 0x23, 0xe8, + 0x98, 0xe8, 0x64, 0x7a, 0xca, 0x47, 0x65, 0x79, 0x35, 0x07, 0x3f, 0xde, + 0x8f, 0x3f, 0xe8, 0x47, 0x8d, 0x57, 0x29, 0x5c, 0x53, 0xc4, 0xda, 0x67, + 0xd7, 0x91, 0x9e, 0x9e, 0x41, 0x9a, 0xdd, 0x8e, 0xaa, 0xaa, 0x54, 0x5e, + 0x9a, 0x2d, 0x3f, 0xf7, 0x1d, 0x27, 0xe0, 0x06, 0xfc, 0x0f, 0x01, 0xd8, + 0x4a, 0xca, 0x22, 0x81, 0xed, 0x1b, 0x8a, 0xb2, 0x89, 0x8b, 0xb6, 0x20, + 0x84, 0x00, 0x49, 0xe2, 0xd7, 0xfb, 0x7e, 0xc3, 0x9e, 0xfd, 0xbb, 0xe9, + 0xbf, 0xd8, 0x8f, 0x84, 0x84, 0x2c, 0xc9, 0xe4, 0xda, 0x73, 0xd9, 0x90, + 0x57, 0x82, 0x7b, 0x62, 0x82, 0xcc, 0xac, 0x2c, 0x3e, 0x3b, 0x74, 0x14, + 0x8f, 0xdb, 0x8d, 0x24, 0x49, 0x98, 0x4c, 0x26, 0xcc, 0x16, 0xcb, 0x03, + 0x9b, 0x6a, 0xb6, 0xfc, 0x42, 0xd3, 0xb7, 0x9b, 0x5b, 0xe6, 0xaf, 0x7e, + 0x6e, 0x04, 0xb6, 0x01, 0x96, 0x1d, 0x9b, 0x8a, 0x40, 0x02, 0x59, 0x0a, + 0xdf, 0x51, 0x45, 0xcf, 0xae, 0xe6, 0xf4, 0x27, 0xd5, 0x34, 0x5d, 0x75, + 0x32, 0x39, 0xe9, 0xc5, 0x9e, 0x9c, 0x4e, 0x6c, 0x6c, 0x1c, 0x29, 0xa9, + 0xa9, 0xd8, 0x12, 0x13, 0xc3, 0x0e, 0x14, 0x85, 0x04, 0xab, 0x75, 0xbe, + 0x5f, 0x00, 0xee, 0x8c, 0x4c, 0xd0, 0x7a, 0x73, 0x00, 0x3d, 0xe8, 0x6b, + 0xd3, 0xfd, 0x1e, 0xff, 0xfc, 0xfc, 0xcf, 0x05, 0x78, 0x0d, 0x60, 0xfb, + 0xa6, 0xa2, 0x87, 0xae, 0xc7, 0x34, 0xbb, 0x9d, 0x34, 0xbb, 0x7d, 0x41, + 0x81, 0x2f, 0xb3, 0xca, 0x4b, 0xe1, 0xdd, 0xaf, 0xf9, 0x5c, 0x4e, 0x20, + 0x08, 0x4c, 0xcc, 0xff, 0x46, 0x9e, 0x3d, 0xfb, 0x77, 0x16, 0xaf, 0xc8, + 0x24, 0xc5, 0x16, 0xfb, 0x44, 0x42, 0x8b, 0xd9, 0xfd, 0xf2, 0x1b, 0xee, + 0x74, 0x12, 0x0e, 0xff, 0x43, 0x6d, 0x9a, 0x0c, 0x6c, 0x01, 0x62, 0x76, + 0x6c, 0x2e, 0x7a, 0xaa, 0xe2, 0xd3, 0x81, 0x20, 0x17, 0x1b, 0x3a, 0x10, + 0x5a, 0x70, 0x30, 0x30, 0x72, 0x73, 0x90, 0x05, 0xc2, 0x7f, 0x0f, 0xa0, + 0x18, 0xa0, 0x30, 0x37, 0xe3, 0xa9, 0x02, 0x5c, 0x70, 0xde, 0xc0, 0x1f, + 0x9c, 0x41, 0x9b, 0xf6, 0x34, 0x10, 0x5e, 0xf9, 0xc8, 0x62, 0x00, 0x21, + 0x80, 0xcf, 0x8e, 0x5d, 0xa0, 0x77, 0xf0, 0xa9, 0xb4, 0xfa, 0x00, 0x73, + 0xca, 0x6f, 0xa0, 0x1e, 0x18, 0x03, 0x16, 0x6c, 0x4c, 0x15, 0xe0, 0x4f, + 0x42, 0xd7, 0xca, 0x8e, 0x9f, 0x6b, 0xb4, 0x1f, 0x3f, 0xd7, 0x48, 0x7e, + 0x96, 0x9d, 0xc2, 0xdc, 0x0c, 0x0a, 0x72, 0x33, 0x28, 0xcc, 0xcd, 0x20, + 0xdf, 0x61, 0x27, 0xd2, 0xa4, 0x7e, 0x25, 0x71, 0x21, 0x04, 0x15, 0xb5, + 0xad, 0x08, 0xa1, 0xfb, 0x7d, 0x03, 0x4d, 0xd7, 0x58, 0x24, 0xfc, 0x30, + 0xdb, 0x13, 0x9a, 0x97, 0xae, 0x5b, 0x63, 0x4a, 0x74, 0x7c, 0x2c, 0x1b, + 0xcd, 0xb9, 0x92, 0x41, 0x79, 0xa0, 0xa6, 0x64, 0x59, 0x22, 0x67, 0x69, + 0x0a, 0x05, 0x39, 0x19, 0xb3, 0x60, 0xe9, 0xac, 0x70, 0x2c, 0x21, 0xca, + 0x1c, 0xb1, 0x28, 0xc0, 0xc5, 0x86, 0x0e, 0x5e, 0xdd, 0x7b, 0x18, 0xcd, + 0xef, 0xfd, 0xdf, 0xb8, 0xf3, 0xe8, 0x87, 0xc0, 0x79, 0xc0, 0xbb, 0x28, + 0xc0, 0xec, 0x58, 0x00, 0x64, 0x18, 0x63, 0xd3, 0xe2, 0x55, 0x5b, 0x96, + 0x43, 0xb1, 0x58, 0x1d, 0xb2, 0x29, 0x3a, 0x5b, 0x36, 0x46, 0x38, 0x24, + 0x59, 0x89, 0x7b, 0x60, 0x92, 0x24, 0x91, 0x95, 0x9e, 0x14, 0x06, 0xca, + 0x49, 0xbf, 0x3f, 0x46, 0x5b, 0x22, 0x99, 0x09, 0x69, 0xbc, 0xf5, 0xc1, + 0xef, 0xa9, 0xbc, 0xd4, 0x46, 0x60, 0xb4, 0xeb, 0x63, 0xef, 0x8d, 0xca, + 0x7f, 0x01, 0x67, 0x1e, 0x19, 0x81, 0x39, 0x96, 0x0c, 0xc4, 0x03, 0x71, + 0x40, 0x2c, 0xa0, 0x02, 0x18, 0xe3, 0x33, 0x6c, 0x26, 0xeb, 0x32, 0x87, + 0xc1, 0x6c, 0xcd, 0x96, 0x4d, 0x51, 0x8e, 0x30, 0x94, 0x21, 0x7a, 0xbe, + 0xb3, 0xcc, 0x25, 0x89, 0x04, 0x67, 0x34, 0x06, 0x86, 0xc6, 0xd0, 0x43, + 0xc1, 0xdb, 0xe3, 0xf5, 0x47, 0xde, 0x15, 0x5a, 0xb0, 0x0b, 0x68, 0x7d, + 0x5c, 0x80, 0xf9, 0x66, 0x9e, 0x05, 0x89, 0x9b, 0x03, 0x65, 0x04, 0x50, + 0xad, 0x99, 0xc9, 0x6a, 0xc2, 0x52, 0x87, 0xc1, 0x9c, 0x90, 0x6d, 0x30, + 0x59, 0x1c, 0x92, 0x12, 0xe9, 0x90, 0x64, 0xd9, 0x0c, 0x20, 0x74, 0x6d, + 0x72, 0x7a, 0xa0, 0xf9, 0x43, 0x5f, 0xdf, 0x95, 0x6b, 0x40, 0x2d, 0xe1, + 0x4d, 0xf8, 0x44, 0x00, 0x0b, 0x99, 0x65, 0x1e, 0x50, 0x2c, 0xa0, 0x80, + 0x24, 0x99, 0x12, 0x1d, 0xa9, 0x06, 0x73, 0x82, 0x35, 0x30, 0x72, 0xab, + 0x5b, 0xf3, 0xb9, 0xa6, 0x08, 0xff, 0xa2, 0x39, 0x1f, 0xe1, 0xeb, 0x89, + 0x00, 0x16, 0xf2, 0x31, 0x1f, 0x2a, 0x92, 0x70, 0xe3, 0x71, 0x9d, 0xf0, + 0x11, 0xbc, 0xa8, 0xfd, 0x1f, 0xbf, 0x8b, 0x3f, 0x6e, 0xf8, 0x00, 0xc8, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, + 0x82 +}; + +#include +using namespace std; +#include +#include +#include +#include +using namespace Music; + +GLGraph::GLGraph(const QString& name, QWidget* parent) +: QGLWidget(parent, "GLGraph") +, View(name, this) +, m_skip(1) +, m_new_values(false) +{ + // settings + QImage img; + img.loadFromData(g_icon_graph, sizeof(g_icon_graph), "PNG"); + setting_show->setIconSet(QIconSet(QImage(img))); + setting_show->setOn(true); + + setting_showWaveForm = new QAction(this); + setting_showWaveForm->setMenuText(tr("Show Wave Form")); + setting_showWaveForm->setToggleAction(true); + connect(setting_showWaveForm, SIGNAL(toggled(bool)), this, SLOT(update())); + setting_showWaveForm->setOn(true); + setting_showWaveForm->addTo(&m_popup_menu); + + setting_autoScale = new QAction(this); + setting_autoScale->setMenuText(tr("Auto scale")); + setting_autoScale->setToggleAction(true); + connect(setting_autoScale, SIGNAL(toggled(bool)), this, SLOT(update())); + setting_autoScale->setOn(false); + setting_autoScale->addTo(&m_popup_menu); + + m_popup_menu.insertItem(new Title(tr("Scale factor"), &m_popup_menu)); + setting_spinScaleFactor = new QSpinBox(1, 1000, 10, &m_popup_menu); + QToolTip::add(setting_spinScaleFactor, tr("Scale factor")); + setting_spinScaleFactor->setValue(1000); + connect(setting_spinScaleFactor, SIGNAL(valueChanged(int)), this, SLOT(update())); + m_popup_menu.insertItem(setting_spinScaleFactor); + + m_popup_menu.insertItem(new Title(tr("Duration"), &m_popup_menu)); + setting_spinDuration = new QSpinBox(20, 120000, 100, &m_popup_menu); + QToolTip::add(setting_spinDuration, tr("Duration")); + setting_spinDuration->setValue(10000); + connect(setting_spinDuration, SIGNAL(valueChanged(int)), this, SLOT(update())); + m_popup_menu.insertItem(setting_spinDuration); + + m_popup_menu.insertItem(new Title(tr("Max height"), &m_popup_menu)); + setting_spinMaxHeight = new QSpinBox(10, 100000, 1, &m_popup_menu); + QToolTip::add(setting_spinMaxHeight, tr("Max height")); + setting_spinMaxHeight->setValue(50); + m_popup_menu.insertItem(setting_spinMaxHeight); +} + +void GLGraph::save() +{ + s_settings->writeEntry("showWaveForm", setting_showWaveForm->isOn()); + s_settings->writeEntry("autoScale", setting_autoScale->isOn()); + s_settings->writeEntry("setting_spinScaleFactor", setting_spinScaleFactor->value()); + s_settings->writeEntry("spinDuration", setting_spinDuration->value()); + s_settings->writeEntry("spinMaxHeight", setting_spinMaxHeight->value()); +} +void GLGraph::load() +{ + setting_showWaveForm->setOn(s_settings->readBoolEntry("showWaveForm", setting_showWaveForm->isOn())); + setting_autoScale->setOn(s_settings->readBoolEntry("autoScale", setting_autoScale->isOn())); + setting_spinScaleFactor->setValue(s_settings->readNumEntry("setting_spinScaleFactor", setting_spinScaleFactor->value())); + setting_spinDuration->setValue(s_settings->readNumEntry("spinDuration", setting_spinDuration->value())); + setting_spinMaxHeight->setValue(s_settings->readNumEntry("spinMaxHeight", setting_spinMaxHeight->value())); +} +void GLGraph::clearSettings() +{ +// cerr << "GLGraph::clearSettings" << endl; + s_settings->removeEntry("showWaveForm"); + s_settings->removeEntry("autoScale"); + s_settings->removeEntry("setting_spinScaleFactor"); + s_settings->removeEntry("spinDuration"); + s_settings->removeEntry("spinMaxHeight"); +} + +void GLGraph::initializeGL() +{ + // Set the clear color to white + glClearColor(1.0, 1.0, 1.0, 0.0); + + // glShadeModel( GL_FLAT ); + glShadeModel(GL_SMOOTH); + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + glLoadIdentity(); +} + +void GLGraph::resizeGL( int w, int h ) +{ + // Set the new viewport size + glViewport(0, 0, (GLint)w, (GLint)h); + + // Choose the projection matrix to be the matrix + // manipulated by the following calls + glMatrixMode(GL_PROJECTION); + + // Set the projection matrix to be the identity matrix + glLoadIdentity(); + + // Define the dimensions of the Orthographic Viewing Volume + glOrtho(0.0, w, 0.0, h, 0.0, 1.0); + + // Choose the modelview matrix to be the matrix + // manipulated by further calls + glMatrixMode(GL_MODELVIEW); + + update_maxs(); +} + +void GLGraph::addValue(double v) +{ + m_pending_queue.push_front(v); + m_queue.push_front(v); + + m_new_values = true; +} +void GLGraph::clearValues() +{ + m_queue.clear(); + m_maxs.clear(); +} +void GLGraph::refreshGraph() +{ + int max_size = getLength(); + m_skip = max_size/width(); + if(m_skip<1) m_skip = 1; + + while(!m_pending_queue.empty() && int(m_pending_queue.size()) >= m_skip) + { + double smin = m_pending_queue.back(); + double smax = m_pending_queue.back(); + for(int i=0; i=width()) + m_maxs.pop_back(); + + // drop unused data + while(!m_queue.empty() && int(m_queue.size())>max_size) + m_queue.pop_back(); + + m_new_values = false; +} + +void GLGraph::update_maxs() +{ +// cerr << "GLGraph::update_maxs " << m_sampling_rate << endl; + + if(m_queue.empty()) return; + + m_maxs.clear(); + int max_size = getLength(); + m_skip = max_size/width(); + if(m_skip<1) m_skip = 1; + + // drop unused data + while(!m_queue.empty() && int(m_queue.size())>max_size) + m_queue.pop_back(); + + // computes maxs + for(size_t j=0; j+m_skip<=m_queue.size(); j+=m_skip) + { + double smin, smax; + smin = smax = m_queue[j+m_skip]; + for(size_t i=j; iisOn() && !m_queue.empty()) + { + // horiz line + glBegin(GL_LINES); + float gray = 0.8; + glColor3f(gray, gray, gray); + glVertex2i(0, height()/2); + glVertex2i(width, height()/2); + glEnd(); + + m_queue_amplitude = 0.0; + double scale_factor; + if(setting_autoScale->isOn()) + { + if(m_skip<2) + for(size_t i=0; ivalue(); + + // paint the noise treshold + glBegin(GL_LINES); + int y = int((1+m_treshold*scale_factor)*height()/2); + glColor3f(1.0,1.0,1.0); + glVertex2i(0, y); + glColor3f(1.0,0.5,0.5); + glVertex2i(width, y); + y = int((1-m_treshold*scale_factor)*height()/2); + glColor3f(1.0,1.0,1.0); + glVertex2i(0, y); + glColor3f(1.0,0.5,0.5); + glVertex2i(width, y); + glEnd(); + + // paint the wave form + glColor3f(graph_gray, graph_gray, graph_gray); + if(m_skip<2) + { + glBegin(GL_LINE_STRIP); + + glVertex2i(width-1, int((m_queue[0]*scale_factor)*height()/2 + height()/2)); + float istep = float(width)/m_queue.size(); + for(size_t i=1; i +using namespace std; +#include +#include +#include +class QTimer; +#include +#include "View.h" + +class GLGraph : public QGLWidget, public View +{ + Q_OBJECT + + protected: + virtual void mouseReleaseEvent(QMouseEvent* e){View::mouseReleaseEvent(e);} + + deque m_pending_queue; + deque m_queue; + int m_skip; + deque< pair > m_maxs; + double m_queue_amplitude; + bool m_new_values; + + virtual void base_paint(float graph_gray=0.0); + + void update_maxs(); + + public: + GLGraph(const QString& name, QWidget* parent); + ~GLGraph(){} + void addValue(double v); + void clearValues(); + void refreshGraph(); + int getLength() const {return (setting_spinDuration->value()*Music::GetSamplingRate())/1000;} + + double m_treshold; + + // settings + QAction* setting_showWaveForm; + QAction* setting_autoScale; + QSpinBox* setting_spinScaleFactor; + QSpinBox* setting_spinDuration; + QSpinBox* setting_spinMaxHeight; + virtual void save(); + virtual void load(); + virtual void clearSettings(); + + public slots: + void initializeGL(); + void paintGL(); + void resizeGL( int w, int h ); +}; + +#endif // _GLGraph_h_ diff --git a/src/modules/GLSample.cpp b/src/modules/GLSample.cpp new file mode 100644 index 0000000..2079591 --- /dev/null +++ b/src/modules/GLSample.cpp @@ -0,0 +1,310 @@ +// Copyright 2004 "Gilles Degottex" + +// This file is part of "fmit" + +// "fmit" 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. +// +// "fmit" 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 + +#include "GLSample.h" + +static const unsigned char g_icon_sample[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, + 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7a, 0x7a, 0xf4, 0x00, 0x00, 0x05, + 0xf4, 0x49, 0x44, 0x41, 0x54, 0x78, 0x9c, 0xbd, 0x97, 0x7b, 0x4c, 0x53, + 0x57, 0x1c, 0xc7, 0x3f, 0xf7, 0xb6, 0x45, 0x28, 0x30, 0x9e, 0xad, 0x83, + 0x20, 0x54, 0x59, 0x7c, 0x4d, 0x2a, 0xc4, 0x81, 0x32, 0x61, 0xd9, 0xa6, + 0x53, 0xa7, 0x7f, 0xcc, 0x39, 0x97, 0xa9, 0xd9, 0xe2, 0x96, 0xe8, 0x5e, + 0xd9, 0xcc, 0x92, 0x6d, 0x71, 0x4b, 0x36, 0x71, 0x89, 0x71, 0x5b, 0xf6, + 0x7e, 0xc5, 0x25, 0x2e, 0x3e, 0x92, 0xc5, 0xa9, 0x51, 0x36, 0x63, 0x34, + 0x46, 0x74, 0xce, 0x21, 0x8f, 0x39, 0x03, 0x14, 0xd4, 0x55, 0x44, 0x10, + 0x54, 0x1e, 0xe5, 0xd5, 0x16, 0xda, 0x52, 0x68, 0xef, 0xd9, 0x1f, 0xb7, + 0x76, 0x20, 0x05, 0x04, 0x93, 0x7d, 0x93, 0x9b, 0x7b, 0xee, 0x39, 0xbf, + 0x7b, 0xbe, 0xdf, 0x73, 0xee, 0xef, 0xfc, 0x7e, 0xbf, 0x2b, 0x71, 0xf7, + 0xd0, 0x03, 0xd3, 0x81, 0x24, 0x20, 0x05, 0xf0, 0x02, 0x95, 0x80, 0x15, + 0x18, 0x18, 0xc7, 0x3c, 0x43, 0x20, 0x8d, 0x31, 0x1e, 0x0d, 0x3c, 0x0f, + 0xac, 0x07, 0xa6, 0x00, 0x3a, 0x20, 0x02, 0x88, 0x04, 0x7c, 0x40, 0x77, + 0x80, 0xdc, 0x0d, 0x5c, 0x07, 0x8e, 0x01, 0x3f, 0x06, 0xc4, 0xdd, 0x93, + 0x00, 0x09, 0x78, 0x19, 0xf8, 0x10, 0x48, 0x04, 0x26, 0x85, 0x87, 0x6b, + 0x31, 0x3f, 0x98, 0x48, 0x96, 0xd9, 0x48, 0x96, 0xd9, 0x88, 0xdb, 0xe3, + 0xa3, 0xaa, 0xda, 0x46, 0x85, 0xc5, 0x86, 0xf5, 0x6a, 0x17, 0x3e, 0x9f, + 0x42, 0x80, 0xb8, 0x0d, 0xd8, 0x01, 0x7c, 0x06, 0xf8, 0x27, 0x22, 0x20, + 0x0a, 0x28, 0x02, 0x1e, 0x04, 0xa2, 0x17, 0x2e, 0x48, 0x66, 0xdb, 0x07, + 0x79, 0x64, 0xcc, 0x4e, 0x44, 0xa3, 0x51, 0xcd, 0xbd, 0x52, 0x02, 0x92, + 0x18, 0x20, 0x0c, 0x27, 0x00, 0x7d, 0x7d, 0x3e, 0x8a, 0xcb, 0x6e, 0xb1, + 0xb9, 0xa0, 0x98, 0x86, 0x46, 0x07, 0x80, 0x0b, 0xb8, 0x0c, 0xac, 0x00, + 0xda, 0xc7, 0x23, 0x20, 0x01, 0x38, 0x0b, 0xcc, 0xd0, 0xeb, 0x75, 0xda, + 0x82, 0xcd, 0x0b, 0xd8, 0xb8, 0xde, 0x4c, 0x9f, 0x34, 0x99, 0x4e, 0x39, + 0x07, 0x97, 0x94, 0x8a, 0x4b, 0x4e, 0xc3, 0x8f, 0x1e, 0x00, 0x9d, 0xb0, + 0x13, 0x29, 0x9a, 0xd0, 0x8b, 0x46, 0x8c, 0x4a, 0x09, 0x03, 0xee, 0x6e, + 0x3e, 0xfa, 0xb4, 0x9c, 0x9d, 0x7b, 0xab, 0x11, 0x02, 0x01, 0x34, 0x02, + 0x4b, 0x81, 0xda, 0xbb, 0x11, 0x20, 0x03, 0x17, 0x80, 0xb9, 0xf3, 0x32, + 0x27, 0xcb, 0x3b, 0xbf, 0x7d, 0x02, 0x53, 0x5a, 0x2c, 0xad, 0xf2, 0x62, + 0x6e, 0x69, 0x96, 0x23, 0xd0, 0x8d, 0xb6, 0x10, 0x34, 0xa2, 0x17, 0x93, + 0x72, 0x80, 0x78, 0xa5, 0x92, 0x92, 0xf2, 0x66, 0x36, 0x6c, 0x3a, 0x49, + 0x6b, 0x9b, 0x0b, 0xa0, 0x1e, 0xc8, 0x06, 0xba, 0xc6, 0x12, 0xb0, 0x05, + 0x78, 0x27, 0xe6, 0xbe, 0x49, 0xd1, 0x65, 0x45, 0x6b, 0x89, 0xbb, 0xdf, + 0x44, 0xbd, 0x66, 0x3d, 0x2e, 0xd9, 0x34, 0x2a, 0xf1, 0x9d, 0x88, 0xf3, + 0x57, 0x60, 0x52, 0xf6, 0x51, 0x5a, 0x5a, 0xc7, 0xca, 0x75, 0x47, 0x10, + 0x02, 0x05, 0x28, 0x05, 0xf2, 0x43, 0x0a, 0x0f, 0xdc, 0x8d, 0xc0, 0x4f, + 0x40, 0xc2, 0x57, 0xdb, 0x1f, 0x65, 0x7e, 0xf6, 0x14, 0xae, 0x68, 0x37, + 0xe1, 0x96, 0xa7, 0x8c, 0x8b, 0x1c, 0xe0, 0x96, 0x23, 0x8a, 0xe3, 0x95, + 0xe1, 0x3c, 0x97, 0xdb, 0x42, 0x47, 0x67, 0x1f, 0x15, 0x16, 0x9b, 0x84, + 0x7a, 0x6a, 0xfe, 0x42, 0xfd, 0x24, 0x43, 0x20, 0x07, 0xee, 0x6f, 0x03, + 0xc6, 0x25, 0x8f, 0xa7, 0xb1, 0x76, 0xf5, 0x4c, 0x9a, 0x35, 0xcb, 0xf1, + 0xc8, 0xc9, 0xe3, 0x26, 0x07, 0xf0, 0x78, 0xfa, 0x39, 0x57, 0xed, 0xe6, + 0x7c, 0xeb, 0x3c, 0x3e, 0x7a, 0x3f, 0x97, 0xa9, 0x69, 0x31, 0xa0, 0xfa, + 0xd6, 0xf7, 0xa1, 0xec, 0xe5, 0xc0, 0xb5, 0x4e, 0x92, 0xd0, 0x7c, 0xb5, + 0xfd, 0x51, 0x5c, 0x52, 0x2a, 0x2d, 0xf2, 0xe2, 0x09, 0x91, 0x03, 0x38, + 0x7b, 0x3d, 0x80, 0x60, 0xe7, 0xd9, 0x64, 0x44, 0x58, 0x3c, 0x9f, 0x6c, + 0x0d, 0xee, 0x7c, 0x02, 0x30, 0x6c, 0x55, 0x32, 0xea, 0x71, 0x0b, 0x9b, + 0x66, 0x8a, 0x25, 0x39, 0x29, 0x8a, 0x56, 0xf9, 0x71, 0x90, 0x34, 0x77, + 0xda, 0x8d, 0x53, 0x00, 0x74, 0x3b, 0x3d, 0x14, 0x5e, 0xce, 0xe1, 0xe1, + 0xf9, 0xc9, 0x48, 0x52, 0x50, 0xc0, 0xb0, 0x95, 0xc9, 0x40, 0x1e, 0x10, + 0x9f, 0x65, 0x36, 0x02, 0xe0, 0x92, 0x52, 0x27, 0x4c, 0x0e, 0xe0, 0xec, + 0x71, 0x07, 0xdb, 0x75, 0xb6, 0x08, 0xa2, 0x22, 0x75, 0xa4, 0x4f, 0x8d, + 0x05, 0x08, 0x03, 0x56, 0x85, 0x12, 0xf0, 0x30, 0xa0, 0xcd, 0x32, 0x1b, + 0xf1, 0x11, 0x4e, 0x1f, 0x86, 0x7b, 0x12, 0xd0, 0xde, 0xe5, 0x0c, 0xb6, + 0x9b, 0xda, 0x15, 0x00, 0xe6, 0x66, 0x04, 0xe7, 0x4c, 0x09, 0x25, 0x20, + 0x02, 0x20, 0xcb, 0x6c, 0xc0, 0x2d, 0xa5, 0x22, 0x49, 0x63, 0xa5, 0x87, + 0x91, 0xd1, 0x6a, 0xb3, 0x73, 0xb3, 0xa5, 0x33, 0xf8, 0xdc, 0xd3, 0xdb, + 0x4f, 0x87, 0x3b, 0x8a, 0xb9, 0x73, 0x82, 0x02, 0x86, 0x05, 0x13, 0x19, + 0x98, 0x04, 0xa0, 0xd3, 0x69, 0x50, 0xd0, 0x4e, 0x98, 0x1c, 0xa0, 0xbc, + 0xf2, 0xea, 0xb0, 0x3e, 0xbb, 0x3b, 0x9c, 0x30, 0x5d, 0xd0, 0xa7, 0x86, + 0x11, 0xc8, 0x04, 0x22, 0x54, 0x55, 0x8d, 0x8d, 0x48, 0xd1, 0x34, 0x61, + 0x72, 0xeb, 0xb5, 0x66, 0xae, 0x5c, 0x6b, 0x1e, 0x3a, 0xb9, 0x2c, 0x61, + 0x8a, 0xeb, 0xa4, 0xaa, 0xc6, 0x76, 0xbb, 0xab, 0x35, 0x94, 0x80, 0x52, + 0xc0, 0x5f, 0x61, 0xb1, 0xa1, 0xa3, 0x97, 0x30, 0x11, 0x32, 0x62, 0x8e, + 0x8a, 0xfa, 0xa6, 0x36, 0x8e, 0x16, 0x5d, 0x00, 0xc4, 0x90, 0xfe, 0xa4, + 0x78, 0x1d, 0x5a, 0x8d, 0xc0, 0x72, 0x31, 0x98, 0x8f, 0xfe, 0x0c, 0x25, + 0xc0, 0x02, 0xd8, 0x2b, 0xab, 0x55, 0x95, 0xfa, 0x71, 0xee, 0x42, 0x43, + 0x93, 0x8d, 0x5f, 0x4f, 0x9c, 0x47, 0x51, 0x94, 0x61, 0x63, 0x69, 0x86, + 0x7e, 0x3c, 0x1e, 0x1f, 0xb5, 0x75, 0xdd, 0x00, 0x4e, 0xa0, 0xf8, 0x4e, + 0x1b, 0x2d, 0x50, 0x0d, 0x78, 0x6b, 0xeb, 0xba, 0xe9, 0xec, 0xea, 0xc3, + 0x98, 0x70, 0x0e, 0xbb, 0x9c, 0x39, 0x26, 0xb1, 0xdd, 0xe9, 0xe2, 0x4c, + 0xe9, 0x25, 0x6a, 0xeb, 0x9b, 0x47, 0xb4, 0xc9, 0x37, 0x5d, 0xa5, 0xc2, + 0x62, 0xc3, 0xef, 0x17, 0xa0, 0x16, 0x2d, 0x95, 0x77, 0xda, 0xc8, 0x81, + 0x81, 0x72, 0x45, 0x11, 0xbc, 0xb7, 0xb5, 0x98, 0x18, 0x61, 0xc5, 0xe0, + 0x3f, 0x37, 0xe2, 0xa4, 0x5e, 0xef, 0x00, 0x67, 0x4a, 0x2f, 0xb1, 0x73, + 0xdf, 0xe9, 0x51, 0xc9, 0x73, 0xa7, 0xfb, 0xc8, 0x4e, 0x69, 0xe4, 0x8b, + 0xef, 0x2f, 0x04, 0x5f, 0x45, 0xad, 0xa0, 0x86, 0xe0, 0xb6, 0x57, 0x6e, + 0x07, 0xf2, 0x0f, 0x1d, 0xa9, 0x35, 0xac, 0x5c, 0x91, 0xce, 0xb2, 0xa5, + 0x85, 0x38, 0xe4, 0x59, 0xf4, 0x4b, 0x09, 0x08, 0x01, 0x6d, 0xed, 0x76, + 0xae, 0xdf, 0xb0, 0xd1, 0x70, 0xc3, 0xc6, 0xcd, 0xd6, 0xae, 0x90, 0xdb, + 0x3d, 0x18, 0xd1, 0x7a, 0x0d, 0xaf, 0x2e, 0xf8, 0x83, 0xae, 0xdd, 0x15, + 0x9c, 0x2b, 0xbe, 0x71, 0xbb, 0xbb, 0x25, 0x94, 0xed, 0xe0, 0x43, 0x7f, + 0x12, 0x58, 0x64, 0x34, 0xe8, 0xe5, 0xf2, 0x53, 0x6b, 0x11, 0x51, 0xd3, + 0xd9, 0x51, 0x96, 0x87, 0xf5, 0xba, 0x1d, 0x4f, 0x5f, 0xff, 0xa8, 0x84, + 0x83, 0x11, 0xa6, 0x93, 0x28, 0x48, 0xff, 0x9d, 0x9c, 0x6d, 0x7b, 0x91, + 0xac, 0x0e, 0x6c, 0x0f, 0xc5, 0x73, 0xff, 0x85, 0x2e, 0x84, 0x2a, 0xe0, + 0x11, 0xa0, 0x6e, 0xb0, 0xbd, 0x3c, 0xa8, 0xbd, 0x06, 0x68, 0xb6, 0xb5, + 0xbb, 0xd9, 0xf0, 0xe6, 0x49, 0x84, 0xb3, 0x96, 0x97, 0x32, 0x8f, 0x92, + 0x14, 0x37, 0x66, 0x59, 0x17, 0xc4, 0xac, 0x14, 0xc1, 0x37, 0xcf, 0x9c, + 0x25, 0xe7, 0xb3, 0xc3, 0x48, 0x56, 0x07, 0x00, 0xc6, 0xba, 0x5e, 0xf6, + 0xbf, 0x38, 0x15, 0xd4, 0x6a, 0xba, 0x08, 0xb5, 0xc6, 0x0c, 0x62, 0x70, + 0xd6, 0xf1, 0x00, 0x7f, 0x03, 0xcb, 0x1b, 0x1a, 0x9d, 0x51, 0xbf, 0x1c, + 0xb2, 0x62, 0x9e, 0x11, 0xc1, 0xeb, 0x4f, 0x76, 0xa1, 0x9d, 0x14, 0x4b, + 0x8b, 0x33, 0x0a, 0x8f, 0x57, 0x61, 0x78, 0x15, 0x27, 0x30, 0xc4, 0x68, + 0x58, 0x93, 0x7d, 0x83, 0x57, 0x72, 0xff, 0x26, 0xfa, 0x54, 0x35, 0xe1, + 0x6f, 0xec, 0x85, 0xb2, 0x32, 0x98, 0xea, 0x83, 0x57, 0xcd, 0xcc, 0x4e, + 0x8f, 0xa1, 0x27, 0x42, 0xa1, 0xec, 0xb2, 0x33, 0x06, 0x58, 0x0e, 0xec, + 0x41, 0xad, 0xaa, 0x43, 0x16, 0xa5, 0x0f, 0x01, 0xbf, 0xa1, 0xa6, 0x4e, + 0xe9, 0xd9, 0x95, 0xd3, 0xd9, 0xbe, 0x25, 0x8f, 0xc4, 0x84, 0x08, 0x5c, + 0x5e, 0x2d, 0x57, 0x3b, 0xe2, 0xb1, 0x76, 0xa4, 0xa0, 0xc1, 0xcf, 0xcc, + 0xc4, 0x9b, 0xa4, 0x1b, 0x1c, 0xe8, 0xc3, 0x7c, 0xd4, 0xd5, 0xdb, 0xf9, + 0xf8, 0xcb, 0xf3, 0x94, 0x9c, 0xa9, 0xa7, 0x7e, 0x59, 0x0e, 0xfa, 0x5a, + 0x07, 0x14, 0xbe, 0x0b, 0x15, 0xbb, 0xa0, 0x0d, 0x44, 0x38, 0x3c, 0xbd, + 0xe7, 0x1f, 0x8e, 0x94, 0x74, 0x0c, 0x00, 0x25, 0xc0, 0x22, 0x40, 0x19, + 0x29, 0xf0, 0x27, 0xa1, 0x96, 0xd5, 0x8b, 0x80, 0xc9, 0x92, 0x84, 0x64, + 0x4a, 0x8d, 0x21, 0x33, 0xc3, 0x80, 0x79, 0x8e, 0x81, 0xcc, 0x0c, 0x03, + 0x1e, 0x8f, 0x8f, 0xaa, 0x9a, 0x76, 0x2c, 0x17, 0xdb, 0xa9, 0xaa, 0xb1, + 0xd1, 0x66, 0xfb, 0x2f, 0x0b, 0x6a, 0x25, 0x38, 0xb6, 0x6d, 0x01, 0x4b, + 0x36, 0xed, 0x86, 0x1e, 0x0b, 0x9c, 0xfd, 0x01, 0x3a, 0x40, 0x89, 0x14, + 0x2c, 0xfc, 0xdc, 0x42, 0xf9, 0xe5, 0x1e, 0x37, 0x50, 0x08, 0xbc, 0x30, + 0xe2, 0xf7, 0x0c, 0x20, 0x05, 0x38, 0x84, 0xea, 0x40, 0x3e, 0xd4, 0x50, + 0x17, 0xea, 0xf2, 0xa2, 0x86, 0xd9, 0x7a, 0x60, 0x17, 0x70, 0x0b, 0x10, + 0x05, 0xaf, 0xcd, 0x16, 0x8a, 0xbd, 0x42, 0x88, 0xe6, 0x83, 0x42, 0xfc, + 0x9c, 0x2f, 0xc4, 0x77, 0xf9, 0xc2, 0xbb, 0x3b, 0x4f, 0x3c, 0x90, 0x12, + 0x2e, 0x00, 0x07, 0x50, 0x70, 0xb7, 0xa9, 0x2f, 0x35, 0xb0, 0x1b, 0x79, + 0xc0, 0x5c, 0x54, 0x47, 0x92, 0x81, 0x0e, 0xd4, 0x5a, 0xef, 0x34, 0xaa, + 0xff, 0xdc, 0xae, 0xf9, 0xd2, 0x81, 0x13, 0xc0, 0xb4, 0xd5, 0x8b, 0x93, + 0xe5, 0x03, 0xfb, 0x0f, 0x20, 0xf7, 0xb7, 0x41, 0xd1, 0xd7, 0xe0, 0x94, + 0x70, 0xea, 0xfd, 0x98, 0xde, 0x3a, 0x4f, 0x77, 0x8f, 0x6f, 0xd4, 0x7f, + 0x86, 0x7b, 0x45, 0x0c, 0x50, 0x06, 0xb8, 0x73, 0x33, 0x62, 0x45, 0x5f, + 0xf3, 0x71, 0x21, 0x5a, 0x0e, 0x0b, 0xb1, 0x27, 0x4f, 0x88, 0xe3, 0xf9, + 0x62, 0xe3, 0x53, 0x93, 0x05, 0xd0, 0x21, 0x8f, 0x31, 0xc9, 0xbd, 0xc0, + 0x81, 0xba, 0x63, 0x85, 0x65, 0x35, 0x76, 0xfb, 0xec, 0xec, 0x55, 0x74, + 0xf7, 0x0c, 0xc0, 0xbc, 0x59, 0x88, 0x38, 0x68, 0x53, 0x4f, 0xe9, 0x84, + 0x7f, 0x6a, 0xc7, 0x8b, 0x77, 0x81, 0xf6, 0xd8, 0x68, 0xad, 0x58, 0xf5, + 0x58, 0xa2, 0x58, 0xba, 0xd0, 0x20, 0x00, 0x05, 0x38, 0xf8, 0x7f, 0x09, + 0x00, 0xd5, 0x87, 0x4e, 0x01, 0x0d, 0xc0, 0x25, 0xe0, 0x73, 0xc0, 0xf0, + 0x2f, 0xf1, 0xc1, 0x43, 0x84, 0x70, 0x5c, 0x14, 0x05, 0x00, 0x00, 0x00, + 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 +}; + +#include +#include +#include +using namespace std; +#include +#include +#include +#include + +GLSample::GLSample(QWidget* parent) +: QGLWidget(parent, "GLSample") +, View("Wave form", this) +, m_max_value(1.0) +{ + // settings + QImage img; + img.loadFromData(g_icon_sample, sizeof(g_icon_sample), "PNG"); + setting_show->setIconSet(QIconSet(QImage(img))); + setting_show->setOn(false); + hide(); + + setting_hasFading = new QAction(this); + setting_hasFading->setMenuText(tr("Show fading")); + setting_hasFading->setToggleAction(true); + connect(setting_hasFading, SIGNAL(toggled(bool)), this, SLOT(updateGL())); + setting_hasFading->addTo(&m_popup_menu); + + m_popup_menu.insertItem(new Title(tr("Number of fading"), &m_popup_menu)); + setting_spinNumFading = new QSpinBox(1, 10000, 1, &m_popup_menu); + setting_spinNumFading->setValue(20); + QToolTip::add(setting_spinNumFading, tr("Number of fading")); + connect(setting_spinNumFading, SIGNAL(valueChanged(int)), this, SLOT(updateGL())); + m_popup_menu.insertItem(setting_spinNumFading); +} + +void GLSample::save() +{ + s_settings->writeEntry("hasFading", setting_hasFading->isOn()); + s_settings->writeEntry("spinNumFading", setting_spinNumFading->value()); +} +void GLSample::load() +{ + setting_hasFading->setOn(s_settings->readBoolEntry("hasFading", setting_hasFading->isOn())); + setting_spinNumFading->setValue(s_settings->readNumEntry("spinNumFading", setting_spinNumFading->value())); +} +void GLSample::clearSettings() +{ + s_settings->removeEntry("hasFading"); + s_settings->removeEntry("spinNumFading"); +} + +GLSample::Sample::Sample(double t, const deque& d) +{ + time = t; + data = d; + max_value = 0.0; + for(size_t i=0; i& data) +{ + m_samples.push_front(Sample(time, data)); + + if(setting_hasFading->isOn()) + while(!m_samples.empty() && int(m_samples.size())>setting_spinNumFading->value()) + m_samples.pop_back(); + else + while(!m_samples.empty() && m_samples.size()>1) + m_samples.pop_back(); +} + +void GLSample::initializeGL() +{ + // Set the clear color to black + glClearColor(1.0, 1.0, 1.0, 0.0); + + // glShadeModel( GL_FLAT ); + glShadeModel( GL_SMOOTH ); + + glLoadIdentity(); +} + +void GLSample::paintGL() +{ + glClear(GL_COLOR_BUFFER_BIT); + + // name + string str = tr("Wave form"); + glColor3f(0.75,0.75,0.75); + glRasterPos2i(2, height()-20); + for(size_t i = 0; i < str.size(); i++) + glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, str[i]); + + // horiz lines + glBegin(GL_LINES); + float gray = 0.5; + glColor3f(gray, gray, gray); + glVertex2i(0, height()/2); + glVertex2i(width(), height()/2); + glEnd(); + + if(m_max_value==0.0) m_max_value = 1.0; + + // sample + if(!m_samples.empty()) + { + m_max_value = 0.0; + for(int j=m_samples.size()-1; j>=0; j--) + { + m_max_value = max(m_max_value, abs(m_samples[j].max_value)); + if(!setting_hasFading->isOn()) j=-1; + } + + for(int j=m_samples.size()-1; j>=0; j--) + { + if(m_max_value!=0.0) + { + glBegin(GL_LINE_STRIP); + float grey = float(j)/m_samples.size(); + glColor3f(grey, grey, grey); + int size = m_samples[j].data.size(); + float step = float(width())/size; + for(int i=size-1; i>0; i--) + glVertex2i(int((size-i-1)*step), int((m_samples[j].data[i]/m_max_value)*height()/2 + height()/2)); + glVertex2i(width(), int((m_samples[j].data[0]/m_max_value)*height()/2 + height()/2)); + glEnd(); + } + + if(!setting_hasFading->isOn()) j=-1; + } + } + + glFlush(); +} + +void GLSample::resizeGL( int w, int h ) +{ + // Set the new viewport size + glViewport(0, 0, (GLint)w, (GLint)h); + + // Choose the projection matrix to be the matrix + // manipulated by the following calls + glMatrixMode(GL_PROJECTION); + + // Set the projection matrix to be the identity matrix + glLoadIdentity(); + + // Define the dimensions of the Orthographic Viewing Volume + glOrtho(0.0, w, 0.0, h, 0.0, 1.0); + + // Choose the modelview matrix to be the matrix + // manipulated by further calls + glMatrixMode(GL_MODELVIEW); +} diff --git a/src/modules/GLSample.h b/src/modules/GLSample.h new file mode 100644 index 0000000..497816e --- /dev/null +++ b/src/modules/GLSample.h @@ -0,0 +1,68 @@ +// Copyright 2004 "Gilles Degottex" + +// This file is part of "fmit" + +// "fmit" 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. +// +// "fmit" 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 + +#ifndef _GLSample_h_ +#define _GLSample_h_ + +#include +using namespace std; + +#include +#include +#include +class QTimer; +#include "View.h" + +class GLSample : public QGLWidget, public View +{ + Q_OBJECT + + virtual void mouseReleaseEvent(QMouseEvent* e){View::mouseReleaseEvent(e);} + + double m_max_value; + + public: + GLSample(QWidget* parent); + + struct Sample + { + double time; + deque data; + double max_value; + Sample(double t, const deque& d); + }; + deque m_samples; + + void add(double time, const deque& data); + void clear() {m_samples.clear();} + + // settings + QAction* setting_hasFading; + QSpinBox* setting_spinNumFading; + virtual void save(); + virtual void load(); + virtual void clearSettings(); + + public slots: + void initializeGL(); + void paintGL(); + void resizeGL( int w, int h ); +}; + +#endif // _GLSample_h_ + diff --git a/src/modules/GLStatistics.cpp b/src/modules/GLStatistics.cpp new file mode 100644 index 0000000..52df0b7 --- /dev/null +++ b/src/modules/GLStatistics.cpp @@ -0,0 +1,694 @@ +// Copyright 2007 "Gilles Degottex" + +// This file is part of "fmit" + +// "fmit" 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. +// +// "fmit" 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 + +#include "GLStatistics.h" + +static const unsigned char g_icon_statistics[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, + 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7a, 0x7a, 0xf4, 0x00, 0x00, 0x06, + 0xc4, 0x49, 0x44, 0x41, 0x54, 0x58, 0x85, 0xb5, 0x97, 0x6d, 0x4c, 0x5b, + 0xd7, 0x19, 0xc7, 0x7f, 0xf7, 0x5e, 0x1b, 0x1b, 0xdb, 0x04, 0x6c, 0x63, + 0xc0, 0xe1, 0xd5, 0x04, 0x92, 0x40, 0x63, 0x9c, 0x89, 0xac, 0x1f, 0x12, + 0xa1, 0x69, 0x5a, 0x84, 0x14, 0x05, 0x91, 0x69, 0x5a, 0xaa, 0x54, 0x51, + 0x42, 0xb6, 0x26, 0x43, 0x8b, 0xca, 0x40, 0xcd, 0x3e, 0xa4, 0xca, 0xa2, + 0x4a, 0x45, 0xcd, 0xb4, 0x2f, 0xec, 0x43, 0x22, 0xa5, 0x48, 0x93, 0x26, + 0x2d, 0x9b, 0x54, 0x6d, 0x51, 0xa3, 0xd2, 0xa8, 0xeb, 0xa6, 0xee, 0x25, + 0xb3, 0x50, 0xa7, 0x89, 0xa5, 0x84, 0xb2, 0x26, 0x59, 0x49, 0x00, 0x63, + 0x9b, 0xf2, 0x6e, 0xe3, 0x6b, 0x83, 0x5f, 0xef, 0x3e, 0xf8, 0x05, 0x1b, + 0x9b, 0x8e, 0x6d, 0xda, 0x23, 0x1d, 0x9d, 0x73, 0x8f, 0xce, 0x39, 0xff, + 0xdf, 0xf3, 0x9c, 0x97, 0x7b, 0x8e, 0xc0, 0xff, 0xc1, 0x3a, 0xba, 0x7b, + 0xb5, 0x40, 0x15, 0x60, 0x06, 0xca, 0x80, 0x35, 0xe0, 0x13, 0xe7, 0xc8, + 0xb0, 0xb2, 0xbd, 0xad, 0xf0, 0x5f, 0x0c, 0x2e, 0x02, 0xd5, 0x80, 0x0d, + 0x68, 0x00, 0xea, 0x80, 0x9a, 0x54, 0x5d, 0x4d, 0x2a, 0x99, 0x0b, 0x8c, + 0x3d, 0x09, 0x9c, 0x72, 0x8e, 0x0c, 0x3f, 0xcf, 0xae, 0x54, 0xed, 0x20, + 0x62, 0x04, 0x9a, 0x53, 0x22, 0xe9, 0xd4, 0x90, 0xca, 0xeb, 0x81, 0xa2, + 0x9d, 0x00, 0x35, 0x45, 0x45, 0x18, 0xf4, 0xc5, 0xe8, 0xf5, 0xc5, 0x18, + 0x74, 0xc5, 0x68, 0x8a, 0xd4, 0x3c, 0x7d, 0xe6, 0x22, 0xb4, 0xb1, 0x79, + 0x08, 0x78, 0x0d, 0x78, 0xb5, 0x20, 0x40, 0x47, 0x77, 0xaf, 0x1e, 0xb8, + 0x02, 0x9c, 0x4d, 0x89, 0x0b, 0x00, 0x92, 0x24, 0x52, 0x69, 0x31, 0x61, + 0x31, 0x19, 0x29, 0x2b, 0x35, 0x50, 0x56, 0x5a, 0x82, 0xb1, 0xb4, 0x24, + 0x93, 0x97, 0x96, 0x96, 0xa0, 0xd7, 0xeb, 0xd1, 0xe9, 0xf4, 0xa8, 0x35, + 0x5a, 0xe2, 0x8a, 0x48, 0x38, 0x9a, 0x20, 0xa1, 0x80, 0x4a, 0x14, 0xa8, + 0xb7, 0x68, 0xf8, 0xe0, 0x0f, 0xa3, 0xfc, 0xe4, 0xe6, 0x1d, 0x52, 0x0e, + 0x90, 0x07, 0x90, 0x12, 0x1f, 0x05, 0x1c, 0xa2, 0x28, 0x72, 0xec, 0xab, + 0x76, 0x8e, 0xbe, 0xd8, 0x46, 0x5b, 0x4b, 0x13, 0x55, 0x95, 0xe5, 0x44, + 0xe3, 0x02, 0xa1, 0x70, 0x9c, 0x60, 0x38, 0x41, 0x28, 0x92, 0xe0, 0xaf, + 0x1f, 0x7f, 0x8c, 0xae, 0xa2, 0x99, 0x88, 0x5a, 0xcf, 0x6c, 0x28, 0x41, + 0x5c, 0x56, 0x50, 0x88, 0xa3, 0x28, 0x41, 0x14, 0x05, 0x14, 0x40, 0x51, + 0x14, 0x14, 0x05, 0x4c, 0x25, 0x2a, 0xf6, 0x37, 0xd6, 0xa5, 0xf5, 0x6a, + 0x0b, 0x02, 0x00, 0x97, 0x00, 0x87, 0x24, 0x8a, 0xdc, 0xfc, 0xf1, 0x0f, + 0xd9, 0xdf, 0x64, 0x63, 0x66, 0x31, 0x8c, 0x6b, 0x3d, 0xca, 0xe3, 0x65, + 0x99, 0x44, 0x42, 0x49, 0x0d, 0x9c, 0xcc, 0xff, 0xfc, 0xe0, 0x01, 0xdd, + 0x67, 0x5a, 0x50, 0xa3, 0x20, 0x8a, 0x02, 0x82, 0x40, 0x96, 0x70, 0x56, + 0xae, 0x80, 0xbc, 0x19, 0xc7, 0x64, 0xdc, 0x93, 0xd6, 0xdb, 0xd7, 0xd1, + 0xdd, 0x2b, 0x64, 0x2f, 0xc6, 0x34, 0x40, 0x23, 0xc0, 0xc1, 0xe6, 0x7a, + 0x0e, 0x34, 0xd9, 0x18, 0x7b, 0x2e, 0xb3, 0x19, 0x49, 0x86, 0x51, 0x12, + 0x41, 0x14, 0x84, 0x9c, 0x81, 0xd5, 0x92, 0x84, 0x28, 0x24, 0x50, 0x49, + 0xe9, 0x3a, 0x21, 0x23, 0x98, 0x1e, 0x39, 0xa1, 0x00, 0x0a, 0x84, 0x23, + 0x0a, 0xd6, 0x8a, 0x3d, 0x68, 0x35, 0x45, 0x6c, 0x86, 0x23, 0x3a, 0x60, + 0x2f, 0xe0, 0x49, 0x03, 0x88, 0xd9, 0x20, 0x55, 0x95, 0xe5, 0x78, 0xd7, + 0x22, 0xc4, 0xe2, 0xc9, 0xf9, 0xcb, 0x24, 0x49, 0x40, 0x25, 0x91, 0x29, + 0x1b, 0xcd, 0xe5, 0xc8, 0xbe, 0x95, 0x64, 0x7d, 0xa1, 0x36, 0xe2, 0x56, + 0xff, 0x70, 0x2c, 0x81, 0x20, 0x08, 0xd4, 0xec, 0xad, 0x48, 0x6b, 0x1e, + 0xc8, 0x9e, 0x02, 0x31, 0xfb, 0x43, 0xa7, 0xd5, 0x10, 0x8b, 0x2b, 0xc9, + 0x81, 0x24, 0x61, 0x2b, 0x89, 0x59, 0xdf, 0xa2, 0x40, 0xd5, 0xde, 0x1a, + 0x56, 0x97, 0x3c, 0x59, 0xc2, 0xdb, 0x20, 0xb2, 0xfa, 0x46, 0x63, 0xc9, + 0x98, 0x34, 0xd4, 0x5a, 0xd3, 0x32, 0x2d, 0x85, 0x00, 0x22, 0x00, 0x5a, + 0x4d, 0x51, 0xae, 0xb0, 0x54, 0x48, 0x40, 0xa0, 0xb6, 0xce, 0xc6, 0x17, + 0x9e, 0x99, 0x2f, 0x6d, 0x93, 0x4e, 0xb1, 0x44, 0x12, 0xa0, 0xb1, 0x7e, + 0x6f, 0x5a, 0xf3, 0x60, 0x21, 0x80, 0x75, 0x80, 0x78, 0x22, 0x81, 0x5a, + 0x25, 0xe4, 0x86, 0xbf, 0x80, 0x97, 0xd5, 0x35, 0xb5, 0x78, 0x66, 0xa7, + 0x08, 0xc9, 0xbe, 0xc2, 0x6d, 0x32, 0x09, 0xd4, 0x52, 0x52, 0xc2, 0x56, + 0x57, 0xfd, 0xef, 0x01, 0x22, 0x91, 0x28, 0x45, 0x2a, 0x31, 0xcb, 0x03, + 0xf2, 0x3c, 0xfb, 0xfc, 0xb3, 0x71, 0x2e, 0xbe, 0xf4, 0x75, 0xde, 0xf9, + 0xf9, 0x2d, 0xbe, 0xfd, 0x0d, 0x3b, 0xaf, 0xbf, 0xfa, 0x32, 0xb2, 0x7f, + 0x25, 0x77, 0x9a, 0x24, 0x81, 0xf2, 0x12, 0x15, 0x0e, 0x9b, 0x9e, 0x43, + 0x75, 0xc5, 0x49, 0x80, 0xdd, 0x44, 0x20, 0x12, 0x8d, 0xa1, 0xfe, 0x92, + 0x29, 0xf0, 0xb8, 0xa6, 0xf8, 0xc1, 0x2b, 0xdf, 0xa2, 0xe7, 0x52, 0x3f, + 0xe7, 0xbf, 0x37, 0xc0, 0x47, 0x7f, 0x9b, 0xc6, 0xb6, 0xaf, 0x99, 0xfe, + 0xef, 0x76, 0x13, 0x0d, 0x87, 0x50, 0x4b, 0x02, 0x95, 0x65, 0x6a, 0x0e, + 0xdb, 0x74, 0xd8, 0xeb, 0x75, 0x98, 0x0c, 0x5b, 0x07, 0xad, 0xb5, 0xc2, + 0x4c, 0xb1, 0x56, 0x03, 0x50, 0xdd, 0xd1, 0xdd, 0x5b, 0xb2, 0x1d, 0x60, + 0x19, 0x20, 0x18, 0xdc, 0x48, 0x02, 0xe4, 0xac, 0xe4, 0x2d, 0xcf, 0xde, + 0xfe, 0xe9, 0x5b, 0x5c, 0xb8, 0xd4, 0x47, 0xd7, 0x37, 0x5f, 0xc2, 0x58, + 0x66, 0x24, 0x16, 0xdd, 0xe4, 0xb5, 0xd7, 0xdf, 0xa2, 0x69, 0x7f, 0x2b, + 0xbf, 0x7c, 0xfb, 0x06, 0x8e, 0x06, 0x3d, 0x4d, 0x55, 0x5a, 0xf4, 0x1a, + 0x29, 0xdb, 0x49, 0x42, 0xa1, 0x10, 0x82, 0x20, 0xd0, 0x50, 0x67, 0x85, + 0xe4, 0x09, 0x7b, 0x70, 0x3b, 0xc0, 0x22, 0x80, 0x3f, 0x10, 0xdc, 0xd1, + 0xfb, 0x68, 0x38, 0xc4, 0x83, 0x3f, 0x7e, 0xc8, 0xcb, 0xe7, 0x2e, 0xa2, + 0x92, 0x04, 0x5a, 0xed, 0x0e, 0x9e, 0x3d, 0xfd, 0x14, 0x4b, 0xa9, 0x8a, + 0x9f, 0x0d, 0xdf, 0xe4, 0xdd, 0x5f, 0xff, 0x8a, 0x79, 0x8f, 0x8b, 0x40, + 0x20, 0x80, 0xdf, 0xef, 0xc7, 0xe7, 0xf3, 0x65, 0x92, 0x28, 0x8a, 0xa9, + 0x85, 0x98, 0x59, 0x07, 0x2f, 0x6c, 0x07, 0x58, 0x02, 0x58, 0x97, 0x83, + 0xa9, 0x79, 0x27, 0x0f, 0xe2, 0x9f, 0x8f, 0x27, 0xd8, 0xd7, 0x7c, 0x00, + 0x93, 0xc9, 0x88, 0x4a, 0x12, 0x38, 0xdc, 0xf6, 0x02, 0x9f, 0x4f, 0x8c, + 0xa2, 0x13, 0x42, 0x14, 0x6b, 0xd4, 0x9c, 0x3e, 0x7d, 0x9a, 0x5b, 0xb7, + 0x6e, 0xa1, 0xd7, 0xeb, 0x29, 0x2d, 0x2d, 0xa5, 0xac, 0xac, 0x2c, 0x93, + 0xb4, 0x5a, 0x2d, 0x00, 0xfb, 0xb6, 0x00, 0x0e, 0x15, 0x8e, 0x80, 0x5f, + 0x46, 0x14, 0x84, 0xad, 0x69, 0xc8, 0xf2, 0xde, 0x3d, 0x3b, 0x8d, 0x41, + 0x6f, 0x20, 0x24, 0xfb, 0xd0, 0x12, 0xa4, 0xc5, 0x56, 0x81, 0x28, 0x90, + 0x11, 0xe9, 0xeb, 0xeb, 0xe3, 0xce, 0x9d, 0x3b, 0x78, 0x3c, 0x99, 0x43, + 0x2e, 0xcf, 0x1a, 0x77, 0x02, 0x70, 0x8e, 0x0c, 0xaf, 0x01, 0x41, 0x7f, + 0x40, 0xc6, 0xbf, 0x1e, 0x60, 0x23, 0xe0, 0x27, 0x28, 0xfb, 0x09, 0x06, + 0x7c, 0xc8, 0xb2, 0x8f, 0xa2, 0x22, 0x35, 0xe6, 0x72, 0x33, 0x92, 0x24, + 0xd0, 0x62, 0xab, 0xa4, 0xa6, 0xca, 0x9c, 0xf1, 0x2a, 0x6d, 0xad, 0xad, + 0xad, 0x5c, 0xbd, 0x7a, 0x95, 0x93, 0x27, 0x4f, 0xb2, 0xba, 0xba, 0x5a, + 0x18, 0xa0, 0x61, 0xe7, 0x08, 0x00, 0xb8, 0x01, 0x02, 0xf2, 0x06, 0x16, + 0x8b, 0x19, 0xb3, 0xd9, 0x84, 0xc5, 0x6c, 0xa2, 0xdc, 0x64, 0x42, 0xaf, + 0xd3, 0xf2, 0xa7, 0x8f, 0x7e, 0x4b, 0xe7, 0xf1, 0xe3, 0xa8, 0xa4, 0xad, + 0x7b, 0x86, 0xc9, 0x64, 0xca, 0x11, 0x1b, 0x18, 0x18, 0xe0, 0xd4, 0xa9, + 0x53, 0x1c, 0x3d, 0x7a, 0x94, 0xd1, 0xd1, 0xd1, 0x3c, 0x80, 0xb2, 0x3d, + 0x06, 0xcc, 0xc6, 0x52, 0x48, 0xee, 0x04, 0x23, 0xe4, 0x5e, 0x48, 0xe6, + 0x80, 0x03, 0x8b, 0x2b, 0x6b, 0x58, 0x2c, 0x96, 0xe4, 0x4f, 0x45, 0x49, + 0xfe, 0x54, 0xbc, 0x5e, 0x0f, 0xef, 0xbd, 0xfb, 0x1b, 0x26, 0x27, 0x27, + 0x73, 0x06, 0x3c, 0x72, 0xe4, 0x08, 0x63, 0x63, 0x63, 0x74, 0x76, 0x76, + 0x66, 0xea, 0x06, 0x07, 0x07, 0xb1, 0xdb, 0xed, 0x9c, 0x39, 0x73, 0x86, + 0xaa, 0xaa, 0x2a, 0x3a, 0x3b, 0x3b, 0xb9, 0x7e, 0xfd, 0x3a, 0x13, 0x13, + 0x13, 0x8c, 0x8f, 0x8f, 0x53, 0x5f, 0x5b, 0xc9, 0xca, 0x9a, 0x3f, 0x1d, + 0x05, 0x67, 0x76, 0x04, 0xe6, 0x00, 0x96, 0x96, 0xd7, 0x90, 0x44, 0x32, + 0xdb, 0x10, 0x25, 0x4e, 0xdf, 0xf7, 0x5f, 0xa1, 0xbf, 0xbf, 0x1f, 0xab, + 0xd5, 0x9a, 0x03, 0xd0, 0xde, 0xde, 0xce, 0xd8, 0xd8, 0x58, 0x4e, 0x9d, + 0x2c, 0xcb, 0x54, 0x57, 0x57, 0x73, 0xe5, 0xca, 0x15, 0xec, 0x76, 0x3b, + 0x5e, 0xaf, 0x97, 0xa1, 0xa1, 0x21, 0x16, 0x17, 0x17, 0xe9, 0xea, 0xea, + 0xa2, 0xae, 0xba, 0x2a, 0xdd, 0xd4, 0xbe, 0x3d, 0x02, 0x6e, 0x80, 0xc5, + 0xe5, 0x35, 0x44, 0x51, 0x40, 0x05, 0x2c, 0x2d, 0x2d, 0x73, 0xe9, 0xe2, + 0x77, 0xd0, 0xeb, 0x74, 0x5c, 0xbb, 0x76, 0x2d, 0x2f, 0xa4, 0xe1, 0x70, + 0x98, 0x27, 0x4f, 0x9e, 0x30, 0x34, 0x34, 0x84, 0xcf, 0xe7, 0x03, 0xc0, + 0x60, 0x30, 0xe0, 0x70, 0x38, 0x38, 0x7b, 0xf6, 0x2c, 0x03, 0x03, 0x03, + 0x79, 0x7d, 0x6a, 0xf6, 0x56, 0xa6, 0x8b, 0x87, 0x0b, 0x4d, 0x41, 0x12, + 0x40, 0x80, 0x37, 0x07, 0xdf, 0xe4, 0xf6, 0xed, 0xdb, 0x9c, 0x3f, 0x7f, + 0x8e, 0x1b, 0x37, 0x6e, 0xb0, 0xba, 0xba, 0xca, 0xc3, 0x87, 0x0f, 0x79, + 0xf4, 0xe8, 0x11, 0xb2, 0x2c, 0x03, 0xc9, 0x1d, 0xa0, 0x28, 0x0a, 0x3d, + 0x3d, 0x3d, 0x98, 0xcd, 0xe6, 0x3c, 0xb1, 0x42, 0x56, 0xbb, 0xf5, 0x5b, + 0xfe, 0x4a, 0x41, 0x80, 0x85, 0xa5, 0x55, 0xbc, 0x5e, 0x2f, 0x82, 0x00, + 0x17, 0x2e, 0xf4, 0xa0, 0xd1, 0x68, 0x18, 0x1c, 0x1c, 0xa4, 0xbc, 0xbc, + 0x9c, 0xf6, 0xf6, 0x76, 0x2e, 0x5f, 0xbe, 0x8c, 0xc1, 0x60, 0xc8, 0x74, + 0xba, 0x7b, 0xf7, 0x2e, 0x6e, 0xb7, 0x7b, 0xd7, 0x00, 0x16, 0xb3, 0x31, + 0x5d, 0x6c, 0xeb, 0xe8, 0xee, 0xd5, 0x65, 0x03, 0xb8, 0x00, 0x66, 0xe6, + 0xe6, 0xb9, 0x7f, 0xff, 0x3e, 0x27, 0x4e, 0x9c, 0xa0, 0xad, 0xad, 0x2d, + 0x6f, 0xbb, 0x6d, 0xb7, 0x63, 0xc7, 0x8e, 0x71, 0xef, 0xde, 0x3d, 0x1c, + 0x0e, 0xc7, 0xae, 0x00, 0x34, 0x1a, 0x75, 0xba, 0x58, 0x04, 0xd8, 0xb2, + 0x01, 0x9e, 0x03, 0x89, 0x85, 0xa5, 0x55, 0xb1, 0xa7, 0xe7, 0x0d, 0x34, + 0x9a, 0x1d, 0x6f, 0xde, 0x39, 0x66, 0xb5, 0x5a, 0x99, 0x9f, 0x9f, 0xdf, + 0x55, 0xdb, 0x8d, 0xcd, 0x30, 0xf7, 0x7f, 0x9f, 0xb3, 0x3d, 0x7d, 0x19, + 0x00, 0xe7, 0xc8, 0xf0, 0x66, 0x47, 0x77, 0xaf, 0x4b, 0x51, 0x94, 0x06, + 0x97, 0x67, 0x81, 0xe6, 0xc6, 0xbc, 0x0b, 0xec, 0x7f, 0x64, 0x4b, 0x2b, + 0x3e, 0xa6, 0xa6, 0xdd, 0x4c, 0x4d, 0xcf, 0x31, 0x35, 0xe3, 0x66, 0x6a, + 0xda, 0x8d, 0x67, 0x7e, 0x91, 0x44, 0x22, 0x73, 0x1f, 0x7d, 0xdf, 0x39, + 0x32, 0xec, 0xd9, 0xfe, 0x30, 0x79, 0x0c, 0x34, 0xcc, 0xce, 0xcd, 0xef, + 0x1a, 0x20, 0x16, 0x8b, 0x63, 0x3f, 0x7c, 0x84, 0xf7, 0x7f, 0xe7, 0xc4, + 0xe5, 0x5d, 0x48, 0x89, 0xba, 0xf1, 0xaf, 0xcb, 0x3b, 0x75, 0x99, 0x05, + 0xee, 0x01, 0x6f, 0x40, 0xfe, 0xcb, 0xe8, 0xef, 0xc0, 0x89, 0xa7, 0xcf, + 0x5c, 0x1c, 0xff, 0xda, 0x8b, 0x79, 0x3d, 0x03, 0x72, 0x28, 0x29, 0x30, + 0x33, 0x97, 0x11, 0x9a, 0x99, 0x9b, 0x27, 0x1a, 0x8d, 0x15, 0x12, 0x4a, + 0x00, 0xcf, 0x80, 0x4f, 0x81, 0x71, 0xe0, 0x13, 0x60, 0xcc, 0x39, 0x32, + 0xfc, 0x45, 0x76, 0xa3, 0xed, 0x00, 0x0f, 0x80, 0x1f, 0xbd, 0xf7, 0xe1, + 0x5f, 0xd0, 0x15, 0x6b, 0xd9, 0x53, 0xa2, 0x67, 0x65, 0xcd, 0xcf, 0xb4, + 0xcb, 0xcb, 0xd4, 0xb4, 0x9b, 0x85, 0xa5, 0xc2, 0x67, 0x3c, 0xb0, 0x42, + 0xf2, 0xed, 0x37, 0x91, 0x12, 0x9c, 0x00, 0x26, 0x9d, 0x23, 0xc3, 0xc1, + 0x9d, 0x3a, 0xa4, 0x2d, 0xef, 0x71, 0xda, 0xd1, 0xdd, 0xfb, 0x0b, 0xe0, + 0xdc, 0x0e, 0xed, 0x03, 0xc0, 0x67, 0x29, 0xb1, 0x7f, 0xa4, 0xf2, 0x49, + 0xe7, 0xc8, 0xf0, 0xee, 0x56, 0x61, 0x01, 0x2b, 0xf4, 0x38, 0xed, 0x01, + 0xde, 0x01, 0xba, 0x00, 0x43, 0x96, 0xe0, 0x24, 0x30, 0x5b, 0xe8, 0x89, + 0xfd, 0xbf, 0xd8, 0xbf, 0x00, 0x33, 0x30, 0x7d, 0x18, 0x07, 0x61, 0x44, + 0x81, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, + 0x82 +}; + +#include +#include +using namespace std; +#include +#include +#include +#include +#include + +void GLStatistics::AverageNote::init() +{ + err_mean = 0.0; + err_std = 0.0; +} +GLStatistics::AverageNote::AverageNote() + : ht(-1000) +{ + init(); +} +GLStatistics::AverageNote::AverageNote(int h) + : ht(h) +{ + init(); +} +GLStatistics::AverageNote::AverageNote(int h, int num, int den) + : ht(h) +{ + init(); + factor = QString::number(num)+"/"+QString::number(den); +} +GLStatistics::AverageNote::AverageNote(int h, float cents) + : ht(h) +{ + init(); + factor = QString::number(cents); +} +QString GLStatistics::AverageNote::getName() const +{ + return Music::h2n(ht)+factor; +} +void GLStatistics::AverageNote::addErr(float err) +{ + // mean estimation + if(!errs.empty()) + err_mean *= errs.size(); + errs.push_back(err); + err_mean += err; + err_mean /= errs.size(); + + // standard deviation estimation + err_std = 0.0; + for(size_t i=0; i1) + { + err_std /= errs.size()-1; // unbiased estimation of the variance + err_std = sqrt(err_std); + } +} + +void GLStatistics::addNote(int ht, float err) +{ + if(isHidden() && !setting_keep_hidden->isOn()) + return; + + if(htminValue() || ht>setting_scale_max->maxValue()) + return; + +// cerr << "ht=" << ht << endl; + + if(setting_scale_auto->isOn()) + { + if(m_avg_notes.empty()) + { + m_avg_notes.resize(1); + m_avg_notes[0] = AverageNote(ht); + setting_scale_min->setValue(ht); + setting_scale_max->setValue(ht); + } + else if(htvalue()) + { +// cerr << "min: "; + int min_ht = ht; + vector avg_notes(setting_scale_max->value()-min_ht+1); + for(int i=0; ivalue()-min_ht; i++) + avg_notes[i].ht = min_ht+i; + for(size_t i=0; ivalue()-min_ht+i] = m_avg_notes[i]; + m_avg_notes = avg_notes; + setting_scale_min->setValue(ht); +/* for(size_t i=0; ivalue() << ":" << setting_scale_max->value() << "]" << endl;*/ + } + else if(ht>setting_scale_max->value()) + { +// cerr << "max: "; + int max_ht = ht; + vector avg_notes(max_ht-setting_scale_min->value()+1); + for(size_t i=0; ivalue()+i; + m_avg_notes = avg_notes; + setting_scale_max->setValue(ht); +/* for(size_t i=0; ivalue() << ":" << setting_scale_max->value() << "]" << endl;*/ + } + +// cerr << setting_scale_min->value()-ht << endl; + + m_avg_notes[ht-setting_scale_min->value()].addErr(err); + } +} +void GLStatistics::addNote(int ht, int num, int den, float err) +{ +} +void GLStatistics::addNote(int ht, float cents, float err) +{ +} + +GLStatistics::GLStatistics(QWidget* parent) +: QGLWidget(parent, "GLStatistics") +, View("Statistics", this) +{ + // settings + QImage img; + img.loadFromData(g_icon_statistics, sizeof(g_icon_statistics), "PNG"); + setting_show->setIconSet(QIconSet(QImage(img))); + setting_show->setOn(false); + hide(); + + setting_reset = new QAction(this); + setting_reset->setMenuText(tr("Reset statistics")); + connect(setting_reset, SIGNAL(activated()), this, SLOT(reset())); + setting_reset->addTo(&m_popup_menu); + + setting_keep_hidden = new QAction(this); + setting_keep_hidden->setMenuText(tr("Keep notes when hidden")); + setting_keep_hidden->setToggleAction(true); + setting_keep_hidden->setOn(false); + connect(setting_keep_hidden, SIGNAL(toggled(bool)), this, SLOT(update())); + setting_keep_hidden->addTo(&m_popup_menu); + + setting_show_std = new QAction(this); + setting_show_std->setMenuText(tr("Show standard deviation")); + setting_show_std->setToggleAction(true); + setting_show_std->setOn(true); + setting_show_std->setEnabled(true); + connect(setting_show_std, SIGNAL(toggled(bool)), this, SLOT(update())); + setting_show_std->addTo(&m_popup_menu); + + setting_scale_auto = new QAction(this); + setting_scale_auto->setMenuText(tr("Scale auto")); + setting_scale_auto->setToggleAction(true); + setting_scale_auto->setOn(true); + setting_scale_auto->setEnabled(false); + connect(setting_scale_auto, SIGNAL(toggled(bool)), this, SLOT(update())); + setting_scale_auto->addTo(&m_popup_menu); + + m_popup_menu.insertItem(new Title(tr("Scale min"), &m_popup_menu)); + setting_scale_min = new QSpinBox(-96, 96, 1, &m_popup_menu); + setting_scale_min->setValue(0); + QToolTip::add(setting_scale_min, tr("Scale min value (in semi-tones)")); + connect(setting_scale_min, SIGNAL(valueChanged(int)), this, SLOT(update())); + m_popup_menu.insertItem(setting_scale_min); + setting_scale_min->setEnabled(false); + + m_popup_menu.insertItem(new Title(tr("Scale max"), &m_popup_menu)); + setting_scale_max = new QSpinBox(-96, 96, 1, &m_popup_menu); + setting_scale_max->setValue(0); + QToolTip::add(setting_scale_max, tr("Scale max value (in semi-tones)")); + connect(setting_scale_max, SIGNAL(valueChanged(int)), this, SLOT(update())); + m_popup_menu.insertItem(setting_scale_max); + setting_scale_max->setEnabled(false); + + setting_showTolerance = new QAction(this); + setting_showTolerance->setMenuText(tr("Show tolerance")); + setting_showTolerance->setToggleAction(true); + setting_showTolerance->setOn(true); + connect(setting_showTolerance, SIGNAL(toggled(bool)), this, SLOT(update())); + setting_showTolerance->addTo(&m_popup_menu); + + setting_useCents = new QAction(this); + setting_useCents->setMenuText(tr("Use cents")); + setting_useCents->setToggleAction(true); + setting_useCents->setOn(true); + connect(setting_useCents, SIGNAL(toggled(bool)), this, SLOT(update())); + setting_useCents->addTo(&m_popup_menu); + + m_popup_menu.insertItem(new Title(tr("Scale range"), &m_popup_menu)); + setting_spinScale = new QSpinBox(5, 50, 1, &m_popup_menu); + setting_spinScale->setValue(50); + QToolTip::add(setting_spinScale, tr("Scale range (in cents)")); + connect(setting_spinScale, SIGNAL(valueChanged(int)), this, SLOT(update())); + m_popup_menu.insertItem(setting_spinScale); +} + +void GLStatistics::save() +{ + s_settings->writeEntry("setting_keep_hidden", setting_keep_hidden->isOn()); + s_settings->writeEntry("setting_show_std", setting_show_std->isOn()); + s_settings->writeEntry("setting_scale_auto", setting_scale_auto->isOn()); + s_settings->writeEntry("setting_scale_min", setting_scale_min->value()); + s_settings->writeEntry("setting_scale_max", setting_scale_max->value()); +} +void GLStatistics::load() +{ + setting_keep_hidden->setOn(s_settings->readBoolEntry("setting_keep_hidden", setting_keep_hidden->isOn())); + setting_show_std->setOn(s_settings->readBoolEntry("setting_show_std", setting_show_std->isOn())); + setting_scale_auto->setOn(s_settings->readBoolEntry("setting_scale_auto", setting_scale_auto->isOn())); + setting_scale_min->setValue(s_settings->readNumEntry("setting_scale_min", setting_scale_min->value())); + setting_scale_max->setValue(s_settings->readNumEntry("setting_scale_max", setting_scale_max->value())); +} +void GLStatistics::clearSettings() +{ + s_settings->removeEntry("setting_keep_hidden"); + s_settings->removeEntry("setting_show_std"); + s_settings->removeEntry("setting_scale_auto"); + s_settings->removeEntry("setting_scale_min"); + s_settings->removeEntry("setting_scale_max"); +} + +void GLStatistics::reset() +{ + m_avg_notes.clear(); + setting_scale_min->setValue(0); + setting_scale_max->setValue(0); + updateGL(); +} + +void GLStatistics::initializeGL() +{ + // Set the clear color to black + glClearColor(1.0, 1.0, 1.0, 0.0); + + // glShadeModel( GL_FLAT ); + glShadeModel( GL_SMOOTH ); + + glLoadIdentity(); +} + +void GLStatistics::drawTicksCent(int r, int dx, int dy) +{ + // only work within range that is a pure multiple of r + float range = int(setting_spinScale->value()/r)*r; + + float scale = 50.0f/setting_spinScale->value(); + + if((height()-dy)*r/100.0f*scale>2) + { + for(float i=-range; i<=range; i+=r) + { + int y = int((height()-dy)*i/100.0f*scale) + (height()-dy)/2 + dy; + glVertex2i(dx, y); + glVertex2i(width(), y); + } + } +} +void GLStatistics::drawTextTickCent(int r, int dy) +{ + // only work within range that is a pure multiple of r + int range = int(setting_spinScale->value()/r)*r; + + float scale = 50.0f/setting_spinScale->value(); + QString txt; + for(int i=-range; i=0) txt = QString(" ")+txt; + if(i==0) txt = QString(" ")+txt; + glRasterPos2i(2, int((height()-dy)*i/100.0f*scale) + (height()-dy)/2 + dy - 4); + for(size_t i=0; iisOn()) + scale = 50.0f/setting_spinScale->value(); + else + scale = int(50/setting_spinScale->value()); + + // name + QString str = tr("Statistics"); + glColor3f(0.75,0.75,0.75); + glRasterPos2i(2, height()-20); + for(size_t i = 0; i < str.length(); i++) + glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, str.latin1()[i]); + + int char_size = 9; + int ticks_size = 2+3*char_size; + int grid_width = width()-ticks_size; + int dy = char_size/2; + int legend_height = 40; + int grid_height = height()-legend_height; + + // draw green rect + if(setting_showTolerance->isOn()) + { + int green_ytop = int((scale*human_tol+0.5)*grid_height) + legend_height; + int green_ybottom = int((-scale*human_tol+0.5)*grid_height) + legend_height; + + glBegin(GL_QUADS); + glColor3f(168/256.0,221/256.0,182/256.0); + glVertex2i(ticks_size, green_ytop); + glVertex2i(ticks_size, green_ybottom); + glVertex2i(width(), green_ybottom); + glVertex2i(width(), green_ytop); + glEnd(); + + // draw green lines + glBegin(GL_LINES); + glColor3f(0.48,0.80,0.57); + glVertex2i(ticks_size, green_ytop); + glVertex2i(width(), green_ytop); + glVertex2i(ticks_size, green_ybottom); + glVertex2i(width(), green_ybottom); + glEnd(); + } + + // std + if(setting_show_std->isOn()) + { + glBegin(GL_QUADS); + glLineWidth(1.0f); + glColor3f(0.85, 0.85, 0.85); + for(size_t i=0; iisOn()) + { + glBegin(GL_LINES); + float gray = 0.87; +// glColor3f(gray, gray, gray); +// drawTicksCent(1, ticks_size); + gray = 0.875; + glColor3f(gray, gray, gray); + drawTicksCent(2, ticks_size, legend_height); + gray = 0.75; + glColor3f(gray, gray, gray); + drawTicksCent(10, ticks_size, legend_height); + glEnd(); + } + else + { + glBegin(GL_LINES); + float gray = 0.5; + glColor3f(gray, gray, gray); + glVertex2i(ticks_size, grid_height/2+legend_height); + glVertex2i(width(), grid_height/2+legend_height); + gray = 0.75; + glColor3f(gray, gray, gray); + glVertex2i(ticks_size, grid_height/4+legend_height); + glVertex2i(width(), grid_height/4+legend_height); + glVertex2i(ticks_size, 3*grid_height/4+legend_height); + glVertex2i(width(), 3*grid_height/4+legend_height); + gray = 0.87; + glColor3f(gray, gray, gray); + glVertex2i(ticks_size, grid_height/8+legend_height); + glVertex2i(width(), grid_height/8+legend_height); + glVertex2i(ticks_size, 7*grid_height/8+legend_height); + glVertex2i(width(), 7*grid_height/8+legend_height); + glVertex2i(ticks_size, 3*grid_height/8+legend_height); + glVertex2i(width(), 3*grid_height/8+legend_height); + glVertex2i(ticks_size, 5*grid_height/8+legend_height); + glVertex2i(width(), 5*grid_height/8+legend_height); + glEnd(); + } + + // center line +// glBegin(GL_LINES); +// glColor3f(0,0,0); +// glVertex2i(ticks_size, grid_height/2+legend_height); +// glVertex2i(width(), grid_height/2+legend_height); +// glEnd(); + + // text marks + float gray = 0.5; + glColor3f(gray, gray, gray); + if(setting_useCents->isOn()) + { + int grad = 10; + if(setting_spinScale->value() <= 25) grad=5; + if(setting_spinScale->value() <= 10) grad=1; + drawTextTickCent(grad, legend_height); + } + else + { + string sfraq, sufraq; + sufraq = string("1/")+QString::number(int(50/setting_spinScale->value())*2).latin1(); + sfraq = string("+")+sufraq; + glRasterPos2i(2, 3*grid_height/4-dy+legend_height); + for(size_t i = 0; i < sfraq.size(); i++) + glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, sfraq[i]); + sfraq = string("-")+sufraq; + glRasterPos2i(2, grid_height/4-dy+legend_height); + for(size_t i = 0; i < sfraq.size(); i++) + glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, sfraq[i]); + + sufraq = string("1/")+QString::number(int(50/setting_spinScale->value())*4).latin1(); + sfraq = string("+")+sufraq; + glRasterPos2i(2, 5*grid_height/8-dy+legend_height); + for(size_t i = 0; i < sfraq.size(); i++) + glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, sfraq[i]); + sfraq = string("-")+sufraq; + glRasterPos2i(2, 3*grid_height/8-dy+legend_height); + for(size_t i = 0; i < sfraq.size(); i++) + glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, sfraq[i]); + } + + // vertical lines + glBegin(GL_LINES); + gray = 0.5; + glColor3f(gray, gray, gray); + for(size_t i=0; i +using namespace std; +#include +#include +#include +#include +class QTimer; +#include +#include "View.h" + +class GLStatistics : public QGLWidget, public View +{ + Q_OBJECT + + virtual void mouseReleaseEvent(QMouseEvent* e){View::mouseReleaseEvent(e);} + + void drawTicksCent(int r, int dx, int dy); + void drawTextTickCent(int r, int dx); + + public: + GLStatistics(QWidget* parent); + + struct AverageNote + { + int ht; + deque errs; + float err_mean; + float err_std; + + void addErr(float err); + + void init(); + AverageNote(); + AverageNote(int h); + AverageNote(int h, int num, int den); + AverageNote(int h, float cents); + QString factor; + QString getName() const; + }; + vector m_avg_notes; + void addNote(int ht, float err); + void addNote(int ht, int num, int den, float err); + void addNote(int ht, float cents, float err); + + // settings + QAction* setting_reset; + QAction* setting_keep_hidden; + QAction* setting_show_std; + QAction* setting_scale_auto; + QSpinBox* setting_scale_min; + QSpinBox* setting_scale_max; + QAction* setting_showTolerance; + QAction* setting_useCents; + QSpinBox* setting_spinScale; + virtual void save(); + virtual void load(); + virtual void clearSettings(); + + public slots: + void initializeGL(); + void paintGL(); + void resizeGL( int w, int h ); + + void reset(); +}; + +#endif // _GLErrorHistory_h_ diff --git a/src/modules/GLVolumeHistory.cpp b/src/modules/GLVolumeHistory.cpp new file mode 100644 index 0000000..57c5f81 --- /dev/null +++ b/src/modules/GLVolumeHistory.cpp @@ -0,0 +1,404 @@ +// Copyright 2004 "Gilles Degottex" + +// This file is part of "fmit" + +// "fmit" 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. +// +// "fmit" 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 + +#include "GLVolumeHistory.h" + +static const unsigned char g_icon_volume_graph[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, + 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7a, 0x7a, 0xf4, 0x00, 0x00, 0x06, + 0x83, 0x49, 0x44, 0x41, 0x54, 0x78, 0x9c, 0xb5, 0xd7, 0x59, 0x6c, 0x54, + 0xd7, 0x19, 0xc0, 0xf1, 0xff, 0xdd, 0xe6, 0xce, 0xcc, 0x9d, 0x19, 0x8f, + 0xf7, 0xb1, 0xf1, 0xd8, 0x9e, 0xc1, 0x6b, 0xcd, 0x62, 0x23, 0x4c, 0x1c, + 0xc4, 0x52, 0x9a, 0x84, 0xf2, 0x10, 0x08, 0x52, 0x17, 0x1e, 0xaa, 0x54, + 0xed, 0x43, 0xd3, 0x36, 0x7d, 0x69, 0xd4, 0x3e, 0xa4, 0xd0, 0xb7, 0xbe, + 0xb4, 0x51, 0x53, 0xa9, 0x8d, 0xaa, 0x34, 0x95, 0x1a, 0x35, 0x0f, 0x88, + 0x2c, 0x6a, 0x4a, 0x24, 0xa8, 0x4a, 0x94, 0x02, 0x0d, 0x34, 0x21, 0xec, + 0x9b, 0x31, 0x06, 0x4c, 0x60, 0xa8, 0xf7, 0xf1, 0x78, 0x9b, 0xed, 0xee, + 0x7d, 0x00, 0x13, 0x63, 0x3c, 0xb6, 0x83, 0xe8, 0x27, 0x8d, 0x34, 0x73, + 0x74, 0xbe, 0xf3, 0xfd, 0x74, 0xee, 0x39, 0xf7, 0x9c, 0x11, 0x78, 0xf4, + 0xf0, 0x03, 0xdf, 0x02, 0x9a, 0x45, 0x49, 0x2a, 0x77, 0x6c, 0xbb, 0x1b, + 0x38, 0x71, 0xef, 0xb3, 0xe4, 0x10, 0x1e, 0xa5, 0xb2, 0x2c, 0x2b, 0xbb, + 0x81, 0xdd, 0x15, 0xd5, 0xb5, 0xb4, 0xac, 0xee, 0xf4, 0x04, 0x42, 0x61, + 0x25, 0x71, 0xb3, 0x37, 0xdb, 0x7b, 0xe1, 0x94, 0xe8, 0x38, 0xf6, 0x09, + 0x3d, 0x9f, 0xfb, 0x1e, 0x70, 0xfb, 0xff, 0x01, 0xf0, 0x7b, 0x54, 0xef, + 0x15, 0x2d, 0x58, 0x54, 0xf9, 0xc3, 0x5f, 0xbc, 0xe2, 0x8d, 0xb7, 0xac, + 0xe4, 0xd3, 0x7f, 0x1d, 0xa4, 0xf7, 0xe2, 0x19, 0x04, 0x51, 0x42, 0x14, + 0x05, 0xb2, 0xe9, 0x49, 0xeb, 0xc2, 0x89, 0xa3, 0xa6, 0x65, 0x59, 0xbb, + 0xc1, 0xfd, 0x03, 0xe0, 0x3c, 0x36, 0x80, 0xac, 0x7a, 0x4f, 0x95, 0x57, + 0x54, 0xad, 0x7d, 0xf9, 0xd5, 0xb7, 0x90, 0x24, 0x99, 0xbf, 0xfe, 0xfe, + 0x57, 0x34, 0xac, 0x5a, 0x4f, 0xb4, 0xa1, 0x0d, 0x00, 0xdb, 0xb6, 0xe8, + 0x3e, 0x79, 0x98, 0xa9, 0xe4, 0x20, 0x7d, 0x3d, 0xe7, 0x32, 0x13, 0x63, + 0x23, 0x57, 0x0d, 0x3d, 0xbf, 0x09, 0xc8, 0x16, 0x1a, 0x53, 0x5a, 0x6a, + 0x71, 0xc5, 0xab, 0xfd, 0x40, 0xc0, 0x7d, 0xe1, 0xc7, 0x7b, 0x5e, 0x15, + 0xaa, 0xa2, 0x31, 0xf6, 0xfe, 0xf1, 0xd7, 0xb4, 0x6f, 0xda, 0x4e, 0x79, + 0x75, 0xdd, 0xfd, 0x3e, 0xa2, 0x28, 0x52, 0x19, 0x5d, 0x8e, 0x1a, 0x08, + 0x91, 0x99, 0x4e, 0x79, 0x64, 0x59, 0x2e, 0xcd, 0xa6, 0xa7, 0x9b, 0x1c, + 0xdb, 0xfe, 0x5b, 0xa1, 0x71, 0xc5, 0x25, 0xd6, 0x6f, 0x94, 0x15, 0xe5, + 0x77, 0xcd, 0xab, 0x3a, 0x85, 0xc6, 0xb6, 0x0e, 0x86, 0xfb, 0x6f, 0xa3, + 0xf8, 0x03, 0x04, 0xc3, 0xa5, 0xf3, 0x76, 0xae, 0x5c, 0x16, 0xe7, 0xab, + 0x3b, 0xbe, 0x4f, 0x51, 0x69, 0x44, 0x55, 0x14, 0xcf, 0x4e, 0x04, 0xe1, + 0x85, 0x42, 0x03, 0x2f, 0x65, 0x06, 0xfc, 0xbe, 0x60, 0xf8, 0xb8, 0xa5, + 0xe7, 0x22, 0x2f, 0xee, 0xf9, 0x2d, 0xa1, 0x70, 0x09, 0x1f, 0xec, 0xfd, + 0x33, 0x2b, 0x9e, 0x78, 0x06, 0x59, 0xf1, 0x14, 0x4c, 0x92, 0x64, 0x85, + 0xb2, 0xaa, 0x3a, 0x2c, 0x23, 0x2b, 0x8f, 0xf4, 0xdf, 0xfa, 0xba, 0xeb, + 0x38, 0x07, 0x81, 0xa1, 0xb9, 0xfd, 0x16, 0x9d, 0x01, 0x5f, 0x30, 0xfc, + 0x4e, 0x65, 0x7d, 0x4b, 0xbc, 0x79, 0x55, 0x27, 0xcb, 0xea, 0x1b, 0x48, + 0x4f, 0x4f, 0x62, 0x18, 0x26, 0xaa, 0x4f, 0x5b, 0x54, 0x1e, 0x2e, 0x8b, + 0x50, 0x51, 0xd3, 0x48, 0xd7, 0x96, 0x67, 0x15, 0xc5, 0xa3, 0x1e, 0x00, + 0x02, 0x5f, 0x0a, 0xe0, 0xd5, 0x42, 0x3f, 0xaf, 0x6b, 0x5b, 0xb7, 0x11, + 0xd7, 0x15, 0xeb, 0x1a, 0x5a, 0x00, 0x18, 0x4c, 0xdc, 0xa4, 0x34, 0x12, + 0x5d, 0xb4, 0xf8, 0x4c, 0xac, 0x78, 0xe2, 0x6b, 0xe4, 0xf2, 0x39, 0x21, + 0x52, 0x13, 0x0b, 0x03, 0xdf, 0x5d, 0x32, 0x40, 0x94, 0xa4, 0xce, 0x50, + 0x59, 0xe4, 0x67, 0xcb, 0x3b, 0x36, 0x16, 0xe5, 0xd3, 0x13, 0x44, 0x6a, + 0x62, 0x00, 0x8c, 0x27, 0x87, 0xd1, 0x42, 0x25, 0x4b, 0x06, 0x00, 0xac, + 0xd9, 0xb4, 0x9d, 0xaa, 0xda, 0xb8, 0x5f, 0xf5, 0xfa, 0x7e, 0xba, 0x54, + 0x40, 0x89, 0x3f, 0x54, 0xba, 0xaf, 0xe3, 0x99, 0x6f, 0x47, 0x00, 0xd2, + 0x13, 0x49, 0x22, 0xd1, 0x7a, 0x00, 0x52, 0xa3, 0xc3, 0x04, 0x42, 0xc5, + 0x5f, 0x0a, 0x50, 0x5c, 0x5e, 0x8d, 0x65, 0xda, 0x20, 0x08, 0x51, 0x60, + 0xdd, 0x62, 0x00, 0xc1, 0x17, 0x0c, 0xef, 0x5f, 0xb3, 0x75, 0x57, 0x5c, + 0x56, 0x54, 0x6c, 0xcb, 0x24, 0x3d, 0x99, 0x22, 0x52, 0x73, 0x17, 0x30, + 0x9e, 0x1c, 0x26, 0x50, 0x54, 0x72, 0xef, 0xfb, 0x10, 0xbd, 0x17, 0x4f, + 0x92, 0xcf, 0x65, 0x16, 0x45, 0x44, 0xea, 0x9a, 0x58, 0xd9, 0xb9, 0x41, + 0x96, 0x15, 0xcf, 0x4f, 0x16, 0x04, 0x78, 0xb5, 0xd0, 0x2b, 0x4d, 0x9d, + 0x4f, 0x75, 0x04, 0x4b, 0x2a, 0x04, 0x00, 0x3d, 0x3b, 0x8d, 0xaa, 0xfa, + 0xf0, 0x6b, 0x41, 0x00, 0x4c, 0xd3, 0x44, 0x92, 0x15, 0x06, 0xef, 0xdc, + 0xe4, 0xc4, 0x27, 0xc7, 0x48, 0x8c, 0x4e, 0x71, 0xe4, 0xd0, 0x07, 0x24, + 0x87, 0xfe, 0xbb, 0x20, 0xa0, 0x71, 0x75, 0x17, 0x92, 0xe4, 0x91, 0x5d, + 0xc7, 0xd9, 0x05, 0x04, 0xe7, 0x05, 0xc8, 0x1e, 0x75, 0x5b, 0x59, 0xcd, + 0xf2, 0xe7, 0x6b, 0x9a, 0xdb, 0xef, 0xaf, 0x56, 0xd5, 0x17, 0x40, 0xcf, + 0x67, 0x31, 0x0d, 0x1d, 0x80, 0x70, 0x71, 0x29, 0x99, 0xa9, 0x09, 0x6e, + 0xf4, 0x5e, 0x46, 0x09, 0x94, 0x22, 0x08, 0x22, 0x4a, 0x28, 0xc2, 0x95, + 0x8b, 0xa7, 0x17, 0x04, 0x78, 0x54, 0x1f, 0x08, 0x12, 0x91, 0x68, 0xcc, + 0x04, 0xbe, 0x31, 0x1f, 0xa0, 0xdc, 0x1f, 0x2a, 0x79, 0x7d, 0xe5, 0xe6, + 0x1d, 0x95, 0xb3, 0x13, 0x25, 0xc5, 0x83, 0x57, 0x0b, 0x92, 0x1c, 0x1e, + 0x00, 0x20, 0x12, 0x8d, 0x31, 0x9e, 0x1c, 0x98, 0x6b, 0x27, 0x6b, 0x49, + 0xdc, 0xf9, 0xbc, 0x77, 0x41, 0x44, 0x79, 0x75, 0x3d, 0x55, 0xd1, 0x98, + 0x1f, 0x68, 0x7b, 0x08, 0xe0, 0x0d, 0x14, 0xbd, 0xd4, 0xba, 0x7e, 0x5b, + 0x9d, 0x28, 0xc9, 0x0f, 0x25, 0x6a, 0xa1, 0x12, 0x46, 0x07, 0xef, 0x4e, + 0x71, 0xa4, 0xa6, 0x8e, 0xc9, 0xe4, 0x30, 0x82, 0xf8, 0x20, 0x40, 0xf6, + 0x6a, 0xf4, 0xf5, 0x76, 0x2f, 0x08, 0x28, 0x2a, 0xab, 0x42, 0x56, 0x3c, + 0xa2, 0xea, 0xf3, 0xb7, 0xce, 0x05, 0x08, 0xb2, 0xe2, 0xf9, 0x66, 0x69, + 0x75, 0x6c, 0xde, 0xc3, 0xc9, 0x17, 0x2c, 0xba, 0xff, 0x8c, 0x2b, 0xaa, + 0x6b, 0x99, 0x4c, 0x0d, 0xcd, 0x7b, 0x8a, 0xe9, 0x86, 0xb5, 0x20, 0xa0, + 0xb8, 0x3c, 0x82, 0x6d, 0x5b, 0x08, 0x82, 0xb0, 0x7c, 0x2e, 0xa0, 0xae, + 0x38, 0x52, 0x1b, 0x12, 0x84, 0xf9, 0x0f, 0x47, 0x8f, 0x3f, 0xc4, 0xe8, + 0x50, 0x3f, 0x00, 0x5e, 0x9f, 0x1f, 0x3d, 0x97, 0xc1, 0xa3, 0x3c, 0xfc, + 0x16, 0x77, 0x1c, 0x77, 0x41, 0x80, 0x4f, 0x0b, 0x61, 0x59, 0x16, 0x96, + 0x69, 0x2e, 0x9b, 0x0b, 0x48, 0x99, 0xf9, 0x9c, 0x5d, 0x28, 0xd1, 0x1f, + 0x2a, 0xa1, 0xaf, 0xe7, 0xe2, 0x17, 0xbf, 0x35, 0x8d, 0xc6, 0xb6, 0x0e, + 0x8c, 0xe9, 0xe1, 0x39, 0x3d, 0x17, 0x06, 0x00, 0xc8, 0xb2, 0x07, 0xcb, + 0x34, 0x82, 0x80, 0x36, 0x1b, 0x30, 0x65, 0xe4, 0xb3, 0x05, 0xe7, 0x2f, + 0x12, 0x6b, 0xe5, 0xf3, 0x6b, 0x97, 0x18, 0x19, 0xb8, 0x03, 0xc0, 0x86, + 0xad, 0xcf, 0x91, 0xb8, 0x7a, 0x9e, 0xb2, 0xe2, 0x62, 0x5c, 0xe7, 0x8b, + 0xfb, 0x46, 0xa1, 0x19, 0x7c, 0x20, 0x04, 0x11, 0xc5, 0xa3, 0x9a, 0x40, + 0x74, 0x36, 0x00, 0x53, 0xcf, 0xa5, 0x5d, 0x77, 0xfe, 0xcb, 0x8b, 0xea, + 0x0f, 0x50, 0x15, 0x6f, 0xe3, 0xd8, 0xa1, 0xf7, 0x01, 0x58, 0xde, 0xb2, + 0x8a, 0xd1, 0xc1, 0x5b, 0x74, 0x74, 0x6d, 0xc1, 0xcd, 0x8c, 0xe0, 0x3a, + 0x0e, 0x96, 0x9e, 0xa5, 0xb2, 0xb2, 0x62, 0x09, 0x00, 0x30, 0x0d, 0x5d, + 0x06, 0xc6, 0x1e, 0x00, 0x18, 0xf9, 0xcc, 0x9b, 0x83, 0x37, 0xba, 0xf5, + 0x42, 0x79, 0x35, 0x2d, 0x6b, 0x38, 0x76, 0x68, 0x3f, 0x8e, 0x7d, 0xf7, + 0x49, 0xd5, 0x37, 0x34, 0x33, 0x3d, 0x9e, 0xe4, 0xe9, 0x67, 0x77, 0x11, + 0x2d, 0xd3, 0x68, 0x8a, 0x45, 0xe9, 0xe8, 0xda, 0xb2, 0x68, 0x7d, 0xcb, + 0xd0, 0x91, 0x65, 0x25, 0x07, 0x8c, 0x3e, 0x00, 0xd0, 0xb3, 0xe9, 0xd7, + 0xae, 0x7e, 0xf6, 0xe1, 0xf9, 0xf1, 0xa1, 0xc4, 0xbc, 0xd3, 0x50, 0xba, + 0x2c, 0x0e, 0x08, 0x5c, 0x3a, 0xfd, 0x1f, 0x00, 0x36, 0x6c, 0xdd, 0xc9, + 0x95, 0x33, 0x47, 0x11, 0x25, 0x89, 0x96, 0xf6, 0x27, 0x89, 0xb7, 0xac, + 0x5e, 0xb4, 0xb8, 0x6d, 0x5b, 0xd8, 0x96, 0x89, 0xa2, 0xaa, 0x89, 0x99, + 0xb6, 0xd9, 0x9b, 0xd9, 0xc8, 0x4d, 0x4f, 0x3c, 0x75, 0xee, 0xa3, 0xf7, + 0x0e, 0x5e, 0x3f, 0x7d, 0x24, 0xe5, 0xba, 0x0f, 0x2e, 0x28, 0x41, 0x10, + 0xa8, 0x6e, 0x6e, 0xe7, 0xe8, 0xc1, 0x77, 0x01, 0x28, 0x2a, 0x2e, 0xa5, + 0xb2, 0xaa, 0x8a, 0x81, 0x5b, 0xd7, 0x16, 0x2d, 0x3c, 0x13, 0xe9, 0x89, + 0x31, 0x70, 0x5d, 0x5c, 0xc7, 0xb9, 0x32, 0xd3, 0x36, 0x77, 0x2f, 0x99, + 0x96, 0x91, 0xdf, 0x37, 0x3d, 0x3e, 0x32, 0xd6, 0x7f, 0xfd, 0x62, 0x9b, + 0xc7, 0xab, 0xf9, 0x03, 0xc5, 0xe5, 0xf2, 0xcc, 0xe2, 0xd2, 0x8a, 0xca, + 0x38, 0x73, 0x78, 0x3f, 0xd5, 0xd1, 0x18, 0x55, 0xb5, 0x71, 0x1a, 0xbf, + 0xd2, 0xce, 0xa1, 0xf7, 0xfe, 0x42, 0x4d, 0xc3, 0x0a, 0xa4, 0x79, 0x5e, + 0x60, 0x73, 0xe3, 0xf2, 0xa9, 0xc3, 0x64, 0xa6, 0x52, 0xf6, 0xc0, 0xed, + 0xbe, 0x77, 0x81, 0x7f, 0xcf, 0x07, 0x00, 0xc0, 0xb6, 0xcc, 0x73, 0x46, + 0x2e, 0xfd, 0x46, 0x6a, 0xf0, 0x96, 0xde, 0x7f, 0xed, 0x42, 0xcc, 0xe3, + 0xd3, 0xfc, 0x81, 0x70, 0xb9, 0x2c, 0x7b, 0x54, 0xb4, 0x70, 0x19, 0xff, + 0xdc, 0xf7, 0x3a, 0xeb, 0x36, 0x6f, 0x23, 0x10, 0x0a, 0x53, 0xdb, 0xd8, + 0xc2, 0xd1, 0x03, 0x6f, 0x13, 0x6d, 0x58, 0xb1, 0x60, 0x71, 0xc7, 0xb6, + 0xb9, 0x76, 0xee, 0x18, 0xdd, 0xa7, 0x8f, 0xdb, 0x8e, 0x63, 0xef, 0x01, + 0xfa, 0x0b, 0x02, 0x66, 0x1c, 0xb6, 0x69, 0x1c, 0x9f, 0x0b, 0x89, 0xc4, + 0x5a, 0x65, 0x23, 0x9f, 0xe1, 0x93, 0x0f, 0xdf, 0x67, 0xc3, 0xd6, 0x9d, + 0x84, 0xc2, 0x25, 0xa4, 0x27, 0xc6, 0xe8, 0xeb, 0x3e, 0x47, 0x65, 0x6d, + 0x43, 0xc1, 0xc1, 0x7a, 0xce, 0x1e, 0x63, 0x7a, 0x6c, 0xc8, 0x49, 0x0e, + 0x0f, 0x7c, 0x64, 0x5b, 0xe6, 0x6f, 0x66, 0xda, 0x97, 0x72, 0x29, 0x9d, + 0x05, 0xb9, 0xad, 0xf7, 0x5f, 0xbb, 0x10, 0xab, 0x6e, 0x58, 0xe9, 0x1f, + 0x1b, 0x4c, 0xc8, 0xc3, 0x77, 0x6e, 0xd2, 0xde, 0xb5, 0x99, 0xba, 0x86, + 0x56, 0x04, 0xc1, 0xe5, 0xe3, 0x7f, 0xbc, 0x4d, 0xa4, 0xb6, 0xf1, 0xa1, + 0xcb, 0x6a, 0x72, 0x30, 0xc1, 0x8d, 0x4b, 0x9f, 0x72, 0xe1, 0xc4, 0x51, + 0xcb, 0x34, 0xf5, 0xe7, 0xb8, 0xb7, 0x05, 0x97, 0x0a, 0x78, 0x08, 0x32, + 0x3e, 0x94, 0xd0, 0x5d, 0xc7, 0x6d, 0x4c, 0xf4, 0xf5, 0x14, 0xdd, 0xbe, + 0xd1, 0x23, 0x34, 0xaf, 0x5a, 0x4b, 0x4d, 0xac, 0x91, 0xa6, 0x15, 0x77, + 0xd7, 0x44, 0x6a, 0x74, 0x08, 0x51, 0x94, 0x98, 0x4a, 0x8d, 0xd2, 0x73, + 0xf6, 0x63, 0x52, 0x43, 0xb7, 0xc8, 0x65, 0xa6, 0x8c, 0xb1, 0x91, 0x81, + 0xbd, 0xb6, 0x6d, 0xbd, 0x39, 0x7b, 0xd0, 0x47, 0xfa, 0x6f, 0x78, 0x2f, + 0x54, 0xc5, 0xab, 0xfd, 0x52, 0x96, 0xc4, 0x97, 0x5c, 0xd7, 0xd5, 0xbe, + 0xf3, 0xe2, 0xcb, 0xac, 0x7f, 0x7a, 0x07, 0x00, 0x03, 0x89, 0x9b, 0x5c, + 0xbf, 0x7c, 0x16, 0x45, 0x55, 0x89, 0xc6, 0x9a, 0xf9, 0xfb, 0x5b, 0xaf, + 0xe9, 0x3d, 0xe7, 0x3f, 0x1b, 0x30, 0xf4, 0x7c, 0x17, 0x30, 0xf2, 0xb8, + 0x00, 0xf7, 0x21, 0x92, 0xe2, 0x79, 0x43, 0x14, 0xc4, 0xe7, 0xa3, 0xf1, + 0x26, 0x67, 0xed, 0xc6, 0xad, 0x72, 0x75, 0x5d, 0x9c, 0xcc, 0xf4, 0x24, + 0x89, 0x1b, 0x57, 0xed, 0x23, 0x07, 0xde, 0xb1, 0x81, 0x93, 0x86, 0x9e, + 0xdf, 0x0e, 0x4c, 0xcc, 0x4d, 0x7e, 0x1c, 0x80, 0x99, 0x28, 0x03, 0x7e, + 0xe4, 0xf5, 0x69, 0x4f, 0x0a, 0x82, 0xd0, 0x2a, 0x88, 0x42, 0xca, 0x32, + 0xcd, 0xab, 0x86, 0x9e, 0xff, 0x13, 0x70, 0xbc, 0x50, 0xd2, 0xff, 0x00, + 0x3c, 0x39, 0x7b, 0xa0, 0x73, 0xfc, 0x63, 0xd4, 0x00, 0x00, 0x00, 0x00, + 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 +}; + +#include +using namespace std; +#include +#include +#include +#include + +GLVolumeHistory::Note::Note(int h) +: ht(h) +{ +} +GLVolumeHistory::Note::Note(int h, int num, int den) +: ht(h) +{ + factor = QString::number(num)+"/"+QString::number(den); +} +GLVolumeHistory::Note::Note(int h, float cents) +: ht(h) +{ + factor = QString::number(cents); +} +QString GLVolumeHistory::Note::getName() const +{ + return Music::h2n(ht)+factor; +} + +GLVolumeHistory::GLVolumeHistory(QWidget* parent) +: QGLWidget(parent, "GLVolumeHistory") +, View("Volume history", this) +{ + QImage img; + setting_show->setToggleAction(true); + img.loadFromData(g_icon_volume_graph, sizeof(g_icon_volume_graph), "PNG"); + setting_show->setIconSet(QIconSet(QImage(img))); + setting_show->setOn(false); + hide(); + + m_volume_treshold = -100; + + setting_keep = new QAction(this); + setting_keep->setMenuText(tr("Keep previous notes")); + setting_keep->setToggleAction(true); + setting_keep->setOn(false); + connect(setting_keep, SIGNAL(toggled(bool)), this, SLOT(keepPreviousNotes(bool))); +// setting_keep->addTo(&m_popup_menu); +} + +void GLVolumeHistory::save() +{ + s_settings->writeEntry("keep", setting_keep->isOn()); +} +void GLVolumeHistory::load() +{ + setting_keep->setOn(s_settings->readBoolEntry("keep", setting_keep->isOn())); +} +void GLVolumeHistory::clearSettings() +{ + s_settings->removeEntry("keep"); +} + +void GLVolumeHistory::addNote(GLVolumeHistory::Note note) +{ + m_notes.push_back(note); + + if(!setting_keep->isOn()) + while(m_notes.size()>1) + m_notes.pop_front(); +} +void GLVolumeHistory::addVolume(float vol) +{ + m_notes.back().volumes.push_back(vol); +} + +void GLVolumeHistory::keepPreviousNotes(bool keep) +{ + if(!keep) + while(m_notes.size()>1) + m_notes.pop_front(); +} + +void GLVolumeHistory::setVolumeTreshold(int treshold) +{ + m_volume_treshold = treshold; +} + +void GLVolumeHistory::initializeGL() +{ + // Set the clear color to black + glClearColor(1.0, 1.0, 1.0, 0.0); + + // glShadeModel( GL_FLAT ); + glShadeModel( GL_SMOOTH ); + + glLoadIdentity(); +} + +void GLVolumeHistory::paintGL() +{ +// cerr << "GLVolumeHistory::paintGL " << m_notes.size() << endl; + + glClear(GL_COLOR_BUFFER_BIT); + + glLineWidth(1.0f); + + // name + QString str = tr("Volume"); + glColor3f(0.75,0.75,0.75); + glRasterPos2i(2, height()-20); + for(size_t i = 0; i < str.length(); i++) + glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, str.latin1()[i]); + + int s = 2+fontMetrics().width("50%"); + + // horiz lines + if(2*height()/50>2) + { + glBegin(GL_LINES); + float gray = 0.875; + glColor3f(gray, gray, gray); + for(int h=2; h<50; h+=2) + { + glVertex2i(s, h*height()/50); + glVertex2i(width(), h*height()/50); + } + glEnd(); + } + if(10*height()/50>2) + { + glBegin(GL_LINES); + float gray = 0.75; + glColor3f(gray, gray, gray); + for(int h=10; h<50; h+=10) + { + glVertex2i(s, h*height()/50); + glVertex2i(width(), h*height()/50); + } + glEnd(); + } + + int dy = 3; + glColor3f(0.5f,0.5f,0.5f); + string sfraq = "-10"; + glRasterPos2i(2, height()-10*height()/50-dy); + for(size_t i = 0; i < sfraq.size(); i++) + glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, sfraq[i]); + sfraq = "-20"; + glRasterPos2i(2, height()-20*height()/50-dy); + for(size_t i = 0; i < sfraq.size(); i++) + glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, sfraq[i]); + sfraq = "-30"; + glRasterPos2i(2, height()-30*height()/50-dy); + for(size_t i = 0; i < sfraq.size(); i++) + glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, sfraq[i]); + sfraq = "-40"; + glRasterPos2i(2, height()-40*height()/50-dy); + for(size_t i = 0; i < sfraq.size(); i++) + glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, sfraq[i]); + + glColor3f(1.0,0.5,0.5); + glLineWidth(2.0f); + glBegin(GL_LINES); + glVertex2f(s, height()+height()*m_volume_treshold/50); + glVertex2f(width(), height()+height()*m_volume_treshold/50); + glEnd(); + + // volumes + if(!m_notes.empty()) + { + int total_size = 0; + for(size_t i=0; i +using namespace std; +#include +#include +class QTimer; +#include "View.h" + +class GLVolumeHistory : public QGLWidget, public View +{ + Q_OBJECT + + public: + GLVolumeHistory(QWidget* parent); + + struct Note + { + int ht; + QString factor; + deque volumes; + Note(int h); + Note(int h, int num, int den); + Note(int h, float cents); + QString getName() const; + }; + deque m_notes; + void addNote(GLVolumeHistory::Note note); + void addVolume(float vol); + + int m_volume_treshold; + + // settings + QAction* setting_keep; + virtual void save(); + virtual void load(); + virtual void clearSettings(); + + public slots: + void initializeGL(); + void paintGL(); + void resizeGL( int w, int h ); + void keepPreviousNotes(bool keep); + void setVolumeTreshold(int treshold); +}; + +#endif // _GLVolumeHistory_h_ diff --git a/src/modules/Makefile.am b/src/modules/Makefile.am new file mode 100644 index 0000000..e023140 --- /dev/null +++ b/src/modules/Makefile.am @@ -0,0 +1,9 @@ +lib_LIBRARIES = libmodules.a +libmodules_a_SOURCES = View.cpp DialView.cpp GLFreqStruct.cpp GLSample.cpp GLErrorHistory.cpp GLGraph.cpp GLVolumeHistory.cpp MicrotonalView.cpp GLFT.cpp GLStatistics.cpp +nodist_libmodules_a_SOURCES = DialView_moc.cpp GLFreqStruct_moc.cpp GLFT_moc.cpp GLSample_moc.cpp GLErrorHistory_moc.cpp GLGraph_moc.cpp GLVolumeHistory_moc.cpp MicrotonalView_moc.cpp GLStatistics_moc.cpp +AM_CXXFLAGS = -Wall -I../../libs +EXTRA_DIST = *.h +CLEANFILES = *_moc.cpp *_moc.o + +%_moc.cpp: %.h + $(QT_MOC) $< > $@ diff --git a/src/modules/Makefile.in b/src/modules/Makefile.in new file mode 100644 index 0000000..4f7b7d7 --- /dev/null +++ b/src/modules/Makefile.in @@ -0,0 +1,472 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = src/modules +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_cxx_exceptions.m4 \ + $(top_srcdir)/m4/ac_cxx_have_complex.m4 \ + $(top_srcdir)/m4/ac_cxx_have_numeric_limits.m4 \ + $(top_srcdir)/m4/ac_cxx_have_sstream.m4 \ + $(top_srcdir)/m4/ac_cxx_have_stl.m4 \ + $(top_srcdir)/m4/ac_cxx_namespaces.m4 \ + $(top_srcdir)/m4/ac_cxx_templates.m4 \ + $(top_srcdir)/m4/bnv_have_qt.m4 \ + $(top_srcdir)/m4/mdl_have_opengl.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLIBRARIES_INSTALL = $(INSTALL_DATA) +LIBRARIES = $(lib_LIBRARIES) +AR = ar +ARFLAGS = cru +libmodules_a_AR = $(AR) $(ARFLAGS) +libmodules_a_LIBADD = +am_libmodules_a_OBJECTS = View.$(OBJEXT) DialView.$(OBJEXT) \ + GLFreqStruct.$(OBJEXT) GLSample.$(OBJEXT) \ + GLErrorHistory.$(OBJEXT) GLGraph.$(OBJEXT) \ + GLVolumeHistory.$(OBJEXT) MicrotonalView.$(OBJEXT) \ + GLFT.$(OBJEXT) GLStatistics.$(OBJEXT) +nodist_libmodules_a_OBJECTS = DialView_moc.$(OBJEXT) \ + GLFreqStruct_moc.$(OBJEXT) GLFT_moc.$(OBJEXT) \ + GLSample_moc.$(OBJEXT) GLErrorHistory_moc.$(OBJEXT) \ + GLGraph_moc.$(OBJEXT) GLVolumeHistory_moc.$(OBJEXT) \ + MicrotonalView_moc.$(OBJEXT) GLStatistics_moc.$(OBJEXT) +libmodules_a_OBJECTS = $(am_libmodules_a_OBJECTS) \ + $(nodist_libmodules_a_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +SOURCES = $(libmodules_a_SOURCES) $(nodist_libmodules_a_SOURCES) +DIST_SOURCES = $(libmodules_a_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QT_CXXFLAGS = @QT_CXXFLAGS@ +QT_DIR = @QT_DIR@ +QT_LIBS = @QT_LIBS@ +QT_MOC = @QT_MOC@ +QT_UIC = @QT_UIC@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_prefix = @ac_prefix@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +lib_LIBRARIES = libmodules.a +libmodules_a_SOURCES = View.cpp DialView.cpp GLFreqStruct.cpp GLSample.cpp GLErrorHistory.cpp GLGraph.cpp GLVolumeHistory.cpp MicrotonalView.cpp GLFT.cpp GLStatistics.cpp +nodist_libmodules_a_SOURCES = DialView_moc.cpp GLFreqStruct_moc.cpp GLFT_moc.cpp GLSample_moc.cpp GLErrorHistory_moc.cpp GLGraph_moc.cpp GLVolumeHistory_moc.cpp MicrotonalView_moc.cpp GLStatistics_moc.cpp +AM_CXXFLAGS = -Wall -I../../libs +EXTRA_DIST = *.h +CLEANFILES = *_moc.cpp *_moc.o +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/modules/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLIBRARIES: $(lib_LIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + @list='$(lib_LIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(libLIBRARIES_INSTALL) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(libLIBRARIES_INSTALL) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + @$(POST_INSTALL) + @list='$(lib_LIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + p=$(am__strip_dir) \ + echo " $(RANLIB) '$(DESTDIR)$(libdir)/$$p'"; \ + $(RANLIB) "$(DESTDIR)$(libdir)/$$p"; \ + else :; fi; \ + done + +uninstall-libLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLIBRARIES: + -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES) +libmodules.a: $(libmodules_a_OBJECTS) $(libmodules_a_DEPENDENCIES) + -rm -f libmodules.a + $(libmodules_a_AR) libmodules.a $(libmodules_a_OBJECTS) $(libmodules_a_LIBADD) + $(RANLIB) libmodules.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DialView.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DialView_moc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GLErrorHistory.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GLErrorHistory_moc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GLFT.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GLFT_moc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GLFreqStruct.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GLFreqStruct_moc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GLGraph.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GLGraph_moc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GLSample.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GLSample_moc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GLStatistics.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GLStatistics_moc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GLVolumeHistory.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GLVolumeHistory_moc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MicrotonalView.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MicrotonalView_moc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/View.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-libLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-libLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLIBRARIES ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-libLIBRARIES install-man install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-info-am uninstall-libLIBRARIES + + +%_moc.cpp: %.h + $(QT_MOC) $< > $@ +# 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: diff --git a/src/modules/MicrotonalView.cpp b/src/modules/MicrotonalView.cpp new file mode 100644 index 0000000..8475025 --- /dev/null +++ b/src/modules/MicrotonalView.cpp @@ -0,0 +1,830 @@ +// Copyright 2004 "Gilles Degottex" + +// This file is part of "fmit" + +// "fmit" 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. +// +// "fmit" 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 + +#include "MicrotonalView.h" + +static const unsigned char g_icon_ji[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, + 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7a, 0x7a, 0xf4, 0x00, 0x00, 0x05, + 0xc3, 0x49, 0x44, 0x41, 0x54, 0x78, 0x9c, 0xb5, 0x97, 0x4b, 0x6c, 0x24, + 0xc5, 0x19, 0xc7, 0x7f, 0x55, 0xfd, 0x98, 0x5d, 0x7b, 0x1e, 0x1e, 0xdb, + 0x0c, 0xb3, 0xbb, 0xf6, 0x78, 0xed, 0xf1, 0xda, 0xe0, 0x85, 0x95, 0x80, + 0x43, 0x88, 0x90, 0x15, 0xb8, 0x70, 0x88, 0xc0, 0x42, 0xe2, 0x86, 0xc4, + 0x85, 0xa0, 0x58, 0x4a, 0x4e, 0x44, 0x8a, 0x84, 0x72, 0x8a, 0xb4, 0x70, + 0x08, 0x91, 0x12, 0x5e, 0x97, 0x91, 0x78, 0x48, 0x51, 0x24, 0x94, 0x70, + 0xca, 0x04, 0x89, 0x03, 0x52, 0x72, 0x18, 0xe5, 0xc4, 0x29, 0x2c, 0x9b, + 0x08, 0xd6, 0x6b, 0x0f, 0xcc, 0xcb, 0x5e, 0xcf, 0xf8, 0xbd, 0x9e, 0x99, + 0x6e, 0x4f, 0x17, 0x87, 0xee, 0x9e, 0x99, 0x6e, 0x8f, 0xd7, 0xcb, 0xeb, + 0x93, 0x4a, 0xdd, 0x35, 0xea, 0xaf, 0xfe, 0xbf, 0xfa, 0x7f, 0x55, 0xd5, + 0xd3, 0x82, 0x1f, 0x28, 0x16, 0x97, 0x96, 0x47, 0x80, 0x14, 0x70, 0xaf, + 0x77, 0xed, 0x6f, 0x6d, 0xe0, 0xdd, 0x42, 0x3e, 0x77, 0x3d, 0x9c, 0x27, + 0xee, 0x72, 0xf0, 0x33, 0xc0, 0x14, 0x30, 0x3d, 0xa0, 0xa5, 0x81, 0x7b, + 0x00, 0xf3, 0x94, 0x61, 0x1c, 0x20, 0x5b, 0xc8, 0xe7, 0x8a, 0xfd, 0x3f, + 0xea, 0x21, 0x21, 0x09, 0xfc, 0x04, 0x78, 0x12, 0xb8, 0x14, 0x12, 0x39, + 0x06, 0x2b, 0x84, 0x20, 0x16, 0x1d, 0x22, 0x1e, 0x1b, 0x26, 0x11, 0x1b, + 0x26, 0x1e, 0x8b, 0x32, 0x12, 0x8f, 0x12, 0x8f, 0x0d, 0x13, 0x8f, 0x0f, + 0x93, 0x88, 0x45, 0x11, 0xc0, 0x87, 0xff, 0xfc, 0x17, 0xc5, 0x52, 0x4d, + 0x02, 0xbf, 0x04, 0x7e, 0x37, 0x10, 0x60, 0x71, 0x69, 0xf9, 0x37, 0xc0, + 0xcb, 0xde, 0x6c, 0x10, 0x42, 0x30, 0x79, 0x3e, 0xc5, 0xec, 0xcc, 0x24, + 0xd9, 0x8b, 0x17, 0x18, 0x1f, 0x1d, 0xe9, 0x8a, 0xc4, 0xa3, 0xc3, 0x98, + 0x67, 0x86, 0x10, 0x7a, 0x84, 0x96, 0xad, 0x68, 0x5a, 0x0e, 0x6d, 0x5b, + 0xd1, 0xb6, 0x1d, 0x9a, 0x96, 0x43, 0xcb, 0x76, 0x30, 0x34, 0xc9, 0x50, + 0x44, 0xf2, 0xe8, 0x5c, 0x94, 0xb6, 0x65, 0xf3, 0xe6, 0x3b, 0x7f, 0x07, + 0x78, 0x2c, 0x3c, 0x09, 0xdd, 0x13, 0xff, 0x2d, 0xf0, 0x1a, 0xc0, 0xc3, + 0x0f, 0xce, 0xf3, 0xc2, 0x73, 0x4f, 0x73, 0x69, 0x26, 0x83, 0xe5, 0x68, + 0x34, 0x2d, 0x87, 0x66, 0xbb, 0x43, 0xd3, 0x52, 0x1c, 0x5a, 0x0e, 0xdb, + 0x6d, 0x87, 0x6a, 0xbd, 0x83, 0xe3, 0x74, 0xe8, 0xa8, 0x43, 0x94, 0x52, + 0x38, 0x0a, 0x1c, 0xa5, 0x50, 0x0a, 0x1c, 0xc7, 0xef, 0x77, 0x70, 0x1c, + 0xc5, 0x23, 0x33, 0xc3, 0x3c, 0x70, 0x5f, 0xd6, 0xd7, 0x5b, 0x18, 0x08, + 0x00, 0x3c, 0x03, 0xf0, 0xb3, 0x9f, 0x3e, 0xc4, 0xd5, 0x97, 0x97, 0x29, + 0x37, 0x2c, 0xfe, 0x5f, 0xb5, 0xb1, 0x8f, 0xac, 0x9e, 0x00, 0xa0, 0x3c, + 0x11, 0x1c, 0x9b, 0x8d, 0x5a, 0x8d, 0x6a, 0xa5, 0x42, 0xb5, 0x5a, 0xa1, + 0x56, 0xad, 0xf0, 0xf3, 0xa5, 0x67, 0x49, 0x9f, 0x9f, 0x70, 0x41, 0x1c, + 0x17, 0xc8, 0x51, 0x82, 0xa6, 0xe5, 0x90, 0xb9, 0x70, 0xaf, 0xaf, 0x37, + 0xbe, 0xb8, 0xb4, 0x9c, 0x2a, 0xe4, 0x73, 0xb7, 0xc2, 0x00, 0xa3, 0x00, + 0x17, 0x33, 0xe7, 0x59, 0xdf, 0xb1, 0x69, 0xec, 0x1f, 0x21, 0x05, 0x98, + 0x86, 0xc0, 0x51, 0x82, 0x7a, 0xbd, 0xc1, 0xe7, 0xd7, 0x3e, 0xa7, 0x54, + 0x29, 0x53, 0x2e, 0x95, 0xd9, 0xdc, 0xdc, 0x44, 0x29, 0x05, 0x80, 0x69, + 0x98, 0x5c, 0x9c, 0x99, 0x21, 0x62, 0x4a, 0x22, 0xba, 0x40, 0x21, 0xe8, + 0x38, 0x0a, 0xa5, 0x04, 0x8e, 0x82, 0x96, 0xed, 0x90, 0x4a, 0x9c, 0x61, + 0x6c, 0x34, 0x41, 0x63, 0x6b, 0x17, 0xe0, 0x32, 0x30, 0x18, 0x20, 0x7d, + 0xcf, 0x28, 0x07, 0xcd, 0x0e, 0xa6, 0x2e, 0x50, 0x4a, 0xa0, 0x70, 0x67, + 0xb2, 0xb1, 0x5e, 0xe3, 0x1f, 0xf9, 0x3c, 0xa6, 0x61, 0x60, 0xd9, 0x76, + 0xc0, 0xc2, 0x5f, 0xbc, 0xf8, 0x22, 0x53, 0xd3, 0xd3, 0xae, 0xfd, 0x9e, + 0x43, 0x4a, 0x09, 0xb7, 0x14, 0x80, 0x7d, 0xe4, 0x82, 0x4e, 0x5d, 0x48, + 0xfb, 0x00, 0x0b, 0xc0, 0xbf, 0xfd, 0x7c, 0xe9, 0x5d, 0x93, 0x00, 0xe9, + 0xd4, 0x18, 0xba, 0x26, 0x30, 0x34, 0x81, 0xa1, 0xbb, 0x57, 0x53, 0x13, + 0x3c, 0x74, 0x65, 0x81, 0x3f, 0xfd, 0xf1, 0x55, 0xde, 0xf8, 0xf3, 0x6b, + 0x3c, 0x78, 0x39, 0x58, 0xc6, 0x56, 0xf3, 0x36, 0x11, 0x5d, 0x62, 0xea, + 0x82, 0x88, 0x2e, 0xbb, 0xf7, 0xa6, 0xe1, 0x3a, 0x62, 0x77, 0x5c, 0x80, + 0xc9, 0x5e, 0x19, 0x2e, 0xf7, 0xe7, 0xfb, 0x00, 0x6d, 0x80, 0xe4, 0x48, + 0x8c, 0x88, 0xd1, 0x13, 0x37, 0x34, 0x81, 0xae, 0x0b, 0xce, 0x9e, 0x31, + 0x48, 0xc4, 0x86, 0x31, 0x34, 0xc1, 0xa5, 0xd9, 0x99, 0x00, 0x40, 0xb5, + 0x5a, 0x71, 0x05, 0x3d, 0x61, 0xa3, 0xef, 0xde, 0xd4, 0x25, 0x1d, 0xc7, + 0x05, 0xc8, 0x9c, 0x00, 0xe0, 0x97, 0x60, 0x0b, 0x88, 0xb6, 0x5a, 0x16, + 0xf1, 0xa4, 0x44, 0x29, 0x07, 0x47, 0x81, 0x02, 0xcf, 0xd2, 0x5e, 0xcb, + 0x4e, 0x4f, 0x06, 0x00, 0xca, 0xa5, 0x12, 0x86, 0x2e, 0x7a, 0xd6, 0xfb, + 0xbb, 0x41, 0x09, 0x4c, 0x5d, 0x30, 0x16, 0x73, 0x25, 0x32, 0x13, 0x69, + 0x3f, 0x25, 0x60, 0xa1, 0xef, 0xc0, 0x16, 0xc0, 0xed, 0x66, 0x13, 0x43, + 0x17, 0x68, 0xd2, 0x73, 0x40, 0xd2, 0x75, 0xc2, 0x77, 0x23, 0x0c, 0xf0, + 0x75, 0xb9, 0xd2, 0x7b, 0x46, 0x17, 0x18, 0xba, 0x24, 0x76, 0x56, 0x63, + 0x3a, 0x15, 0xe1, 0xfe, 0x89, 0xb3, 0x8c, 0x0c, 0xeb, 0x61, 0x07, 0xc6, + 0x17, 0x97, 0x96, 0x53, 0x61, 0x07, 0xb6, 0x01, 0x6e, 0xdf, 0x6e, 0xa2, + 0x6b, 0x02, 0x5d, 0x73, 0x17, 0x20, 0xfe, 0xcc, 0x7d, 0x27, 0x50, 0x24, + 0x13, 0x51, 0xc6, 0x46, 0x93, 0x34, 0xb6, 0xb6, 0x01, 0xd8, 0xdf, 0x3f, + 0x60, 0x7f, 0x6f, 0x87, 0xe4, 0x48, 0x12, 0xd3, 0x10, 0x24, 0x86, 0x74, + 0x86, 0x22, 0xfe, 0xbc, 0x7a, 0x91, 0x4e, 0x8d, 0x61, 0x9a, 0x06, 0x96, + 0x65, 0xfb, 0x65, 0xb8, 0x75, 0xdc, 0x81, 0xc3, 0x16, 0x9a, 0x04, 0x5d, + 0x03, 0x5d, 0x82, 0xa6, 0x09, 0xb7, 0x49, 0x17, 0x4a, 0x97, 0x12, 0x5d, + 0x1e, 0x77, 0xa1, 0x56, 0xad, 0x92, 0x4e, 0x1a, 0x9c, 0x4b, 0x9a, 0x03, + 0xc5, 0xc1, 0x3f, 0x59, 0xbb, 0x2e, 0x74, 0xcb, 0x10, 0x2a, 0x41, 0x0b, + 0x4d, 0x8a, 0x40, 0xd3, 0xa5, 0x40, 0xd7, 0x40, 0x93, 0xa0, 0x69, 0x2e, + 0xd4, 0x6c, 0x08, 0x60, 0xbd, 0x56, 0x25, 0x62, 0x0c, 0x16, 0xee, 0x8f, + 0xe9, 0xcc, 0x39, 0xff, 0xb6, 0xbb, 0x10, 0x03, 0x25, 0x38, 0x3c, 0x6c, + 0x22, 0x05, 0x68, 0x52, 0x74, 0xad, 0x47, 0x29, 0x14, 0xfd, 0x7d, 0x98, + 0x9b, 0xc9, 0x04, 0x06, 0xfe, 0xf2, 0xe6, 0xd7, 0xa7, 0x8a, 0x03, 0x5c, + 0x9c, 0x3c, 0x19, 0xa0, 0x0e, 0xb0, 0xb3, 0x77, 0x80, 0x10, 0x02, 0x29, + 0x14, 0x4a, 0xb8, 0x62, 0x4a, 0xb8, 0x2f, 0x41, 0x1f, 0x40, 0x00, 0x57, + 0xee, 0x9f, 0x0e, 0x02, 0xac, 0x7e, 0x6b, 0x80, 0x63, 0x25, 0x28, 0x02, + 0xd4, 0x36, 0xea, 0x08, 0x40, 0x0a, 0x81, 0x26, 0x04, 0x52, 0x0a, 0xa4, + 0x04, 0x29, 0x40, 0x4a, 0x30, 0x35, 0xc1, 0x50, 0x44, 0x32, 0x3e, 0x1a, + 0x67, 0x2c, 0x99, 0xe8, 0x0e, 0xbc, 0xd9, 0xd8, 0x61, 0x7b, 0x67, 0xef, + 0xdb, 0x00, 0x74, 0x77, 0x82, 0x0f, 0xb0, 0x0a, 0x50, 0x5d, 0xaf, 0x23, + 0x3c, 0x31, 0x21, 0x3c, 0x61, 0x0f, 0xc4, 0xdf, 0x66, 0x7e, 0xcc, 0x65, + 0x83, 0x65, 0xf8, 0xe2, 0x2e, 0xca, 0x70, 0xe1, 0x5c, 0x0a, 0x5d, 0xd7, + 0xfc, 0xee, 0xe5, 0x63, 0x00, 0xb5, 0x8d, 0x3a, 0x4a, 0xa9, 0xae, 0x78, + 0x0f, 0xc2, 0x5d, 0x17, 0xfd, 0x11, 0x06, 0xf8, 0x72, 0xb5, 0x74, 0x2a, + 0x80, 0xa6, 0xc9, 0xfe, 0xf3, 0x60, 0xa1, 0x0b, 0x50, 0xc8, 0xe7, 0xb6, + 0x81, 0x1d, 0xcb, 0x3e, 0xa2, 0xb1, 0xb5, 0x8b, 0x40, 0x78, 0x6b, 0xc1, + 0xbd, 0x86, 0xc5, 0x01, 0xe6, 0x66, 0x82, 0x3b, 0xe1, 0xbb, 0x2e, 0xc4, + 0xfe, 0xbd, 0xe3, 0x96, 0x61, 0xc3, 0x2d, 0x03, 0x5e, 0x1b, 0xa0, 0x0d, + 0xc0, 0xfc, 0xec, 0xd4, 0x8f, 0x04, 0xb0, 0xbe, 0x09, 0x3d, 0xfd, 0x13, + 0x23, 0x35, 0x9e, 0x24, 0x11, 0x8f, 0x76, 0xfb, 0xeb, 0xb7, 0x1a, 0xd4, + 0xdd, 0xd7, 0xad, 0x7f, 0xda, 0x9d, 0x06, 0xb0, 0x00, 0xc1, 0x3f, 0xa5, + 0xde, 0x3a, 0x68, 0xdc, 0x79, 0x0a, 0x7d, 0x31, 0x3e, 0x9a, 0x60, 0x77, + 0xef, 0xa0, 0xdb, 0x7f, 0xfe, 0xd7, 0xbf, 0x47, 0x29, 0xc5, 0xfc, 0xec, + 0x14, 0x6f, 0xbc, 0xf2, 0xd2, 0xc0, 0x9c, 0x91, 0x44, 0xac, 0x9b, 0xbe, + 0xb8, 0xb4, 0x9c, 0x3a, 0x06, 0x50, 0xdd, 0xa8, 0x9f, 0x2a, 0xfc, 0xfe, + 0x07, 0x1f, 0xf1, 0x9f, 0x4f, 0x3f, 0xe3, 0x66, 0xb1, 0xd2, 0xfd, 0xcd, + 0x34, 0x0d, 0xa6, 0x26, 0xd2, 0xcc, 0x65, 0x33, 0x5c, 0x59, 0xc8, 0x9e, + 0x98, 0x6b, 0x1a, 0x46, 0xa0, 0xdf, 0x0f, 0xb0, 0x06, 0xbd, 0x12, 0xdc, + 0x29, 0xfe, 0xfb, 0xbf, 0x1b, 0x44, 0x4c, 0x83, 0x67, 0x9f, 0x7a, 0x82, + 0xf9, 0x6c, 0x86, 0xb9, 0x6c, 0x86, 0xa9, 0x89, 0x73, 0x68, 0xda, 0x9d, + 0x8f, 0xe3, 0x8d, 0xcd, 0x2d, 0xde, 0x7e, 0xef, 0x43, 0xbf, 0xdb, 0x2a, + 0xe4, 0x73, 0xb7, 0xbe, 0x93, 0x03, 0xaf, 0x5f, 0x1d, 0x6c, 0xaf, 0x1f, + 0x47, 0x47, 0x1d, 0x8a, 0xa5, 0x2a, 0x2b, 0x6b, 0x65, 0x6e, 0xac, 0x95, + 0xb9, 0xb9, 0x56, 0xe6, 0xc6, 0x5a, 0x89, 0xfd, 0x83, 0xc3, 0xfe, 0xc7, + 0xfe, 0x0a, 0x41, 0x07, 0xbe, 0x02, 0x3a, 0x8d, 0xad, 0x5d, 0xad, 0x6d, + 0xd9, 0x44, 0xcc, 0xa0, 0x55, 0x27, 0xc5, 0xee, 0xde, 0x01, 0x2b, 0x45, + 0x5f, 0xa4, 0xcc, 0xca, 0x5a, 0x99, 0x62, 0xa9, 0x4a, 0xa7, 0xe3, 0x0c, + 0x7a, 0xbc, 0x09, 0x5c, 0x07, 0xfe, 0x06, 0xbc, 0x09, 0xa1, 0x85, 0xbe, + 0xb8, 0xb4, 0xbc, 0x0a, 0x4c, 0xbf, 0x7e, 0xf5, 0x25, 0x1e, 0xbe, 0x32, + 0x1f, 0xc8, 0x74, 0x1c, 0x87, 0xca, 0xfa, 0x26, 0x2b, 0x9e, 0xc8, 0xca, + 0x5a, 0x89, 0x95, 0xb5, 0x32, 0x9b, 0x8d, 0x9d, 0x93, 0xd8, 0x8a, 0xc0, + 0x67, 0xa1, 0x76, 0xa3, 0x90, 0xcf, 0x05, 0xc8, 0xf4, 0x50, 0xd2, 0xc7, + 0xc0, 0xaf, 0xfe, 0xf0, 0xd6, 0x5f, 0x78, 0xf2, 0x89, 0x47, 0xe9, 0x74, + 0x3a, 0xec, 0xee, 0x1d, 0xb0, 0xfa, 0x55, 0x85, 0x9b, 0xc5, 0x0a, 0xad, + 0xb6, 0x35, 0x48, 0x68, 0x1f, 0xb8, 0x16, 0x12, 0xba, 0x56, 0xc8, 0xe7, + 0x4e, 0x7f, 0x39, 0x70, 0xdc, 0x81, 0xf3, 0xc0, 0x27, 0x0c, 0xf8, 0x82, + 0xc1, 0xfd, 0x36, 0x59, 0x19, 0x30, 0xab, 0x62, 0x21, 0x9f, 0x53, 0x77, + 0x23, 0x76, 0x2a, 0x80, 0x07, 0x61, 0x02, 0x8f, 0x03, 0x4f, 0x7b, 0xa2, + 0xbe, 0xd0, 0xf5, 0x42, 0x3e, 0x77, 0x18, 0x7e, 0xfe, 0xfb, 0xc6, 0x37, + 0xa1, 0xfe, 0x5a, 0x08, 0x89, 0xe7, 0x8c, 0xbc, 0x00, 0x00, 0x00, 0x00, + 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 +}; + +#include +#include +#include +#include +using namespace std; +#include +#include +#include +#include +#include +#include +#include +using namespace Music; + +// ---------------------- MScale ------------------------------ + +void MScale::load_scala(const QString& file_name) +{ + ifstream file(file_name.latin1()); + + if(!file.is_open()) + throw MicrotonalView::tr("Unkown filename: '")+file_name+"'"; + + int lines_red = 0; + int num_line = 1; + + char buff[1024]; + file.getline(buff, 1024); + while(file) + { + if(buff[0]!='!') + { + if(lines_red==0) + { + m_name = QString(buff); + m_name = m_name.remove("\r"); + m_name = m_name.remove("\n"); + m_name = m_name.simplifyWhiteSpace(); + lines_red++; + } + else if(lines_red==1) + { + // ignore number of lines ... + lines_red++; + } + else + { + bool is_ratio = true; + for(size_t i=0; is_ratio && i> num >> slash >> den; + if(num<0) throw QString("Line ")+QString::number(num_line)+": Parsed numerator is negative '"+QString::number(num)+"'"; + if(slash!='/') throw QString("Line ")+QString::number(num_line)+": There is no slash between numerator and denominator"+slash+"'"; + if(den<=0) throw QString("Line ")+QString::number(num_line)+": Parsed denominator is not positive'"+QString::number(den)+"'"; + values.push_back(MValue(num, den)); + } + else + { + float cents=0.0; + stringstream in(buff); + in >> cents; + if(cents<=0.0) throw QString("Line ")+QString::number(num_line)+": Parsed cents value is negative '"+QString::number(cents)+"'"; + values.push_back(MValue(cents)); + } + } + } + file.getline(buff, 1024); + num_line++; + } +} + +MScale::MScale(const QString& name) +: m_name(name) +{ +} +MScale::MScale(const QString& file_name, FileType type) +{ + m_path = file_name; + + if(type==SCALA) load_scala(file_name); + else + { + cerr << "MicrotonalView::Scale::Scale unsupported file type '" << type << "'" << endl; + } +} + +bool MScale::operator != (const MScale& scale) +{ + return m_name!=scale.m_name; +} + +// ---------------------- QRoot button ------------------------- + +QRoot::QRoot(MicrotonalView* view, int ht) +: QPushButton(view, "QRoot:"+QString::number(ht)) +, m_ht(ht) +{ +// cerr << "QRoot::QRoot " << m_ht << endl; + +// if(ht>8) ht+=12; + + connect(this, SIGNAL(clicked()), this, SLOT(clicked2())); + connect(this, SIGNAL(rootClicked(int)), view, SLOT(selectRoot(int))); + setFlat(true); + setText(h2n(ht, GetNotesName(), GetTonality(), false)); + setToggleButton(true); + setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + setFixedWidth(35); // TODO + setFocusPolicy(QPushButton::NoFocus); +} +void QRoot::clicked2() +{ + emit(rootClicked(m_ht)); +} + +// --------------------------- MicrotonalView ---------------------------- + +MicrotonalView::MicrotonalView(QWidget* parent) +: QFrame(parent, "MicrotonalView") +, View("Microtonal", this) +, ui_scale_menu(this) +{ + setting_selectedRoot = -1000; + m_AFreq = 440.0f; + m_selected_jivalue = NULL; + m_tuningFreq = 0.0; + + // settings + QImage img; + img.loadFromData(g_icon_ji, sizeof(g_icon_ji), "PNG"); + setting_show->setIconSet(QIconSet(QImage(img))); + setting_show->setOn(false); + hide(); + + m_popup_menu.insertItem(new Title(tr("Root's octave"), &m_popup_menu)); + setting_octave = new QSpinBox(-3, 8, 1, &m_popup_menu); + QToolTip::add(setting_octave, tr("Root's octave")); + setting_octave->setValue(3); +// m_old_octave = setting_octave->value(); +// connect(setting_octave, SIGNAL(valueChanged(int)), this, SLOT(octaveChanged(int))); + connect(setting_octave, SIGNAL(valueChanged(int)), this, SLOT(emitTuningFreqChanged())); + m_popup_menu.insertItem(setting_octave); + + setting_keepRootToLeft = new QAction(this); + setting_keepRootToLeft->setMenuText(tr("Keep root to left side")); + setting_keepRootToLeft->setToggleAction(true); + connect(setting_keepRootToLeft, SIGNAL(toggled(bool)), this, SLOT(keepRootToLeft(bool))); + setting_keepRootToLeft->addTo(&m_popup_menu); + + setting_loadScale = new QAction(this); + setting_loadScale->setMenuText(tr("Load Scala file ...")); + setting_loadScale->addTo(&m_popup_menu); + connect(setting_loadScale, SIGNAL(activated()), this, SLOT(loadScale())); + ui_scale_menu.setCheckable(true); + m_popup_menu.insertItem(tr("used scale"), &ui_scale_menu); + + QVBoxLayout* layout = new QVBoxLayout(this, 0, 0, "MicrotonalView:layout"); + QHBoxLayout* roots_layout = new QHBoxLayout(layout, 0, "MicrotonalView:roots_layout"); + for(int i=0; i<13; i++) + { + m_roots.push_back(new QRoot(this, i+3)); + roots_layout->addWidget(m_roots.back()); + if(i+1<13) + roots_layout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding)); + } + m_roots.back()->setDisabled(true); + ui_scale = new QScaleLabel(this); + layout->addWidget(ui_scale); + ui_ratios = new QRatiosLabel(this); + layout->addWidget(ui_ratios); + + setMaximumHeight(ui_scale->maximumHeight()+ui_ratios->maximumHeight()+20); + + load_default_scales(); + + refreshScaleList(); + + selectRoot(3); + selectScale(0); +} +void MicrotonalView::save() +{ + s_settings->writeEntry("octave", setting_octave->value()); + s_settings->writeEntry("keepRootToLeft", setting_keepRootToLeft->isOn()); + QStringList scale_list; + for(size_t i=0; igetPath().isEmpty()) + scale_list.push_back(setting_scales[i]->getPath()); + s_settings->writeEntry("scales", scale_list); + s_settings->writeEntry("selectedScale", setting_selectedScale->getName()); + s_settings->writeEntry("lastScalesDirectory", setting_lastScalesDirectory); + s_settings->writeEntry("selectedRoot", setting_selectedRoot); +} +void MicrotonalView::load() +{ + setting_octave->setValue(s_settings->readNumEntry("octave", setting_octave->value())); + setting_keepRootToLeft->setOn(s_settings->readBoolEntry("keepRootToLeft", setting_keepRootToLeft->isOn())); + QStringList scale_list = s_settings->readListEntry("scales"); + for(QStringList::iterator it=scale_list.begin(); it!=scale_list.end(); ++it) + { + try + { + MScale* scale = new MScale(*it, MScale::SCALA); + setting_scales.push_back(scale); + } + catch(QString error){cerr << "MicrotonalView::load " << error << endl;} + } + refreshScaleList(); + + selectScale(s_settings->readEntry("selectedScale", "default")); + setting_lastScalesDirectory = s_settings->readEntry("lastScalesDirectory", "."); + selectRoot(s_settings->readNumEntry("selectedRoot", m_roots[0]->m_ht)); +} +void MicrotonalView::clearSettings() +{ + s_settings->removeEntry("octave"); + s_settings->removeEntry("keepRootToLeft"); + s_settings->removeEntry("scales"); + s_settings->removeEntry("selectedScale"); + s_settings->removeEntry("lastScalesDirectory"); + s_settings->removeEntry("selectedRoot"); +} + +/*void MicrotonalView::octaveChanged(int value) +{ + if(value==0) + { + if(m_old_octave==1) + { + m_old_octave = -1; + setting_octave->setValue(-1); + } + else if(m_old_octave==-1) + { + m_old_octave = 1; + setting_octave->setValue(1); + } + } + else + m_old_octave = value; +}*/ + +int MicrotonalView::getOctaveShift() +{ + return 12*(setting_octave->value()-5); +} + +QString MicrotonalView::getTuningNoteName() +{ + if(hasTuningFreqSelected()) + { + if(m_selected_jivalue->is_ratio) + return QString(h2n(setting_selectedRoot+getOctaveShift()))+":"+QString::number(m_selected_jivalue->num)+"/"+QString::number(m_selected_jivalue->den); + else + return QString(h2n(setting_selectedRoot+getOctaveShift()))+":"+QString::number(m_selected_jivalue->cents); + } + + return "no tuning note selected"; +} + +void MicrotonalView::selectScale(int index) +{ + assert(index>=0 && indexrepaint(); +} +void MicrotonalView::selectScale(const QString& name) +{ + int index = -1; + for(size_t i=0; index==-1 && igetName()==name) + { + setting_selectedScale = setting_scales[i]; + index = i; + } + } + + if(index==-1) + { + cerr << "MicrotonalView::selectScale unknown scale '" << name << "'" << endl; + return; + } + + for(size_t i=0; irepaint(); +} +int MicrotonalView::getIndex(MScale* scale) +{ + for(size_t i=0; isetText(h2n(m_roots[i]->m_ht, GetNotesName(), GetTonality(), false)); +} + +void MicrotonalView::keepRootToLeft(bool keep) +{ + if(keep) + { + for(int i=0; i<13; i++) + m_roots[i]->m_ht = (setting_selectedRoot+i)%12; + notesNameChanged(); + selectRoot(setting_selectedRoot); + ui_ratios->repaint(); + } + else + { + } +} + +void MicrotonalView::setAFreq(float AFreq) +{ + float AFreq_old = m_AFreq; + + m_AFreq = AFreq; + + if(m_AFreq!=AFreq_old) + emitTuningFreqChanged(); +} + +void MicrotonalView::updateCursor(float freq) +{ + ui_scale->m_htf = f2hf(freq, m_AFreq); + ui_scale->repaint(); +} + +void MicrotonalView::selectRoot(int ht) +{ +// cerr << "MicrotonalView::selectRoot " << ht << endl; + + if(ht==setting_selectedRoot) + { + for(int i=0; i<13; i++) + m_roots[i]->setOn(m_roots[i]->m_ht==ht); + } + else + { + if(setting_keepRootToLeft->isOn()) + { + for(int i=0; i<13; i++) + m_roots[i]->m_ht = (ht+i)%12; + notesNameChanged(); + } + + for(int i=0; i<13; i++) + m_roots[i]->setOn(m_roots[i]->m_ht==ht); + + setting_selectedRoot = ht; + + ui_ratios->repaint(); + emitTuningFreqChanged(); + } +} +void MicrotonalView::emitTuningFreqChanged() +{ + m_tuningFreq = 0.0; + if(m_selected_jivalue!=NULL) + { + if(m_selected_jivalue->is_ratio) + m_tuningFreq = h2f(setting_selectedRoot+getOctaveShift(), m_AFreq)*m_selected_jivalue->ratio; + else + m_tuningFreq = h2f(setting_selectedRoot+getOctaveShift()+m_selected_jivalue->cents/100.0f, m_AFreq); + } + + emit(tuningFreqChanged(m_tuningFreq)); +} + +MicrotonalView::QScaleLabel::QScaleLabel(MicrotonalView* view) +: QLabel(view, "QScaleLabel") +, ui_view(view) +{ + setMaximumHeight(15); + m_htf = -1000.0f; +} +void MicrotonalView::QScaleLabel::drawContents(QPainter* p) +{ + int left = ui_view->m_roots[0]->x() + ui_view->m_roots[0]->width()/2; + int right = ui_view->m_roots[12]->x() + ui_view->m_roots[12]->width()/2; + int w = right - left; + p->setBrush(QColor(255,255,255)); + p->setPen(QColor(128,128,128)); + p->drawRect(0, 0, left+1, height()); + p->drawRect(right, 0, width()-(right+1), height()); + p->setPen(QColor(0,0,0)); + p->drawRect(left, 0, w+1, height()); + + if(m_htf!=-1000.0) + { + float htw = w*(m_htf-ui_view->m_roots[0]->m_ht)/12.0f; + while(htw>=w) htw-=w; + while(htw<0) htw+=w; + int x = int(left+htw); + p->setPen(QColor(0,0,255)); + p->setBrush(QColor(191,191,255)); + QPointArray arr; + arr.resize(3); + arr.setPoint(0, x-5, 0); + arr.setPoint(1, x+5, 0); + arr.setPoint(2, x, 2*height()/3); + p->drawConvexPolygon(arr); + p->drawLine(x, 2*height()/3, x, height()); + + if(htw<(w/12.0f)/4.0f || -(htw-w)<(w/12.0f)/4.0f) + { + if(htw<(w/12.0f)/4.0f) x += w; + else x -= w; + arr.setPoint(0, x-5, 0); + arr.setPoint(1, x+5, 0); + arr.setPoint(2, x, 2*height()/3); + p->drawConvexPolygon(arr); + p->drawLine(x, 2*height()/3, x, height()); + } + } +} + +MicrotonalView::QRatiosLabel::QRatiosLabel(MicrotonalView* view) +: QLabel(view, "QRatiosLabel") +, ui_view(view) +{ + setMaximumHeight(12+3*(2*fontMetrics().height()+10)); +} +void MicrotonalView::QRatiosLabel::drawTicks(QPainter* p, float r, int h) +{ + int left = ui_view->m_roots[0]->x() + ui_view->m_roots[0]->width()/2; + int right = ui_view->m_roots[12]->x() + ui_view->m_roots[12]->width()/2; + int w = right - left; + + for(float i=r; i<=12.0f; i+=2*r) + { + int x = left + int(w*i/12.0f); + p->drawLine(x, 0, x, h); + } +} +void MicrotonalView::QRatiosLabel::drawContents(QPainter* p) +{ + QLabel::drawContents(p); + // p->eraseRect(rect()); + + int left = ui_view->m_roots[0]->x() + ui_view->m_roots[0]->width()/2; + int right = ui_view->m_roots[12]->x() + ui_view->m_roots[12]->width()/2; + int w = right - left; + + int tick_height = 12; + int max_dec = 3; + + // draw ratios + p->setPen(QColor(0,0,255)); + int dec = 0; + int dec_h = 2*p->fontMetrics().height()+2; + int dec_h2 = (height()-tick_height-p->fontMetrics().height()+2)/3; + dec_h = min(dec_h, dec_h2); + int ht = ui_view->setting_selectedRoot - ui_view->m_roots[0]->m_ht; + if(ui_view->setting_keepRootToLeft->isOn()) ht = 0; + for(list::iterator it=ui_view->setting_selectedScale->values.begin(); it!=ui_view->setting_selectedScale->values.end(); ++it) + { + float htw = 0.0f; + + if((*it).is_ratio) + htw = w*f2hf(h2f(ht)*(*it).ratio)/12.0f; + else + htw = w*(ht+(*it).cents/100.0f)/12.0f; + while(htw>w) htw-=w; + while(htw<0) htw+=w; + + int x = left + int(htw); + int y = tick_height + 2 + dec_h*dec; + p->drawLine(x, 0, x, y+dec_h); + + if((*it).is_ratio) + { + QRect num_rect = fontMetrics().boundingRect(QString::number((*it).num)); + num_rect.moveBy(x+1, y+p->fontMetrics().height()); + QRect den_rect = fontMetrics().boundingRect(QString::number((*it).den)); + den_rect.moveBy(x+1, y+2*p->fontMetrics().height()); + (*it).bounding_rect = num_rect; + (*it).bounding_rect |= den_rect; + } + else + { + QRect cents_rect = fontMetrics().boundingRect(QString::number((*it).cents)); + cents_rect.moveBy(x+1, y+2*p->fontMetrics().height()); + + (*it).bounding_rect = cents_rect; + } + (*it).bounding_rect.rLeft() = x; + (*it).bounding_rect.rRight() += 2; + (*it).bounding_rect.rTop() -= 2; + (*it).bounding_rect.rBottom() = y+dec_h; + + if(ui_view->m_selected_jivalue==&(*it)) + { + p->setBrush(QColor(210,210,255)); + p->drawRect((*it).bounding_rect); + } + + if((*it).is_ratio) + { + p->drawText(x+1, y+p->fontMetrics().height(), QString::number((*it).num)); + p->drawLine(x, y+p->fontMetrics().height()+2, x+p->fontMetrics().width(QString::number((*it).num)), y+p->fontMetrics().height()+2); + p->drawText(x+1, y+2*p->fontMetrics().height(), QString::number((*it).den)); + } + else + { + p->drawText(x+1, y+2*p->fontMetrics().height(), QString::number((*it).cents)); + } + + dec++; + if(dec>max_dec-1) dec = 0; + if(dec<0) dec = max_dec-1; + } + + // draw ticks + p->setPen(QColor(0,0,0)); + for(float i=0.0f; i<=12.0f; i+=1.0f) + { + int x = left + int(w*i/12.0f); + p->drawLine(x, 0, x, tick_height); + } + drawTicks(p, 0.5f, tick_height/2); + drawTicks(p, 0.25f, tick_height/3); + drawTicks(p, 0.125f, tick_height/4); +} + +void MicrotonalView::mouseReleaseEvent(QMouseEvent* e) +{ + if(e->button()==LeftButton) + { + MScale::MValue* selected_jivalue_old = m_selected_jivalue; + m_selected_jivalue = NULL; + + QPoint mouse_pos = e->pos() - ui_ratios->pos(); + for(list::iterator it=setting_selectedScale->values.begin(); m_selected_jivalue==NULL && it!=setting_selectedScale->values.end(); ++it) + if((*it).bounding_rect.contains(mouse_pos.x(), mouse_pos.y())) + m_selected_jivalue = &(*it); + + if(m_selected_jivalue!=selected_jivalue_old) + { + ui_ratios->repaint(); + emitTuningFreqChanged(); + } + } + + View::mouseReleaseEvent(e); +} + +void MicrotonalView::refreshScaleList() +{ + ui_scale_menu.clear(); + for(size_t i=0; igetName(), i); + ui_scale_menu.connectItem(i, this, SLOT(selectScale(int))); + if(setting_selectedScale==setting_scales[i]) + ui_scale_menu.setItemChecked(i, true); + } +} +void MicrotonalView::loadScale() +{ + QFileDialog dlg_file(setting_lastScalesDirectory, "Scala files (*.scl *.SCL)", this, "open file dialog", true); + dlg_file.setCaption(tr("Open scale file")); + dlg_file.setMode(QFileDialog::ExistingFile); + dlg_file.setInfoPreviewEnabled(true); + ScalePreview p(&dlg_file); + dlg_file.setInfoPreview(&p,&p); + dlg_file.setPreviewMode(QFileDialog::Info); + + dlg_file.exec(); + + if(dlg_file.result()==QDialog::Accepted) + { + setting_lastScalesDirectory = dlg_file.dirPath(); + s_settings->writeEntry("MicrotonalView_lastScalesDirectory", setting_lastScalesDirectory); +// cerr << "setting_lastScalesDirectory=" << setting_lastScalesDirectory << endl; + try + { + MScale* scale = new MScale(dlg_file.selectedFile(), MScale::SCALA); + bool new_one = true; + for(size_t i=0; new_one && irepaint(); +} + +void MicrotonalView::load_default_scales() +{ + MScale* scale = new MScale("default"); + scale->values.push_back(MScale::MValue(25,24)); + scale->values.push_back(MScale::MValue(16,15)); + scale->values.push_back(MScale::MValue(9,8)); + scale->values.push_back(MScale::MValue(7,6)); + scale->values.push_back(MScale::MValue(75,64)); + scale->values.push_back(MScale::MValue(6,5)); + scale->values.push_back(MScale::MValue(5,4)); + scale->values.push_back(MScale::MValue(32,25)); + scale->values.push_back(MScale::MValue(125,96)); + scale->values.push_back(MScale::MValue(4,3)); + scale->values.push_back(MScale::MValue(25,18)); + scale->values.push_back(MScale::MValue(45,32)); + scale->values.push_back(MScale::MValue(36,25)); + scale->values.push_back(MScale::MValue(3,2)); + scale->values.push_back(MScale::MValue(25,16)); + scale->values.push_back(MScale::MValue(8,5)); + scale->values.push_back(MScale::MValue(5,3)); + scale->values.push_back(MScale::MValue(125,72)); + scale->values.push_back(MScale::MValue(16,9)); + scale->values.push_back(MScale::MValue(9,5)); + scale->values.push_back(MScale::MValue(15,8)); + scale->values.push_back(MScale::MValue(48,25)); + scale->values.push_back(MScale::MValue(125,64)); + setting_scales.push_back(scale); +} + +// ------------------ MicrotonalView::ScalePreview -------------------- +MicrotonalView::ScalePreview::ScalePreview(QWidget* parent) +: QLabel(parent) +{ + setAlignment(QLabel::WordBreak|QLabel::AlignVCenter); + setMinimumWidth(100); +} +void MicrotonalView::ScalePreview::previewUrl(const QUrl& url) +{ + if(url.path().contains(QRegExp("\\.scl$"))==0 && url.path().contains(QRegExp("\\.SCL$"))==0) + { +// setText(""); + } + else + { + try + { + MScale* scale = new MScale(url.path(), MScale::SCALA); + QString txt; + txt += tr("name: ") + scale->getName() + "

"; + txt += tr("number of ratio: ") + QString::number(scale->values.size()); + setText(txt); + delete scale; + } + catch(QString error) + { + setText(tr("Invalid Scala file: ")+error); + } + } +} + diff --git a/src/modules/MicrotonalView.h b/src/modules/MicrotonalView.h new file mode 100644 index 0000000..7ec54a0 --- /dev/null +++ b/src/modules/MicrotonalView.h @@ -0,0 +1,172 @@ +// Copyright 2004 "Gilles Degottex" + +// This file is part of "fmit" + +// "fmit" 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. +// +// "fmit" 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 + + +#ifndef _MicrotonalView_h_ +#define _MicrotonalView_h_ + +#include +#include +#include +using namespace std; +#include +#include +#include +#include +#include +#include +#include +#include "View.h" + +class MicrotonalView; + +class MScale +{ + void load_scala(const QString& file_name); + + QString m_name; + QString m_path; + + public: + struct MValue + { + bool is_ratio; + int num; + int den; + float ratio; + float cents; + QRect bounding_rect; + MValue(int n, int d) : is_ratio(true), num(n), den(d), ratio(float(num)/den) {} + MValue(float c) : is_ratio(false), cents(c) {} + }; + + QString getName() {return m_name;} + QString getPath() {return m_path;} + + enum FileType {AUTO,SCALA}; + MScale(const QString& name); + MScale(const QString& file_name, FileType type); + + list values; + + bool operator != (const MScale& scale); +}; + +class QRoot : public QPushButton +{ + Q_OBJECT + + private slots: + void clicked2(); + + signals: + void rootClicked(int); + + public: + QRoot(MicrotonalView* view, int ht); + + int m_ht; + + virtual ~QRoot(){} +}; + +class MicrotonalView : public QFrame, public View +{ + Q_OBJECT + + QPopupMenu ui_scale_menu; + + float m_AFreq; + float m_tuningFreq; + + void load_default_scales(); + + vector m_roots; + struct QScaleLabel : QLabel + { + MicrotonalView* ui_view; + float m_htf; + QScaleLabel(MicrotonalView* view); + virtual void drawContents(QPainter* p); + virtual ~QScaleLabel(){} + }* ui_scale; + + struct QRatiosLabel : QLabel + { + MicrotonalView* ui_view; + void drawTicks(QPainter* p, float r, int h); + QRatiosLabel(MicrotonalView* view); + virtual void drawContents(QPainter* p); + virtual ~QRatiosLabel(){} + }* ui_ratios; + + virtual void mouseReleaseEvent(QMouseEvent* e); + + struct ScalePreview : QLabel, QFilePreview + { + ScalePreview(QWidget* parent); + virtual void previewUrl(const QUrl& url); + }; + + int m_old_octave; + int getOctaveShift(); + + protected slots: + void refreshScaleList(); + void loadScale(); + void selectScale(int index); +// void octaveChanged(int value); + void emitTuningFreqChanged(); + + public: + MicrotonalView(QWidget* parent); + + float getTuningFreq() {return m_tuningFreq;} + bool hasTuningFreqSelected() {return m_selected_jivalue!=NULL;} + QString getTuningNoteName(); + MScale::MValue* m_selected_jivalue; + + int getIndex(MScale* scale); + + ~MicrotonalView(){} + + // settings + QSpinBox* setting_octave; + QAction* setting_keepRootToLeft; + int setting_selectedRoot; + QAction* setting_loadScale; + vector setting_scales; + MScale* setting_selectedScale; + QString setting_lastScalesDirectory; + virtual void save(); + virtual void load(); + virtual void clearSettings(); + + public slots: + void setAFreq(float AFreq); + void selectScale(const QString& name); + void selectRoot(int ht); + void updateCursor(float freq); + void notesNameChanged(); + void keepRootToLeft(bool keep); + + signals: + void tuningFreqChanged(float freq); +}; + +#endif // _MicrotonalView_h_ diff --git a/src/modules/View.cpp b/src/modules/View.cpp new file mode 100644 index 0000000..9d944e9 --- /dev/null +++ b/src/modules/View.cpp @@ -0,0 +1,102 @@ +// Copyright 2005 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#include "View.h" + +#include +#include +using namespace std; +#include + +list View::s_views; +QSettings* View::s_settings = NULL; + +void View::saveAll() +{ + assert(s_settings!=NULL); + + for(list::iterator it=s_views.begin(); it!=s_views.end(); ++it) + { + s_settings->beginGroup((*it)->getName()); + s_settings->writeEntry("show", (*it)->setting_show->isOn()); + (*it)->save(); + s_settings->endGroup(); + } +} +void View::loadAll() +{ + assert(s_settings!=NULL); + + for(list::iterator it=s_views.begin(); it!=s_views.end(); ++it) + { + s_settings->beginGroup((*it)->getName()); + (*it)->setting_show->setOn(s_settings->readBoolEntry("show", (*it)->setting_show->isOn())); + (*it)->load(); + s_settings->endGroup(); + } +} +void View::clearAllSettings() +{ + assert(s_settings!=NULL); + + for(list::iterator it=s_views.begin(); it!=s_views.end(); ++it) + { + s_settings->beginGroup((*it)->getName()); + s_settings->removeEntry("show"); + (*it)->clearSettings(); + s_settings->endGroup(); + } +} + +// ------------------------- instances --------------------------- + +View::View(const QString& name, QWidget* parent) +: m_name(name) +, m_parent(parent) +, m_popup_menu(parent) +{ + // settings + m_popup_menu.insertItem(new Title(""+QWidget::tr(m_name)+"", &m_popup_menu)); + m_popup_menu.insertSeparator(); + + setting_show = new QAction(parent); + setting_show->setMenuText(QWidget::tr("Show ")+getName()+QWidget::tr(" view")); + setting_show->setToggleAction(true); + parent->connect(setting_show, SIGNAL(toggled(bool)), parent, SLOT(setShown(bool))); + setting_show->setToolTip(QWidget::tr(m_name)); + + parent->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); + + s_views.push_back(this); +} + +void View::mouseReleaseEvent(QMouseEvent* e) +{ + if(e->button()==Qt::RightButton) + m_popup_menu.exec(e->globalPos()); +} + +// ----------------------- LabeledSpinBox ------------------------ + +//LabeledSpinBox::LabeledSpinBox(int min, int max, int step, QWidget* parent) +//: QWidget(parent) +//{ +// +//} + diff --git a/src/modules/View.h b/src/modules/View.h new file mode 100644 index 0000000..94862a3 --- /dev/null +++ b/src/modules/View.h @@ -0,0 +1,75 @@ +// Copyright 2005 "Gilles Degottex" + +// This file is part of "Music" + +// "Music" is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// "Music" 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 + + +#ifndef _View_h_ +#define _View_h_ + +#include +using namespace std; +#include +#include +#include +#include +#include + +class View +{ + static list s_views; + + protected: + struct Title : QLabel + { + Title(const QString& text, QWidget* parent) : QLabel(text, parent) + {setAlignment(QLabel::AlignCenter);} + }; + + const QString m_name; + QWidget* m_parent; + QPopupMenu m_popup_menu; + + View(const QString& name, QWidget* parent); + virtual void mouseReleaseEvent(QMouseEvent* e); + + virtual ~View() {} + + public: + static QSettings* s_settings; + const QString& getName() {return m_name;} + + int getNbView() const {return s_views.size();} + + // settings + QAction* setting_show; + virtual void save(){} + virtual void load(){} + virtual void clearSettings(){} + + static void saveAll(); + static void loadAll(); + static void clearAllSettings(); +}; + +//class LabeledSpinBox : QWidget +//{ +// public: +// LabeledSpinBox(int min, int max, int step, QWidget* parent); +//}; + +#endif // _View_h_ + diff --git a/tr/Makefile.am b/tr/Makefile.am new file mode 100644 index 0000000..7544a45 --- /dev/null +++ b/tr/Makefile.am @@ -0,0 +1,9 @@ +default_DATA = fmit_fr.qm +defaultdir = $(prefix)/share/fmit/tr +EXTRA_DIST = *.ts +CLEANFILES = *.qm + +%.qm: %.ts + $(QT_DIR)/bin/lupdate -verbose ../src/*.cpp ../src/*.h ../ui/*.ui -ts $< + $(QT_DIR)/bin/lrelease $< + diff --git a/tr/Makefile.in b/tr/Makefile.in new file mode 100644 index 0000000..1daa81c --- /dev/null +++ b/tr/Makefile.in @@ -0,0 +1,342 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = tr +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_cxx_exceptions.m4 \ + $(top_srcdir)/m4/ac_cxx_have_complex.m4 \ + $(top_srcdir)/m4/ac_cxx_have_numeric_limits.m4 \ + $(top_srcdir)/m4/ac_cxx_have_sstream.m4 \ + $(top_srcdir)/m4/ac_cxx_have_stl.m4 \ + $(top_srcdir)/m4/ac_cxx_namespaces.m4 \ + $(top_srcdir)/m4/ac_cxx_templates.m4 \ + $(top_srcdir)/m4/bnv_have_qt.m4 \ + $(top_srcdir)/m4/mdl_have_opengl.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(defaultdir)" +defaultDATA_INSTALL = $(INSTALL_DATA) +DATA = $(default_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QT_CXXFLAGS = @QT_CXXFLAGS@ +QT_DIR = @QT_DIR@ +QT_LIBS = @QT_LIBS@ +QT_MOC = @QT_MOC@ +QT_UIC = @QT_UIC@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_prefix = @ac_prefix@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +default_DATA = fmit_fr.qm +defaultdir = $(prefix)/share/fmit/tr +EXTRA_DIST = *.ts +CLEANFILES = *.qm +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tr/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu tr/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +uninstall-info-am: +install-defaultDATA: $(default_DATA) + @$(NORMAL_INSTALL) + test -z "$(defaultdir)" || $(mkdir_p) "$(DESTDIR)$(defaultdir)" + @list='$(default_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(defaultDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(defaultdir)/$$f'"; \ + $(defaultDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(defaultdir)/$$f"; \ + done + +uninstall-defaultDATA: + @$(NORMAL_UNINSTALL) + @list='$(default_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(defaultdir)/$$f'"; \ + rm -f "$(DESTDIR)$(defaultdir)/$$f"; \ + done +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(defaultdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-defaultDATA + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-defaultDATA uninstall-info-am + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-defaultDATA install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am uninstall-defaultDATA \ + uninstall-info-am + + +%.qm: %.ts + $(QT_DIR)/bin/lupdate -verbose ../src/*.cpp ../src/*.h ../ui/*.ui -ts $< + $(QT_DIR)/bin/lrelease $< +# 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: diff --git a/tr/fmit_de.ts b/tr/fmit_de.ts new file mode 100644 index 0000000..0f483d4 --- /dev/null +++ b/tr/fmit_de.ts @@ -0,0 +1,576 @@ + + + ConfigForm + + Configuration + + + + Error variation tolerance + + + + Sound Capture + + + + Auto detect at startup + + + + Auto detect + + + + ALSA + + + + PCM name + + + + hw:0 + + + + Sampling rate + + + + set to max + + + + JACK + + + + automaticaly connect at startup to + + + + ms + + + + Sound Analysis + + + + Range + + + + °/.. + + + + Length factor + + + + % + + + + Tolerance of the error variance + + + + Tonality + + + + C (Do) + + + + Bb (Sib) + + + + Eb (Mib) + + + + Notes name + + + + Latin + + + + Latency + + + + Restore factory settings + + + + &OK + + + + Use theses settings and exist configure panel (but don't save them !) + + + + &Cancel + + + + General + + + + Start in full-screen + + + + Auto-save configuration and views layout on exit + + + + Anglo-Saxon + + + + <b>To get more options:</b> right-click every view to show up their properties ! + + + + Volume threshold + + + + Refresh time + + + + Time between each sound analysis. Increase to get less CPU usage but less time resolution. + + + + Frequency analysis range. + + + + Minimal half-tone from A3 + + + + Maximal half-tone form A3 + + + + Wave-length average size + + + + Size of the average to compute the frequency in one analysis. + + + + Algorithms + + + + Default algorithm + + + + for microtonal view + + + + Multi-Correlation + + + + Increase recognition quality at cost of processor usage. + + + + Shifting test complexity + + + + Error noise threshold + + + + Consider as valuable all errors below this. + + + + Auto-Correlation (usualy used for Microtonal view) + + + + Consider as valuable all errors below this (in per thousands !) + + + + Bubble + + + + Convolution threshold + + + + Restore all settings as you just installed the program (need a program restart). + + + + Raise the window to the whole screen when the program start (f) + + + + Use anglo-saxon or latin notes name. +englo-saxon: C D E F G A B +latin: Do Re Mi Fa Sol La + + + + Consider as unstable all sound with frequency variance above this (in half-tones). + + + + The tonality of the showed notes name. +Usefull for converting notes name to a corresponding instrument tonality. +(examples: Eb for saxophone, Bb for trumpet, etc.) + + + + Ignore all sounds with volume below this threshold (in perthousands !) +(shown has a red line in the graph view). + + + + Response of the program and tolerance of holes, scratches, artefacts, etc. +Smaller is the value faster the tuner respond, but more unstable the computed frequency is. + + + + + CustomInstrumentTunerForm + + About Free Music Instrument Tuner + + + + <h3>Version + + + + </h3><p><h3>Website:</h3><p>homepage: <a href="http://home.gna.org/fmit">http://home.gna.org/fmit</a><p>development site: <a href="http://gna.org/projects/fmit">http://gna.org/projects/fmit</a><p><h3>Authors:</h3><p>Gilles Degottex: gilles.degottex@net2000.ch + + + + Restore Factory Settings + + + + This operation is NOT reversible. +Are you sure you want to lose all your current settings ? + + + + You can now restart FMIT to get back factory settings + + + + + DialView + + Show trace + + + + Use percentages + + + + Resolution + + + + + GLErrorHistory + + Error + + + + Keep previous notes + + + + Use percentages + + + + Anglo-saxon + + + + Latin + + + + Resolution + + + + + GLFormants + + Formants + + + + Number of formants + + + + + GLGraph + + Captured Sound + + + + Auto scale + + + + Duration + + + + Max height + + + + + GLSample + + Wave form sample + + + + Show fading + + + + Number of fading + + + + + GLVolumeHistory + + Keep previous notes + + + + Volume + + + + + InstrumentTunerForm + + Music Instrument Tuner + + + + K +e +e +p + + + + K + + + + Keep errors (k) + + + + Volume + + + + Note Stability + + + + Stability of the playing note + + + + Tuning Frequency + + + + Hz + + + + Tools + + + + About + + + + &About + + + + Pause + + + + Space + + + + Configure + + + + Save settings + + + + Ctrl+S + + + + Reset + + + + Reset capture system + + + + Views + + + + Do not clear histories between notes. + + + + Green if the note is stable enough, red if not and grey if there is no sound. + + + + the A3 frequency + + + + The played note frequency + + + + The frequency of the current played note. + + + + The recognized note + + + + The frequency of the note as it should be. + + + + Capture stability + + + + Put in pause state to use less processor has possible. + + + + Save configure panel settings, views settings and window size. + + + + Stop, reload settings and restart the capture sound system. + + + + Green if the program is capturing sound, red if something goes wrong (sound server unavailable, drivers not loaded, etc.) + + + + + MicrotonalView + + Unkown filename: ' + + + + Keep root to left side + + + + Load Scala file ... + + + + used scale + + + + Open scale file + + + + Scale name already exist + + + + Invalid file content ! + + + + + MicrotonalView::ScalePreview + + <b>name:</b> + + + + <b>number of ratio:</b> + + + + Invalid Scala file: + + + + + QWidget + + Show + + + + view + + + + diff --git a/tr/fmit_fr.ts b/tr/fmit_fr.ts new file mode 100644 index 0000000..62946f1 --- /dev/null +++ b/tr/fmit_fr.ts @@ -0,0 +1,1286 @@ + + + ConfigForm + + Configuration + + + + Error variation tolerance + Tolérance sur la variance de l'erreur + + + Sound Capture + Capture du son + + + Auto detect at startup + Détection automatique au démarrage + + + Auto detect + Détection automatique + + + ALSA + + + + hw:0 + + + + Sampling rate + Taux d'échantillonnage + + + set to max + maximiser + + + JACK + + + + automaticaly connect at startup to + se connecte automatiquement au démarrage + + + Real-time parameters + Paramètres temps-réel + + + Refresh + temps de rafraichissement + + + increase to get less CPU usage but less time resolution + Augmente pour alléger le processeur mais perdre de la résolution en temps + + + ms + + + + Sound Analysis + Analyse du son + + + Note Recognition + Reconnaissance de notes + + + Range + Tessiture + + + from half-tones below A3 and above + Du plus bas au plus haut demi-ton + + + min half-tone from A + demi-ton minimum depuis A3 + + + max half-tone form A + demi-ton maximum depuis A3 + + + Volume treshold + Seuil de volume + + + volume treshold + Seuil de volume + + + ignore sounds below this treshold + Ignore le son en dessous de ce seuil + + + °/.. + °/.. + + + volume treshold in per thousands ! + Seuil du volume en pourmilles ! + + + Length factor + Facteur de longueur + + + so much to say ... + tellement à dire ... + + + increase recognition quality at cost of processor usage + améliore la qualité de la reconnaissance au dépend du processeur + + + Test complexity + complexité du test + + + Components treshold + seuil des composantes + + + in per thousands ! + en pourmilles ! + + + Frequency Analysis + Analyse de la fréquence + + + Number of wave length computed for each analysis + Nombre de longueur d'onde calculées pour chaque analyses + + + Stability Criteria + Critères de stabilité + + + Tolerance of the error variance + Tolérance sur la variance de l'erreur + + + Views + Vues + + + start in full-screen + démarre en plein-écran + + + raise the window to the whole screen (f) + Agrandire la fenêtre pour qu'elle prenne tout l'écran (f) + + + Tonality + Tonalité + + + C (Do) + + + + Bb (Sib) + + + + Eb (Mib) + + + + the tonality of the showed notes name + la tonalité des noms des notes + + + The tonality of the showed notes name. +Usefull for converting notes name to a corresponding instrument tonality (examples: Eb for saxophone, Bb for trumpet, etc.) + La tonalité des noms des notes + + + Notes name + Nom des notes + + + Latin + + + + use englo-saxon or latin notes name + Utiliser la notation englo-saxonne au latine + + + Use englo-saxon or latin notes name. +englo-saxon: C D E F G A B +latin: Do Re Mi Fa Sol La Si + Utiliser la notation englo-saxonne au latine +englo-saxonne: C D E F G A B +latine: Do Re Mi Fa Sol La Si + + + Sound History + Son + + + Duration + Durée + + + View max height + Hauteur maximum (en pixel) + + + Error + Erreur + + + the length of the average to compute the instrument frequency + La longueur de la moyenne pour calculer la férquence + + + smaller is the value faster the tuner respond, but more unprecise the computed frequency is + Plus petite est la valeur, plus vite l'accordeur répond, mais l'accordeur perd en précision + + + Latency + Latence + + + Wave Sample + Échantillon + + + Show fading away + Montrer un estompage + + + Number of sample keept + Nombre d'estompage + + + Formants + Composantes + + + Number of formants shown + Nombre d'harmoniques affichées + + + &Help + &Aide + + + &Save + &Sauvegarder + + + Save settings + Sauvegarder la configuration + + + Restore factory settings + Restaurer la configuration de départ + + + &OK + &Accepter + + + Use theses settings and exist configure panel (but don't save them !) + Utiliser cette configuration (mais ne la sauvegarde pas !) + + + &Cancel + A&nnuller + + + Show volume history + Afficher l'historique du volume + + + General + Général + + + Start in full-screen + Démarre en plein-écran + + + Auto-save configuration and views layout on exit + Sauvegarder automatiquement la configuration et la disposition des vues en quittant + + + Anglo-Saxon + + + + use anglo-saxon or latin notes name + Utiliser la notation anglo-saxone ou latine + + + Use anglo-saxon or latin notes name. +englo-saxon: C D E F G A B +latin: Do Re Mi Fa Sol La Si + Utiliser la notation anglo-saxone ou latine. +Anglo-saxon: C D E F G A B +Latine: Do Re Mi Fa Sol La Si + + + <b>To get more options:</b> right-click every view to show up their properties ! + <b>Pour obtenir plus d'options:</b> cliquez les vues avec le boutton droit de la souris pour faire apparaître leurs propriétés ! + + + Volume threshold + Seuil de volume + + + Components threshold + Seuil de composantes + + + Refresh time + Temps de rafraîchissement + + + Time between each sound analysis. Increase to get less CPU usage but less time resolution. + Temps entre chaque analyse du son. Augmenter pour réduire l'utilisation du processeur mais baisser la résolution temporelle. + + + Frequency analysis range. + Portée de l'analyse des fréquences. + + + Minimal half-tone from A3 + Demi-ton minimum depuis La3 + + + Maximal half-tone form A3 + Demi-ton maximum depuis La3 + + + Ignore all sounds with volume below this threshold (in perthousands !)(shown has a red line in the graph view). + Ignore tout les sons dont le volume est inférieur à ce seuil (en pour-milles !) +(visible sous la forme d'une ligne rouge dans la vue du graphe). + + + Wave-length average size + Taille de la moyenne de la longueur d'onde + + + Size of the average to compute the frequency in one analysis. + Taille de la moyenne utilisée pour calculer la fréquence dans une analyse. + + + Algorithms + Algorithmes + + + Default algorithm + Algorithme par défaut + + + for microtonal view + pour la vue microtonale + + + Increase recognition quality at cost of processor usage. + Améliore la qualité de la reconnaissance au dépend du processeur. + + + Error noise threshold + Seuil du bruit de l'erreur + + + Consider as valuable all errors below this. + Considère comme valable toutes les erreurs en-dessous de ce seuil. + + + Auto-Correlation (usualy used for Microtonal view) + Auto-Correlation (utilisé normalement pour la vue microtonale) + + + Consider as valuable all errors below this (in per thousands !) + Considère comme valable toutes les erreurs en-dessous de ce seuil (en pour-milles !) + + + Convolution threshold + Seuil de convolution + + + Restore all settings as you just installed the program (need a program restart). + Revenir à la configuration comme si le program venait d'être installé (requière un redémarrage du programme). + + + Raise the window to the whole screen when the program start (f) + Agrandit la fenêtre sur tout l'écran lorsque le programme démarre (f) + + + Use anglo-saxon or latin notes name. +englo-saxon: C D E F G A B +latin: Do Re Mi Fa Sol La + Utiliser la notation anglo-saxone ou latine. +Anglo-saxon: C D E F G A B +Latine: Do Re Mi Fa Sol La Si + + + Consider as unstable all sound with frequency variance above this (in half-tones). + Considère comme instable tout les sons dont la variance de l'erreur est au dessus de ce seuil (en demi-ton). + + + The tonality of the showed notes name. +Usefull for converting notes name to a corresponding instrument tonality. +(examples: Eb for saxophone, Bb for trumpet, etc.) + La tonalité des noms des notes. +Utile pour convertir le nom des notes dans la tonalité d'un instrument. +(examples: Mib pour le saxophone, Sib pour la trompette, etc.) + + + Response of the program and tolerance of holes, scratches, artefacts, etc. +Smaller is the value faster the tuner respond, but more unprecise the computed frequency is. + Temps de réponse du program et tolérance des trous, grésillements, etc. +Plus petites est la valeur plus vite le program répond, mais plus la fréquence calculée est instable. + + + Ignore all sounds with volume below this threshold (in perthousands !) +(shown has a red line in the graph view). + Ignore tout les sons dont le volume est inférieur à ce seuil (en pour-milles !) +(visible sous la forme d'une ligne rouge dans la vue du graphe). + + + Response of the program and tolerance of holes, scratches, artefacts, etc. +Smaller is the value faster the tuner respond, but more unstable the computed frequency is. + Temps de réponse du program et tolérance des trous, grésillements, etc. +Plus petites est la valeur plus vite le program répond, mais plus la fréquence calculée est instable. + + + Client name + Nom de client ("client name") + + + fmit + fmit + + + Show A3 offset spin box + Montrer la boite de décalage du La3 + + + Detect now + Détecter maintenant + + + mix channels if they are multiple (will use the first channel if not checked) + mélanger les canaux s'il y en a plusieurs (utilise le premier sinon) + + + PortAudio + PortAudio + + + Device name + Nom du device + + + default + default + + + OSS + OSS + + + /dev/dsp + /dev/dsp + + + <b>To get more options:</b><br> +right-click every view to show up their properties ! + <b>Pour plus d'options:</b><br> +click-droit sur les vues pour afficher leurs propriétés ! + + + Auto detect now + Détecter maintenant + + + Selected capture system + Système de capture sélectionné + + + Auto-detect a working one at startup + En détecter un automatiquement au lancement + + + dB + dB + + + Algorithm + Algorithme + + + Quantizer + Quantizer + + + Frequency refinement + Raffinage de la fréquence + + + Use sub-harmonic audibility treshold + Utiliser un seuil d'audibilité de sous-harmonique + + + Maximum number of harmonics + Nombre maximum d'harmoniques + + + Do not use a too big sampling rate. This is not so much important for pitch recognition, 22050Hz should be largely enough. + Ne pas utiliser une fréquence d'échantillonage trop élevée. 22050Hz devrait être largement suffisant dans la pluspart des cas. + + + Range filtering + Filtrage de la portée + + + Maximum number of periods + + + + Do not use a too big sampling rate. 22050Hz should be largely enough in most cases. + + + + Rectangular filter: bad precision, but very fast + + + + FIR filter: good precision, but more costly in CPU usage + + + + Window size factor + + + + The tonality of the notes name. + + + + The tonality of the notes name. +Usefull for converting notes name to a corresponding instrument tonality. +(examples: Eb for saxophone, Bb for trumpet, etc.) + + + + Use anglo-saxon or latin notes name: +anglo-saxon: C D E F G A B +latin: Do Re Mi Fa Sol La + + + + Use anglo-saxon or latin notes name: +anglo-saxon: C D E F G A B +latin: Do Re Mi Fa Sol La + + + + Show A4 offset spin box + Montrer la boite de décalage du La4 + + + right-click every view to show up their properties ! + + + + Capture System + + + + The selected capture system: the sound server, sound library, like: +JACK, ALSA, OSS, PortAudio + + + + Auto-detect an available capture system at startup + + + + Auto-detect an available capture system at startup. +Even if the capture system is available, it may not works if it's bad configured. + + + + Auto-detect an available capture system now. +Even if the capture system is available, it may not works if it's bad configured. + + + + The name of FMIT under the JACK connection system + + + + Connect automaticaly FMIT to the following source at startup + + + + Connect automaticaly FMIT to the this source at startup + + + + Sampling rate of the JACK server + + + + The device name, where the ALSA library have to be connected to + + + + The sampling rate, sampling frequency, number of samples by second ... + + + + The sampling rate, sampling frequency, number of samples by second ... +Do not rise it too much. Around 22050Hz should be largely enough in most cases. + + + + Time between each sound analysis. +Increase to get less CPU usage but less time precision. + + + + Frequency analysis range: from the lowest note to the highest from the A4 reference note. + + + + Lowest semi-tone from the A4 reference note. +Sometimes, this is usefull to put it higher than -35 to avoid a noise from the sector alimentation. + + + + Lowest semi-tone from the A4 reference note in frequency. +Sometimes, this is usefull to put it higher than 50hz to avoid a noise from the sector alimentation. + + + + Highest semi-tone from the A4 reference note. + + + + Highest semi-tone from the A4 reference note in frequency + + + + Filter frequencies belove the lowest semi-tone and above the highest semi-tone to avoid artefacts, noises, in all the following steps of the sound analysis. + + + + Filter frequencies belove the lowest semi-tone and above the highest semi-tone +to avoid artefacts, noises, in all the following steps of the sound analysis. + + + + Algorithm settings + + + + Ignore all sounds with volume below this threshold. +in dB in frequency domain. +(shown has a red line in different views) + + + + Ignore weak sub-harmonics. +The treshold is defined between two neighborhood frequency components. +Prevent too-low errors. + + + + Factor defining the window size from the lowest period define by the range. +Bigger is this factor, more stable is the analysis but more CPU the program will need and slower the program will react to sound changes. + + + + Frequency domain fundamental refinement: +Mean of the fundamental relative frequencies of the harmonics. +Choose the number of harmonics to use. + + + + Time domain fundamental refinement: +Mean of period lengths. +Choose the number of period to use. + + + + Quantize the analysis results: ignore frequency jumps, fill holes, ignore too short notes. +Smaller is the following value, faster the tuner respond, but more unstable the computed frequency is. + + + + Use theses settings and exist configure panel (but don't save the settings !) + + + + + CustomInstrumentTunerForm + + Restore Factory Settings + Restaurer la configuration de départ + + + This operation is NOT reversible. +Are you sure you want to lose all your current settings ? + Cette opération n'est pas réversible. +Êtes-vous sûr de vouloir perdre votre configuration courrante ? + + + You can now restart FMIT to get back factory settings + Vous pouvez maintenant redémarrer FMIT pour obtenir la configuration de départ + + + About Free Music Instrument Tuner + A propos de Free Music Instrument Tuner + + + <h3>Version + + + + JI value + Valeur JI + + + </h3><p><h3>Website:</h3><p>homepage: <a href="http://home.gna.org/fmit">http://home.gna.org/fmit</a> + + + + <p>development site: <a href="http://gna.org/projects/fmit">http://gna.org/projects/fmit</a> + + + + <p>donation link: <a href="http://home.gna.org/fmit/donation.html">http://home.gna.org/fmit/donation.html</a> + + + + <p><h3>Author:</h3><p>Gilles Degottex [gilles.degottex@net2000.ch] + + + + <p><h3>Packager:</h3><p> + + + + about_box + + + + OK + + + + + DialView + + Show trace + Afficher une trace + + + Use percentages + Utiliser des pourcents + + + Show tolerance + Montrer la tolérance + + + Use cents + Utilise la mesure en cents + + + Scale range + Échelle d'étirement + + + Scale range (in cents) + Échelle d'étirement (en cents) + + + + GLErrorHistory + + Error + Erreur + + + Keep previous notes + Conserver les anciennes notes + + + Use percentages + Utiliser des pourcents + + + Use cents + Utilise la mesure en cents + + + Scale range + Échelle d'étirement + + + Scale range (in cents) + Échelle d'étirement (en cents) + + + + GLFT + + Auto scale + Adapte la taille automatiquement + + + + GLFormants + + Formants + Composantes + + + Number of formants + Nombre de composantes + + + + GLFreqStruct + + Number of formants + Nombre de composantes + + + Formants + Composantes + + + Number of harmonics + Nombre d'harmoniques + + + Harmonics + Harmoniques + + + + GLGraph + + Captured Sound + Son + + + Auto scale + Adapte la taille automatiquement + + + Duration + Durée + + + Max height + Hauteur maximale + + + Show Wave Form + Montrer la forme d'onde + + + Scale factor + Facteur d'étirement + + + + GLSample + + Wave form sample + Echantillon + + + Show fading + Afficher un estompage + + + Number of fading + Nombre d'estompages + + + + GLVolumeHistory + + Keep previous notes + Conserver les anciennes notes + + + + InstrumentTunerForm + + Music Instrument Tuner + Accordeur d'instruments de musique + + + K +e +e +p + G +a +r +d +e +r + + + K + G + + + Keep errors (k) + Garder les erreurs (g) + + + Keep errors + Garder les erreurs (g) + + + Note Stability + Stabilité de la note + + + Stability of the playing note + Stabilité de la note jouée + + + Tuning Frequency + Fréquence d'accordage + + + Hz + + + + A3 frequency + Fréquence du La3 + + + the frequency error + L'erreur + + + the arrow should be at 12 o'clock for a perfect tuned instrument. +At 9, the instrument is a quarter tone lower. + La flèche devrait être à midi pour un instrument parfaitement accordé. +à 9 heure, l'instruement est un quart de ton trop bas. + + + the dominant note + La note dominante + + + the frequency of the note as it should be + La fréquence de la note comme elle devrait être + + + the instrument frequency + La fréquence de la note jouée + + + Tools + Outils + + + About + A propos de + + + &About + &A propos de + + + Show sample + Montrer l'échantillon + + + Show formants + Montrer les composantes + + + Pause + + + + Space + Espace + + + Configure + Configurer + + + Show captured sound + Montrer le son capturé + + + Show error History + Montrer l'historique de l'erreur + + + Save settings + Sauvegarder la configuration + + + Ctrl+S + + + + Reset + Redémarre + + + Reset capture system + Redémarrer la capture du son + + + capture stability + Stabilité de la capture + + + Views + Vues + + + Restore Factory Settings + Restaurer la configuration de départ + + + This operation is NOT reversible. +Are you sure you want to lose all your current settings ? + Cette opération n'est pas réversible. Êtes-vous sûr de vouloir perdre votre configuration courrante ? + + + You can now restart FMIT to get back factory settings + Vous pouvez maintenant redémarrer FMIT pour obtenir la configuration de départ + + + Do not clear histories between notes. + N'efface pas les historiques entre les notes. + + + Green if the note is stable enough, red if not and grey if there is no sound. + Vert si la note est assez stable, rouge sinon et gris s'il n'y a pas de son. + + + the A3 frequency + la fréquence du La3 + + + The played note frequency + La fréquence de la note jouée + + + The frequency of the current played note. + La fréquence de la note jouée. + + + The recognized note + La note reconnue + + + The frequency of the note as it should be. + La fréquence de la note comme elle devrait être. + + + Capture stability + La stabilité de la capture du son + + + Green if FMIT is capturing sound, red if something goes wrong (sound server unavailable, drivers not loaded, etc.) + Vert si le program est en train de capturer du son, rouge si quelque chose ne va pas (serveur son indisponible, drivers pas chargés, etc.) + + + Put in pause state to use less processor has possible. + Met le program en état de pause pour utiliser un minimum de processeur. + + + Save configure panel settings, views settings and window size. + Sauvegarde les réglages du panneau de configuration, les réglages des vues et la taille de la fenêtre. + + + Stop, reload settings and restart the capture sound system. + Arrête, recharger les réglages et redémarre la capture du son. + + + Green if the program is capturing sound, red if something goes wrong (sound server unavailable, drivers not loaded, etc.) + Vert si le program est en train de capturer du son, rouge si quelque chose ne va pas (serveur son indisponible, drivers pas chargés, etc.) + + + Settings + Configurations + + + Offset + Décalage + + + Offset in cents on the tuning frequency + Décalage en cents depuis la fréquence d'accordage + + + cents + cents + + + Red if capture system is not working<br/> +Grey if capture system is ok, but there is no sound enough<br/> +Orange if analysis conditions are bad (like saturation)<br/> +Green if a note is beeing catured and conditions are ok + + + + Free Music Instrument Tuner + + + + Do not clear graphs between notes (for error and volume graphs only) + + + + Volume with dB scale + + + + Volume with dB scale. +Computed from in the frequency domaine, from the max bin. +The maximum is reached when the signal energy is maximal NOT when the sound saturate in time domaine. + + + + the tuning frequency: A4 frequency + + + + Offset in cents from the tuning frequency + + + + The frequency of the current played note + + + + The frequency of the note as it should be + + + + About FMIT + + + + Invoke the about box + + + + Put in pause state, stop the capture, the sound analysis and all views + + + + + JustIntonationView + + Unkown filename: ' + Nom de fichier inconnu: ' + + + Keep root to left side + Conserver la tonique à l'extrémité gauche + + + Load Scala file ... + Charger un fichier Scala ... + + + used scale + Échelle utilisée + + + Open scale file + Ouvrir un fichier d'échelle + + + Scale name already exist + Nom d'échelle déjà existant + + + Invalid file content ! + Contenu de fichier invalid ! + + + + JustIntonationView::ScalePreview + + <b>name:</b> + <b>nom:</b> + + + <b>number of ratio:</b> + <b>nombre de valeurs:</b> + + + Invalid Scala file: + Fichier Scala invalid: + + + + MicrotonalView + + Unkown filename: ' + Nom de fichier inconnu: ' + + + Keep root to left side + Conserver la tonique à l'extrémité gauche + + + Load Scala file ... + Charger un fichier Scala ... + + + used scale + Échelle utilisée + + + Open scale file + Ouvrir un fichier d'échelle + + + Scale name already exist + Nom d'échelle déjà existant + + + Invalid file content ! + Contenu de fichier invalid ! + + + Root's octave + Octave de base + + + + MicrotonalView::ScalePreview + + <b>name:</b> + <b>nom:</b> + + + <b>number of ratio:</b> + <b>nombre de valeures:</b> + + + Invalid Scala file: + Fichier Scala invalid: + + + + QWidget + + Show + Afficher + + + view + vue + + + diff --git a/ui/ConfigForm.ui b/ui/ConfigForm.ui new file mode 100644 index 0000000..93fa781 --- /dev/null +++ b/ui/ConfigForm.ui @@ -0,0 +1,2235 @@ + +ConfigForm + + + ConfigForm + + + + 0 + 0 + 537 + 702 + + + + Configuration + + + image0 + + + true + + + Error variation tolerance + + + + unnamed + + + 11 + + + 6 + + + + tabWidget + + + + TabPage + + + General + + + + unnamed + + + + ui_chkFullScreen + + + Start in full-screen + + + Raise the window to the whole screen when the program start (f) + + + Raise the window to the whole screen when the program start (f) + + + + + ui_chkAutoSaveOnExit + + + Auto-save configuration and views layout on exit + + + false + + + Auto-save configuration and views layout on exit + + + Auto-save configuration and views layout on exit + + + + + layout34_2 + + + + unnamed + + + + textLabel1_7 + + + Tonality + + + The tonality of the notes name. + + + The tonality of the notes name. +Usefull for converting notes name to a corresponding instrument tonality. +(examples: Eb for saxophone, Bb for trumpet, etc.) + + + + + + C (Do) + + + + + Bb (Sib) + + + + + Eb (Mib) + + + + ui_cbTonality + + + The tonality of the notes name. + + + The tonality of the notes name. +Usefull for converting notes name to a corresponding instrument tonality. +(examples: Eb for saxophone, Bb for trumpet, etc.) + + + + + + + layout35_4 + + + + unnamed + + + + textLabel3_3 + + + Notes name + + + Use anglo-saxon or latin notes name: +anglo-saxon: C D E F G A B +latin: Do Re Mi Fa Sol La + + + Use anglo-saxon or latin notes name: +anglo-saxon: C D E F G A B +latin: Do Re Mi Fa Sol La + + + + + + Anglo-Saxon + + + + + Latin + + + + ui_cbNotesName + + + Use anglo-saxon or latin notes name: +anglo-saxon: C D E F G A B +latin: Do Re Mi Fa Sol La + + + Use anglo-saxon or latin notes name: +anglo-saxon: C D E F G A B +latin: Do Re Mi Fa Sol La + + + + + + + ui_chkShowA4Offset + + + Show A4 offset spin box + + + false + + + Show A4 offset spin box + + + Show A4 offset spin box + + + + + spacer5 + + + Vertical + + + Expanding + + + + 20 + 110 + + + + + + textLabel1_5 + + + + 10 + + + + <b>To get more options:</b><br> +right-click every view to show up their properties ! + + + WordBreak|AlignVCenter + + + right-click every view to show up their properties ! + + + <b>To get more options:</b><br> +right-click every view to show up their properties ! + + + + + spacer5_2 + + + Vertical + + + Expanding + + + + 20 + 100 + + + + + + + + Widget2 + + + Capture System + + + + unnamed + + + + layout51 + + + + unnamed + + + + ui_lblSelectedCaptureSystem + + + Selected capture system + + + The selected capture system: the sound server, sound library, like: +JACK, ALSA, OSS, PortAudio + + + The selected capture system: the sound server, sound library, like: +JACK, ALSA, OSS, PortAudio + + + + + ui_cbTransports + + + The selected capture system: the sound server, sound library, like: +JACK, ALSA, OSS, PortAudio + + + The selected capture system: the sound server, sound library, like: +JACK, ALSA, OSS, PortAudio + + + + + + + layout56 + + + + unnamed + + + + ui_chkAutoDetect + + + Auto-detect an available capture system at startup + + + true + + + Auto-detect a working one at startup + + + Auto-detect an available capture system at startup. +Even if the capture system is available, it may not works if it's bad configured. + + + + + ui_btnAutoDetect + + + Auto detect now + + + Auto-detect an available capture system now. +Even if the capture system is available, it may not works if it's bad configured. + + + Auto-detect an available capture system now. +Even if the capture system is available, it may not works if it's bad configured. + + + + + + + ui_grpJACK + + + JACK + + + + unnamed + + + + layout56 + + + + unnamed + + + + textLabel1 + + + Client name + + + The name of FMIT under the JACK connection system + + + The name of FMIT under the JACK connection system + + + + + lineEdit7 + + + false + + + + 5 + 0 + 0 + 0 + + + + fmit + + + The name of FMIT under the JACK connection system + + + The name of FMIT under the JACK connection system + + + + + + + layout24 + + + + unnamed + + + + ui_chkJACKAutoConnect + + + automaticaly connect at startup to + + + Connect automaticaly FMIT to the following source at startup + + + Connect automaticaly FMIT to the following source at startup + + + + + ui_txtJACKSourcePort + + + false + + + + 5 + 0 + 0 + 0 + + + + Connect automaticaly FMIT to the this source at startup + + + Connect automaticaly FMIT to the this source at startup + + + + + + + layout25 + + + + unnamed + + + + textLabel3 + + + Sampling rate + + + Sampling rate of the JACK server + + + Sampling rate of the JACK server + + + + + ui_lblJACKSamplingRate + + + Sampling rate of the JACK server + + + Sampling rate of the JACK server + + + + + + + + + ui_grpALSA + + + ALSA + + + + unnamed + + + + layout22 + + + + unnamed + + + + textLabel1_2 + + + Device name + + + The device name, where the ALSA library have to be connected to + + + The device name, where the ALSA library have to be connected to + + + + + ui_txtALSAPCMName + + + + 5 + 0 + 0 + 0 + + + + hw:0 + + + The device name, where the ALSA library have to be connected to + + + The device name, where the ALSA library have to be connected to + + + + + + + layout33 + + + + unnamed + + + + textLabel4 + + + Sampling rate + + + The sampling rate, sampling frequency, number of samples by second ... + + + The sampling rate, sampling frequency, number of samples by second ... +Do not rise it too much. Around 22050Hz should be largely enough in most cases. + + + + + ui_spinALSASamplingRate + + + PlusMinus + + + 96000 + + + 8000 + + + 22050 + + + The sampling rate, sampling frequency, number of samples by second ... + + + The sampling rate, sampling frequency, number of samples by second ... +Do not rise it too much. Around 22050Hz should be largely enough in most cases. + + + + + ui_chkALSASamplingRateMax + + + set to max + + + + + + + textLabel1_5_2_2 + + + Do not use a too big sampling rate. 22050Hz should be largely enough in most cases. + + + WordBreak|AlignVCenter + + + + + ui_chkALSAMixMultipleChannels + + + mix channels if they are multiple (will use the first channel if not checked) + + + false + + + + + + + ui_grpOSS + + + OSS + + + + unnamed + + + + layout22_2 + + + + unnamed + + + + textLabel1_2_2 + + + Device name + + + The device name, where the ALSA library have to be connected to + + + The device name, where the ALSA library have to be connected to + + + + + ui_txtOSSPCMName + + + + 5 + 0 + 0 + 0 + + + + /dev/dsp + + + The device name, where the ALSA library have to be connected to + + + The device name, where the ALSA library have to be connected to + + + + + + + layout33_3 + + + + unnamed + + + + textLabel4_3 + + + Sampling rate + + + The sampling rate, sampling frequency, number of samples by second ... + + + The sampling rate, sampling frequency, number of samples by second ... +Do not rise it too much. Around 22050Hz should be largely enough in most cases. + + + + + ui_spinOSSSamplingRate + + + PlusMinus + + + 96000 + + + 8000 + + + 22050 + + + The sampling rate, sampling frequency, number of samples by second ... + + + The sampling rate, sampling frequency, number of samples by second ... +Do not rise it too much. Around 22050Hz should be largely enough in most cases. + + + + + ui_chkOSSSamplingRateMax + + + set to max + + + + + + + textLabel1_5_2 + + + Do not use a too big sampling rate. 22050Hz should be largely enough in most cases. + + + WordBreak|AlignVCenter + + + + + ui_chkOSSMixMultipleChannels + + + mix channels if they are multiple (will use the first channel if not checked) + + + false + + + + + + + ui_grpPortAudio + + + PortAudio + + + + unnamed + + + + layout30 + + + + unnamed + + + + textLabel1_8 + + + Device name + + + The device name, where the ALSA library have to be connected to + + + The device name, where the ALSA library have to be connected to + + + + + + default + + + + ui_cbPortAudioDeviceName + + + The device name, where the ALSA library have to be connected to + + + The device name, where the ALSA library have to be connected to + + + + + + + layout33_2 + + + + unnamed + + + + textLabel4_2 + + + Sampling rate + + + The sampling rate, sampling frequency, number of samples by second ... + + + The sampling rate, sampling frequency, number of samples by second ... +Do not rise it too much. Around 22050Hz should be largely enough in most cases. + + + + + ui_spinPortAudioSamplingRate + + + PlusMinus + + + 96000 + + + 8000 + + + 22050 + + + The sampling rate, sampling frequency, number of samples by second ... + + + The sampling rate, sampling frequency, number of samples by second ... +Do not rise it too much. Around 22050Hz should be largely enough in most cases. + + + + + ui_chkPortAudioSamplingRateMax + + + set to max + + + + + + + textLabel1_5_2_2_2 + + + Do not use a too big sampling rate. 22050Hz should be largely enough in most cases. + + + WordBreak|AlignVCenter + + + + + ui_chkPortAudioMixMultipleChannels + + + mix channels if they are multiple (will use the first channel if not checked) + + + false + + + + + + + spacer6 + + + Vertical + + + Expanding + + + + 20 + 16 + + + + + + + + Widget3 + + + Sound Analysis + + + + unnamed + + + + layout147 + + + + unnamed + + + + textLabel1_4 + + + Refresh time + + + Time between each sound analysis. +Increase to get less CPU usage but less time precision. + + + Time between each sound analysis. +Increase to get less CPU usage but less time precision. + + + + + ui_spinRefreshTime + + + ms + + + PlusMinus + + + 2000 + + + 1 + + + 20 + + + Time between each sound analysis. +Increase to get less CPU usage but less time precision. + + + Time between each sound analysis. +Increase to get less CPU usage but less time precision. + + + + + + + layout34 + + + + unnamed + + + + textLabel7 + + + Range + + + Frequency analysis range: from the lowest note to the highest from the A4 reference note. + + + Frequency analysis range: from the lowest note to the highest from the A4 reference note. + + + + + layout26 + + + + unnamed + + + + ui_spinMinHT + + + PlusMinus + + + 96 + + + -96 + + + -36 + + + Lowest semi-tone from the A4 reference note. +Sometimes, this is usefull to put it higher than -35 to avoid a noise from the sector alimentation. + + + Lowest semi-tone from the A4 reference note. +Sometimes, this is usefull to put it higher than -35 to avoid a noise from the sector alimentation. + + + + + ui_txtMinHT + + + Lowest semi-tone from the A4 reference note in frequency. +Sometimes, this is usefull to put it higher than 50hz to avoid a noise from the sector alimentation. + + + Lowest semi-tone from the A4 reference note in frequency. +Sometimes, this is usefull to put it higher than 50hz to avoid a noise from the sector alimentation. + + + + + + + layout27 + + + + unnamed + + + + ui_spinMaxHT + + + PlusMinus + + + 96 + + + -96 + + + 48 + + + Highest semi-tone from the A4 reference note. + + + Highest semi-tone from the A4 reference note. + + + + + ui_txtMaxHT + + + Highest semi-tone from the A4 reference note in frequency + + + Highest semi-tone from the A4 reference note in frequency + + + + + + + + + ui_grpRangeFiltering + + + Range filtering + + + true + + + Filter frequencies belove the lowest semi-tone and above the highest semi-tone to avoid artefacts, noises, in all the following steps of the sound analysis. + + + Filter frequencies belove the lowest semi-tone and above the highest semi-tone to avoid artefacts, noises, in all the following steps of the sound analysis. + + + + unnamed + + + + ui_rdRangeFilteringRectangular + + + Rectangular filter: bad precision, but very fast + + + true + + + Filter frequencies belove the lowest semi-tone and above the highest semi-tone +to avoid artefacts, noises, in all the following steps of the sound analysis. + + + Filter frequencies belove the lowest semi-tone and above the highest semi-tone +to avoid artefacts, noises, in all the following steps of the sound analysis. + + + + + ui_rdRangeFilteringFIR + + + false + + + FIR filter: good precision, but more costly in CPU usage + + + Filter frequencies belove the lowest semi-tone and above the highest semi-tone +to avoid artefacts, noises, in all the following steps of the sound analysis. + + + Filter frequencies belove the lowest semi-tone and above the highest semi-tone +to avoid artefacts, noises, in all the following steps of the sound analysis. + + + + + + + groupBox7_2_3 + + + Algorithm + + + Algorithm settings + + + Algorithm settings + + + + unnamed + + + + layout54 + + + + unnamed + + + + textLabel3_2 + + + Volume threshold + + + Ignore all sounds with volume below this threshold. +in dB in frequency domain. +(shown has a red line in different views) + + + Ignore all sounds with volume below this threshold. +in dB in frequency domain. +(shown has a red line in different views) + + + + + line2 + + + + 100 + 0 + + + + + + + 0 + 0 + 0 + + + 255 + 0 + 0 + + + 255 + 127 + 127 + + + 255 + 63 + 63 + + + 127 + 0 + 0 + + + 170 + 0 + 0 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 230 + 231 + 230 + + + 0 + 0 + 0 + + + 0 + 0 + 128 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + 128 + 128 + 128 + + + 255 + 0 + 0 + + + 255 + 127 + 127 + + + 255 + 38 + 38 + + + 127 + 0 + 0 + + + 170 + 0 + 0 + + + 128 + 128 + 128 + + + 255 + 255 + 255 + + + 128 + 128 + 128 + + + 255 + 255 + 255 + + + 230 + 231 + 230 + + + 0 + 0 + 0 + + + 0 + 0 + 128 + + + 255 + 255 + 255 + + + 0 + 0 + 192 + + + 128 + 0 + 128 + + + + + 0 + 0 + 0 + + + 255 + 0 + 0 + + + 255 + 127 + 127 + + + 255 + 38 + 38 + + + 127 + 0 + 0 + + + 170 + 0 + 0 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 230 + 231 + 230 + + + 0 + 0 + 0 + + + 0 + 0 + 128 + + + 255 + 255 + 255 + + + 0 + 0 + 192 + + + 128 + 0 + 128 + + + + + + HLine + + + Sunken + + + Horizontal + + + Ignore all sounds with volume below this threshold. +in dB in frequency domain. +(shown has a red line in different views) + + + Ignore all sounds with volume below this threshold. +in dB in frequency domain. +(shown has a red line in different views) + + + + + + + layout59 + + + + unnamed + + + + ui_sldVolumeTreshold + + + -100 + + + 0 + + + -28 + + + Horizontal + + + Below + + + 6 + + + Ignore all sounds with volume below this threshold. +in dB in frequency domain. +(shown has a red line in different views) + + + Ignore all sounds with volume below this threshold. +in dB in frequency domain. +(shown has a red line in different views) + + + + + ui_spinVolumeTreshold + + + dB + + + PlusMinus + + + 0 + + + -100 + + + -28 + + + Ignore all sounds with volume below this threshold. +in dB in frequency domain. +(shown has a red line in different views) + + + Ignore all sounds with volume below this threshold. +in dB in frequency domain. +(shown has a red line in different views) + + + + + + + layout60 + + + + unnamed + + + + ui_sldCombedFFTAudibilityRatio + + + false + + + 100 + + + 15 + + + Horizontal + + + Below + + + 6 + + + Ignore weak sub-harmonics. +The treshold is defined between two neighborhood frequency components. +Prevent too-low errors. + + + Ignore weak sub-harmonics. +The treshold is defined between two neighborhood frequency components. +Prevent too-low errors. + + + + + ui_spinCombedFFTAudibilityRatio + + + false + + + dB + + + PlusMinus + + + 100 + + + 15 + + + Ignore weak sub-harmonics. +The treshold is defined between two neighborhood frequency components. +Prevent too-low errors. + + + Ignore weak sub-harmonics. +The treshold is defined between two neighborhood frequency components. +Prevent too-low errors. + + + + + + + ui_chkAlgoUseSubHarmTresh + + + Use sub-harmonic audibility treshold + + + Ignore weak sub-harmonics. +The treshold is defined between two neighborhood frequency components. +Prevent too-low errors. + + + Ignore weak sub-harmonics. +The treshold is defined between two neighborhood frequency components. +Prevent too-low errors. + + + + + layout59_2_3 + + + + unnamed + + + + ui_sldWindowSizeFactor + + + 1 + + + 8 + + + 10 + + + 4 + + + Horizontal + + + Below + + + 1 + + + Factor defining the window size from the lowest period define by the range. +Bigger is this factor, more stable is the analysis but more CPU the program will need and slower the program will react to sound changes. + + + Factor defining the window size from the lowest period define by the range. +Bigger is this factor, more stable is the analysis but more CPU the program will need and slower the program will react to sound changes. + + + + + ui_spinWindowSizeFactor + + + PlusMinus + + + 8 + + + 1 + + + 4 + + + Factor defining the window size from the lowest period define by the range. +Bigger is this factor, more stable is the analysis but more CPU the program will need and slower the program will react to sound changes. + + + Factor defining the window size from the lowest period define by the range. +Bigger is this factor, more stable is the analysis but more CPU the program will need and slower the program will react to sound changes. + + + + + + + textLabel1_6 + + + Window size factor + + + Factor defining the window size from the lowest period define by the range. +Bigger is this factor, more stable is the analysis but more CPU the program will need and slower the program will react to sound changes. + + + Factor defining the window size from the lowest period define by the range. +Bigger is this factor, more stable is the analysis but more CPU the program will need and slower the program will react to sound changes. + + + + + + + up_grpFreqRefinement + + + Frequency refinement + + + true + + + + unnamed + + + + ui_rdUseFreqRefinement + + + Maximum number of harmonics + + + Frequency domain fundamental refinement: +Mean of the fundamental relative frequencies of the harmonics. +Choose the number of harmonics to use. + + + Frequency domain fundamental refinement: +Mean of the fundamental relative frequencies of the harmonics. +Choose the number of harmonics to use. + + + + + ui_rdUseTimeRefinement + + + Maximum number of periods + + + true + + + Time domain fundamental refinement: +Mean of period lengths. +Choose the number of period to use. + + + Time domain fundamental refinement: +Mean of period lengths. +Choose the number of period to use. + + + + + layout59_2_2 + + + + unnamed + + + + ui_sldTimeRefinMaxPeriod + + + 1 + + + 64 + + + 10 + + + 16 + + + Horizontal + + + Below + + + 8 + + + Time domain fundamental refinement: +Mean of period lengths. +Choose the number of period to use. + + + Time domain fundamental refinement: +Mean of period lengths. +Choose the number of period to use. + + + + + ui_spinTimeRefinMaxPeriod + + + PlusMinus + + + 64 + + + 1 + + + 4 + + + Time domain fundamental refinement: +Mean of period lengths. +Choose the number of period to use. + + + Time domain fundamental refinement: +Mean of period lengths. +Choose the number of period to use. + + + + + + + layout59_2 + + + + unnamed + + + + ui_sldFreqRefinMaxHarm + + + 1 + + + 64 + + + 10 + + + 8 + + + Horizontal + + + Below + + + 8 + + + Frequency domain fundamental refinement: +Mean of the fundamental relative frequencies of the harmonics. +Choose the number of harmonics to use. + + + Frequency domain fundamental refinement: +Mean of the fundamental relative frequencies of the harmonics. +Choose the number of harmonics to use. + + + + + ui_spinFreqRefinMaxHarm + + + PlusMinus + + + 64 + + + 1 + + + 8 + + + Frequency domain fundamental refinement: +Mean of the fundamental relative frequencies of the harmonics. +Choose the number of harmonics to use. + + + Frequency domain fundamental refinement: +Mean of the fundamental relative frequencies of the harmonics. +Choose the number of harmonics to use. + + + + + + + + + ui_grpQuantizer + + + Quantizer + + + true + + + + unnamed + + + + layout35_2 + + + + unnamed + + + + textLabel1_3 + + + Latency + + + Quantize the analysis results: ignore frequency jumps, fill holes, ignore too short notes. +Smaller is the following value, faster the tuner respond, but more unstable the computed frequency is. + + + Quantize the analysis results: ignore frequency jumps, fill holes, ignore too short notes. +Smaller is the following value, faster the tuner respond, but more unstable the computed frequency is. + + + + + ui_spinErrorLatency + + + ms + + + PlusMinus + + + 4000 + + + 1 + + + 125 + + + Quantize the analysis results: ignore frequency jumps, fill holes, ignore too short notes. +Smaller is the following value, faster the tuner respond, but more unstable the computed frequency is. + + + Quantize the analysis results: ignore frequency jumps, fill holes, ignore too short notes. +Smaller is the following value, faster the tuner respond, but more unstable the computed frequency is. + + + + + + + + + spacer8 + + + Vertical + + + Expanding + + + + 20 + 40 + + + + + + + + + layout54 + + + + unnamed + + + + ui_btnRestoreFactorySettings + + + Restore factory settings + + + Restore all settings as you just installed the program (need a program restart). + + + Restore all settings as you just installed the program (need a program restart). + + + + + spacer3 + + + Horizontal + + + Expanding + + + + 40 + 20 + + + + + + buttonOk + + + &OK + + + + + + true + + + true + + + Use theses settings and exist configure panel (but don't save the settings !) + + + Use theses settings and exist configure panel (but don't save the settings !) + + + + + buttonCancel + + + &Cancel + + + + + + true + + + + + + + + + 89504e470d0a1a0a0000000d4948445200000020000000200806000000737a7af400000995494441545885ad97596c5cd519c77f779fb9b379c64eec388ee36c640f2610b134850402626d4b6969a144290f541404550b0814aaee955a15fa50412b01a29b0ab4f481250d2941ec04502981e090385e13db33f678167be6de3b73f73e8c1d2089d33ef493cecbe8fb9fffef7cf79c39df11f8bf85005d9f5f2f6fbae946ad65f15a521d097bfce3a2d7f7ea5b7cf0b7bf624e66e750cd117254a4fdac8548728642df18d55c616e6f19f99a07ee3bf3fa3b7fd8de2444ec3ad80e982ee4a67d72bd6f1c0b76edbc93a36f3f7ba2543ae5842b2e5fb3f8b63f3fb6fc2b3b7fdd7cc1f6db84b36edc61e9adcbc9f70e52af9c04227df1d7f7debef33bbfd8b94d90a3b186b922434c81942c12e8eda9e9f96baf6668df47988523a7075876e98a1d0f3fbfe7c73b169d2b6ba2a22992d8d2948cd3b9f99ca9d4ca4bc3432fbc8c579f3c9edfb565ed967b1efac36fb6895a93047d0e4c5980089208b2089140c40834d50a59c591977601d559b978a27fe735b7dffded2d6a57b302b206f11864e2b0ba0916afdd7206ebbff43d409dcd57baafbb6ed54229d9ebc3be1a580ee83ae8118869108f422621b0281621da71d646324b2efeb4df6701d4a4debaf282adaf8ec08b63200890883600dad2b03cad12ef3cfb42a06b569298b7e8ac6209fe7100f60f43a5069a0651ada14dc720adc3fc98422a9684746737a0cceae5130aa03a76a81f3a0a4d4988e9d0ac8312858a00665420a6289a811083b0b182d08d964d90f3904a423c0eaa0ac9284474a85b2039505240174310a4f84c05dd932be054a74b477b3eb46ca8996019e0d441f04109c077ead8d903a31056662576a5305c77c0b11bc3ae3586ef8018822a801282e0d904b532181313ccd29fbc07c230fbc2af1e193e6685d31530ca305580fc380c1f7338b87f9f3f75e0f91780e327c1e8d9b5bb3c6553af43cd6a80db33f046056a0618559fe97291e9dc91290a03ef03f6acfea4531016fa7b27c7fa2b466ce566cb89a8b90983fe23831cd8f71c43bb7e9e0bf2477e031c3e2e28f40fd633cb37c5dabb97cb3e841e042e040e3835a84c058c8e8cd33bd44beef5479ea638f814509e130020183ff86ef9bdbfefcd1e7e23dde41d5d13cdbe863ab89bf2508fe8fac193c0f0a7d3eda1b7df998eccdbea44da5a034fc0adf958864ba95865786494de818f197ded91bd41ef8b0f00bd803f2b3e71131e2f0456e15f41efde7b979e216dddb0a1bb79585f456e74346ee5726b80573e935d9d1848bef9d3bd2b3a83f5fb8f26b1c5042221ae59c6c91d2c9b079e7d9adc478f020701e7d3d2b9006663f050dff08b9bcebff0864c8b4d737333b95c6ef5a912972c6cedb865a3ceb37bfe496ecae2c8e0310a6343c8b6f12853530f01634070a2eebf0130d0dff744213f71831e8bd3924923c65b2e0c575d792fb1160803290c832a134385d68ee43a49d3492762441589a10339d211319fafd82f022373cd7f7a8096335adc6597ae399433fc2dddf3a54ca6093d9658df76d53dbf88af58073ef82114c7b2b4571fa3661a78418855b7a99a353445fec0b6ed23a7b3383540bc3d215f7cef1d4bb77df38ec59dc9b6da0bbfc4770c5adb1612f1df2639dd4367621d6100a108a9628905b28e59ab138621939393388e83d4b9a9d52f058ba98ccc5981934fc1daaf6eecbaf3e967b6df7cd9372e5ea3c55b533055f51046de67e1c2760e7df42156a499e4da2d08b284a442fdd801ce6b36b1eb75b2d91c873e3e88ebf9442ebaabcd3aff8eebbcc057c8f5bc47e8bba7af40f78ecbb67dffd127efba5cc9482af41c856c19269bcec42e3d41bdfc0178362a2287fbf2f8924add87c8e18f69ea4a712c57c1344d26c6b33475aea3b57319cd2d67a606e73ff0937cfb9917b2e707dfc22a0d9d1a60d5b5e75efda3479f78f81a25531161ef10bcd90fb92244e41423c9cdbcb3ef49321bae27b27233e9549d585c40d32304932eb22451abd529954a985583255dab696a6b454a802e2739f2b91ddb46a3a96778e6bb5fc32c1cfe2c40a233b5eed6077ffbe0154a3322bc3e0abbdfb3181eae90897878ba4aebd66b597ac965c4b490443a4532a9a328603b3e95430aa2ac50abd598181f271444325dab496652086ae34e581544f1d75fbe2167e41f67d77d5fc677c78f0328dbeebeedd62f2cd91853614f0e7a4740137c962d5249679a89c714a21a8852024902510049005104df36d13c0b4952a8542ae472595a167490ec5a4932a9e1d3b8ccc2406299ad535d7bd5f9c6c0ebf7d0f3ecdd4028a2cf8b2edd7cfdf69638bc9c8783c3306540269da07d41865854411621084008411620aa80a6802f40253f41c78c51b158a43a3dc5fce5ebf0921d38a2422034aee7a80a695d65412286b0fa8a1b91d40d8d0ab4ae5aac45524bf6ee073700db070410a54643228b8dd56a32a80a984ec8d06440d980ba2f61f45b8cbdb487d75c8ba363e364d229c2f967f3ca4187707814bb36cda6ae142b1675509304d28a889e6a6b3353ed67531afe5026f4e5baed087dd9088ad230d11488680d0899c69d5e3643c6a7a1660bc4448926190409cc8e95ec6fba9cfc9bbfa7599358bbf5eb14339d2c9b07d1580d3c91b6a48614804c808a4b8400535232802c933f3c522d8d8d6612c965028d120702845263d82ef4e5434cc32321b8244517a3e63215f8a89a88ae8b6cbdf916f4edd7a1ba06482a7ab28578b20942f05cb04c30aa10ba359c5a15cf2c3818852c10ca58a5e9d23b7f7caa79c14fef9703015790910077a6ec23458bbe8151daf4907a54434a4659d41923938ca0472422aa0021f8611cdf87c0833000cb02d705cf06bb0ea661512a1598284e62f4befc2eb5720f8d6d0468c979a99b1edfbdb8fbca7312324454958826115541967cc2d025129189eb3211b5b13760e65533db5c85108410ce40781eb80e38751fd3a832519c64283bc6f8fee7fa9db77eb713afbe1b301b7fc5be6dd9fdafbf69c6dace93335ded5218200401a12f00328a2c238622810b8ed398d89b19ae3df35bfd937eb066069886c3d47495f1c93c83d931fa063e0a26dff9d3abfebffff2333cfb15a0727c11c743892e9436de707ffadced3b5ada97eba9884e4c95892832aa2c218b029224228a202020101286214110e27b1eb6eb50b3eb58759b8a65502ae628e7fa2bb58137f68703af3ec774762f300058b396a77a1bcac4e69d27acdc7693befca24b12edab96eaf1b418d1a28d4a8822221012e2fb1e9e6363d70d6ab52a75a3ecd64ad949bb746cc22f0d1f23dfdb4371e05dbcfa21601c303ff5d1e604f80444103b49b475d3bca49b68ba1549d591150d4114f15c1fdfb171eb2656a98c55ca6316c6708c09c2a008e4018346ffefcd65723a801343a1f1a090f9a49df76786738249c8ff18ff019be35d187a77ecac0000000049454e44ae426082 + + + + + buttonOk + clicked() + ConfigForm + accept() + + + buttonCancel + clicked() + ConfigForm + reject() + + + ui_chkALSASamplingRateMax + toggled(bool) + ui_spinALSASamplingRate + setDisabled(bool) + + + ui_chkJACKAutoConnect + toggled(bool) + ui_txtJACKSourcePort + setEnabled(bool) + + + ui_chkPortAudioSamplingRateMax + toggled(bool) + ui_spinPortAudioSamplingRate + setDisabled(bool) + + + ui_chkOSSSamplingRateMax + toggled(bool) + ui_spinOSSSamplingRate + setDisabled(bool) + + + ui_sldCombedFFTAudibilityRatio + valueChanged(int) + ui_spinCombedFFTAudibilityRatio + setValue(int) + + + ui_spinCombedFFTAudibilityRatio + valueChanged(int) + ui_sldCombedFFTAudibilityRatio + setValue(int) + + + ui_sldVolumeTreshold + valueChanged(int) + ui_spinVolumeTreshold + setValue(int) + + + ui_spinVolumeTreshold + valueChanged(int) + ui_sldVolumeTreshold + setValue(int) + + + ui_chkAlgoUseSubHarmTresh + toggled(bool) + ui_spinCombedFFTAudibilityRatio + setEnabled(bool) + + + ui_chkAlgoUseSubHarmTresh + toggled(bool) + ui_sldCombedFFTAudibilityRatio + setEnabled(bool) + + + ui_sldFreqRefinMaxHarm + valueChanged(int) + ui_spinFreqRefinMaxHarm + setValue(int) + + + ui_spinFreqRefinMaxHarm + valueChanged(int) + ui_sldFreqRefinMaxHarm + setValue(int) + + + ui_sldWindowSizeFactor + valueChanged(int) + ui_spinWindowSizeFactor + setValue(int) + + + ui_spinWindowSizeFactor + valueChanged(int) + ui_sldWindowSizeFactor + setValue(int) + + + ui_sldTimeRefinMaxPeriod + valueChanged(int) + ui_spinTimeRefinMaxPeriod + setValue(int) + + + ui_spinTimeRefinMaxPeriod + valueChanged(int) + ui_sldTimeRefinMaxPeriod + setValue(int) + + + + diff --git a/ui/InstrumentTunerForm.ui b/ui/InstrumentTunerForm.ui new file mode 100644 index 0000000..0bbf5de --- /dev/null +++ b/ui/InstrumentTunerForm.ui @@ -0,0 +1,707 @@ + +InstrumentTunerForm + + + InstrumentTunerForm + + + + 0 + 0 + 532 + 448 + + + + Free Music Instrument Tuner + + + image0 + + + + unnamed + + + + layout19 + + + + unnamed + + + + layout18 + + + + unnamed + + + + ui_graphLayout + + + + unnamed + + + + + + layout17 + + + + unnamed + + + + ui_btnKeepErrorHistory + + + + 1 + 5 + 0 + 0 + + + + + 20 + 32767 + + + + NoFocus + + + K +e +e +p + + + K + + + true + + + false + + + Keep errors (k) + + + Do not clear graphs between notes (for error and volume graphs only) + + + + + layout16 + + + + unnamed + + + + ui_errorLayout + + + + unnamed + + + + + + ui_volumeLayout + + + + unnamed + + + + + + + + + + ui_sampleLayout + + + + unnamed + + + + + + ui_formantsLayout + + + + unnamed + + + + + + ui_FT + + + + unnamed + + + + + + + + ui_rightLayout + + + + unnamed + + + + ui_pgbVolume + + + + 1 + 0 + 0 + 0 + + + + + 32767 + 14 + + + + false + + + Volume with dB scale + + + Volume with dB scale. +Computed from in the frequency domaine, from the max bin. +The maximum is reached when the signal energy is maximal NOT when the sound saturate in time domaine. + + + + + ui_lblSoundStability + + + + 1 + 5 + 0 + 0 + + + + + 300 + 0 + + + + + 165 + 165 + 165 + + + + + 11 + + + + Note Stability + + + WordBreak|AlignCenter + + + Red if capture system is not working<br/> +Grey if capture system is ok, but there is no sound enough<br/> +Orange if analysis conditions are bad (like saturation)<br/> +Green if a note is beeing catured and conditions are ok + + + Red if capture system is not working<br/> +Grey if capture system is ok, but there is no sound enough<br/> +Orange if analysis conditions are bad (like saturation)<br/> +Green if a note is beeing catured and conditions are ok + + + + + layout16 + + + + unnamed + + + + layout27 + + + + unnamed + + + + textLabel8 + + + + 10 + 1 + + + + Tuning Frequency + + + AlignVCenter|AlignRight + + + + + ui_spinAFreq + + + + 100 + 32767 + + + + + 14 + 1 + + + + NoFocus + + + Hz + + + PlusMinus + + + 880 + + + 220 + + + 1 + + + 440 + + + the tuning frequency: A4 frequency + + + the tuning frequency: A4 frequency + + + + + + + layout27_2 + + + + unnamed + + + + ui_lblA3Offset + + + Offset + + + AlignVCenter|AlignRight + + + Offset in cents on the tuning frequency + + + + + ui_spinA3Offset + + + + 100 + 32767 + + + + NoFocus + + + cents + + + PlusMinus + + + 50 + + + -50 + + + 1 + + + 0 + + + Offset in cents on the tuning frequency + + + Offset in cents from the tuning frequency + + + + + + + + + ui_dialTuneLayout + + + + unnamed + + + + + + ui_txtFreq + + + + 0 + 25 + + + + NoFrame + + + Plain + + + Flat + + + The frequency of the current played note + + + The frequency of the current played note + + + + + layout69 + + + + unnamed + + + + ui_txtNote + + + + 28 + + + + AlignCenter + + + The recognized note + + + The recognized note + + + + + ui_txtNoteFreq + + + + 1 + 1 + 0 + 0 + + + + + 32767 + 25 + + + + NoFrame + + + Plain + + + Flat + + + The frequency of the note as it should be + + + The frequency of the note as it should be + + + + + + + + + + + ui_microtonalLayout + + + NoFocus + + + + unnamed + + + + + + + + MenuBarEditor + + + + + + ui_tbViews + + + Views + + + + textLabel7 + + + Views + + + + + + ui_tbButtons + + + Settings + + + + + + + + + + + helpAboutAction + + + image1 + + + About + + + &About + + + About FMIT + + + Invoke the about box + + + + + + + + pauseAction + + + true + + + image2 + + + Pause + + + Put in pause state to use less processor has possible. + + + Put in pause state, stop the capture, the sound analysis and all views + + + Space + + + + + configAction + + + image3 + + + Configure + + + + + saveSettingsAction + + + image4 + + + Save settings + + + Save configure panel settings, views settings and window size. + + + Save configure panel settings, views settings and window size. + + + Ctrl+S + + + + + + 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000003a849444154388d8d954b4c5c6514c77f77e672a7cccb99f0b2a4093666061b4402098f020b024436920848a37521246a8ca6abc69ad865830b13a376d918178d6da262ac93b40b174dc0486b902812093e182c42a08333cc1d66eedcd7dccf45d154321739c9b7f94efebffccf39dfc3cbd1e224300a3c0b540019403fa2b66c34023f4b92743f1289e8d5d5d54296e51c701f78ed30a174486e08b8168bc5aa3a3a3aa8acac440881aeebacacacb0b8b8b867dbf697c04be5c45e176818f8baa5a5a5aebdbd9d70384c3018445114244922140a1189447cebebeb27800560ed20c0e302be188d461f6d6c6ca4a2a2029fcf472814c2eff7a3280ab22c138d46696868a8022e9703b881fb6b6b6bbd8ee3f0cf324d13dbb6711c07210442086a6a6a00aaca552ebb806bfc7e3f9665619a269aa6fd0bd5751dd334b12c0b4551e0c19c4e00f78e0236f2f93cbaaee3f57a711c075996711c07cbb228168b188641369b0510c0c6511dcf673299587d7dbd2484c0344dbc5e2f42086cdbc6300c0cc3209d4e03fc05948e0a9e4aa7d3438140b13a972b619a261e8f072104a55209dbb6515595542a95065e2d07701bde73f1f823e1975fa9a2a5354ca150209fcf532814d0348d6c36cbeaea6ad6719c6bc05c3940b90b720c48be79a1ebb8659de2cc591feb6b5916e677b879738dcdcd744e55d5027001f8c4c55859c7afd7d55546b482cde6460ecbb2f1780a24d7922c2f27b755551d011e03be05de57142501f41f841cec7105707e64e464e5ae6ad371da43c92cb2bd95e3ee9d94037c01dc06a6babbbbcf353737878410eceeee3e3d3d3d7d4308f1bc5b05670201397fe3ab2191dc784b2c2cbe213efd7c58bc70f671c18387a71668eceaeaca8d8d8d99c06fc07bfdfdfdf9dedede3de0b45b2b8ecbb2a7e2d453714c5323bbbbcbf696ca777777c4bed394cfe7fbaca7a727944824fe049e00cecfccccdc6a6d6d0d0297dcc0095535b3b712cbe4559d9d548eefe7b748267319e06de099c1c1c1d8ececec9e655993ec9fdf52a974a5582c5ab22cc7dcc0f700b1f4539ed48eced4a53bcef5ebbfa781abc01fc160f0723c1eaf9c9f9fff05987d48f76b2a9532eaebeb0340c0adcfef4e4e4e0a45514ac03b40dbfefed5898909b3a9a94905da0f68a4b6b6b64c6767e77ffa7c309e1c1e1e2ef4f5f569c037c045e087f1f171636060a0085c29279224e9b6a228ab40145c7e1059963f1a1d1d7d311a8d1ed3340dbfdfcfd2d292363737f73170cecd11e007b443f200744a92f4612814fa11f80018f83fc1c3f1373a379a4ec5018c7f0000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000020000000200806000000737a7af4000003da494441545885c5d64b6cd4451c07f0cff6012d94d2424593261c50ab520ebe2e2884c407d10389a25e0807133918138909c4c478f080241ed498e8cd8b891c247a2162627cc041c10858340a288f02a51468e9634bed6eb7dd8e87f963d7cd1676db127fc964e63ff3fbcff73bbff93d86ff5952e52ab6d1329fe726792ab0040b3196e7c7c097273988c93925d0ce9214cf4eb239c5da14d54db8132d388c814437cfe941b65ee65b4c544aa414f82bed8cae22ac267c4ce823848296271c216c21b4c79659ce3b689e2df887ab080f11de270c150117b70c6127e17ec22a422b3bb0a21cacea52938dacac65fd7bd884ba9b6c52838731843f51cbca341d792e215b31011c6fe0e51eea36faafa35c4e8016a0aa60be162318c425162ca46e804e5c40a8884096b1069a0759d38645a2c3edc577f819fbf144d17fc3095a3aee71f70487b3f1b3bf2202e2e90e2d64d33e9af6c65319c5197488a67e41b4c475398b53a2c52e919ae4d470345817f2a5706aa62330c0700d2f35b27d9cc7fa9897c2049dd5ac785c0cc542e949fa86a4afe58e78168de8ab8800f4b2bf97ce061e58c6c6514e34b17931de28d21dc2b1645c9004c6927e8169e48604c4cc76768473231cbc9b1d35dcbb13b71729ee452e195f49fa1cdd05fbcc88c07509edbc9662cb36ac2b5afc15c793f184781581813e8e26d323332690a4e34fb0612b5e2c5a1fc4d705dfbf8bce3accae5cbc828c18093322904a717429cbb76143d1620f764530705eb4799e731762c4c209b3b88210a87f134f162d9cc667e2698919e73802997e3e8a4383a682634604047acf735be1dc3738807131b87fc3454c92eee5adab315d04538131ad54dd4c21d0d35934d79180ff8d1f12f03c5d17793d01cfe388189d3794722cd05d4c609178effdb886113ebdc017f978d7391c2a07bc5c025d6745773e2adaf462b27bf394ce58027e597485d1527bcd94c099513c83bbc4d34393185b35a88fa9e10365dc79b14c5b8cae4b3f27ea68ccd0d645fd8468f63ff0177291e057e95808cfcd39014ca6c9a4d9574fb8465b2f5559422ae689c568ce91ce455e99b92600dd79c6330c35f3f483d46d27b51629aafa6869e091714e66a36166ff282d25f7f1f9ab25de84ef12d610ee899978b50a9efb37cd0345caeb9f2f31ff28da514b7b1dcb4df9eadc11488a52636b89b5c5625404520df111d234e7048e3110b8baa7c4da11ff067e7e384643ae84daec0888bbeed92d96dfac58e4bf17bdee34c6399094e0b2b22015380b2ca171193fd5b2b21d4b1322e7d1136bc6f62cbfe0e42d21008b58dac2dbf359574d6b9e2b393abad99d8bc04955be450412a942abe87ff3c4e4d8eb062f9fe9e41fd23a6b537c367d7e0000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000020000000200806000000737a7af400000355494441545885ed95bf8b245510c73ff576ef9673513ce51031528343c54441840531f1078808c21988469a897f849709626668666e20181d265e721ca8c86a7681b0bab7bbb733b3b7e3ce74f77bef6bd06f7a7aa65fbbb326265b490fddafea7daaea5b35706ee7f63f9be55e3eb475e965113f02ae60ba62d80311a2611143483bc7378b7797fd1edcdaf812e3a5e4f728720e8b11998028b83ebe597cd5f659cf01083d87f1f1635b8ff0fe9b1fb27dfc0bbfeefe44b51b18dc3801e3723e1d7bc55de2c5b73f7d83d7aebec517bf5f677a3065786342f197c76063d9c5f554c6033c75f5493e7bf5739e79e259dc86e1366d46e8f36ed19b83779ebfc67b4f7f40c013bd9a5b8cae5f16c0881ea0f0050007c51e12680930634111ca58b03fbddbc583b012404c1714650298eed762517f26e94b50803296ec4ff7ea579afbe52a976f81ab0f966509c0bde93e6a0512d6c9249947a90293dde6fe39b8adda825481aa2028302c0f5968406a51c62f10b454817609ba15c84e81615ed42d382a8744d543d83a910588102c42194a867190001203606e450dcc48abaaa48a558aa3cef72e786a5d28880af3b70d60b772598090328c3e320d933acca298f21ab0fa7de94b94d296046a20cea60145982480b698e47aa640ad0a1067b13a715700b00420a6e16416bc21e81b434bd3515445ad1b2d1d50777af2220cbe947310e0c7bd1f9af45ae96401a45860c69fe31d76aa3f1aee4684993d90ff2f70ee084001beb9f3f58cfe540dc8d9c804db073f1337038acde2a801566d81e28551fd14637fdcdcfa6f0ba50e664380a22c17a66656b8b0ea221a1f8d47004947096a5e80d8db028dd2b3615eb0b555f7c06f94c044a11dc15abff29b9054012d5fa3997857ac40b2915a156894545b1ec0e2b07ecc2b60d616a13f1b40a7608d08f37f46924bdab185e30ddfaa22ac4f6b11a015cd7a169108a905e9705cfcee33d3d30f201ba955f6f63cf789f022eb35406c79b556b8e90c1a1036523a2e2f08a76bc0aa499a1e212fc2c9f21e3803804323a2f023cf74a7aa83c45926f94534b8c53110e4a138a8087f07dc866bc6d2adba09d325df9677e3e383ef275b6ed31e0ef775a13a0cf741db12b77bdc24f1c9e0bbf1ebeeb27b616ddd36cb7b11857807d9b65d2c0efbee3bddaeb1f6df9dcfaddffe01aa4c03e348a660d30000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000020000000200806000000737a7af4000007ac494441545885bd977b5094e715c67fdf5ed80bcbc58244ebba062163c612f1026219a5418c1a9b042d166b1d1d2b4e641231a6a9edd84b18afe9d4a4b15334d58a33d556ace365466aa396d838801720d1142122acc00a0bba1a606fc0eef2bdfde3db8d94803599a6cfccceb73bdf7bdef39cf39ef39c77d58c8cc98000bc8f58f3b5e13bc003c001acf88a7be8810dc0d42f6b980938cd66b3c8cccc142859781f98f098f661c02b409b4aa512400510fbb8ce9f059c168b459497978bfafa7a515858284c269300dcc046403582ad167819b045444488fcfc7c51525222341a8d00b600eaffe67c0ed0131f1f2f6a6a6ac47d874358ad56515d5d2d4e9e3c29a64f9f1ecac6552071909d065803341b8d46919797274a4b4b45494989282d2d150b172e14402790349cd35034b1c00c20222f2f0f8bc582c7ebc5ed76d3dbdb4b9856cbf66ddb58bf7e3d9224cd04160ddaa342afd717af5ab5eac9a3478f3277ee5c7c3e1f9191917477775359590960051200c34804a4e0a27feedfbf9fa6a6265c2e171eb71b8fdb8dcbeda6adbd9decec6c8c46238071d01ee6356bd6b064c912dc6e37b1b1b1188d465c2e171b366cc0e5729d027e8dd24d1a861c61e88703b80bfcc966b3f5151717d3d3d383dbe3c1ed76e3f57a319bcde8743a0c06034322510b21906599d1a34703e0f57a29282890bbbabaf6020781de60062e01df1f8e00401d4aebfdf5f0e1c3d86c367a7b7bf1783c8c19330693c904805eaf1f9a018d2ccb082100080402343737e3703802c0a74036f097888888f792939393809f024f0d47c003dc064efb7cbeceddbb7763341a191d17474444c4e78b121212005603538247a715427c4e40abd53263c60cd2d3d3c380df272626aeddbc7973dca953a7d8ba752b2a956a3a9015f23db435ba8171c067ededed19e1e1e178bd5e6eddba45434303494949ac58b182caca4aa3dd6eff01b04492a484458b163169d2249c4e277abd9ebebe3ed2d2d2c8caca62f5ead5444747e3f7fbd16ab534343460b7dbc3800f01a7c417311e45bdb601c9835f646464b06fdf3e743a1dcb972fa7aaaa8a4d9b3691939303404b4b0b515151a8d56afafafaf07abd180c06743a1db22c73eedc398a8a8a0804023750c4aa7c3871700271400df077e02c500674b4b6b64eb55aadd2fcf9f3c9cdcda5aaaa8a3367ce909a9a4a4c4c0c269389b6b636244942afd763341a916519954ac5ce9d3b3976ec18b22c9f01de0966ffce48ea64031a518aa80e45482c40aad5da14d6d6d6cebc79f3c8c9c9e1f2e5cb141717d3d9d9495959197ebf9f2953a6a0d16800b0dbed141414505f5fdf07bc0b9c005cc0151e73d08503ef01e28db51962dbcff38446ad122b57ae1456ab5558ad56919191212c1ab598a0550b404447478bc58b178b65cb9685a4b8155807bc8022789ac7710c300b684c9f3e413cb8fe96b8db7c5594162d15af2ff8a600447e7ebeb0de6a1055392f09db9444e1dcbf476c7deac99064cbc1e707400ef05d207ea883918e400b6c55a93878e8eda5b1efee2ac418398ef01b3bd0593b304a6aee7bfc1c3b5bc1e4ba7f21ae5523f9fb89d458497bc982c56ce0ecf57b921054a29cb71ba8023a1e87c064e0fdd929f1b91f9ddea89af5dc2b486d27e0d211680f10add7d2e397d97bc981d3eb676d5f0f2061c98cc59c1b83e1996f90ba740be3f59f70fa62a705e803f6a0e8cc1730988004bcae5673ecd0ae9cf1bf7deb2784478d839a2d50db0a1ea563bb8d7a9edb5d4beb5d773fa099aad3f2845e435a6e3c5217a0f182d4c4b4f9bf22d257cdf92bf7a6a148f73f1e452012383b3b257edd47a75fd3cc5ab001a9fd245c3d0e6d03204b08351cb7ab49d97441ee76f55f04ce0193ca7a7dfad5b3e3484c8c5242e802d44e906c7cfbc53709dcafa0fcda8374947ab83812813529cf985fad38f402175a665259dd44b4348a516db500788c3ab28a1a79e744ed1d603b703e687701482bb1f61856658d215aad51487403ea2ed0743237a71047f305aaebba3351daeff26002a159f0a3577f988c3ad0856f40457c7c3cda7b9f225470be3b0c535e995c51db7e1c780db809dc00fe18fcfecb0119e7d33faba663c0f770e7db32b4d441e7718afef067563c6f06a5205f1e4c2024c557f37253661ef8b18140f7047c2d6e541a174b0f3471e64aab0dd88d224c4ee013a067d0d1a5034f033b220c6ae3eddfa4128b36f85a40a20a12e620c73c4ff6e21cfe567e5706560247fea306aed5d917684c8944c5a869b43b99fcc607030d777a8e03bb50ee0b8dc03594aa0ea11f65841b807a5f40cc3958d1a159376f2c7a544a7c5d02b8831497ccf79e1dc5c54b7592ed6e7f36500bdc0c65400dbc1d4cb104b404a3b606a3be1e7c8e8418200d9806bc39365a1b766b472a26f96193b9c7091e74f8686eee63c99e7aba7b033e60d2d069380345adfa5194ac31f8118f701e421c900acc047e31f1099dbaae3005fd800a01486a604059b8f1c46d7ef7613bc0f8e1c6b11145097d2857a92f83b1c12066039bbe353e5cf5f1e669088340e77e78f749dd758d1a9b5b0674c329a11f2503812fe91c14c9f506c93b1c4e7fdad99b5dd2344b3866a30eff8060fbb93b1ca971803265f77c051f8f8509c08bc05e4084a9259134365c4c8cd58706553f432e3b5f072606491c003ee3e184bc0e2c0e2d1aae06fe974840c98601d0a108f5c73cd491ff1b2446f84ff96f135d0792420819e00000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000020000000200806000000737a7af4000007b3494441545885c5977b70547715c73f77efeede7d27d96c364931c926c01228ef37a17690f22c030575acb5b68c4ec7ca63044a5b2c9621b54251463b7580b636ce88f58180222a96b1e55532c32b2049790784244d52369b6477b3cffbd8eb1f812424883c3a7afefbfdeef97dcff79cdf39e7772efc9f457850007f8167143001b876a921b8f77f46c05fe0b101af03cb00f1c6f6924b0dc12df78263b84fe3338033c00bfd8b33c48d1bbe88d76b05d8e02ff07ce15eb08cf768381bf819f06cffc1c3e9d74fe2276b4b10c5ce40bef4fdc34e2d9dde0acc04d4bbc114ffbb4a97f1a780bf0165cf2c5fc3936b363178ec74ae9ed886afc885afc8c5a54b6dd437448b25b32877c4e5cacf8580bfc0e3c9ceb06d03563b5c99f6f5bfdf87afec717404048b83ab97357cd9ff429244460ccf61d75fae802e8c5114ed2359d59a1e8880bfc03305f810183b79d67c5eaed88321c37b8b4eff017e7eb7790b93277a70384c98cc068e1fbf6e914c6249289adc0324ee9980bfc0236667d8ca815f02ae556fbdcf23cfac4013ba53c62080df0543b28cc84a0675570e5358e8e2e121d91caa6c241c924b0c06a12d9e544e00da5d13f01778f2e9bceb677dfe21c2ba1d95b84a86d1b3629d2618ed861c4be77a807f105bb7ee67c4d034168b4869a99bdd7fbd82d9681c164dc847b5b45e775704fc059ec1c00160f8538b57f1f46bef9236dbbabe0b80cf0ec33241ea457dc4e8896c7eab82b2491ebc3956dadb939cbfd0eeb048a6cc702c5905b4df8e40571ff017782603958240d1f21fbfc3e4852fa2f5681316114667c3405767f87b8aaeebecdcf65b6cf6eeca5bb268049e6c2b92497c22cb699d0b64fd4702fe02cf02e0a31c8fc5fdab8a195c3cfc0b4c5aaa4b29cf0a933ce036f705686b0db26cd13729ceaf64f1778676eddbed26562e1f85200806b7cbfa3d83208c034cbdcf8bfe02cf18e0c30c97d9f4fada498c1c99c3f8d12e36adff35a3a77e99d24c91fecebe5e03541d3bc24fd73fcf8aa55e06f9dd7dbe97946470f66c2b8d8db12c8bd9a447e2a93ae096d23400f34037bcbd792a27ab03e87a27fb65cfb97877e91c9c5ab40fb0aeebbcb3e94d0efcfd07ac2b1f4a8ea73b4f76fef132affde858d77ad54b63902411ab64fcbad3268d068a6f8980db651d2008c2bccc0c89af7d7520ffd8574fe920372e974451a1c0c68dbb9839673ea22876857cf5cae79938aa8e27e61663b8111a5d879f6faee65a6020f50d29321c098a7d2e9c4e33a268e044d575d12a998adb3b12a78100900210db23895086c3f2d899b3addee98f15928c6b385d66ec76135eaf8ddc9c2415151f3375fa6c4e1e3fca9b1bbecbf2255e060ec8ecf24296355e2dafc2682f233fbf1f46b3c4ce1d47983da31f56ab91a10f6773f0e0a784c3b25747af4ea4548006202d02f9aaa635db24f3f49a4f82c657968e65fbae8b8c1cd9d9f172736d386d41de78633bd1b63dac5c3604bbbd3b97c291142fbc5c85cf3f03c96ae5d4a99304020174c14cf5e96bcc9c5e88c120909929b1ef40035a5a3f1f4dc80d800d681681a8ac689916b329198baa633d6e8905d3fa5179aa055f910b80bc5c3b651324268ecf4310bab3b1b129ca8bafd4307cdce3a4810be7cf110a8591651955d368688c91e316686f4ff1c375c74824553d9a947727524a007002919b6839c0849287dcebcc2661f807ef4fe3d2b50843c715e270f4a91c00ce9e6f6375790d658fce46d37582810075f575a88a8aaa6aa89a8aa66aa462adc88938e9344413a92d4dc18e0f7ac07c76b39fc50114556bb65ba49935e743c665dfc863c7de46860df3f6317ee87023e5eb2fe0f566138f050847649a9a9a482692c88a82acc828b242221a21158fa1ebba1e4f2aef35053bf6f482eae8d950db6455335bccc6747b4819979f6f63d6783367ea74f2f3ec5d4a75f51156ae3e8dcd99c9e26f7b99352d9bed7f3a473ca1222b0a8aaca0a46492b13069390ee8a9482cb5b1b9ad635f2fe371e074efc7a8a5232ec7331c96e11f1f0be62d9c9b45536388dcc25c44b1b32d67664804ae47a8bd9ae2ccd9169efc4a09037c16f6ee6f44553452a9244a3c0c6995745a0f06c3b135ad91784d2f3b61e02890ec4d4003da65550b39add28c9ada9469c57c99dd8752940ee9be8a09e3f33874f832f5cd02572e5de75b0b079356121c3dd18c2ec710d0d1b4746d736bc7ab1d09b9f750520f9c0214b8fd3c9054542d24998c96b6507a4271919d2f9506a969caecba0a8341e0d1471e62f79f2f72ee6a8a8e509443871a08b7c7110059d10e3404c2eb53ca2d6d54014e035700fde6e69dc6f29125f9591526a361ccd1b7753eb9eee1e0852ce6cd1b44b1afb33c6b6bdb79fab9fd68b28a41d0d1755d8925e5f77a653a401bf04f6e331ddd69246b51b474d06195e6545f359b97cc8e30c5574f24d8ca1f763753f79946b6dbc291234dc46232e9b41e688dc4cb5b42b1633d3074a016a8be11813e722702baac6af566a3680a868431bb2a0de684e0a2c8ab3279e2605a2256162ddf4f34aaa0a85a55634b646d342137f7381f014ed0ebf5eb2d77f367942799c429de2cc7028bd9384f10040b80280aa86a5a4fa4d4df7cda12de41f7bddef4bab6c7de031100f003032593e874bb6c932c66e33841109c9158725b301cafeea117a633dc91bbc4bda77f432be0030ae93bd9a4e9f4f83277e1f5fd12b82922e0057201079dc9750ee8b80f2cfe0d8fa11dfe311eba210000000049454e44ae426082 + + + + + helpAboutAction + activated() + InstrumentTunerForm + helpAbout() + + + configAction + activated() + InstrumentTunerForm + configure() + + + pauseAction + toggled(bool) + InstrumentTunerForm + pause(bool) + + + ui_spinAFreq + valueChanged(int) + InstrumentTunerForm + ui_spinAFreq_valueChanged(int) + + + saveSettingsAction + activated() + InstrumentTunerForm + saveSettings() + + + ui_spinA3Offset + valueChanged(int) + InstrumentTunerForm + ui_spinAOffset_valueChanged(int) + + + + helpAbout() + refresh() + refresh_views() + ui_spinLatency_destroyed( QObject * ) + ui_spinAFreq_valueChanged( int ) + configure() + pause(bool on) + configure_ok() + saveSettings() + errorRaised(const QString&) + samplingRateChanged(int) + restoreFactorySettings() + noteRangeChanged() + transportChanged(const QString& name) + autoDetectTransport() + update_views() + tuningFreqChanged(float) + ui_spinAOffset_valueChanged( int ) + selectTransport(const QString & string) + noteStarted(double,double) + noteFinished(double,double) + + + diff --git a/ui/Makefile.am b/ui/Makefile.am new file mode 100644 index 0000000..29b757a --- /dev/null +++ b/ui/Makefile.am @@ -0,0 +1,12 @@ +BUILT_SOURCES = ConfigForm.h ConfigForm.cpp ConfigForm_moc.cpp InstrumentTunerForm.h InstrumentTunerForm.cpp InstrumentTunerForm_moc.cpp +EXTRA_DIST = *.ui +CLEANFILES = *.h *.cpp + +%.h: %.ui + $(QT_UIC) $< > $@ + +%.cpp: %.h %.ui + $(QT_UIC) -impl $^ > $@ + +%_moc.cpp: %.h + $(QT_MOC) $< > $@ diff --git a/ui/Makefile.in b/ui/Makefile.in new file mode 100644 index 0000000..6e6881b --- /dev/null +++ b/ui/Makefile.in @@ -0,0 +1,319 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 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. + +@SET_MAKE@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = ui +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_cxx_exceptions.m4 \ + $(top_srcdir)/m4/ac_cxx_have_complex.m4 \ + $(top_srcdir)/m4/ac_cxx_have_numeric_limits.m4 \ + $(top_srcdir)/m4/ac_cxx_have_sstream.m4 \ + $(top_srcdir)/m4/ac_cxx_have_stl.m4 \ + $(top_srcdir)/m4/ac_cxx_namespaces.m4 \ + $(top_srcdir)/m4/ac_cxx_templates.m4 \ + $(top_srcdir)/m4/bnv_have_qt.m4 \ + $(top_srcdir)/m4/mdl_have_opengl.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GL_CFLAGS = @GL_CFLAGS@ +GL_LIBS = @GL_LIBS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QT_CXXFLAGS = @QT_CXXFLAGS@ +QT_DIR = @QT_DIR@ +QT_LIBS = @QT_LIBS@ +QT_MOC = @QT_MOC@ +QT_UIC = @QT_UIC@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_prefix = @ac_prefix@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +BUILT_SOURCES = ConfigForm.h ConfigForm.cpp ConfigForm_moc.cpp InstrumentTunerForm.h InstrumentTunerForm.cpp InstrumentTunerForm_moc.cpp +EXTRA_DIST = *.ui +CLEANFILES = *.h *.cpp +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu ui/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu ui/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +uninstall-info-am: +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile +installdirs: +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \ + uninstall-info-am + + +%.h: %.ui + $(QT_UIC) $< > $@ + +%.cpp: %.h %.ui + $(QT_UIC) -impl $^ > $@ + +%_moc.cpp: %.h + $(QT_MOC) $< > $@ +# 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: