pax_global_header00006660000000000000000000000064147767510100014522gustar00rootroot0000000000000052 comment=d0522e55483a7c8856b4cc6826514594134e5893 qspeakers-1.8/000077500000000000000000000000001477675101000133705ustar00rootroot00000000000000qspeakers-1.8/.editorconfig000066400000000000000000000002561477675101000160500ustar00rootroot00000000000000root = true [*] end_of_line = lf insert_final_newline = false [*.{vala}] charset = utf-8 indent_style = space indent_size = 4 tab_width = 4 trim_trailing_whitespace = true qspeakers-1.8/.github/000077500000000000000000000000001477675101000147305ustar00rootroot00000000000000qspeakers-1.8/.github/FUNDING.yml000066400000000000000000000001051477675101000165410ustar00rootroot00000000000000liberapay: be1 github: be1 custom: ["https://www.paypal.me/brouits"] qspeakers-1.8/.gitignore000066400000000000000000000011461477675101000153620ustar00rootroot00000000000000build/ # C++ objects and libs *.slo *.lo *.o *.a *.la *.lai *.so *.so.* *.dll *.dylib # Qt-es object_script.*.Release object_script.*.Debug *_plugin_import.cpp /.qmake.cache /.qmake.stash *.pro.user *.pro.user.* *.qbs.user *.qbs.user.* *.moc moc_*.cpp moc_*.h qrc_*.cpp ui_*.h *.qmlc *.jsc Makefile* *build-* *.qm *.prl # Qt unit tests target_wrapper.* # QtCreator *.autosave # QtCreator Qml *.qmlproject.user *.qmlproject.user.* # QtCreator CMake CMakeLists.txt.user* # QtCreator 4.8< compilation database compile_commands.json # QtCreator local machine specific files for imported projects *creator.user* qspeakers-1.8/COPYING000066400000000000000000000013511477675101000144230ustar00rootroot00000000000000 QSpeakers is written by Benoît Rouits. Copyright © 2014 Benoît Rouits 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 3 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, see qspeakers-1.8/INFO000066400000000000000000000025451477675101000140540ustar00rootroot00000000000000- about frequency response: Formulæ are in system.cpp, function response() - about rectangular ports: I deduced the function [1.1-log10(x+1.1)*0.35]*circPortLen where x = L/l, from the analysis of Francis Brooke. https://sites.google.com/site/francisaudio69/ - about multiple instance of the same loudspeaker: Two drivers in series: Re, Le, Sd, Vas and Bl double and the sensitivity is the same as for one driver. Two drivers in parallel: Re and Le are halved, Sd and Vas double (Bl same as for one driver) and the sensitivity increases by 6dB. Qes, Qms and Qts don't change for either combination, remaining same as for one driver. - about Legendre bass-reflex alignment: Fb = 0.3802 * pow(Qts, 1.0657) * Fs Vb = 10.728 * pow(Qts, 2.4186) * Vas (see: https://sites.google.com/site/francisaudio69/5-l-enceinte-acoustique/5-6-comment-calculer-une-enceinte-bass-reflex) - about Bessel bass-refex alignment: Fb = 0.3552 * pow(Qts, 0.9649) * Fs Vb = 8.0707 * pow(Qts, 2.5848) * Vas (see: same site as above) - about the Zbinden M4 alignment: for average baffle: Volume = (2.68 * Qts - 0.45) * Vas Tuning frequency = 0.41 * sqrt(1/(Qts*Qts) + 0.97) * Fs the one above is used in QSpeakers. for infinite baffle or car application: Volume = (2.52 * Qts - 0.35) * Vas Tuning frequency = 0.32 * sqrt(1/(Qts*Qts) + 3.38) * Fs (see: http://www.mzbinden.ch/ventedalignments/index.html) qspeakers-1.8/LICENSE000066400000000000000000001045141477675101000144020ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. 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 them 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 prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. 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. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey 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; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If 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 convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU 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 that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. 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. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 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. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. 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 state 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 3 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, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program 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, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . qspeakers-1.8/README000066400000000000000000000015451477675101000142550ustar00rootroot00000000000000Building QSpeakers: Pre requisites: Install Qt5 (and QtCharts) library. Don't forget to install the development header files too. Compilation: You can use both command-line compilation or QtCreator. See below: In short, for Qt5 on Debian Buster, this should do the trick: $ sudo apt-get install qt5-default qttools5-dev-tools $ cd qspeakers $ qmake -config release && make && sudo make install Using QSpeakers: Start it by your window manager's menu, or /usr/local/bin/qspeakers from a shell. Choose a loudspeaker, or create a new one you want to build an enclosure for. Change the box parameters or click 'Optimize'. Contributing: If you want, you can read TODO and start contribute, or write litterals translations in your own language. Thanks: Thanks to Upacesky for his drawing: https://openclipart.org/detail/202508/ Happy DIY! qspeakers-1.8/README.md000066400000000000000000000027211477675101000146510ustar00rootroot00000000000000# QSpeakers Loudspeaker enclosure designer, open-source, portable, written in c++/Qt, for Linux and some other platforms. Note that stable versions of QSpeakers are officially in Debian GNU/Linux and Ubuntu Linux. ![screenshot](http://brouits.free.fr/qspeakers/qspeakers.png "QSpeakers Main Window") ## Pre-requisites Install Qt5 or Qt6 (and QtCharts) libraries and development files, and translation tools. In Debian or Ubuntu, for Qt6, this should install all the needed requirements: ``` sudo apt install qmake6 qt6-base-dev qt6-charts-dev qt6-tools-dev-tools ``` ## Build You can use QtCreator to build the program. You can also use `qmake6` in commandline: ``` qmake6 -config release && make sudo make install ``` ## Usage In very short: by clicking on the QSpeakers icon in your preferred menu, the application shows up. Select a loudspeaker or enter a new one by filling its **Thiele/Small** mechanical parameters. Click on *optimize* and you're done: the best enclosure volume is calculated for you. ## Homepage QSpeakers homepage with source releases and Microsoft® Windows® installer is currently hosted on [my old website](http://brouits.free.fr/qspeakers/) ## Thanks Thanks to *Upacesky* for his [free svg drawing](https://openclipart.org/detail/202508/studio-monitoring-loudspeaker) ## Todo - more plots: excursion, phase and impendance - implement dual-free ports and dual-flanged ports in a combobox option - implement crossover filters ## Formulæ See INFO file. qspeakers-1.8/TODO000066400000000000000000000002221477675101000140540ustar00rootroot00000000000000- more plots: excursion, phase and impendance - consider dual-free ports and dual-flanged ports in a combobox option - consider crossover filters qspeakers-1.8/application-x-qspeakers.xml000066400000000000000000000010031477675101000206500ustar00rootroot00000000000000 Loudspeaker project file Projet d'enceinte acoustique qspeakers-1.8/bandpassbox.cpp000066400000000000000000000106511477675101000164030ustar00rootroot00000000000000#include #include #include "bandpassbox.h" BandPassBox::BandPassBox(double svol, double pvol, double pfreq, unsigned int pnum, double plen, double pdiam) : sealedBox(svol), portedBox(pvol, pfreq, pnum, plen, pdiam) { } void BandPassBox::setSealedBoxVolume(double vol) { sealedBox.setVolume(vol); } void BandPassBox::setPortedBoxVolume(double vol) { portedBox.setBoxVolume(vol); } void BandPassBox::setPortedBoxPortNum(unsigned int val) { portedBox.setPortNum(val); } void BandPassBox::setPortedBoxPortLen(double len) { portedBox.setPortLen(len); } void BandPassBox::setPortedBoxPortDiam(double diam) { portedBox.setPortDiam(diam); } void BandPassBox::setPortedBoxSlotWidth(double width) { portedBox.setSlotWidth(width); } void BandPassBox::setPortedBoxResFreq(double freq) { portedBox.setResFreq(freq); } void BandPassBox::setPortedBoxSlotPortActivated(bool enable) { portedBox.setSlotPortActivated(enable); } void BandPassBox::updatePortedBoxPorts(double sd, double xmax) { portedBox.updatePorts(sd, xmax); } void BandPassBox::updatePortedBoxPortsLength() { portedBox.updatePortsLength(); } void BandPassBox::updatePortedBoxSlots() { portedBox.updateSlots(); } double BandPassBox::getSealedBoxVolume() const { return sealedBox.getVolume(); } double BandPassBox::getPortedBoxVolume() const { return portedBox.getBoxVolume(); } unsigned int BandPassBox::getPortedBoxPortNum() const { return portedBox.getPortNum(); } double BandPassBox::getPortedBoxPortLen() const { return portedBox.getPortLen(); } double BandPassBox::getPortedBoxPortDiam() const { return portedBox.getPortDiam(); } bool BandPassBox::getPortedBoxSlotPortActivated() const { return portedBox.getSlotPortActivated(); } double BandPassBox::getPortedBoxSlotWidth() const { return portedBox.getSlotWidth(); } double BandPassBox::getPortedBoxSlotHeight() const { return portedBox.getSlotHeight(); } double BandPassBox::getPortedBoxResFreq(void) const { return portedBox.getResFreq(); } QDomElement BandPassBox::toDomElement(QDomDocument &doc) const { QDomElement e = Box::toDomElement(doc); e.setAttribute("type", "bandpass"); QDomElement b = sealedBox.toDomElement(doc); e.appendChild(b); QDomElement c = portedBox.toDomElement(doc); e.appendChild(c); return e; } void BandPassBox::fromDomElement(const QDomElement &e) { Box::fromDomElement(e); if (e.attribute("type") != "bandpass") { qWarning() << __func__ << "wrong box type! (not bandpass, giving up)"; return; } QDomElement b = e.firstChildElement("box"); while (!b.isNull()) { if (b.attribute("type") == "sealed") sealedBox.fromDomElement(b); else if (b.attribute("type") == "ported") portedBox.fromDomElement(b); b = b.nextSiblingElement("box"); } } void BandPassBox::render(QPainter *painter, const QRectF &area) const { QFont orig = painter->font(); QString params[6]; qreal tab = area.left() + BOX_RENDER_MARGINS; qreal realwidth = area.width() - 2 * BOX_RENDER_MARGINS; painter->drawRoundedRect(area.toRect(), 5, 5); params[0] = QObject::tr("Sealed Volume: %1 L").arg(QString::number(getSealedBoxVolume(), 'f', 2)); params[1] = QObject::tr("Ported Volume: %1 L").arg(QString::number(getPortedBoxVolume(), 'f', 2)); if (!getPortedBoxSlotPortActivated()) { params[2] = QObject::tr("Port Diameter: %1 cm").arg(QString::number(getPortedBoxPortDiam(), 'f', 1)); } else { params[2] = QObject::tr("Slot port: %1 x %2 cm").arg(QString::number(getPortedBoxSlotWidth(), 'f', 1), QString::number(getPortedBoxSlotHeight(), 'f', 1)); } params[3] = QObject::tr("Port Length: %1 cm").arg(QString::number(getPortedBoxPortLen(), 'f', 1)); params[4] = QObject::tr("Port #: %1").arg(getPortedBoxPortNum()); params[5] = QObject::tr("Fb: %1 Hz").arg(getPortedBoxResFreq()); QFont font; font.setBold(false); painter->setFont(font); for (int i = 0; i < 6; i++) { QString text = params[i]; QTextOption option(Qt::AlignVCenter|Qt::AlignLeft); qreal textwidth = painter->boundingRect(QRect(0, 0, realwidth, 0), text, option).width() + BOX_RENDER_MARGINS; QRectF where(tab, area.top(), qMax(realwidth / 6, textwidth), area.height()); painter->drawText(where, text, option); tab += where.width(); } painter->setFont(orig); } qspeakers-1.8/bandpassbox.h000066400000000000000000000027551477675101000160560ustar00rootroot00000000000000#ifndef BANDPASSBOX_H #define BANDPASSBOX_H #include #include #include #include #include "box.h" #include "sealedbox.h" #include "portedbox.h" class BandPassBox : public Box { public: BandPassBox(double svol = 0.1, double pvol = 0.01, double pfreq = 1, unsigned int pnum = 1, double plen = 0, double pdiam = 0); void setSealedBoxVolume(double vol); void setPortedBoxVolume(double vol); void setPortedBoxPortNum(unsigned int val); void setPortedBoxPortLen(double len); void setPortedBoxPortDiam(double diam); void setPortedBoxSlotWidth(double width); void setPortedBoxResFreq(double freq); void setPortedBoxSlotPortActivated(bool enable); void updatePortedBoxPorts(double sd, double xmax); void updatePortedBoxPortsLength(); void updatePortedBoxSlots(); double getSealedBoxVolume(void) const; double getPortedBoxVolume(void) const; unsigned int getPortedBoxPortNum(void) const; double getPortedBoxPortLen(void) const; double getPortedBoxPortDiam(void) const; bool getPortedBoxSlotPortActivated(void) const; double getPortedBoxSlotWidth() const; double getPortedBoxSlotHeight() const; double getPortedBoxResFreq(void) const; QDomElement toDomElement(QDomDocument& doc) const; void fromDomElement(const QDomElement &e); void render(QPainter *painter, const QRectF& area) const; private: SealedBox sealedBox; PortedBox portedBox; }; #endif // BANDPASSBOX_H qspeakers-1.8/bandpassbox_cutting_template.scad000066400000000000000000000130201477675101000221540ustar00rootroot00000000000000/* loudspeaker ___VENDOR__ __MODEL__ */ loudspeaker_number = __NUMBER__; margin = __MARGIN__; /* mm */ loudspeaker_diameter = __DIAMETER__; /* mm */ internal_closed_box_volume = __SEALEDBOXVOLUME__; /* dm³ (Liter) */ internal_closed_box_width = loudspeaker_diameter + margin; /* mm (x)*/ internal_closed_box_golden = max((loudspeaker_diameter + margin) * loudspeaker_number, 1.618 * internal_closed_box_width); /* mm (z)*/ internal_closed_box_alt = internal_closed_box_volume * 1000000 / (internal_closed_box_width * internal_closed_box_golden); /* mm (y)*/ internal_closed_box_height = max(internal_closed_box_golden, internal_closed_box_alt); internal_closed_box_depth = min(internal_closed_box_golden, internal_closed_box_alt); saw_thick = __SAWTHICK__; /* saw cut thick in mm */ wood_thick = __WOODTHICK__; /* board thick in mm */ vertical_center = (internal_closed_box_height + (2 * wood_thick)) / 2; horizontal_center = (internal_closed_box_width + (2 * wood_thick)) / 2; module board(width, height) { square(size = [width, height], center = false); } module speaker(diam, x, y){ translate([x, y, 0]) circle($fn=360, d=diam, true); } module board_speaker(width, height, diam){ difference() { board(width, height); for (i = [0:loudspeaker_number-1]) { speaker(diam, width / 2, margin + (diam / 2) + i * (diam + margin)); } } } /* boards */ front_width = internal_closed_box_width + (2 * wood_thick); /* mm */ front_height = internal_closed_box_height + (2 * wood_thick); /* mm */ side_depth = internal_closed_box_depth; /* mm */ side_height = internal_closed_box_height; /* mm */ top_width = front_width; /* mm */ top_depth = side_depth; /* mm */ /* two times */ for (i = [0:1]) { translate([0, i*(max(front_height,front_width,side_depth,side_height) + saw_thick), 0]) { /* one board with speaker */ translate([0, 0, 0]) board_speaker(front_width, front_height, loudspeaker_diameter); /* one back board */ translate([1 * (front_width + saw_thick), 0, 0]) board(front_width, front_height); /* two side boards */ for (j = [0:1]) { translate([2 * (front_width + saw_thick) + j * (side_depth + saw_thick), 0, 0]) board(side_depth, side_height); } /* two top/bottom boards */ for (j = [0:1]) { translate([j * (top_width + saw_thick) + (2 * (side_depth + saw_thick)) + (2 * (front_width + saw_thick)), 0, 0]) board(top_width, top_depth); } } } internal_ported_box_volume = __PORTEDBOXVOLUME__; /* dm³ (Liter) */ ported_box_port_number = __PORTEDBOXPORTNUMBER__; ported_box_port_slot_activated = __PORTEDBOXPORTSLOTACTIVATED__; ported_box_port_slot_width = __PORTEDBOXPORTSLOTWIDTH__; /* mm */ ported_box_port_slot_height = __PORTEDBOXPORTSLOTHEIGHT__; /* mm */ ported_box_port_diameter = __PORTEDBOXPORTDIAMETER__; /* mm */ ported_box_port_length = __PORTEDBOXPORTLENGTH__; /* mm */ internal_ported_box_width = internal_closed_box_width; /* mm (x)*/ internal_ported_box_height = internal_closed_box_height; /* mm (z) */ internal_ported_box_depth = internal_ported_box_volume * 1000000 / (internal_ported_box_width * internal_ported_box_height); /* mm (y)*/ module port(diam, slot, width, height, x, y) { if (slot == true) { translate([x, y, 0]) { square(size = [width, height], center = false); } } else { translate([x, y, 0]) { circle($fn=360, d=diam, true); } } } module board_port(width, height, diam){ difference() { board(width, height); /* calculate ports distribition */ port_placing = (internal_ported_box_width + (2 * wood_thick)) / (ported_box_port_number + 1); for (i = [1:ported_box_port_number]) { if (ported_box_port_slot_activated == false) { /* circular ports, center is used */ port(ported_box_port_diameter, ported_box_port_slot_activated, ported_box_port_slot_width, ported_box_port_slot_height, i * port_placing, wood_thick + margin + ported_box_port_diameter / 2); } else { /* slot ports, left corner is used */ port(ported_box_port_diameter, ported_box_port_slot_activated, ported_box_port_slot_width, ported_box_port_slot_height, (i * port_placing) - (ported_box_port_slot_width / 2),wood_thick); } } } } /* boards */ ported_front_width = front_width; /* mm */ ported_front_height = front_height; /* mm */ ported_side_depth = internal_ported_box_depth; /* mm */ ported_side_height = internal_ported_box_height; /* mm */ ported_top_width = front_width; /* mm */ ported_top_depth = ported_side_depth; /* mm */ /* two times */ if (true) { for (i = [2:3]) { translate([0, i*(max(front_height,front_width,side_depth,side_height) + saw_thick), 0]) { /* one board with port */ translate([0, 0, 0]) board_port(ported_front_width, ported_front_height, ported_box_port_diameter); /* two side boards */ for (j = [0:1]) { translate([2 * (front_width + saw_thick) + j * (side_depth + saw_thick), 0, 0]) board(ported_side_depth, ported_side_height); } /* two top/bottom boards */ for (j = [0:1]) { translate([j * (top_width + saw_thick) + (2 * (side_depth + saw_thick)) + (2 * (front_width + saw_thick)), 0, 0]) board(ported_top_width, ported_top_depth); } } } } qspeakers-1.8/bandpassbox_template.scad000066400000000000000000000115221477675101000204240ustar00rootroot00000000000000/* loudspeaker __VENDOR__ __MODEL__ */ loudspeaker_number = __NUMBER__; margin = __MARGIN__; /* mm */ loudspeaker_diameter = __DIAMETER__; /* mm */ internal_closed_box_volume = __SEALEDBOXVOLUME__; /* dm³ (Liter) */ internal_ported_box_volume = __PORTEDBOXVOLUME__; /* dm³ (Liter) */ wood_thick = __WOODTHICK__; /* mm */ wood_color = "wheat"; /* sealed box dimensions */ internal_closed_box_width = loudspeaker_diameter + margin; /* mm (x)*/ internal_closed_box_golden = max((loudspeaker_diameter + margin) * loudspeaker_number, 1.618 * internal_closed_box_width); /* mm (z)*/ internal_closed_box_alt = internal_closed_box_volume * 1000000 / (internal_closed_box_width * internal_closed_box_golden); /* mm (y)*/ internal_closed_box_height = max(internal_closed_box_golden, internal_closed_box_alt); internal_closed_box_depth = min(internal_closed_box_golden, internal_closed_box_alt); /* ported box dimensions */ internal_ported_box_width = internal_closed_box_width; /* mm (x)*/ internal_ported_box_height = internal_closed_box_height; /* mm (z)*/ internal_ported_box_depth = internal_ported_box_volume * 1000000 / (internal_ported_box_width * internal_ported_box_height); /* mm (y)*/ /* other ported enclosure declarations */ ported_box_port_number = __PORTEDBOXPORTNUMBER__; ported_box_port_slot_activated = __PORTEDBOXPORTSLOTACTIVATED__; ported_box_port_slot_width = __PORTEDBOXPORTSLOTWIDTH__; /* mm */ ported_box_port_slot_height = __PORTEDBOXPORTSLOTHEIGHT__; /* mm */ ported_box_port_diameter = __PORTEDBOXPORTDIAMETER__; /* mm */ ported_box_port_length = __PORTEDBOXPORTLENGTH__; /* mm */ vertical_center = (internal_closed_box_height + (2 * wood_thick)) / 2; horizontal_center = (internal_closed_box_width + (2 * wood_thick)) / 2; module speaker_hole(diameter, x, z) { translate([x, 0, z]) { rotate([90, 0, 0]) { color("transparent") { cylinder($fn=360, h = wood_thick, r1 = diameter / 2, r2 = diameter / 2, center=true); } } } } module closed_enclosure(width, height, depth) { difference() { /* external dimentions */ color(wood_color) { cube([width + (2 * wood_thick), depth + (2 * wood_thick), height + (2 * wood_thick)]); } /* internal dimentions */ translate([wood_thick, wood_thick, wood_thick]) { color(wood_color) { cube([width, depth, height]); } } } } /* now draw the sealed enclosure with the loudspeaker(s) */ difference() { closed_enclosure(internal_closed_box_width, internal_closed_box_height,internal_closed_box_depth); /* loudpeakers distribution */ for (i = [0:loudspeaker_number-1]) { speaker_hole(loudspeaker_diameter, horizontal_center, margin + (loudspeaker_diameter / 2) + i * (loudspeaker_diameter + margin)); } } module port_hole(diameter, slot, width, height, x, z) { if (ported_box_port_slot_activated == true) { translate([x, 0, z]) { color("transparent") { cube([width, wood_thick, height]); } } } else { translate([x, 0, z]) { rotate([90, 0, 0]) { color("transparent") { cylinder($fn=360, h = wood_thick, r1 = diameter / 2, r2 = diameter / 2, center=true); } } } } } module ported_enclosure(width, height, depth) { difference() { /* external dimentions without internal face */ color(wood_color) { cube([width + (2 * wood_thick), depth, height + (2 * wood_thick)]); } /* internal dimentions */ translate([wood_thick, wood_thick, wood_thick]) { color(wood_color) { cube([width, depth, height]); } } } } /* now, draw ported enclosure part with the port(s), beside the sealed enclosure */ translate([internal_closed_box_width + (2 * wood_thick) + margin, 0, 0]) { difference() { ported_enclosure(internal_ported_box_width, internal_ported_box_height, internal_ported_box_depth); /* calculate ports distribution */ port_placing = (internal_ported_box_width + (2 * wood_thick)) / ( ported_box_port_number + 1); for (i = [1:ported_box_port_number]) { if (ported_box_port_slot_activated == false) { /* circular ports, center is used */ port_hole(ported_box_port_diameter, ported_box_port_slot_activated, ported_box_port_slot_width, ported_box_port_slot_height, i * port_placing, wood_thick + margin + ported_box_port_diameter / 2); } else { /* slot ports, left corner is used */ port_hole(ported_box_port_diameter, ported_box_port_slot_activated, ported_box_port_slot_width, ported_box_port_slot_height, (i * port_placing) - (ported_box_port_slot_width / 2), wood_thick); } } } } qspeakers-1.8/bandpassdialog.cpp000066400000000000000000000012041477675101000170440ustar00rootroot00000000000000#include "bandpassdialog.h" #include "ui_bandpassdialog.h" BandpassDialog::BandpassDialog(QWidget *parent) : QDialog(parent), ui(new Ui::BandpassDialog) { ui->setupUi(this); connect(this, &BandpassDialog::accepted, this, &BandpassDialog::onAccepted); connect(this, &BandpassDialog::rejected, this, &BandpassDialog::onRejected); } BandpassDialog::~BandpassDialog() { delete ui; } void BandpassDialog::onAccepted() { double s, pa; s = ui->rippleDoubleSpinBox->value(); pa = ui->gainSpinBox->value(); emit optimizeRequested(s, pa); } void BandpassDialog::onRejected() { emit optimizeCancelled(); } qspeakers-1.8/bandpassdialog.h000066400000000000000000000007221477675101000165150ustar00rootroot00000000000000#ifndef BANDPASSDIALOG_H #define BANDPASSDIALOG_H #include namespace Ui { class BandpassDialog; } class BandpassDialog : public QDialog { Q_OBJECT public: explicit BandpassDialog(QWidget *parent = 0); ~BandpassDialog(); signals: void optimizeRequested(double s, double pa); void optimizeCancelled(); private slots: void onAccepted(); void onRejected(); private: Ui::BandpassDialog *ui; }; #endif // BANDPASSDIALOG_H qspeakers-1.8/bandpassdialog.ui000066400000000000000000000067561477675101000167200ustar00rootroot00000000000000 BandpassDialog 0 0 314 146 Alignment 0 0 Curve gain (dB) 0 0 -6 6 0 0 Curve ripple (0.7 = 0dB) 0 0 0.400000000000000 0.700000000000000 0.100000000000000 0.700000000000000 Qt::Horizontal QDialogButtonBox::Cancel|QDialogButtonBox::Ok buttonBox accepted() BandpassDialog accept() 248 254 157 274 buttonBox rejected() BandpassDialog reject() 316 260 286 274 qspeakers-1.8/box.cpp000066400000000000000000000004671477675101000146730ustar00rootroot00000000000000#include #include "box.h" QDomElement Box::toDomElement(QDomDocument& doc) const { QDomElement e = doc.createElement("box"); return e; } void Box::fromDomElement(const QDomElement &e) { if (e.tagName() != "box") qWarning() << __func__ << "wrong tag name while importing box!"; } qspeakers-1.8/box.h000066400000000000000000000006551477675101000143370ustar00rootroot00000000000000#ifndef BOX_H #define BOX_H #include #include #include #include #define BOX_SEALED 0 #define BOX_PORTED 1 #define BOX_BANDPASS 2 #define BOX_RENDER_MARGINS 13 class Box { public: QDomElement toDomElement(QDomDocument& doc) const; void fromDomElement(const QDomElement& e); virtual void render(QPainter *painter, const QRectF& area) const = 0; }; #endif // BOX_H qspeakers-1.8/config.h.in000066400000000000000000000004531477675101000154150ustar00rootroot00000000000000#ifndef CONFIG_H #define CONFIG_H #define SETTINGS_DOMAIN \"Herewe\" #define SETTINGS_APP \"QSpeakers\" #define TARGET \"$$TARGET\" #define PREFIX \"$$PREFIX\" #define VERSION \"$$VERSION\" #define DATADIR \"$$DATADIR\" #define REVISION \"$$REVISION\" #ifndef $$HOST #define $$HOST #endif #endif qspeakers-1.8/importexport.cpp000066400000000000000000000113641477675101000166550ustar00rootroot00000000000000#include #if QT_VERSION >= QT_VERSION_CHECK(5,0,0) #include #endif #include #include #include #include "importexport.h" QString ImportExport::savePath; QString ImportExport::getSavePath(void) { if (!ImportExport::savePath.isNull() && !ImportExport::savePath.isEmpty()) { return ImportExport::savePath; } #if QT_VERSION >= QT_VERSION_CHECK(6,0,0) QString prefix = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation); #elif QT_VERSION >= QT_VERSION_CHECK(5,0,0) QString prefix = QStandardPaths::writableLocation(QStandardPaths::DataLocation); #else QString prefix = QDesktopServices::storageLocation(QDesktopServices::DataLocation); #endif QDir dir(prefix); if (!dir.exists()) dir.mkpath(prefix); QString path = prefix + QDir::separator() + SAVE_FILENAME; return path; } bool ImportExport::saveProject(const ProjectProperties& props, const Speaker &speaker, const SealedBox &sbox, const PortedBox &pbox, const BandPassBox &bpbox, int number, int tab) { QString path = ImportExport::getSavePath(); qDebug() << "exporting" << path; QFile file(path); /* do not test if it exists, just override it */ return exportProject(file, props, speaker, sbox, pbox, bpbox, number, tab); } bool ImportExport::restoreProject(ProjectProperties &props, Speaker &speaker, SealedBox &sbox, PortedBox &pbox, BandPassBox &bpbox, int* number, int* tab) { QString path = ImportExport::getSavePath(); qDebug() << "importing" << path; QFile file(path); return importProject(props, speaker, sbox, pbox, bpbox, number, tab, file); } bool ImportExport::exportProject(QFile &file, const ProjectProperties& props, const Speaker &speaker, const SealedBox &sbox, const PortedBox &pbox, const BandPassBox &bpbox, int number, int tab) { QDomDocument xml("QSpeakersProject"); QDomElement root = xml.createElement("project"); xml.appendChild(root); QDomElement spk = speaker.toDomElement(xml); root.appendChild(spk); QDomElement xsbox = sbox.toDomElement(xml); root.appendChild(xsbox); QDomElement xpbox = pbox.toDomElement(xml); root.appendChild(xpbox); QDomElement xbpbox = bpbox.toDomElement(xml); root.appendChild(xbpbox); QDomElement xlayout = xml.createElement("layout"); xlayout.setAttribute("sibling", number); root.appendChild(xlayout); QDomElement xstate = xml.createElement("state"); xstate.setAttribute("tab", tab); root.appendChild(xstate); QDomElement xprops = props.toDomElement(xml); root.appendChild(xprops); if (!file.open(QIODevice::WriteOnly)) return false; if (!file.write(xml.toByteArray())) { file.close(); return false; } file.close(); return true; } bool ImportExport::importProject(ProjectProperties& props, Speaker &speaker, SealedBox &sbox, PortedBox &pbox, BandPassBox &bpbox, int *number, int *tab, QFile &file) { QDomDocument doc("QSpeakersProject"); if (!file.exists()) return false; if (!file.open(QIODevice::ReadOnly)) return false; if (!doc.setContent(&file)) { file.close(); return false; } file.close(); QDomElement root = doc.firstChildElement("project"); QDomNodeList speakers = root.elementsByTagName("speaker"); if (!speakers.isEmpty()) { /* for now, only one speaker is considered */ QDomElement spk = speakers.at(0).toElement(); if (!spk.isNull()) speaker.fromDomElement(spk); } /* crawl 1st level boxes */ QDomElement box = root.firstChildElement("box"); while (!box.isNull()) { if (box.attribute("type") == "sealed") sbox.fromDomElement(box); else if (box.attribute("type") == "ported") pbox.fromDomElement(box); else if (box.attribute("type") == "bandpass") bpbox.fromDomElement(box); else qWarning() << __func__ << "unrecognized box type"; box = box.nextSiblingElement("box"); } if (number != nullptr) { QDomElement layout = root.firstChildElement("layout"); if (layout.isNull()) *number = 1; /* default */ else *number = layout.attribute("sibling", "1").toInt(); } if (tab != nullptr) { QDomElement state = root.firstChildElement("state"); if (state.isNull()) *tab = 0; else *tab = state.attribute("tab", "0").toInt(); } props.clear(); QDomNodeList xprops = root.elementsByTagName("properties"); if (!xprops.isEmpty()) props.fromDomElement(xprops.at(0).toElement()); return true; } void ImportExport::setSavePath(const QString &path) { ImportExport::savePath = path; } qspeakers-1.8/importexport.h000066400000000000000000000025351477675101000163220ustar00rootroot00000000000000#ifndef IMPORTEXPORT_H #define IMPORTEXPORT_H #include #include "projectproperties.h" #include "speaker.h" #include "sealedbox.h" #include "portedbox.h" #include "bandpassbox.h" class ImportExport { public: /* save the project state into a unique dotfile */ static bool saveProject(const ProjectProperties& props, const Speaker& speaker, const SealedBox& sbox, const PortedBox& pbox, const BandPassBox& bpbox, int number = 1, int tab = 0); /* restore the saved project from the dotfile */ static bool restoreProject(ProjectProperties& props, Speaker& speaker, SealedBox& sbox, PortedBox& pbox, BandPassBox& bpbox, int *number, int *tab); /* in: speaker, sbox, pbox, bpbox, number, tab * out: file */ static bool exportProject(QFile& file, const ProjectProperties& props, const Speaker& speaker, const SealedBox& sbox, const PortedBox& pbox, const BandPassBox& bpbox, int number = 1, int tab = 0); /* in: file * out: speaker, sbox, pbox, bpbox */ static bool importProject(ProjectProperties& props, Speaker& speaker, SealedBox& sbox, PortedBox& pbox, BandPassBox& bpbox, int *number, int *tab, QFile &file); static void setSavePath(const QString& path); static QString getSavePath(void); private: static QString savePath; #define SAVE_FILENAME "qspeakers_save.xml" }; #endif // IMPORTEXPORT_H qspeakers-1.8/listdialog.cpp000066400000000000000000000041601477675101000162300ustar00rootroot00000000000000#include #include #include "listdialog.h" #include "ui_listdialog.h" SpeakerListModel::SpeakerListModel(const QList &speakers, QWidget *parent) : QAbstractListModel(parent) { this->speakers = speakers; } SpeakerListModel::~SpeakerListModel() { } int SpeakerListModel::rowCount(const QModelIndex &parent) const { if (!parent.isValid()) return speakers.size(); if (parent.row() > 0) return 0; return speakers.size(); } QVariant SpeakerListModel::data(const QModelIndex &index, int role) const { if (!index.isValid()) return QVariant(); if (index.row() >= speakers.size()) return QVariant(); if (role == Qt::DisplayRole) { return QVariant(speakers.at(index.row()).getVendor() + " - " + speakers.at(index.row()).getModel()); } else if (role == Qt::UserRole){ return QVariant::fromValue(speakers.at(index.row())); } else { return QVariant(); } } void SpeakerListModel::clear() { speakers.clear(); } ListDialog::ListDialog(const QList &speakers, QWidget *parent) : QDialog(parent), ui(new Ui::ListDialog), model(nullptr) { ui->setupUi(this); setSpeakerItems(speakers); connect(this, &ListDialog::accepted, this, &ListDialog::onAccepted); connect(this, &ListDialog::rejected, this, &ListDialog::onRejected); } ListDialog::~ListDialog() { delete ui; if (model != nullptr) delete model; } void ListDialog::setSpeakerItems(const QList &speakers) { if (model != nullptr) { model->clear(); delete model; } model = new SpeakerListModel(speakers, this); ui->listDialogListView->setModel(model); } void ListDialog::clear() { model->clear(); } void ListDialog::onAccepted() { QString title = model->data(QModelIndex(ui->listDialogListView->currentIndex()), Qt::DisplayRole).toString(); Speaker s = static_cast (model->data(QModelIndex(ui->listDialogListView->currentIndex()), Qt::UserRole).value()); emit speakerItemSelected(title, s); } void ListDialog::onRejected() { emit speakerItemCancelled(); } qspeakers-1.8/listdialog.h000066400000000000000000000020051477675101000156710ustar00rootroot00000000000000#ifndef LISTDIALOG_H #define LISTDIALOG_H #include #include #include "speaker.h" class SpeakerListModel : public QAbstractListModel { Q_OBJECT public: explicit SpeakerListModel(const QList &speakers, QWidget *parent = 0); ~SpeakerListModel(); int rowCount(const QModelIndex &parent = QModelIndex()) const; QVariant data(const QModelIndex &index, int role) const; void clear(void); private: QList speakers; }; namespace Ui { class ListDialog; } class ListDialog : public QDialog { Q_OBJECT public: explicit ListDialog(const QList& speakers, QWidget *parent = 0); ~ListDialog(); void setSpeakerItems(const QList &speakers); void clear(void); signals: void speakerItemSelected(QString title, const Speaker &speaker); void speakerItemCancelled(); private slots: void onAccepted(); void onRejected(); private: Ui::ListDialog *ui; SpeakerListModel *model; }; #endif // LISTDIALOG_H qspeakers-1.8/listdialog.ui000066400000000000000000000032611477675101000160640ustar00rootroot00000000000000 ListDialog 0 0 400 300 Please select an item Qt::AlignCenter Qt::Horizontal QDialogButtonBox::Cancel|QDialogButtonBox::Ok listDialogButtonBox accepted() ListDialog accept() 248 254 157 274 listDialogButtonBox rejected() ListDialog reject() 316 260 286 274 qspeakers-1.8/main.cpp000066400000000000000000000044501477675101000150230ustar00rootroot00000000000000#include "mainwindow.h" #include "importexport.h" #include #include #include #include #include "config.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); a.setOrganizationName("Herewe"); a.setApplicationName("QSpeakers"); a.setApplicationVersion(VERSION " (" REVISION ")"); QString locale = QLocale::system().name(); QTranslator qtTranslator; #if QT_VERSION >= QT_VERSION_CHECK(6,0,0) if (qtTranslator.load(QLocale::system(), "qtbase", "_", QLibraryInfo::path(QLibraryInfo::TranslationsPath))) a.installTranslator(&qtTranslator); #else qtTranslator.load("qt_" + locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath)); a.installTranslator(&qtTranslator); #endif QTranslator qspeakersTranslator; if (qspeakersTranslator.load(TARGET "_" + locale, "locale")) a.installTranslator(&qspeakersTranslator); #ifdef __mswin else if (qspeakersTranslator.load(TARGET "_" + locale, QCoreApplication::applicationDirPath() + QDir::separator() + "locale")) #else else if (qspeakersTranslator.load(TARGET "_" + locale, DATADIR "/" TARGET "/locale")) #endif a.installTranslator(&qspeakersTranslator); QCommandLineParser parser; parser.setApplicationDescription(QObject::tr("Loudspeaker enclosure computation program.")); parser.addHelpOption(); parser.addVersionOption(); parser.addPositionalArgument("project", QCoreApplication::translate("main", "Project file to work on.")); parser.process(a); const QStringList args = parser.positionalArguments(); if (args.length() > 0) ImportExport::setSavePath(args.at(0)); MainWindow w; /* must be created _after_ setSavePath */ #ifdef __mswin QString iconpath = QCoreApplication::applicationDirPath() + QDir::separator() + TARGET + ".png"; #else QString iconpath = QString(DATADIR "/icons/hicolor/scalable/apps/" TARGET ".svg"); #endif #if QT_VERSION >= QT_VERSION_CHECK(5,0,0) if (QFileInfo::exists(iconpath)) #else if ((QFileInfo(iconpath)).exists()) #endif w.setWindowIcon(QIcon(iconpath)); else w.setWindowIcon(QIcon(TARGET ".png")); if (argc > 1) w.setWindowFilePath(argv[argc - 1]); w.show(); return a.exec(); } qspeakers-1.8/mainwindow.cpp000066400000000000000000002027251477675101000162600ustar00rootroot00000000000000#include #include #include #include #include #include #include #include #if QT_VERSION >= QT_VERSION_CHECK(5,0,0) #include #endif #include #include "mainwindow.h" #include "ui_mainwindow.h" #include "config.h" #include "speaker.h" #include "speakerdb.h" #include "importexport.h" #include "plot.h" #include "searchdialog.h" #include "propertiesdialog.h" #include "listdialog.h" #include "system.h" #include "optimizer.h" #include "scaddialog.h" #include "undocommands.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), projectSaved(true), isModifying(false), spkDialog(nullptr), fileDialog(nullptr), searchDialog(nullptr), propertiesDialog(nullptr), listDialog(nullptr), bandpassDialog(nullptr), currentSpeakerNumber(0), currentTabIndex(-1), sealedPlot(nullptr), portedPlot(nullptr), bandpassPlot(nullptr), notInDbSpeaker(nullptr), commandStack(new QUndoStack(this)) { ui->setupUi(this); /* setup recently opened menu */ for (int i = 0; i < MaxRecentFiles; ++i) { recentFileActs[i] = new QAction(this); recentFileActs[i]->setVisible(false); connect(recentFileActs[i], &QAction::triggered, this, &MainWindow::onOpenRecentActionTriggered); } QMenu* sub = new QMenu(tr("Recently opened"), ui->menuProject); ui->menuProject->insertMenu(ui->actionProjectSave, sub); for (int i = 0; i < MaxRecentFiles; ++i) sub->addAction(recentFileActs[i]); updateRecentFileActions(); /* setup maximums of spinbox */ ui->numberSpinBox->setMaximum(std::numeric_limits::max()); ui->sealedVolumeDoubleSpinBox->setMaximum(std::numeric_limits::max()); ui->portedPortsNumberSpinBox->setMaximum(std::numeric_limits::max()); ui->portedVolumeDoubleSpinBox->setMaximum(std::numeric_limits::max()); ui->portedPortDiameterDoubleSpinBox->setMaximum(std::numeric_limits::max()); ui->portedPortSlotWidthDoubleSpinBox->setMaximum(std::numeric_limits::max()); ui->bandPassSealedVolumeDoubleSpinBox->setMaximum(std::numeric_limits::max()); ui->bandPassPortedVolumeDoubleSpinBox->setMaximum(std::numeric_limits::max()); ui->bandPassPortsNumberSpinBox->setMaximum(std::numeric_limits::max()); ui->bandPassPortDiameterDoubleSpinBox->setMaximum(std::numeric_limits::max()); ui->bandpassPortSlotWidthDoubleSpinBox->setMaximum(std::numeric_limits::max()); /* fix minimum width */ setMinimumWidth(800); ui->menuBar->setMinimumWidth(800); ui->mainToolBar->setFloatable(false); ui->mainToolBar->setMovable(false); /* insert QChartView plotters in ui */ QHBoxLayout *ly1 = new QHBoxLayout(ui->sealedVolumePlotWidget); sealedPlot = new Plot(tr("Sealed volume frequency response"), ui->sealedVolumePlotWidget); sealedPlot->setMinimumSize(400, 300); //sealedPlot->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Expanding); ly1->insertWidget(0, sealedPlot); QHBoxLayout *ly2 = new QHBoxLayout(ui->portedPlotWidget); portedPlot = new Plot(tr("Ported volume frequency response"), ui->portedPlotWidget); portedPlot->setMinimumSize(400, 300); //portedPlot->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Expanding); ly2->insertWidget(0, portedPlot); QHBoxLayout *ly3 = new QHBoxLayout(ui->bandpassPlotWidget); bandpassPlot = new Plot(tr("Bandpass volumes frequency response"), ui->bandpassPlotWidget); bandpassPlot->setMinimumSize(400, 300); //bandpassPlot->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Expanding); ly3->insertWidget(0, bandpassPlot); /* test db */ if (!SpeakerDb::exists() || (SpeakerDb::lastModified() <= SpeakerDb::pkgInstalled())) { QFile pkg_db(SpeakerDb::pkgPath()); if (SpeakerDb::merge(pkg_db)) qDebug() << "merged db"; } /* fill speaker combos */ ui->vendorComboBox->addItems(SpeakerDb::getVendors()); ui->vendorComboBox->setSizeAdjustPolicy(QComboBox::SizeAdjustPolicy::AdjustToContents); ui->modelComboBox->addItems(SpeakerDb::getModelsByVendor(ui->vendorComboBox->currentText())); ui->modelComboBox->setSizeAdjustPolicy(QComboBox::SizeAdjustPolicy::AdjustToContents); /* undo history is empty */ this->ui->actionUndo->setEnabled(false); this->ui->actionRedo->setEnabled(false); /* restore last saved project... */ if (!loadFile(ImportExport::getSavePath())) { /* on error, set default values */ currentSpeakerNumber = 1; currentTabIndex = 0; } /* on first run, no speaker. reset to the speaker of the combos if needed */ if (!currentSpeaker.isValid()) { currentSpeaker = SpeakerDb::getByVendorAndModel(ui->vendorComboBox->currentText(), ui->modelComboBox->currentText()); } /* display sibling number */ ui->numberSpinBox->setValue(currentSpeakerNumber); /* select restored tab */ ui->tabWidget->setCurrentIndex(currentTabIndex); /* tab index change is not connected yet, do menu modifications manually */ if (currentTabIndex != 1) { /* index != 1 needs to deactivate the ported alignments menu */ setActivateActions(ui->menuPorted_alignments->actions(), false); } if (currentTabIndex != 2) { /* index != 2 needs to deactivate the bandpass alignment menu */ ui->actionBandpass_alignment->setEnabled(false); } syncUiFromCurrentSpeaker(currentSpeaker); syncUiFromCurrentSealedBox(currentSealedBox); syncUiFromCurrentPortedBox(currentPortedBox); syncUiFromCurrentBandPassBox(currentBandPassBox); /* * connections */ /* menu actions */ linkMenus(); /* tabs actions */ linkTabs(); /* non-graphic */ linkInternals(); } MainWindow::~MainWindow() { delete ui; } void MainWindow::onProjectSave() { if(ImportExport::saveProject(projectProperties, currentSpeaker, currentSealedBox, currentPortedBox, currentBandPassBox, currentSpeakerNumber, currentTabIndex)) { projectSaved = true; #if QT_VERSION >= QT_VERSION_CHECK(6,0,0) QString prefix = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation); #elif QT_VERSION >= QT_VERSION_CHECK(5,0,0) QString prefix = QStandardPaths::writableLocation(QStandardPaths::DataLocation); #else QString prefix = QDesktopServices::storageLocation(QDesktopServices::DataLocation); #endif if (!ImportExport::getSavePath().startsWith(prefix)) setRecentFile(ImportExport::getSavePath(), true); } } void MainWindow::onProjectExport() { QString home = MainWindow::getHome(); QString fileName = QFileDialog::getSaveFileName(this, tr("Export File"), home + QDir::separator() + tr("untitled.qsp"), tr("QSpeakers project (*.qsp)")); /* user cancelled */ if (fileName.isEmpty()) return; if (!fileName.endsWith(".qsp")) fileName += ".qsp"; QFile file(fileName); if(ImportExport::exportProject(file, projectProperties, currentSpeaker, currentSealedBox, currentPortedBox, currentBandPassBox, currentSpeakerNumber, currentTabIndex)) { setRecentFile(fileName, true); } } void MainWindow::onProjectImport() { if (!projectSaved) { QMessageBox::StandardButton pressed = QMessageBox::question(this, tr("Project not saved"), tr("Current project has not been saved. Continue anyway?"), QMessageBox::Yes|QMessageBox::No); if (pressed == QMessageBox::No) return; } QString home = MainWindow::getHome(); QString fileName = QFileDialog::getOpenFileName(this, tr("Import File"), home, tr("QSpeakers project (*.qsp)")); /* user cancelled */ if (fileName.isEmpty()) return; if (!loadFile(fileName)) { QMessageBox::warning(this, tr("Warning"), tr("Could not open project!")); } } void MainWindow::onOpenRecentActionTriggered() { if (!projectSaved) { QMessageBox::StandardButton pressed = QMessageBox::question(this, tr("Project not saved"), tr("Current project has not been saved. Continue anyway?"), QMessageBox::Yes|QMessageBox::No); if (pressed == QMessageBox::No) return; } QAction *action = qobject_cast(sender()); if (action) { if (!loadFile(action->data().toString())) { QMessageBox::warning(this, tr("Warning"), tr("Could not open project!")); } } } QString MainWindow::strippedName(const QString& fullFileName) { return QFileInfo(fullFileName).fileName(); } void MainWindow::updateRecentFileActions() { QSettings settings(SETTINGS_DOMAIN, SETTINGS_APP); QStringList files = settings.value("recentFileList").toStringList(); int numRecentFiles = qMin(files.size(), (int)MaxRecentFiles); for (int i = 0; i < numRecentFiles; ++i) { QString text("&%1 %2"); text = text.arg(i + 1).arg(strippedName(files[i])); recentFileActs[i]->setText(text); recentFileActs[i]->setData(files[i]); recentFileActs[i]->setVisible(true); } for (int j = numRecentFiles; j < MaxRecentFiles; ++j) recentFileActs[j]->setVisible(false); } void MainWindow::setRecentFile(const QString& fileName, bool ok) { QSettings settings(SETTINGS_DOMAIN, SETTINGS_APP); QStringList files = settings.value("recentFileList").toStringList(); files.removeAll(fileName); if (ok) files.prepend(fileName); while (files.size() > MaxRecentFiles) files.removeLast(); settings.setValue("recentFileList", files); updateRecentFileActions(); } bool MainWindow::loadFile(const QString& fileName) { /* clear undo history */ this->commandStack->clear(); unlinkInternals(); unlinkTabs(); QFile file(fileName); if (!ImportExport::importProject(projectProperties, currentSpeaker, currentSealedBox, currentPortedBox, currentBandPassBox, ¤tSpeakerNumber, ¤tTabIndex, file)) { setRecentFile(fileName, false); linkInternals(); linkTabs(); return false; } #if QT_VERSION >= QT_VERSION_CHECK(6,0,0) QString prefix = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation); #elif QT_VERSION >= QT_VERSION_CHECK(5,0,0) QString prefix = QStandardPaths::writableLocation(QStandardPaths::DataLocation); #else QString prefix = QDesktopServices::storageLocation(QDesktopServices::DataLocation); #endif if (!fileName.startsWith(prefix)) setRecentFile(fileName, true); ImportExport::setSavePath(fileName); setWindowFilePath(ImportExport::getSavePath()); syncUiFromCurrentSpeaker(currentSpeaker); syncUiFromCurrentSealedBox(currentSealedBox); syncUiFromCurrentPortedBox(currentPortedBox); syncUiFromCurrentBandPassBox(currentBandPassBox); linkInternals(); linkTabs(); ui->tabWidget->setCurrentIndex(currentTabIndex); /* if (notInDbSpeaker) onSpeakerModify(); */ projectSaved = true; return true; } void MainWindow::onProjectQuit() { if (projectSaved) { this->close(); return; } if (!currentSpeaker.isValid()) { this->close(); return; } QMessageBox::StandardButton pressed = QMessageBox::question(this, tr("Project not saved"), tr("The current project has not been saved. Exit anyway?"), QMessageBox::Yes|QMessageBox::No); if (pressed == QMessageBox::Yes) this->close(); } void MainWindow::syncUiFromCurrentSpeaker(const Speaker& spk) { if (!spk.isValid()) return; /* look if vendor is in the db */ QList speakers = SpeakerDb::getByVendor(spk.getVendor()); unlinkTabs(); if (speakers.count() == 0) { /* if this is an unknown vendor, insert in combo */ ui->vendorComboBox->insertItem(0, spk.getVendor()); ui->vendorComboBox->setCurrentIndex(0); ui->modelComboBox->clear(); /* this means also a new model */ ui->modelComboBox->insertItem(0, spk.getModel()); ui->modelComboBox->setCurrentIndex(0); notInDbSpeaker = &spk; } else { /* select correct vendor */ ui->vendorComboBox->setCurrentIndex(ui->vendorComboBox->findText(spk.getVendor())); /* fill speakers of this vendor */ ui->modelComboBox->clear(); ui->modelComboBox->addItems(SpeakerDb::getModelsByVendor(spk.getVendor())); int i = 0; for (i = 0; i < speakers.count(); i++) { Speaker speaker = speakers[i]; if (speaker.getModel() == spk.getModel()) { if (speaker != spk) { /* speaker conflict, renaming */ currentSpeaker.setModel(speaker.getModel() + "*"); ui->modelComboBox->addItem(spk.getModel()); ui->modelComboBox->setCurrentIndex(ui->modelComboBox->findText(spk.getModel())); notInDbSpeaker = &spk; } else { /* okay, select correct combo */ ui->modelComboBox->setCurrentIndex(ui->modelComboBox->findText(spk.getModel())); notInDbSpeaker = nullptr; } break; } } if (i == speakers.count()) { /* vendor was ok but model was not in DB */ ui->modelComboBox->addItem(spk.getModel()); ui->modelComboBox->setCurrentIndex(ui->modelComboBox->findText(spk.getModel())); notInDbSpeaker = &spk; } } ui->numberSpinBox->setValue(currentSpeakerNumber); /* display speaker's values */ ui->splValueLabel->setNum(currentSpeaker.getSpl()); ui->fsValueLabel->setNum(currentSpeaker.getFs()); ui->qtsValueLabel->setNum(currentSpeaker.getQts()); ui->vasValueLabel->setNum(currentSpeaker.getVas()); ui->diaValueLabel->setNum(currentSpeaker.getDia()); ui->zValueLabel->setNum(currentSpeaker.getZ()); ui->vcValueLabel->setNum(currentSpeaker.getVc()); linkTabs(); projectSaved = false; } void MainWindow::syncUiFromCurrentSealedBox(const SealedBox& box) { unlinkTabs(); ui->sealedVolumeDoubleSpinBox->setValue(box.getVolume()); System s(currentSpeaker, &box, currentSpeakerNumber); sealedPlot->clear(); for (double f = sealedPlot->getXmin(); f < portedPlot->getXmax(); f *= pow(10, 1.0/100.0)) { double db = s.response(f); sealedPlot->appendPointF(QPointF(f, db)); } sealedPlot->draw3dbVLine(); linkTabs(); projectSaved = false; } void MainWindow::syncUiFromCurrentPortedBox(const PortedBox& box) { unlinkTabs(); ui->portedVolumeDoubleSpinBox->setValue(box.getBoxVolume()); ui->portedResonancedoubleSpinBox->setValue(box.getResFreq()); ui->portedPortsNumberSpinBox->setValue(box.getPortNum()); ui->portedPortDiameterDoubleSpinBox->setValue(box.getPortDiam()); bool slotPortActivated = box.getSlotPortActivated(); ui->portedPortSlotWidthButton->setChecked(slotPortActivated); ui->portedPortSlotWidthButton->clicked(slotPortActivated); ui->portedPortSlotWidthDoubleSpinBox->setEnabled(slotPortActivated); ui->portedPortSlotHeightLineEdit->setEnabled(slotPortActivated); ui->portedPortSlotWidthDoubleSpinBox->setValue(box.getSlotWidth()); ui->portedPortSlotHeightLineEdit->setText(QString::number(box.getSlotHeight(), 'f', 1)); ui->portedPortLengthLineEdit->setText(QString::number(box.getPortLen(), 'f', 1)); System s(currentSpeaker, &box, currentSpeakerNumber); portedPlot->clear(); for (double f = portedPlot->getXmin(); f < portedPlot->getXmax(); f *= pow(10, 1.0/100.0)) { double db = s.response(f); portedPlot->appendPointF(QPointF(f, db)); } portedPlot->draw3dbVLine(); linkTabs(); projectSaved = false; } void MainWindow::syncUiFromCurrentBandPassBox(const BandPassBox& box) { unlinkTabs(); ui->bandPassSealedVolumeDoubleSpinBox->setValue(box.getSealedBoxVolume()); ui->bandPassPortedVolumeDoubleSpinBox->setValue(box.getPortedBoxVolume()); ui->bandPassPortedResonanceDoubleSpinBox->setValue(box.getPortedBoxResFreq()); ui->bandPassPortsNumberSpinBox->setValue(box.getPortedBoxPortNum()); ui->bandPassPortDiameterDoubleSpinBox->setValue(box.getPortedBoxPortDiam()); bool slotPortActivated = box.getPortedBoxSlotPortActivated(); ui->bandpassPortSlotWidthButton->setChecked(slotPortActivated); ui->bandpassPortSlotWidthButton->clicked(slotPortActivated); ui->bandpassPortSlotWidthDoubleSpinBox->setEnabled(slotPortActivated); ui->bandpassPortSlotHeightLineEdit->setEnabled(slotPortActivated); ui->bandpassPortSlotWidthDoubleSpinBox->setValue(box.getPortedBoxSlotWidth()); ui->bandpassPortSlotHeightLineEdit->setText(QString::number(box.getPortedBoxSlotHeight(), 'f', 1)); ui->bandPassPortLengthLineEdit->setText(QString::number(box.getPortedBoxPortLen(), 'f', 1)); System s(currentSpeaker, &box, currentSpeakerNumber); bandpassPlot->clear(); for (double f = bandpassPlot->getXmin(); f < bandpassPlot->getXmax(); f *= pow(10, 1.0/100.0)) { double db = s.response(f); bandpassPlot->appendPointF(QPointF(f, db)); } bandpassPlot->draw3dbVLine(); linkTabs(); projectSaved = false; } void MainWindow::setCurrentSpeaker(const Speaker &spk) { if ((currentSpeaker.getVendor() == spk.getVendor()) && (currentSpeaker.getModel() == spk.getModel())) return; currentSpeaker = spk; emit currentSpeakerChanged(spk); } bool MainWindow::print(QPrinter *printer) { QPainter painter; if (!painter.begin(printer)) return false; QRect page = printer->pageLayout().paintRectPixels(printer->resolution()); QMargins margins = printer->pageLayout().marginsPixels(printer->resolution()); qreal realwidth = page.width() - 2 * margins.left(); qreal textheight = painter.fontMetrics().height(); qreal step = 0; QFont font; font.setBold(true); painter.setFont(font); QPen pen; pen.setCosmetic(true); painter.setPen(pen); QTextOption option(Qt::AlignHCenter); painter.drawText(QRectF(page.left(), page.top(), realwidth, page.height()), projectProperties.title, option); step += textheight; if (ui->tabWidget->currentWidget() == ui->sealedTab) { System s(currentSpeaker, ¤tSealedBox, currentSpeakerNumber); s.render(&painter, QRectF(page.left(), page.top() + step, realwidth, page.height() / 4.)); step += page.height() / 4.; sealedPlot->render(&painter, QRectF(page.left(), page.top() + step, realwidth, page.height() / 2.)); step += page.height() / 2.; } else if (ui->tabWidget->currentWidget() == ui->portedTab) { System s(currentSpeaker, ¤tPortedBox, currentSpeakerNumber); s.render(&painter, QRectF(page.left(), page.top() + step, realwidth, page.height() / 4.)); step += page.height() / 4.; portedPlot->render(&painter, QRectF(page.left(), page.top() + step, realwidth, page.height() / 2.)); step += page.height() / 2.; } else { System s(currentSpeaker, ¤tBandPassBox, currentSpeakerNumber); s.render(&painter, QRectF(page.left(), page.top() + step, realwidth, page.height() / 4.)); step += page.height() / 4.; bandpassPlot->render(&painter, QRectF(page.left(), page.top() + step, realwidth, page.height() / 2.)); step += page.height() / 2.; } font.setBold(false); painter.setFont(font); painter.drawText(QRectF(page.left(), page.top() + step, page.width(), page.height() - step), projectProperties.note); painter.end(); return true; } QString MainWindow::getHome() { QString home; #if QT_VERSION >= QT_VERSION_CHECK(5,0,0) home = QStandardPaths::writableLocation(QStandardPaths::HomeLocation); #else home = QDesktopServices::storageLocation(QDesktopServices::HomeLocation); #endif return home; } void MainWindow::onBandpassAlignment() { bandpassDialog = new BandpassDialog(this); connect(bandpassDialog, &BandpassDialog::optimizeRequested, this, &MainWindow::onBandpassOptimizeRequested); connect(bandpassDialog, &BandpassDialog::optimizeCancelled, this, &MainWindow::onBandpassOptimizeCancelled); bandpassDialog->show(); } void MainWindow::onBandpassOptimizeRequested(double s, double pa) { if (ui->tabWidget->currentWidget() == ui->bandpassTab) { Optimizer optimizer(currentSpeaker, ¤tBandPassBox, currentSpeakerNumber, this); optimizer.bandpassAlignS_Pa(s, pa); emit currentBandPassBoxChanged(currentBandPassBox); } disconnect(bandpassDialog, &BandpassDialog::optimizeRequested, this, &MainWindow::onBandpassOptimizeRequested); disconnect(bandpassDialog, &BandpassDialog::optimizeCancelled, this, &MainWindow::onBandpassOptimizeCancelled); bandpassDialog->close(); bandpassDialog->deleteLater(); bandpassDialog = nullptr; } void MainWindow::onBandpassOptimizeCancelled() { disconnect(bandpassDialog, &BandpassDialog::optimizeRequested, this, &MainWindow::onBandpassOptimizeRequested); disconnect(bandpassDialog, &BandpassDialog::optimizeCancelled, this, &MainWindow::onBandpassOptimizeCancelled); bandpassDialog->close(); bandpassDialog->deleteLater(); bandpassDialog = nullptr; } void MainWindow::onCurvePlot() { QString home = getHome(); QString box = ui->tabWidget->currentWidget()->objectName().replace("Tab", "Box"); QString f = QString("QSpeakers %1 %2 %3").arg(currentSpeaker.getVendor()).arg(currentSpeaker.getModel()).arg(box); f.replace(' ', '_'); QString fileName = QFileDialog::getSaveFileName(this, tr("Export for Gnuplot"), home + QDir::separator() + f + ".dat", tr("Gnuplot data (*.dat)")); /* user cancelled */ if (fileName.isEmpty()) return; exportPlot(fileName, currentTabIndex); } void MainWindow::on3DScadExport() { bool ok = false; QList vals = ScadDialog::getValues(2, this, &ok); if (!ok) return; Q_ASSERT(vals.size() == 2); qreal margin = vals.at(0); /* loudspeaker margin */ qreal thick = vals.at(1); /* wood thick */ QString home = getHome(); QString box = ui->tabWidget->currentWidget()->objectName().replace("Tab", "Box"); QString f = QString("QSpeakers %1 %2 %3 3D").arg(currentSpeaker.getVendor()).arg(currentSpeaker.getModel()).arg(box); f.replace(' ', '_'); QString fileName = QFileDialog::getSaveFileName(this, tr("Export for 3D OpenSCAD"), home + QDir::separator() + f + ".scad", tr("OpenSCAD script (*.scad)")); /* user cancelled */ if (fileName.isEmpty()) return; exportScad3D(fileName, currentTabIndex, margin, thick); } void MainWindow::on2DScadExport() { bool ok = false; QList vals = ScadDialog::getValues(3, this, &ok); if (!ok) return; Q_ASSERT(vals.size() == 3); qreal margin = vals.at(0); /* loudspeaker margin */ qreal thick = vals.at(1); /* wood thick */ qreal saw = vals.at(2); /* saw thick */ QString home = getHome(); QString box = ui->tabWidget->currentWidget()->objectName().replace("Tab", "Box"); QString f = QString("QSpeakers %1 %2 %3 2D").arg(currentSpeaker.getVendor()).arg(currentSpeaker.getModel()).arg(box); f.replace(' ', '_'); QString fileName = QFileDialog::getSaveFileName(this, tr("Export for 2D OpenSCAD"), home + QDir::separator() + f + ".scad", tr("OpenSCAD script (*.scad)")); /* user cancelled */ if (fileName.isEmpty()) return; exportScad2D(fileName, currentTabIndex, margin, thick, saw); } void MainWindow::exportPlot(const QString& outfileName, int tabindex) { QFile file(outfileName); QString f("# QSpeakers plot: "); f += currentSpeaker.getVendor() + " " + currentSpeaker.getModel() + "\n"; f += "# freq., dB.\n"; QLineSeries* series; switch (tabindex) { case 0: /* closed box */ series = sealedPlot->series(); break; case 1: /* vented box */ series = portedPlot->series(); break; case 2: /* bandpass box */ series = bandpassPlot->series(); break; default: return; } QList points = series->points(); int len = points.length(); QString line; for (int i = 0; i < len; i++) { line.clear(); QPointF p = points.at(i); line += QString("%1 %2 ").arg(p.x()).arg(p.y()); line.chop(1); line.append('\n'); f.append(line); } file.open(QIODevice::WriteOnly); file.write(f.toUtf8()); file.close(); } void MainWindow::exportScad(const QString& scad, const QString &outfileName, int tabindex, qreal margin, qreal thick, qreal saw) { QFile templ(scad); templ.open(QIODevice::ReadOnly); QString s = templ.readAll(); s.replace("__VENDOR__", currentSpeaker.getVendor()); s.replace("__MODEL__", currentSpeaker.getModel()); s.replace("__NUMBER__", QString::number(currentSpeakerNumber)); s.replace("__MARGIN__", QString::number(margin)); s.replace("__DIAMETER__", QString::number(currentSpeaker.getDia() * 1000)); /* mm */ s.replace("__WOODTHICK__", QString::number(thick)); s.replace("__SAWTHICK__", QString::number(saw)); if (tabindex == 0) { s.replace("__SEALEDBOXVOLUME__", QString::number(currentSealedBox.getVolume())); } else if (tabindex == 1) { s.replace("__PORTEDBOXVOLUME__", QString::number(currentPortedBox.getBoxVolume())); s.replace("__PORTEDBOXPORTNUMBER__", QString::number(currentPortedBox.getPortNum())); } else if (tabindex == 2) { s.replace("__SEALEDBOXVOLUME__", QString::number(currentBandPassBox.getSealedBoxVolume())); s.replace("__PORTEDBOXVOLUME__", QString::number(currentBandPassBox.getPortedBoxVolume())); s.replace("__PORTEDBOXPORTNUMBER__", QString::number(currentBandPassBox.getPortedBoxPortNum())); } if (tabindex == 1) { if (currentPortedBox.getSlotPortActivated()) { s.replace("__PORTEDBOXPORTSLOTACTIVATED__", "true"); s.replace("__PORTEDBOXPORTSLOTWIDTH__", QString::number(currentPortedBox.getSlotWidth() * 10)); /* mm */ s.replace("__PORTEDBOXPORTSLOTHEIGHT__", QString::number(currentPortedBox.getSlotHeight() * 10)); /* mm */ } else { s.replace("__PORTEDBOXPORTSLOTACTIVATED__", "false"); s.replace("__PORTEDBOXPORTSLOTWIDTH__", "0"); s.replace("__PORTEDBOXPORTSLOTHEIGHT__", "0"); } s.replace("__PORTEDBOXPORTDIAMETER__", QString::number(currentPortedBox.getPortDiam() * 10)); /* mm */ s.replace("__PORTEDBOXPORTLENGTH__", QString::number(currentPortedBox.getPortLen() * 10)); /* mm */ } else if (tabindex == 2) { if (currentBandPassBox.getPortedBoxSlotPortActivated()) { s.replace("__PORTEDBOXPORTSLOTACTIVATED__", "true"); s.replace("__PORTEDBOXPORTSLOTWIDTH__", QString::number(currentBandPassBox.getPortedBoxSlotWidth() * 10)); /* mm */ s.replace("__PORTEDBOXPORTSLOTHEIGHT__", QString::number(currentBandPassBox.getPortedBoxSlotHeight() * 10)); /* mm */ } else { s.replace("__PORTEDBOXPORTSLOTACTIVATED__", "false"); s.replace("__PORTEDBOXPORTSLOTWIDTH__", "0"); s.replace("__PORTEDBOXPORTSLOTHEIGHT__", "0"); } s.replace("__PORTEDBOXPORTDIAMETER__", QString::number(currentBandPassBox.getPortedBoxPortDiam() * 10)); /* mm */ s.replace("__PORTEDBOXPORTLENGTH__", QString::number(currentBandPassBox.getPortedBoxPortLen() * 10)); /* mm */ } QFile f(outfileName); f.open(QIODevice::WriteOnly); f.write(s.toUtf8()); f.close(); } void MainWindow::onProjectProperties() { propertiesDialog = new PropertiesDialog(this); propertiesDialog->setTitle(projectProperties.title); propertiesDialog->setNote(projectProperties.note); connect(propertiesDialog, &QDialog::accepted, this, &MainWindow::onPropertiesAccepted); connect(propertiesDialog,&QDialog::rejected, this, &MainWindow::onPropertiesRejected); propertiesDialog->show(); } void MainWindow::onPropertiesRejected() { disconnect(propertiesDialog, &QDialog::accepted, this, &MainWindow::onPropertiesAccepted); disconnect(propertiesDialog, &QDialog::rejected, this, &MainWindow::onPropertiesRejected); propertiesDialog->close(); propertiesDialog->deleteLater(); propertiesDialog = nullptr; } void MainWindow::onPropertiesAccepted() { if (projectProperties.title != propertiesDialog->getTitle() || projectProperties.note != propertiesDialog->getNote()) projectSaved = false; projectProperties.title = propertiesDialog->getTitle(); projectProperties.note = propertiesDialog->getNote(); disconnect(propertiesDialog, &QDialog::accepted, this, &MainWindow::onPropertiesAccepted); disconnect(propertiesDialog, &QDialog::rejected, this, &MainWindow::onPropertiesRejected); propertiesDialog->close(); propertiesDialog->deleteLater(); propertiesDialog = nullptr; } void MainWindow::exportScad3D(const QString &outfileName, int tabindex, qreal margin, qreal thick) { QFile file(outfileName); QString scad; switch (tabindex) { case 0: /* closed box */ /* non-prod version: */ scad = "../qspeakers/sealedbox_template.scad"; if (!QFileInfo::exists(scad)) #ifdef __mswin scad = (QCoreApplication::applicationDirPath() + QDir::separator() + "sealedbox_template.scad"); #else scad = (DATADIR "/" TARGET "/sealedbox_template.scad"); #endif break; case 1: /* vented box */ /* non-prod version: */ scad = "../qspeakers/portedbox_template.scad"; if (!QFileInfo::exists(scad)) #ifdef __mswin scad = (QCoreApplication::applicationDirPath() + QDir::separator() + "sealedbox_template.scad"); #else scad = (DATADIR "/" TARGET "/portedbox_template.scad"); #endif break; case 2: /* bandpass box */ /* non-prod version: */ scad = "../qspeakers/bandpassbox_template.scad"; if (!QFileInfo::exists(scad)) #ifdef __mswin scad = (QCoreApplication::applicationDirPath() + QDir::separator() + "sealedbox_template.scad"); #else scad = (DATADIR "/" TARGET "/bandpassbox_template.scad"); #endif break; default: return; } exportScad(scad, outfileName, tabindex, margin, thick, 0); } void MainWindow::exportScad2D(const QString &outfileName, int tabindex, qreal margin, qreal thick, qreal saw) { QFile file(outfileName); QString scad; switch (tabindex) { case 0: /* closed box */ /* non-prod version: */ scad = "../qspeakers/sealedbox_cutting_template.scad"; if (!QFileInfo::exists(scad)) #ifdef __mswin scad = (QCoreApplication::applicationDirPath() + QDir::separator() + "sealedbox_cutting_template.scad"); #else scad = (DATADIR "/" TARGET "/sealedbox_cutting_template.scad"); #endif break; case 1: /* vented box */ /* non-prod version: */ scad = "../qspeakers/portedbox_cutting_template.scad"; if (!QFileInfo::exists(scad)) #ifdef __mswin scad = (QCoreApplication::applicationDirPath() + QDir::separator() + "sealedbox_cutting_template.scad"); #else scad = (DATADIR "/" TARGET "/portedbox_cutting_template.scad"); #endif break; case 2: /* bandpass box */ /* non-prod version: */ scad = "../qspeakers/bandpassbox_cutting_template.scad"; if (!QFileInfo::exists(scad)) #ifdef __mswin scad = (QCoreApplication::applicationDirPath() + QDir::separator() + "sealedbox_cutting_template.scad"); #else scad = (DATADIR "/" TARGET "/bandpassbox_cutting_template.scad"); #endif break; default: return; } exportScad(scad, outfileName, tabindex, margin, thick, saw); } void MainWindow::linkMenus() { connect(ui->actionProjectProperties, &QAction::triggered, this, &MainWindow::onProjectProperties); connect(ui->actionProjectSave, &QAction::triggered, this, &MainWindow::onProjectSave); connect(ui->actionProjectQuit, &QAction::triggered, this, &MainWindow::onProjectQuit); connect(ui->actionSpeakerNew, &QAction::triggered, this, &MainWindow::onSpeakerNew); connect(ui->actionSpeakerModify, &QAction::triggered, this, &MainWindow::onSpeakerModify); connect(ui->actionSpeakerRemove, &QAction::triggered, this, &MainWindow::onSpeakerRemove); connect(ui->actionProjectExport, &QAction::triggered, this, &MainWindow::onProjectExport); connect(ui->actionProjectImport, &QAction::triggered, this, &MainWindow::onProjectImport); connect(ui->actionEditOptimize, &QAction::triggered, this, &MainWindow::onEditOptimize); connect(ui->actionSpeakerSearch, &QAction::triggered, this, &MainWindow::onSpeakerSearch); connect(ui->actionProjectPrint, &QAction::triggered, this, &MainWindow::onProjectPrint); connect(ui->actionUndo, &QAction::triggered, this, &MainWindow::onUndo); connect(ui->actionRedo, &QAction::triggered, this, &MainWindow::onRedo); connect(ui->actionAbout, &QAction::triggered, this, &MainWindow::onAboutAbout); /* ported alignments sub-menu */ connect(ui->actionModerate_Inf, &QAction::triggered, this, &MainWindow::onAlignModerate_Inf); connect(ui->actionLegendre, &QAction::triggered, this, &MainWindow::onAlignLegendre); connect(ui->actionBessel, &QAction::triggered, this, &MainWindow::onAlignBessel); connect(ui->actionBullock, &QAction::triggered, this, &MainWindow::onAlignBullock); connect(ui->actionKeele_Hoge, &QAction::triggered, this, &MainWindow::onAlignKeele_Hoge); /* bandpass alignment */ connect(ui->actionBandpass_alignment, &QAction::triggered, this, &MainWindow::onBandpassAlignment); /* exports menu */ connect(ui->actionCurve_Plot, &QAction::triggered, this, &MainWindow::onCurvePlot); connect(ui->action3D_OpenScad, &QAction::triggered, this, &MainWindow::on3DScadExport); connect(ui->action2D_OpenScad, &QAction::triggered, this, &MainWindow::on2DScadExport); } void MainWindow::linkTabs() { connect(ui->tabWidget, &QTabWidget::currentChanged, this, &MainWindow::onCurrentTabChanged); /* spk combos action */ #if QT_VERSION >= QT_VERSION_CHECK(5,15,0) connect(ui->vendorComboBox, &QComboBox::textActivated, this, &MainWindow::onVendorChanged); connect(ui->modelComboBox, &QComboBox::textActivated, this, &MainWindow::onModelChanged); #else connect(ui->vendorComboBox, QOverload::of(&QComboBox::activated), this, &MainWindow::onVendorChanged); connect(ui->modelComboBox, QOverload::of(&QComboBox::activated), this, &MainWindow::onModelChanged); #endif /* drivers number spin action */ connect(ui->numberSpinBox, QOverload::of(&QSpinBox::valueChanged), this, &MainWindow::onNumberSpinChanged); connect(ui->sealedVolumeDoubleSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &MainWindow::onSealedVolumeDoubleSpinChanged); connect(ui->portedVolumeDoubleSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &MainWindow::onPortedVolumeDoubleSpinChanged); connect(ui->portedResonancedoubleSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &MainWindow::onPortedResonanceDoubleSpinChanged); connect(ui->portedPortsNumberSpinBox, QOverload::of(&QSpinBox::valueChanged), this, &MainWindow::onPortedPortsNumberSpinChanged); connect(ui->portedPortDiameterDoubleSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &MainWindow::onPortedPortDiameterDoubleSpinChanged); connect(ui->portedPortSlotWidthButton, &QPushButton::clicked, this, &MainWindow::onPortedSlotPortActivated); connect(ui->portedPortSlotWidthDoubleSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &MainWindow::onPortedSlotWidthDoubleSpinChanged); connect(ui->bandPassSealedVolumeDoubleSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &MainWindow::onBandPassSealedVolumeDoubleSpinChanged); connect(ui->bandPassPortedVolumeDoubleSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &MainWindow::onBandPassPortedVolumeDoubleSpinChanged); connect(ui->bandPassPortedResonanceDoubleSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &MainWindow::onBandPassPortedResonanceDoubleSpinChanged); connect(ui->bandPassPortsNumberSpinBox, QOverload::of(&QSpinBox::valueChanged), this, &MainWindow::onBandPassPortNumSpinChanged); connect(ui->bandPassPortDiameterDoubleSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &MainWindow::onBandPassPortDiameterDoubleSpinChanged); connect(ui->bandpassPortSlotWidthButton, &QPushButton::clicked, this, &MainWindow::onBandPassSlotPortActivated); connect(ui->bandpassPortSlotWidthDoubleSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &MainWindow::onBandPassSlotWidthDoubleSpinChanged); } void MainWindow::linkInternals() { connect(this, &MainWindow::currentSpeakerChanged, this, &MainWindow::onCurrentSpeakerChanged); connect(this, &MainWindow::currentSealedBoxChanged, this, &MainWindow::onCurrentSealedBoxChanged); connect(this, &MainWindow::currentPortedBoxChanged, this, &MainWindow::onCurrentPortedBoxChanged); connect(this, &MainWindow::currentBandPassBoxChanged, this, &MainWindow::onCurrentBandPassBoxChanged); connect(this->commandStack, &QUndoStack::canUndoChanged, ui->actionUndo, &QAction::setEnabled); connect(this->commandStack, &QUndoStack::canRedoChanged, ui->actionRedo, &QAction::setEnabled); } void MainWindow::unlinkMenus() { disconnect(ui->actionProjectProperties, &QAction::triggered, this, &MainWindow::onProjectProperties); disconnect(ui->actionProjectSave, &QAction::triggered, this, &MainWindow::onProjectSave); disconnect(ui->actionProjectQuit, &QAction::triggered, this, &MainWindow::onProjectQuit); disconnect(ui->actionSpeakerNew, &QAction::triggered, this, &MainWindow::onSpeakerNew); disconnect(ui->actionSpeakerModify, &QAction::triggered, this, &MainWindow::onSpeakerModify); disconnect(ui->actionSpeakerRemove, &QAction::triggered, this, &MainWindow::onSpeakerRemove); disconnect(ui->actionProjectExport, &QAction::triggered, this, &MainWindow::onProjectExport); disconnect(ui->actionProjectImport, &QAction::triggered, this, &MainWindow::onProjectImport); disconnect(ui->actionEditOptimize, &QAction::triggered, this, &MainWindow::onEditOptimize); disconnect(ui->actionSpeakerSearch, &QAction::triggered, this, &MainWindow::onSpeakerSearch); disconnect(ui->actionProjectPrint, &QAction::triggered, this, &MainWindow::onProjectPrint); disconnect(ui->actionAbout, &QAction::triggered, this, &MainWindow::onAboutAbout); /* ported alignments sub-menu */ disconnect(ui->actionModerate_Inf, &QAction::triggered, this, &MainWindow::onAlignModerate_Inf); disconnect(ui->actionLegendre, &QAction::triggered, this, &MainWindow::onAlignLegendre); disconnect(ui->actionBessel, &QAction::triggered, this, &MainWindow::onAlignBessel); disconnect(ui->actionBullock, &QAction::triggered, this, &MainWindow::onAlignBullock); disconnect(ui->actionKeele_Hoge, &QAction::triggered, this, &MainWindow::onAlignKeele_Hoge); /* bandpass alignment */ disconnect(ui->actionBandpass_alignment, &QAction::triggered, this, &MainWindow::onBandpassAlignment); } void MainWindow::unlinkTabs() { disconnect(ui->tabWidget, &QTabWidget::currentChanged, this, &MainWindow::onCurrentTabChanged); /* spk combos action */ #if QT_VERSION >= QT_VERSION_CHECK(5,15,0) disconnect(ui->vendorComboBox, &QComboBox::textActivated, this, &MainWindow::onVendorChanged); disconnect(ui->modelComboBox, &QComboBox::textActivated, this, &MainWindow::onModelChanged); #else disconnect(ui->vendorComboBox, QOverload::of(&QComboBox::activated), this, &MainWindow::onVendorChanged); disconnect(ui->modelComboBox, QOverload::of(&QComboBox::activated), this, &MainWindow::onModelChanged); #endif disconnect(ui->numberSpinBox, QOverload::of(&QSpinBox::valueChanged), this, &MainWindow::onNumberSpinChanged); disconnect(ui->sealedVolumeDoubleSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &MainWindow::onSealedVolumeDoubleSpinChanged); disconnect(ui->portedVolumeDoubleSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &MainWindow::onPortedVolumeDoubleSpinChanged); disconnect(ui->portedResonancedoubleSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &MainWindow::onPortedResonanceDoubleSpinChanged); disconnect(ui->portedPortsNumberSpinBox, QOverload::of(&QSpinBox::valueChanged), this, &MainWindow::onPortedPortsNumberSpinChanged); disconnect(ui->portedPortDiameterDoubleSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &MainWindow::onPortedPortDiameterDoubleSpinChanged); disconnect(ui->portedPortSlotWidthButton, &QPushButton::clicked, this, &MainWindow::onPortedSlotPortActivated); disconnect(ui->portedPortSlotWidthDoubleSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &MainWindow::onPortedSlotWidthDoubleSpinChanged); disconnect(ui->bandPassSealedVolumeDoubleSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &MainWindow::onBandPassSealedVolumeDoubleSpinChanged); disconnect(ui->bandPassPortedVolumeDoubleSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &MainWindow::onBandPassPortedVolumeDoubleSpinChanged); disconnect(ui->bandPassPortedResonanceDoubleSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &MainWindow::onBandPassPortedResonanceDoubleSpinChanged); disconnect(ui->bandPassPortsNumberSpinBox, QOverload::of(&QSpinBox::valueChanged), this, &MainWindow::onBandPassPortNumSpinChanged); disconnect(ui->bandPassPortDiameterDoubleSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &MainWindow::onBandPassPortDiameterDoubleSpinChanged); disconnect(ui->bandpassPortSlotWidthButton, &QPushButton::clicked, this, &MainWindow::onBandPassSlotPortActivated); disconnect(ui->bandpassPortSlotWidthDoubleSpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, &MainWindow::onBandPassSlotWidthDoubleSpinChanged); } void MainWindow::unlinkInternals() { disconnect(this, &MainWindow::currentSpeakerChanged, this, &MainWindow::onCurrentSpeakerChanged); disconnect(this, &MainWindow::currentSealedBoxChanged, this, &MainWindow::onCurrentSealedBoxChanged); disconnect(this, &MainWindow::currentPortedBoxChanged, this, &MainWindow::onCurrentPortedBoxChanged); disconnect(this, &MainWindow::currentBandPassBoxChanged, this, &MainWindow::onCurrentBandPassBoxChanged); } void MainWindow::onSpeakerNew() { isModifying = false; spkDialog = new SpeakerDialog(this); connect(spkDialog, &SpeakerDialog::speakerInserted, this, &MainWindow::onSpeakerInserted); connect(spkDialog, &SpeakerDialog::speakerCancelled, this, &MainWindow::onSpeakerCancelled); spkDialog->show(); } void MainWindow::onSpeakerRemove() { QMessageBox::StandardButton pressed = QMessageBox::question(this, tr("Removal confirmation"), tr("Do you really want to remove this loudspeaker from the database?"), QMessageBox::Yes|QMessageBox::No); if (pressed == QMessageBox::No) return; QString vendor = currentSpeaker.getVendor(); QString model = currentSpeaker.getModel(); int num = SpeakerDb::getModelsByVendor(currentSpeaker.getVendor()).size(); ui->modelComboBox->removeItem(ui->modelComboBox->currentIndex()); if (num == 1) { ui->vendorComboBox->removeItem(ui->vendorComboBox->currentIndex()); } SpeakerDb::removeByVendorAndModel(vendor, model); /* fill speakers of automatically reselected vendor */ QString v = ui->vendorComboBox->currentText(); ui->modelComboBox->clear(); ui->modelComboBox->addItems(SpeakerDb::getModelsByVendor(v)); /* insert a fake speaker to let the choice to the user */ ui->modelComboBox->insertItem(0, "?"); ui->modelComboBox->setCurrentIndex(0); setCurrentSpeaker(Speaker()); } void MainWindow::onSpeakerModify() { isModifying = true; spkDialog = new SpeakerDialog(currentSpeaker, this); connect(spkDialog, &SpeakerDialog::speakerInserted, this, &MainWindow::onSpeakerInserted); connect(spkDialog, &SpeakerDialog::speakerCancelled, this,&MainWindow:: onSpeakerCancelled); spkDialog->show(); } void MainWindow::onSpeakerInserted(Speaker spk) { if (isModifying) { int idx; idx = ui->vendorComboBox->currentIndex(); ui->vendorComboBox->setItemText(idx, spk.getVendor()); idx = ui->modelComboBox->currentIndex(); ui->modelComboBox->setItemText(idx, spk.getModel()); currentSpeaker = spk; emit currentSpeakerChanged(currentSpeaker); } else { int idx = ui->vendorComboBox->findText(spk.getVendor()); if (idx == -1) ui->vendorComboBox->addItem(spk.getVendor()); else if (idx == ui->vendorComboBox->currentIndex()) ui->modelComboBox->addItem(spk.getModel()); } /* spk has been inserted or modified: remove anyway notInDbSpeaker */ notInDbSpeaker = nullptr; disconnect(spkDialog, &SpeakerDialog::speakerInserted, this, &MainWindow::onSpeakerInserted); disconnect(spkDialog, &SpeakerDialog::speakerCancelled, this, &MainWindow::onSpeakerCancelled); spkDialog->close(); spkDialog->deleteLater(); spkDialog = nullptr; } void MainWindow::onSpeakerCancelled() { disconnect(spkDialog, &SpeakerDialog::speakerInserted, this, &MainWindow::onSpeakerInserted); disconnect(spkDialog, &SpeakerDialog::speakerCancelled, this, &MainWindow::onSpeakerCancelled); spkDialog->close(); spkDialog->deleteLater(); spkDialog = nullptr; } void MainWindow::onEditOptimize() { if (ui->tabWidget->currentWidget() == ui->sealedTab) { Optimizer optimizer(currentSpeaker, ¤tSealedBox, currentSpeakerNumber, this); optimizer.genericOptimizeBox(); emit currentSealedBoxChanged(currentSealedBox); } else if (ui->tabWidget->currentWidget() == ui->portedTab) { Optimizer optimizer(currentSpeaker, ¤tPortedBox, currentSpeakerNumber, this); optimizer.genericOptimizeBox(); emit currentPortedBoxChanged(currentPortedBox); } else { Optimizer optimizer(currentSpeaker, ¤tBandPassBox, currentSpeakerNumber, this); optimizer.genericOptimizeBox(); emit currentBandPassBoxChanged(currentBandPassBox); } } void MainWindow::onAlignModerate_Inf() { if (ui->tabWidget->currentWidget() == ui->portedTab) { Optimizer optimzer(currentSpeaker, ¤tPortedBox, currentSpeakerNumber, this); optimzer.portedAlignModerate_Inf(); emit currentPortedBoxChanged(currentPortedBox); } } void MainWindow::onAlignLegendre() { if (ui->tabWidget->currentWidget() == ui->portedTab) { Optimizer optimizer(currentSpeaker, ¤tPortedBox, currentSpeakerNumber, this); optimizer.portedAlignLegendre(); emit currentPortedBoxChanged(currentPortedBox); } } void MainWindow::onAlignBessel() { if (ui->tabWidget->currentWidget() == ui->portedTab) { Optimizer optimzer(currentSpeaker, ¤tPortedBox, currentSpeakerNumber, this); optimzer.portedAlignBessel(); emit currentPortedBoxChanged(currentPortedBox); } } void MainWindow::onAlignKeele_Hoge() { /* BB4 */ if (ui->tabWidget->currentWidget() == ui->portedTab) { Optimizer optimizer(currentSpeaker, ¤tPortedBox, currentSpeakerNumber, this); optimizer.portedAlignKeele_Hoge(); emit currentPortedBoxChanged(currentPortedBox); } } void MainWindow::onAlignBullock() { /* SBB4 */ if (ui->tabWidget->currentWidget() == ui->portedTab) { Optimizer optimizer(currentSpeaker, ¤tPortedBox, currentSpeakerNumber, this); optimizer.portedAlignBullock(); emit currentPortedBoxChanged(currentPortedBox); } } void MainWindow::onSpeakerSearch() { searchDialog = new SearchDialog(this); connect(searchDialog, &SearchDialog::searchRequested, this, &MainWindow::onSearchRequested); connect(searchDialog,&SearchDialog::searchCancelled, this, &MainWindow::onSearchCancelled); searchDialog->show(); } void MainWindow::onProjectPrint() { QPrinter printer; printer.setCreator("QSpeakers"); printer.setDocName("QSpeakers Project"); QString box = ui->tabWidget->currentWidget()->objectName().replace("Tab", "Box"); printer.setOutputFileName("QSpeakers_" + currentSpeaker.getVendor() + "_" + currentSpeaker.getModel() + "_" + box + ".pdf"); printer.setPageOrientation(QPageLayout::Landscape); QPrintDialog dialog(&printer, this); if (dialog.exec() == QDialog::Accepted) { if (printer.isValid()) { if (!print(&printer)) { QPrinterInfo info(printer); qWarning() << "printerinfo definition null:" << info.isNull(); qWarning() << "printerinfo state error:" << (info.state() == QPrinter::Error); } } else { qWarning() << "invalid printer object"; } } } void MainWindow::onUndo() { if (this->commandStack->canUndo()) this->commandStack->undo(); } void MainWindow::onRedo() { if (this->commandStack->canRedo()) this->commandStack->redo(); } void MainWindow::onAboutAbout() { QMessageBox::about(this, tr("About QSpeakers"), tr("QSpeakers version %1 (%2)\n\n" "This program simulates common acoustical enclosures " "behaviour to help designing loudspeaker systems.\n\n" "This program is free software, copyright (C) 2014 " "Benoit Rouits and released under the " "GNU General Public Lisence version 3. It is delivered " "as is in the hope it can be useful, but with NO WARRANTY at all.").arg(VERSION, REVISION)); } void MainWindow::onSearchRequested(const QString& param, double min, double max) { disconnect(searchDialog, &SearchDialog::searchRequested, this, &MainWindow::onSearchRequested); disconnect(searchDialog, &SearchDialog::searchCancelled, this, &MainWindow::onSearchCancelled); searchDialog->close(); searchDialog->deleteLater(); searchDialog = nullptr; QList speakers = SpeakerDb::getByValue(param, min, max); listDialog = new ListDialog(speakers, this); connect(listDialog, &ListDialog::speakerItemSelected, this, &MainWindow::onSpeakerItemSelected); connect(listDialog, &ListDialog::speakerItemCancelled, this, &MainWindow::onSpeakerItemCancelled); listDialog->show(); } void MainWindow::onSearchCancelled() { disconnect(searchDialog, &SearchDialog::searchRequested, this, &MainWindow::onSearchRequested); disconnect(searchDialog, &SearchDialog::searchCancelled, this, &MainWindow::onSearchCancelled); searchDialog->close(); searchDialog->deleteLater(); searchDialog = nullptr; } void MainWindow::onSpeakerItemSelected(QString title, const Speaker& speaker) { qDebug() << title; if (speaker.isValid()) { setCurrentSpeaker(speaker); syncUiFromCurrentSpeaker(speaker); } disconnect(listDialog, &ListDialog::speakerItemSelected, this, &MainWindow::onSpeakerItemSelected); disconnect(listDialog, &ListDialog::speakerItemCancelled, this, &MainWindow::onSpeakerItemCancelled); listDialog->close(); listDialog->deleteLater(); listDialog = nullptr; } void MainWindow::onSpeakerItemCancelled() { disconnect(listDialog, &ListDialog::speakerItemSelected, this, &MainWindow::onSpeakerItemSelected); disconnect(listDialog, &ListDialog::speakerItemCancelled, this, &MainWindow::onSpeakerItemCancelled); listDialog->close(); listDialog->deleteLater(); listDialog = nullptr; } void MainWindow::setActivateActions(QList actions, bool enable) { for (int i = 0; i < actions.count(); i++) { actions[i]->setEnabled(enable); } } void MainWindow::onCurrentTabChanged(int tab) { this->commandStack->clear(); QList alignments = ui->menuPorted_alignments->actions(); currentTabIndex = tab; switch (tab) { case 0: { setActivateActions(alignments, false); ui->actionBandpass_alignment->setEnabled(false); syncUiFromCurrentSealedBox(currentSealedBox); break; } case 1: { setActivateActions(alignments, true); ui->actionBandpass_alignment->setEnabled(false); syncUiFromCurrentPortedBox(currentPortedBox); break; } case 2: { setActivateActions(alignments, false); ui->actionBandpass_alignment->setEnabled(true); syncUiFromCurrentBandPassBox(currentBandPassBox); break; } default: break; } } void MainWindow::onNumberSpinChanged(int number) { if (currentSpeakerNumber == number) return; NumberCommand* com = new NumberCommand (currentSpeakerNumber, number, this); this->commandStack->push(com); } void MainWindow::changeSpeakerNumber(int number) { /* order is very important to avoid crash loop */ currentSpeakerNumber = number; ui->numberSpinBox->setValue(number); /* the user may have used the "?" fake speaker */ if (!currentSpeaker.isValid()) { qDebug() << "invalid speaker, not computing."; return; } syncUiFromCurrentSealedBox(currentSealedBox); syncUiFromCurrentPortedBox(currentPortedBox); syncUiFromCurrentBandPassBox(currentBandPassBox); } void MainWindow::onVendorChanged(QString vendor) { if (currentSpeaker.getVendor() == vendor) return; if (notInDbSpeaker) { if (vendor == notInDbSpeaker->getVendor()) return; QMessageBox::StandardButton pressed = QMessageBox::question(this, tr("Unsaved speaker"), tr("Speaker driver %1 is not present in the database. Do you want to insert it before to continue?").arg(notInDbSpeaker->getModel()), QMessageBox::Yes|QMessageBox::No); if (pressed == QMessageBox::Yes) { SpeakerDb::insertOrReplace(notInDbSpeaker->getVendor(), notInDbSpeaker->getModel(), *notInDbSpeaker); notInDbSpeaker = nullptr; } else /* no insert wanted */ { if (0 == SpeakerDb::getByVendor(notInDbSpeaker->getVendor()).count()) { /* forget entries */ ui->vendorComboBox->removeItem(ui->vendorComboBox->findText(notInDbSpeaker->getVendor())); ui->modelComboBox->removeItem(ui->modelComboBox->findText(notInDbSpeaker->getModel())); } else { /* forget model */ ui->modelComboBox->removeItem(ui->modelComboBox->findText(notInDbSpeaker->getModel())); } notInDbSpeaker = nullptr; } } this->commandStack->beginMacro("changing loudspeaker"); VendorCommand* com = new VendorCommand (currentSpeaker.getVendor(), vendor, currentSpeaker, this); this->commandStack->push(com); } void MainWindow::changeVendor(const QString& vendor, const Speaker& oldspeaker) { ui->vendorComboBox->setCurrentIndex(ui->vendorComboBox->findText(vendor)); /* fill speakers of this vendor */ ui->modelComboBox->clear(); ui->modelComboBox->addItems(SpeakerDb::getModelsByVendor(vendor)); /* if we come back to a previous vendor, set last vendor's selected speaker */ if (oldspeaker.getVendor() == vendor) { ui->modelComboBox->setCurrentIndex(ui->modelComboBox->findText(oldspeaker.getModel())); setCurrentSpeaker(SpeakerDb::getByVendorAndModel(vendor, oldspeaker.getModel())); } else { /* insert a fake speaker to let the choice to the user */ ui->modelComboBox->insertItem(0, "?"); ui->modelComboBox->setCurrentIndex(0); setCurrentSpeaker(Speaker()); } } void MainWindow::onModelChanged(QString model) { if (model.isNull() || model.isEmpty()) return; if (currentSpeaker.getModel() == model) return; if (notInDbSpeaker) { if (model == notInDbSpeaker->getModel()) return; QMessageBox::StandardButton pressed = QMessageBox::question(this, tr("Unsaved speaker"), tr("Speaker driver %1 is not present in the database. Do you want to insert it before to continue?").arg(notInDbSpeaker->getModel()), QMessageBox::Yes|QMessageBox::No); if (pressed == QMessageBox::Yes) { SpeakerDb::insertOrReplace(notInDbSpeaker->getVendor(), notInDbSpeaker->getModel(), *notInDbSpeaker); notInDbSpeaker = nullptr; } else /* no insert wanted */ { if (0 == SpeakerDb::getByVendor(notInDbSpeaker->getVendor()).count()) { /* forget entries */ ui->vendorComboBox->removeItem(ui->vendorComboBox->findText(notInDbSpeaker->getVendor())); ui->modelComboBox->removeItem(ui->modelComboBox->findText(notInDbSpeaker->getModel())); } else { /* forget model */ ui->modelComboBox->removeItem(ui->modelComboBox->findText(notInDbSpeaker->getModel())); } notInDbSpeaker = nullptr; } } oldSpeaker = currentSpeaker; ModelCommand* com = new ModelCommand (currentSpeaker.getModel(), model, this); this->commandStack->push(com); if (oldSpeaker.getVendor() != currentSpeaker.getVendor()) { oldSpeaker = currentSpeaker; this->commandStack->endMacro(); } } void MainWindow::changeModel(const QString& model) { ui->modelComboBox->setCurrentIndex(ui->modelComboBox->findText(model)); /* change model */ if ((ui->modelComboBox->findText("?") == 0) && (ui->modelComboBox->currentIndex() != 0)) { /* user choose a speaker; safely remove fake speaker */ ui->modelComboBox->removeItem(0); } QString vendor = ui->vendorComboBox->currentText(); setCurrentSpeaker(SpeakerDb::getByVendorAndModel(vendor, model)); } void MainWindow::onCurrentSpeakerChanged(const Speaker &spk) { ui->splValueLabel->setNum(spk.getSpl()); ui->fsValueLabel->setNum(spk.getFs()); ui->qtsValueLabel->setNum(spk.getQts()); ui->vasValueLabel->setNum(spk.getVas()); ui->diaValueLabel->setNum(spk.getDia()); ui->zValueLabel->setNum(spk.getZ()); ui->vcValueLabel->setNum(spk.getVc()); /* the user may have activated the "?" fake speaker */ if (!spk.isValid()) { qDebug() << "invalid speaker, not computing."; return; } syncUiFromCurrentSealedBox(currentSealedBox); syncUiFromCurrentPortedBox(currentPortedBox); syncUiFromCurrentBandPassBox(currentBandPassBox); } void MainWindow::onSealedVolumeDoubleSpinChanged(double val) { SealedVolumeCommand* com = new SealedVolumeCommand (currentSealedBox.getVolume(), val, this); this->commandStack->push(com); } void MainWindow::changeSealedVolume(double val) { currentSealedBox.setVolume(val); syncUiFromCurrentSealedBox(currentSealedBox); } void MainWindow::onCurrentSealedBoxChanged(const SealedBox &box) { if (!currentSpeaker.isValid()) return; syncUiFromCurrentSealedBox(box); } void MainWindow::onPortedVolumeDoubleSpinChanged(double val) { PortedVolumeCommand* com = new PortedVolumeCommand (currentPortedBox.getBoxVolume(), val, this); this->commandStack->push(com); } void MainWindow::changePortedVolume(double val) { currentPortedBox.setBoxVolume(val); currentPortedBox.updatePorts(currentSpeaker.getSd() * currentSpeakerNumber, currentSpeaker.getXmax()); syncUiFromCurrentPortedBox(currentPortedBox); } void MainWindow::onPortedResonanceDoubleSpinChanged(double val) { PortedResFreqCommand* com = new PortedResFreqCommand (currentPortedBox.getResFreq(), val, this); this->commandStack->push(com); } void MainWindow::changePortedResFreq(double val) { currentPortedBox.setResFreq(val); currentPortedBox.updatePorts(currentSpeaker.getSd() * currentSpeakerNumber, currentSpeaker.getXmax()); syncUiFromCurrentPortedBox(currentPortedBox); } void MainWindow::onPortedPortsNumberSpinChanged(int val) { PortedPortNumberCommand* com = new PortedPortNumberCommand (currentPortedBox.getPortNum(), val, this); this->commandStack->push(com); } void MainWindow::changePortedPortNumber(unsigned int val) { currentPortedBox.setPortNum(val); currentPortedBox.updatePorts(currentSpeaker.getSd()* currentSpeakerNumber, currentSpeaker.getXmax()); syncUiFromCurrentPortedBox(currentPortedBox); } void MainWindow::onPortedPortDiameterDoubleSpinChanged(double val) { /* allow manual decrease/increase of port diameter */ PortedPortDiamCommand* com = new PortedPortDiamCommand (currentPortedBox.getPortDiam(), val, this); this->commandStack->push(com); } void MainWindow::changePortedPortDiam(double val) { currentPortedBox.setPortDiam(val); currentPortedBox.updateSlots(); currentPortedBox.updatePortsLength(); syncUiFromCurrentPortedBox(currentPortedBox); } void MainWindow::onPortedSlotPortActivated(bool checked) { PortedSlotPortCommand* com = new PortedSlotPortCommand (this->currentPortedBox.getSlotPortActivated(), checked, this); this->commandStack->push(com); } void MainWindow::changePortedSlotPortActivation(bool checked) { currentPortedBox.setSlotPortActivated(checked); ui->portedPortSlotWidthDoubleSpinBox->setEnabled(checked); ui->portedPortSlotHeightLineEdit->setEnabled(checked); syncUiFromCurrentPortedBox(currentPortedBox); } void MainWindow::onPortedSlotWidthDoubleSpinChanged(double val) { PortedSlotWidthCommand* com = new PortedSlotWidthCommand (currentPortedBox.getSlotWidth(), val, this); this->commandStack->push(com); } void MainWindow::changePortedSlotWidth(double val) { currentPortedBox.setSlotWidth(val); syncUiFromCurrentPortedBox(currentPortedBox); } void MainWindow::onCurrentPortedBoxChanged(const PortedBox &box) { if (!currentSpeaker.isValid()) return; syncUiFromCurrentPortedBox(box); } void MainWindow::onBandPassSealedVolumeDoubleSpinChanged(double val) { BPSealedVolumeCommand* com = new BPSealedVolumeCommand (currentBandPassBox.getSealedBoxVolume(), val, this); this->commandStack->push(com); } void MainWindow::changeBPSealedVolume(double val) { currentBandPassBox.setSealedBoxVolume(val); syncUiFromCurrentBandPassBox(currentBandPassBox); } void MainWindow::onBandPassPortedVolumeDoubleSpinChanged(double val) { BPPortedVolumeCommand* com = new BPPortedVolumeCommand (currentBandPassBox.getPortedBoxVolume(), val, this); this->commandStack->push(com); } void MainWindow::changeBPPortedVolume(double val) { currentBandPassBox.setPortedBoxVolume(val); currentBandPassBox.updatePortedBoxPorts(currentSpeaker.getSd() * currentSpeakerNumber, currentSpeaker.getXmax()); syncUiFromCurrentBandPassBox(currentBandPassBox); } void MainWindow::onBandPassPortedResonanceDoubleSpinChanged(double val) { BPPortedResFreqCommand* com = new BPPortedResFreqCommand (currentBandPassBox.getPortedBoxResFreq(), val, this); this->commandStack->push(com); } void MainWindow::changeBPPortedResFreq(double val) { currentBandPassBox.setPortedBoxResFreq(val); currentBandPassBox.updatePortedBoxPorts(currentSpeaker.getSd() * currentSpeakerNumber, currentSpeaker.getXmax()); syncUiFromCurrentBandPassBox(currentBandPassBox); } void MainWindow::onBandPassPortNumSpinChanged(int val) { BPPortedPortNumberCommand* com = new BPPortedPortNumberCommand (currentBandPassBox.getPortedBoxPortNum(), val, this); this->commandStack->push(com); } void MainWindow::changeBPPortedPortNumber(double val) { currentBandPassBox.setPortedBoxPortNum(val); currentBandPassBox.updatePortedBoxPorts(currentSpeaker.getSd() * currentSpeakerNumber, currentSpeaker.getXmax()); syncUiFromCurrentBandPassBox(currentBandPassBox); } void MainWindow::onBandPassPortDiameterDoubleSpinChanged(double val) { /* allow manual decrease/increase of port diameter */ BPPortedPortDiamCommand* com = new BPPortedPortDiamCommand (currentBandPassBox.getPortedBoxPortDiam(), val, this); this->commandStack->push(com); } void MainWindow::changeBPPortedPortDiam(double val) { currentBandPassBox.setPortedBoxPortDiam(val); currentBandPassBox.updatePortedBoxPortsLength(); syncUiFromCurrentBandPassBox(currentBandPassBox); } void MainWindow::onBandPassSlotPortActivated(bool checked) { BPPortedSlotPortCommand* com = new BPPortedSlotPortCommand (this->currentBandPassBox.getPortedBoxSlotPortActivated(), checked, this); this->commandStack->push(com); } void MainWindow::changeBPPortedSlotPortActivation(bool checked) { currentBandPassBox.setPortedBoxSlotPortActivated(checked); ui->bandpassPortSlotWidthDoubleSpinBox->setEnabled(checked); ui->bandpassPortSlotHeightLineEdit->setEnabled(checked); syncUiFromCurrentBandPassBox(currentBandPassBox); } void MainWindow::changeBPPortedSlotWidth(double val) { currentBandPassBox.setPortedBoxSlotWidth(val); syncUiFromCurrentBandPassBox(currentBandPassBox); } void MainWindow::onBandPassSlotWidthDoubleSpinChanged(double val) { BPPortedSlotWidthCommand* com = new BPPortedSlotWidthCommand (currentBandPassBox.getPortedBoxSlotWidth(), val, this); this->commandStack->push(com); } void MainWindow::onCurrentBandPassBoxChanged(const BandPassBox &box) { if (!currentSpeaker.isValid()) return; syncUiFromCurrentBandPassBox(box); } // vim:sw=4:ts=4:et qspeakers-1.8/mainwindow.h000066400000000000000000000133621477675101000157220ustar00rootroot00000000000000#ifndef MAINWINDOW_H #define MAINWINDOW_H #include #include #include #include "projectproperties.h" #include "propertiesdialog.h" #include "speakerdialog.h" #include "searchdialog.h" #include "listdialog.h" #include "bandpassdialog.h" #include "speaker.h" #include "sealedbox.h" #include "portedbox.h" #include "bandpassbox.h" #include "plot.h" namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); QUndoStack* getCommandStack() { return this->commandStack; }; void changeSpeakerNumber(int number); void changeVendor(const QString &vendor, const Speaker& oldspeaker); void changeModel(const QString &model); void changeSealedVolume(double val); void changePortedVolume(double val); void changePortedResFreq(double val); void changePortedPortNumber(unsigned int val); void changePortedPortDiam(double val); void changePortedSlotPortActivation(bool checked); void changePortedSlotWidth(double val); void changeBPSealedVolume(double val); void changeBPPortedVolume(double val); void changeBPPortedResFreq(double val); void changeBPPortedPortNumber(double val); void changeBPPortedPortDiam(double val); void changeBPPortedSlotPortActivation(bool checked); void changeBPPortedSlotWidth(double val); void exportPlot(const QString& outfileName, int tabindex); void exportScad3D(const QString& outfileName, int tabindex, qreal margin, qreal thick); void exportScad2D(const QString& outfileName, int tabindex, qreal margin, qreal thick, qreal saw); void exportScad(const QString &scad, const QString& outfileName, int tabindex, qreal maring, qreal thick, qreal saw); signals: void currentSpeakerChanged(Speaker spk); void currentSealedBoxChanged(SealedBox box); void currentPortedBoxChanged(PortedBox box); void currentBandPassBoxChanged(BandPassBox box); public slots: void onProjectProperties(); void onProjectSave(); void onProjectExport(); void onProjectImport(); void onOpenRecentActionTriggered(); void onProjectQuit(); void onSpeakerNew(); void onSpeakerRemove(); void onSpeakerModify(); void onSpeakerInserted(Speaker spk); void onSpeakerCancelled(); void onEditOptimize(); void onSpeakerSearch(); void onProjectPrint(); void onUndo(); void onRedo(); void onAboutAbout(); void onPropertiesAccepted(); void onPropertiesRejected(); void onSearchRequested(const QString& param, double min, double max); void onSearchCancelled(); void onSpeakerItemSelected(QString title, const Speaker &speaker); void onSpeakerItemCancelled(); void onCurrentTabChanged(int tab); void onNumberSpinChanged(int number); void onVendorChanged(QString vendor); void onModelChanged(QString model); void onCurrentSpeakerChanged(const Speaker& spk); void onCurrentSealedBoxChanged(const SealedBox& box); void onCurrentPortedBoxChanged(const PortedBox& box); void onCurrentBandPassBoxChanged(const BandPassBox& box); void onSealedVolumeDoubleSpinChanged(double val); void onPortedVolumeDoubleSpinChanged(double val); void onPortedResonanceDoubleSpinChanged(double val); void onPortedPortsNumberSpinChanged(int val); void onPortedPortDiameterDoubleSpinChanged(double val); void onPortedSlotWidthDoubleSpinChanged(double val); void onPortedSlotPortActivated(bool checked); void onBandPassSealedVolumeDoubleSpinChanged(double val); void onBandPassPortedVolumeDoubleSpinChanged(double val); void onBandPassPortedResonanceDoubleSpinChanged(double val); void onBandPassPortNumSpinChanged(int val); void onBandPassPortDiameterDoubleSpinChanged(double val); void onBandPassSlotWidthDoubleSpinChanged(double val); void onBandPassSlotPortActivated(bool checked); void onAlignModerate_Inf(); void onAlignLegendre(); void onAlignBessel(); void onAlignBullock(); void onAlignKeele_Hoge(); void onBandpassAlignment(); void onBandpassOptimizeRequested(double s, double pa); void onBandpassOptimizeCancelled(); void onCurvePlot(); void on3DScadExport(); void on2DScadExport(); protected: QString strippedName(const QString& fullFileName); void updateRecentFileActions(); void setRecentFile(const QString& fileName, bool ok); bool loadFile(const QString& fileName); void linkMenus(); void linkTabs(); void linkInternals(); void unlinkMenus(); void unlinkTabs(); void unlinkInternals(); bool print(QPrinter* printer); void syncUiFromCurrentSpeaker(const Speaker &spk); void syncUiFromCurrentSealedBox(const SealedBox& box); void syncUiFromCurrentPortedBox(const PortedBox& box); void syncUiFromCurrentBandPassBox(const BandPassBox& box); void setActivateActions(QList actions, bool enable); void setCurrentSpeaker(const Speaker& spk); private: static QString getHome(); Ui::MainWindow *ui; bool projectSaved; bool isModifying; SpeakerDialog *spkDialog; QFileDialog *fileDialog; SearchDialog *searchDialog; PropertiesDialog *propertiesDialog; ListDialog *listDialog; BandpassDialog *bandpassDialog; Speaker oldSpeaker; Speaker currentSpeaker; int currentSpeakerNumber; SealedBox currentSealedBox; PortedBox currentPortedBox; BandPassBox currentBandPassBox; int currentTabIndex; Plot *sealedPlot; Plot *portedPlot; Plot *bandpassPlot; const Speaker *notInDbSpeaker; QUndoStack *commandStack; enum { MaxRecentFiles = 5 }; QAction *recentFileActs[MaxRecentFiles]; ProjectProperties projectProperties; }; #endif // MAINWINDOW_H qspeakers-1.8/mainwindow.ui000066400000000000000000001135641477675101000161150ustar00rootroot00000000000000 MainWindow 0 0 1300 720 0 0 Loudspeaker number 0 0 42 0 1 vendor 0 0 model 0 0 Qt::Horizontal 10 20 true Spl: 0 dB true Fs: 0 Hz true Qts: 0 true Vas: 0 L true Dia: 0 m true Z: 0 Ohm true Vc: 1 0 Sealed enclosure 1st order filter Simple, safe enclosure good for several speakers. QLayout::SetDefaultConstraint Qt::Horizontal QSizePolicy::Expanding 40 20 Enclosure volume 3 0.010000000000000 L Qt::Horizontal QSizePolicy::Expanding 40 20 0 0 Ported enclosure 2nd order filter Popular enclosure type to enhance bass for most speakers. QLayout::SetDefaultConstraint Qt::Horizontal 40 20 Enclosure volume (Vb) 3 0.010000000000000 L Qt::Horizontal 40 20 Enclosure filter resonance (Fb) 1.000000000000000 999.990000000000009 Hz Qt::Horizontal 40 20 0 0 Number of ports 1 10 Port diameter 1 0.500000000000000 cm Qt::Horizontal 40 20 Slot port true false 1 x false 0 0 true cm Qt::Horizontal 40 20 Port length 0 0 true cm Bandpass enclosure 4th order filter Enclosure for subwoofer, mostly used in 2:1, 5:1 and 7:1 systems. QLayout::SetDefaultConstraint Qt::Horizontal 40 20 Sealed enclosure volume 3 0.010000000000000 L Qt::Horizontal 40 20 QLayout::SetDefaultConstraint Qt::Horizontal 40 20 Ported enclosure volume 3 0.010000000000000 L Qt::Horizontal 40 20 Ported enclosure filter resonance 1.000000000000000 999.990000000000009 Hz Qt::Horizontal 40 20 0 0 Number of ports 1 10 Port diameter 1 0.500000000000000 cm Qt::Horizontal 40 20 Slot port true x cm Qt::Horizontal 40 20 Port length 0 0 true cm 0 0 1300 23 Project Edit Ported alignments About Speaker Exports 0 0 TopToolBarArea false Open... Open a speaker project Ctrl+I Save Save the current project Ctrl+S Save copy... Save the current project in a copy Ctrl+E Print Print the current project Ctrl+P Quit Quit the application Ctrl+Q About QSpeakers Ctrl+A New New speaker parameters Ctrl+N Search Search a speaker Optimize Optimize frequency response Ctrl+O Modify Modify the current speaker Ctrl+M Remove Remove the current speaker Bessel Linear phase and fast transient response alignment Legendre Extended bass response with minimum ripple Hoge BB4 Boom box butterworth 4th order alignment Bullock SBB4 Super boom box butterworth 4th order alignment Zbinden M4 Moderate alignment (infinite baffle) Bandpass alignment .. Undo Undo action Ctrl+U .. Redo Redo action Ctrl+R 3D OpenScad 2D OpenScad Curve Plot Properties qspeakers-1.8/manpage.sgml000066400000000000000000000073311477675101000156700ustar00rootroot00000000000000 BENOIT"> ROUITS"> october 20, 2016"> 1"> brouits@free.fr"> QSPEAKERS"> Ubuntu"> Debian"> GNU"> GPL"> ]>
&dhemail;
&dhfirstname; &dhsurname; 2014 &dhusername; &dhdate;
&dhucpackage; &dhsection; &dhpackage; simulate common loudspeaker enclosures &dhpackage; file.qsp DESCRIPTION This manual page documents the &dhpackage; program. &dhpackage; is a graphical program that simulates common loudspeaker enclosures such as sealed-system, ported-system and symmetric bandpass-system. &dhpackage displays the expected frequency response curve of a system, given the loudspeaker Thiele / Small parameters and the enclosure parameters.
qspeakers-1.8/nsis/000077500000000000000000000000001477675101000143445ustar00rootroot00000000000000qspeakers-1.8/nsis/QSpeakers.nsi000066400000000000000000000117301477675101000167570ustar00rootroot00000000000000;NSIS QSpeakers installer ;Based on example scripts Written by Joost Verburg ;Written by Benoît Rouits ;-------------------------------- ;Include Modern UI !include "MUI2.nsh" Unicode true ;-------------------------------- ;Init checks Function .onInit Push $R0 ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QSpeakers" "UninstallString" StrCmp $R0 "" QSpeakers_NOT_PRESENT MessageBox MB_OK $(DESC_SecInit) Pop $R0 Abort QSpeakers_NOT_PRESENT: Pop $R0 FunctionEnd ;General ;Name and file Name "QSpeakers" OutFile "qspeakers_installer.exe" ;Default installation folder InstallDir "$PROGRAMFILES\QSpeakers" ;Get installation folder from registry if available InstallDirRegKey HKCU "Software\QSpeakers" "Install_Dir" ;Request application privileges for Windows Vista RequestExecutionLevel admin ;-------------------------------- ;Interface Settings !define MUI_ICON "qspeakers_install.ico" !define MUI_UNICON "qspeakers_uninstall.ico" !define MUI_HEADERIMAGE !define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\win.bmp" !define MUI_ABORTWARNING ;-------------------------------- ;Pages ; !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE "../COPYING" !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES ; !insertmacro MUI_PAGE_FINISH ; !insertmacro MUI_UNPAGE_WELCOME !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES ; !insertmacro MUI_UNPAGE_FINISH ;-------------------------------- ;Languages !insertmacro MUI_LANGUAGE "English" !insertmacro MUI_LANGUAGE "French" ;-------------------------------- ;Installer Sections Section "Install" SecInstall SetOutPath "$INSTDIR" ; Add program, db, translations and scad File /r ../release/qspeakers.exe File ../qspeakers.png File ../qspeakers_db.xml File /r ../locale File ../sealedbox_template.scad File ../sealedbox_cutting_template.scad File ../portedbox_template.scad File ../portedbox_cutting_template.scad File ../bandpassbox_template.scad File ../bandpassbox_cutting_template.scad ; Write the installation path into the registry WriteRegStr HKLM SOFTWARE\QSpeakers "Install_Dir" "$INSTDIR" ; Write the uninstall keys for Windows WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QSpeakers" "DisplayName" "QSpeakers" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QSpeakers" "UninstallString" '"$INSTDIR\uninstall.exe"' WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QSpeakers" "NoModify" 1 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QSpeakers" "NoRepair" 1 ;Create uninstaller WriteUninstaller "$INSTDIR\uninstall.exe" SectionEnd Section "Start Menu Shortcuts" SecShortcut CreateDirectory "$SMPROGRAMS\QSpeakers" CreateShortcut "$SMPROGRAMS\QSpeakers\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 CreateShortcut "$SMPROGRAMS\QSpeakers\QSpeakers.lnk" "$INSTDIR\qspeakers.exe" "" "$INSTDIR\qspeakers.exe" 0 SectionEnd ;-------------------------------- ;Descriptions ;Language strings LangString DESC_SecInit ${LANG_ENGLISH} "QSpeakers is already installed. \ Please uninstall it before to run this installer." LangString DESC_SecInstall ${LANG_ENGLISH} "Install QSpeakers software." LangString DESC_SecShortcut ${LANG_ENGLISH} "Install launcher in menu." LangString DESC_SecInit ${LANG_FRENCH} "QSpeakers est déjà installé. \ Veuillez le désinstaller avant d'utiliser cet installateur." LangString DESC_SecInstall ${LANG_FRENCH} "Installe le logiciel QSpeakers." LangString DESC_SecShortcut ${LANG_FRENCH} "Installe le lanceur dans le menu." ;Assign language strings to sections !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${SecInstall} $(DESC_SecInstall) !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcut} $(DESC_SecShortcut) !insertmacro MUI_FUNCTION_DESCRIPTION_END ;-------------------------------- ;Uninstaller Section Section "Uninstall" ; Remove db, translations, program and scad Delete "$INSTDIR\qspeakers_db.xml" Delete "$INSTDIR\locale\*.*" Delete "$INSTDIR\qspeakers.png" Delete "$INSTDIR\qspeakers.exe" Delete "$INSTDIR\sealedbox_template.scad" Delete "$INSTDIR\sealedbox_cutting_template.scad" Delete "$INSTDIR\portedbox_template.scad" Delete "$INSTDIR\portedbox_cutting_template.scad" Delete "$INSTDIR\bandpassbox_template.scad" Delete "$INSTDIR\bandpassbox_cutting_template.scad" ; Remove translation diretory RMDir "$INSTDIR\locale" ; remove uninstaller Delete "$INSTDIR\uninstall.exe" ; Remove used directory RMDir "$INSTDIR" ; Remove registry keys DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\QSpeakers" DeleteRegKey HKLM SOFTWARE\QSpeakers ; Remove shortcuts, if any Delete "$SMPROGRAMS\QSpeakers\*.*" ; Remove directory used RMDir "$SMPROGRAMS\QSpeakers" SectionEnd qspeakers-1.8/nsis/build_windows.sh000077500000000000000000000005231477675101000175540ustar00rootroot00000000000000#!/bin/sh # # Microsoft® Windows® 64bits & 32bit cross builder script # if [ "$1" = "" ] then ARCH="x86_64" else ARCH="$1" # i686 or x86_64 fi PATH=/usr/lib/mxe/usr/bin:$PATH cd .. /usr/bin/make distclean /usr/lib/mxe/usr/bin/${ARCH}-w64-mingw32.static-qmake-qt5 -config release /usr/bin/make cd nsis /usr/bin/makensis QSpeakers.nsi qspeakers-1.8/nsis/qspeakers_install.ico000066400000000000000000000410761477675101000205740ustar00rootroot00000000000000@@ (B(@ MMMMMMMMM3MM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''%%%###############-0426H*********...:::KKKSSSSSSSSS]]]wwwsssZZZRRRSSSRRROOOMMMMMMMMMMMMMMMMMMMMMMMMNNNQQQSSSRRRVVVgggzzzqqq\\\SSSSSSSSSHHH555***))))))'''$$$###$$$%%%&&&&&&''',.|19,5*-'))),,,,,,,,,333EEERRRSSSRRRSSSXXX]]]\\\WWWSSSRRRSSSSSSRRROOOMMMMMMMMMMMMMMMMMMMMMMMMNNNQQQSSSSSSSSSRRRSSSSSSSSSRRRSSSSSSSSSEEE111++++++)))%%%###%%%&&&'''''''''''''''(37.:.;-4F&&&+++......111AAAQRRTTTSSSSSSSSSSSSSSSSSSSSSSSSSSSRRROOOMMMMMMMMMMMMMMMMMMMMMMMMNNNRRRTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTDDD000,,,---((($$$%%%'''''''''''''&&(''*((749.:.;,5(*y(((&&&***///000122@AARRRTTTTTTTTTTTTTTTTTTTTTTTTTTTSSSOOOMMMMMMMMMMMMMMMMMMMMMMMMNNNRRRUUUUUUUUUUUUUUUUUUUUUUUUUUUFGG111...---(((%%%'''((((((('')((---19<1LR-]h&'g,4.;.;,8(/A***((()))000222333CCCTTTUUUUUUUUUUUUUUUUUUUUUUUUSSSOOOMMMMMMMMMMMMMMMMMMMMMMMMNNNRRRUUUUUUUUUUUUUUUUUUUUUVVVKKK444//////(((&&&((((((((()((0113JO,m}7,2-8.;.;.;+4$&`******))))))111333555GHHVVVUUUUUUUUUUUUUUUUUUUUUTTTOOOMMMMMMMMMMMMMMMMMMMMMMMMNNNRRRUUUUUUUUUUUUUUUUUUVVVQQR999111000)))&&&(((((((((,++6CF-p!"_+3.;.;.;.;)3)*|*******)))***333555999NNNVVVUUUUUUUUUUUUUUUUUUTTTOOOMMMMMMMMMMMMMMMMMMMMMMMMNNNSSSVVVVVVVVVVVVVVVVVVWXXIJK666222+++&&&)))))))))0006W_ ""H.3,7.;.;.;.;,8*112t ++*++++++***,,,666999GHHVWWVVVVVVVVVVVVVVVVVVTTTOOOMMMMMMMMMMMMMMMMMMMMMMMMNNNSSSVVVVVVVVVVVVVVVXXXTTTNQQCDD///'''))))))))(2237`k &'e+5.;.;.;.;.;.;,8-3+,c ,**,,,,,,***000ABBFHIOQQXYYVVVVVVVVVVVVVVVUUUOOOMMMMMMMMMMMMMMMMMMMMMMMMNNNSSSWWWWWWWWWWWWWWWXYYCDD???:::)))((())))))1008akI',+7.;.;.;.;.;.;.;+613+57++*,,,,,,+++899;<>>EFFZ[[YYYXXXXXXXXXVVVPPPMMMMMMMMMMMMMMMMMMMMMMMMNNNTTTXXXXXXXXXYYYYZZ@@@;;;222((())))))10/7jw ;'+,8.;.;.;.;.;.;.;.;.;.;,9(2/1.*47,++,,,+++222@@@AAAWXX[[[XXXXXXXXXVVVPPPMMMMMMMMMMMMMMMMMMMMMMMMNNNUUUXXXXXXXXX\\\TTT===<<<,,,((()))*));EH7&**4.;.;.;.;.;.;.;.;.;.;.;.;,8'-%&b "MX,++++++++--->>>BBBPQQ^__XXXXXXXXXWWWPPPMMMMMMMMMMMMMMMMMMMMMMMMOOOUUUYYYYYYYYY___MNN>>>:::)))))))))/--9cm 6+/,5.;.;.;.;.;.;.;.;.;.;.;.;.;.;*5.;##]+12,++,,,+++:::CCCKKK`aaYYYYYYYYYWWWPPPMMMMMMMMMMMMMMMMMMMMMMMMOOOUUUYYYYYYZZZaaaHII@@@777((()))(((677,).0.6.9.:.:.:.;.;.;.;.;.;.;.;.;.;.;.;.;.;L&=B+**+++***555EEEHHH_``[\\YYYYYYWWWPPPMMMMMMMMMMMMMMMMMMMMMMMMOOOVVVZZZZZZ\\\`aaFFFBBB333'''(((('':DG-24}25%'k-9.;.;.;.;.;.;.;%*03O!JT+*)******111FFFHHH^__^^^ZZZZZZWWWPPPMMMMMMMMMMMMMMMMMMMMMMMMOOOVVVZZZZZZ]]^``aFFFCCC000'''(((*((;SX  .7.;.;.;.;.;.;.;79#   # Ub*++******...FFFIII]]^`aaZZZZZZXXXPPPMMMMMMMMMMMMMMMMMMMMMMMMOOOVVV[[[ZZZ____``GGGDDD...'''(((,)):]ecw ""!!!!!!!!!!!!-5.;.;.;.;.;.;.;;<} ~}|),,******,,,FFFJJJ]]]bbcZZZ[[[XXXQQQMMMMMMMMMMMMMMMMMMMMMMMMOOOWWW[[[[[[`aa`aaHHHEEE...&&&''',))9ak Td! !!!!!!!!!!!!+4.;.;.;.;.;.;.;>@~ }|zy]m(,-))()))+++FFFLLL]^^dee[[[\\\YYYQQQMMMMMMMMMMMMMMMMMMMMMMMMOOOWWW\\\[[[aaabccIJJGGG...&&&&&&+((9`k Sb! !!!###%&&*3.;.;.;.;.;.;.;>?{ ~|{ywvZj'+,((((((+++GGGMNN_``eee[[[\\\YYYQQQMMMMMMMMMMMMMMMMMMMMMMMMOOOWWW\\\\\\aaaeffLLLHHH///%%%&&&*'':Zc]p!""$$$355 "k*3.;.;.;.;.;.;+5+-g{yxvutTc')*(''''',,,JJJOOObcceee[[[\\\ZZZQQQMMMMMMMMMMMMMMMMMMMMMMMMOOOXXX]]]\\\```ijjOOOKKK333$$$%%%'%%:PUq),//.K(.,7.;.;.;.;.;*5#(5xvusrpKW'''&&&&&&---MMMRRRfggdee\\\]]]ZZZQQQMMMMMMMMMMMMMMMMMMMMMMMMOOOXXX]]]]]]___lmmSTTMMM888###$$$$##8AC! BL110 ./p,6.;.;.;.;.;.;*3 gusrpoj ?G&%%&&&%%%222QQQTUUkllccc]]]]]]ZZZQQQMMMMMMMMMMMMMMMMMM^^^mnnZZZOOO@@@%%%######233.vm!!B26,7.;.;.;.;.;.;+4%&dtrpoml`s"36%$$%%%$$$:::TTTYYYoppa`a^^^^^^[[[QQQMMMMMMMMMMMMMMMMMM/2jkkdeeQQQIII)))""""""(''9[c79w.7-:.;.;.;.;.;.;-5*+dpomlji~P]#')$##$$$%%%EEEVVV`aapqq^^^^^^^^^[[[QQQMMMMMMMMMMMMMMMMMM"V a''W!!: mnoTTTPPP111 !!!"!!6>@$;47,9.;.;.;.;.;.;.;-5)*^mljh~g|au9@""""""!!!+++PPPXWWjkkkll^^^^^^^^^[[[RRRMMMMMMMMMMMMMMMMMMY {',.1((H"]]]TTTAAA!!! (''7^h79-7.;.;.;.;.;.;.;,8(.@jh~f|ezcxO]!'(!!!!!!!!!999XXX\\\suueff_________\\\RRRMMMMMMMMMMMMMMMMMM5!#o")(0.212m##> 28:*s  "#D/4-:.;.;.;.;.;.;.;)2!zg}ezcxbvZk49! %%%LLL[[[fggtuuaaa______```]]]RRRMMMMMMMMMMMMMMMMMMMMM ##H"'(0)3+33734b,!!"D.1*3.;.;.;.;.;.;.;.;+2Rcxav`t\n>F !888_``___suulmm___`````````]]]RRRMMMMMMMMMMMMMMMMMMMMM!.0)3+7-:,8*103=?<=s)     ;03.2*4.:.;.;.;.;.;.;.;.;17%%Kbv`s^r[mCN#$'''STT_bbjkkxzzccc````````````]]]RRRMMMMMMMMMMMMMMMMMMMMMMMM-.b/5,7.;.;-:-:.9-5+/35>@EFFGDE<>13(-,5-:.;.;.;.;.;.;.;.;.;,805;^r]pXjBK#%DDD___]^^xyzmnn```aaaaaaaaaaaa^^^RRRMMMMMMMMMMMMMMMMMMMMMMMM02n/6-:.;.;.;.;-:,8-8.8.9.9.9-8-7,8.;.;.;.;.;.;.;.;.;.;.;-5)*}[mSb:B !888]]]aaarssxzzcccaaaaaaaaaaaaaaa^^^SSSMMMMMMMMMMMMMMMMMMMMMMMMOOO"/1o.6-:.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.:/5CFP,0333[[[ccclmm~hiiaaabbbbbbbbbbbbbbb^^^SSSMMMMMMMMMMMMMMMMMMMMMMMMOOO[[[$.0o.6-:.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;-8(- /3222ZZZdddjkkoppbbbcccccccccccccccccc___SSSMMMMMMMMMMMMMMMMMMMMMMMMOOO\\\ccc$/0o/6-:.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;,805 !T:::]]]fffkkktuucccccccccccccccccccccccc___SSSMMMMMMMMMMMMMMMMMMMMMMMMOOO\\\cccccc /1q07-9-:.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;-9)/ [###GGGcccgggnnnvwwdddcccccccccccccccccccccccc___SSSMMMMMMMMMMMMMMMMMMMMMMMMPPP\\\ccccccccc24o48*2-8.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;-879 :::ZZZhhhiiituuuvvdddccccccccccccccccccccccccccc```SSSMMMMMMMMMMMMMMMMMMMMMMMMPPP]]]dddddddddddd 346q/5-9.;.;.;.;.;.;.;.;.;.;.;.;.;.;-97<45f &&&>>>XXXgggjjjnnn}qrrddddddddddddddddddddddddddddddddd```SSSMMMMMMMMMMMMMMMMMMMMMMMMPPP]]]dddeeeeeeeeeeeeeee"+-c59,4,7.;.;.;.;.;.;.;.;.;.;-9,76;12i 555DDDTTTcccjjjlllnnnz{{kkkdddeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee```SSSMMMMMMMMMMMMMMMMMMMMMMMMPPP]]]eeeeeeeeeeeeeeeeeeeee ##>&&]05.7,7-:.;.;.;.;.;.;,7*2-1,-Y gggjjjlllmmmnnnrrr}~~sssfffeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeaaaSSSMMMMMMMMMMMMMMMMMMMMMMMMPPP^^^eeeeeeeeeeeeeeeeeeeeeeeeeee''G./a-1-6/8.9.8.8.9.7.3"#^ - pppqqqtuuyzzsssgggeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeaaaSSSMMMMMMMMMMMMMMMMMMMMMMMMPPP^^^fffffffffffffffffffffffffffffffff1*+^>?s=>v<=u<=v>?v/0h@ wxxmmnffgffeffffffffffffffffffffffffffffffffffffffffffffffffbbbSSSMMMMMMMMMMMMMMMMMMMMMMMMPPPaaakkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkuuvwwwwwwuvvssspppmmmkkkjjjjjjkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkfffUUUMMMMMMMMMMMMMMMMMMMMMMMMRRRgggtttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttnnnWWWMMMMMMMMMMMMMMMMMMMMMMMMSSSooovvvZZZMMMMMMMMMMMMMMMMMMMMMMMMUUUvvv]]]MMMMMMMMMMMMMMMMMMMMMMMMUUU|||___MMMMMMMMMMMMMMM}MMMMMMMMMUUUyyy^^^MMMMMMMMMMMMMMM MMM^MMMMMMRRRjjjyyyzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzqqqXXXMMMMMMMMMMMM*MMMMMMMMM%MMMcOOOWWW]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]ZZZQQQMMM~MMM=MMM MMMqspeakers-1.8/nsis/qspeakers_uninstall.ico000066400000000000000000000410761477675101000211370ustar00rootroot00000000000000@@ (B(@ MMMMMMMMM3BBv MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMOMMMMMMMMMMMMoMMMMMMBBv++MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM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PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP88222hhhUUUNNNMMMMMMMMMMMMMMMMMMMMMMMMMMM___hhh&&& OHHHnnnSSSQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQPPPOOOOOONOOOOOOOOPPPQQQQQQQQQQQQQQQQQQLLM eHHHoooSSSNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMYYYxxx@@@ hhhlllQQQQQQQQQQQQQQQRRRQQQNNNHHHAAA;;;666555HIJBDD333555:::@@@GGGMMMQQQRRRQQQ22 +++oooiiiPPPNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMQQQssssss,,,FF]]]QQQRRRRRRRRRPPPIII<<=222+++'''&&&%%%(((=??9::&&&&&&&&&'''+++111;;;GGGHHm !!9...jjj|||XXXPPPNNNMMMMMMMMMMMMMMMMMMMMMMMMNNNPPPZZZxxx@@@###**V66RRRRRRQQQHHH899,,,'''&&&&&&''''''&&&&&&((('''&&&'''(((((((((((())),,,__|||WWWDDDFFF\\\^^^RRRQQQOOOMMMMMMMMMMMMMMMMMMMMMMMMNNNQQQRRR^^^}}}qqqvvvzz AANNN===--.((((((((('''%%%###########################$$$&&&)))***##o]]]wwwsssZZZRRRSSSRRROOOMMMMMMMMMMMMMMMMMMMMMMMMNNNQQQSSSRRRVVVgggzzzqqq\\\@@..h***))))))'''$$$###$$$%%%&&&&&&''''''''''''&&&&&&&&&%%%$$$&&& DDRRRSSSXXX]]]\\\WWWSSSRRRSSSSSSRRROOOMMMMMMMMMMMMMMMMMMMMMMMMNNNQQQSSSSSSSSSRRRSSSSSSSSSRRRSSSSSS66$$9)))%%%###%%%&&&''''''''''''''''''''''''(('(((((((((((( QRRTTTSSSSSSSSSSSSSSSSSSSSSSSSSSSRRROOOMMMMMMMMMMMMMMMMMMMMMMMMNNNRRRTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTDDD $$$%%%'''''''''''''&&(''*((++*,,,,,,,++*)()('(''((()((-.Z@AARRRTTTTTTTTTTTTTTTTTTTTTTTTTTTSSSOOOMMMMMMMMMMMMMMMMMMMMMMMMNNNRRRUUUUUUUUUUUUUUUUUUUUUUUUUUUFGG111... ((((((('')((---19<1LR-]h(jz$p#q$l~&ao)PZ,=B,/0 222333CCCTTTUUUUUUUUUUUUUUUUUUUUUUUUSSSOOOMMMMMMMMMMMMMMMMMMMMMMMMNNNRRRUUUUUUUUUUUUUUUUUUUUUVVVKKK444//////$$Y)((0113JO,m} n )))111333555GHHVVVUUUUUUUUUUUUUUUUUUUUUTTTOOOMMMMMMMMMMMMMMMMMMMMMMMMNNNRRRUUUUUUUUUUUUUUUUUUVVVQQR999111000)))&&& q,7{-pY##p)))***333555999NNNVVVUUUUUUUUUUUUUUUUUUTTTOOOMMMMMMMMMMMMMMMMMMMMMMMMNNNSSSVVVVVVVVVVVVVVVVVVWXXIJK666222+++&&&))))))++++++***,,,666999GHHVWWVVVVVVVVVVVVVVVVVVTTTOOOMMMMMMMMMMMMMMMMMMMMMMMMNNNSSSVVVVVVVVVVVVVVVXXXTTTNQQCDD///'''))))))))(2235A;)69,**,,,,,,***000ABBFHIOQQXYYVVVVVVVVVVVVVVVUUUOOOMMMMMMMMMMMMMMMMMMMMMMMMNNNSSSWWWWWWWWWWWWWWWXYYCDD???:::)))((())))))1008akF]tvm+57++*,,,,,,+++899;<>>EFFZ[[YYYXXXXXXXXXVVVPPPMMMMMMMMMMMMMMMMMMMMMMMMNNNTTTXXXXXXXXXYYYYZZ@@@;;;222((())))))10/7jw w$ }_qO^M[Gm q*47,++,,,+++222@@@AAAWXX[[[XXXXXXXXXVVVPPPMMMMMMMMMMMMMMMMMMMMMMMMNNNUUUXXXXXXXXX\\\TTT===<<<,,,((()))*));EHY)+!!!!!A "MX,++++++++--->>>BBBPQQ^__XXXXXXXXXWWWPPPMMMMMMMMMMMMMMMMMMMMMMMMOOOUUUYYYYYYYYY___MNN>>>:::)))))))))/--9cm $ !!!!!!  h{+12,++,,,+++:::CCCKKK`aaYYYYYYYYYWWWPPPMMMMMMMMMMMMMMMMMMMMMMMMOOOUUUYYYYYYZZZaaaHII@@@777((()))(((677, *if A w&=B+**+++***555EEEHHH_``[\\YYYYYYWWWPPPMMMMMMMMMMMMMMMMMMMMMMMMOOOVVVZZZZZZ\\\`aaFFFBBB333'''(((('':DGJW! 38 w }!JT+*)******111FFFHHH^__^^^ZZZZZZWWWPPPMMMMMMMMMMMMMMMMMMMMMMMMOOOVVVZZZZZZ]]^``aFFFCCC000'''(((*((;SX }+.! !!!b "#Wh ~Ub*++******...FFFIII]]^`aaZZZZZZXXXPPPMMMMMMMMMMMMMMMMMMMMMMMMOOOVVV[[[ZZZ____``GGGDDD...'''(((,)):]ecw ""!!!!!!!!!!!!! AK ~}|),,******,,,FFFJJJ]]]bbcZZZ[[[XXXQQQMMMMMMMMMMMMMMMMMMMMMMMMOOOWWW[[[[[[`aa`aaHHHEEE...&&&''',))9ak Td! !!!!!!!!! !!!!!!! 7=y }|zy]m(,-))()))+++FFFLLL]^^dee[[[\\\YYYQQQMMMMMMMMMMMMMMMMMMMMMMMMOOOWWW\\\[[[aaabccIJJGGG...&&&&&&+((9`k Sb! !!!###!!`###!!!! 6<w ~|{ywvZj'+,((((((+++GGGMNN_``eee[[[\\\YYYQQQMMMMMMMMMMMMMMMMMMMMMMMMOOOWWW\\\\\\aaaeffLLLHHH///%%%&&&*'':Zc]p!""$$$./b-.666&&&! >Gx{yxvutTc')*(''''',,,JJJOOObcceee[[[\\\ZZZQQQMMMMMMMMMMMMMMMMMMMMMMMMOOOXXX]]]\\\```ijjOOOKKK333$$$%%%'%%:PUq),//. !GIw333!""O]yxvusrpKW'''&&&&&&---MMMRRRfggdee\\\]]]ZZZQQQMMMMMMMMMMMMMMMMMMMMMMMMOOOXXX]]]]]]___lmmSTTMMM888###$$$$##8AC! BL --?/2fzwusrpoj ?G&%%&&&%%%222QQQTUUkllccc]]]]]]ZZZQQQMMMMMMMMMMMMMMMMMMMMMMMMOOOXXX^^^^^^^^^mnnZZZOOO@@@%%%######233.v`jmx{ O\strpoml`s"36%$$%%%$$$:::TTTYYYoppa`a^^^^^^[[[QQQMMMMMMMMMMMMMMMMMMMMMMMMPPPYYY^^^^^^^^]jkkdeeQQQIII)))""""""(''9[c2JMPQ?spomlji~P]#')$##$$$%%%EEEVVV`aapqq^^^^^^^^^[[[QQQMMMMMMMMMMMMMMMMMMMMMMMMOOOYYY^^^^^^^^^effmnoTTTPPP111 !!!"!!6>@$U45;>>>766+-.Omljh~g|au9@""""""!!!+++PPPXWWjkkkll^^^^^^^^^[[[RRRMMMMMMMMMMMMMMMMMMMMMMMMOOOYYY_________bbbrss]]]TTTAAA!!! (''7^ho;?F=DCMSafz( Wh~f|ezcxO]!'(!!!!!!!!!999XXX\\\suueff_________\\\RRRMMMMMMMMMMMMMMMMMMMMMMMMOOOZZZ```_________oopijjVVVPPP+++ 28:*s vJ wrpq q p d [cxbvZk49! %%%LLL[[[fggtuuaaa______```]]]RRRMMMMMMMMMMMMMMMMMMMMMMMMOOOZZZ`````````___fgguvv]]]]^^BBB! 6GK z=* v t s r p n lj T]q\n>F !888_``___suulmm___`````````]]]RRRMMMMMMMMMMMMMMMMMMMMMMMMOOOZZZ```````````````sttnpp]_`XYY///$$#5QWSg s q p n l j hg}ezC*CN#$'''STT_bbjkkxzzccc````````````]]]RRRMMMMMMMMMMMMMMMMMMMMMMMMOOOZZZaaaaaaaaaaaa```gggy{{^__[[[LLL###rR q p n l j h g} e{cybv`t1DDD___]^^xyzmnn```aaaaaaaaaaaa^^^RRRMMMMMMMMMMMMMMMMMMMMMMMMOOOZZZaaaaaaaaaaaaaaaaaarssuww^^^\\\BBB?7 p n l j i g} e{ cy av`t^q\p[m888]]]aaarssxzzcccaaaaaaaaaaaaaaa^^^SSSMMMMMMMMMMMMMMMMMMMMMMMMOOO[[[bbbbbbbbbbbbbbbbbbdddz{{opp___\\\<<< _} l j h f} e{ cx av _t ^r \pZmUeFP(Zn333[[[ccclmm~hiiaaabbbbbbbbbbbbbbb^^^SSSMMMMMMMMMMMMMMMMMMMMMMMMOOO[[[bbbcccccccccccccccbbbiii~lmm```]]]##!){+MU#]kcudydxbw`t^r[nXiQ^CL/3iRRsdddjkkoppbbbcccccccccccccccccc___SSSMMMMMMMMMMMMMMMMMMMMMMMMOOO\\\cccccccccccccccccccccbbbmnnmmmKK !%&&25'=B%CK#FN"EM!AH!9? /3#$ }""kkktuucccccccccccccccccccccccc___SSSMMMMMMMMMMMMMMMMMMMMMMMMOOO\\\cccccccccccccccccccccccccccoppqs ###--?@vwwdddcccccccccccccccccccccccc___SSSMMMMMMMMMMMMMMMMMMMMMMMMPPP\\\cccccccccccccccccccccccccccUUc ]:::ZZZhhh::==ccccccccccccccccccccccccccc```SSSMMMMMMMMMMMMMMMMMMMMMMMMPPP]]]ddddddddddddddddddddddddddd))OO\\\DDD+++ &&&>>>XXXgggjjjnnn}>?IIdddddddddddddddddddddddd```SSSMMMMMMMMMMMMMMMMMMMMMMMMPPP]]]dddeeeeeeeeeeeeeeeeeeeee77GHnnnjjjiiidddXXXHHH888---&&&######%%%+++555DDDTTTcccjjjlllnnnz{{kkk$$TTeeeeeeeeeeeeeeeeeeeee```SSSMMMMMMMMMMMMMMMMMMMMMMMMPPP]]]eeeeeeeeeeeeeeeeeeeeeCC&&~rssmmmlllllkjjjgggddd______dddgggjjjlllmmmnnnrrr}~~sssfffeeeZZm[[zeeeeeeeeeeeeeeeeeeaaaSSSMMMMMMMMMMMMMMMMMMMMMMMMPPP^^^eeeeeeeeeeeeeeeeeeLLYYfffoop~zz{tuuqrqppp_``^^_pppqqqtuuyzzsssgggeeeeeeeeeeee\\z bbbeeeeeeeeeeeeeeeaaaSSSMMMMMMMMMMMMMMMMMMMMMMMMPPP^^^fffffffffffffffTTKKffffffffffffkkkuuu~wxxmmnffgffeffffffffffffffffffZZ//fffffffffffffffbbbSSSMMMMMMMMMMMMMMMMMMMMMMMMPPPaaakkkkkkkkkkkk^^::kkkkkkkkkkkkkkkjjjjjjjjjlllooorrsuuvwwwwwwuvvssspppmmmkkkjjjjjjkkkkkkkkkkkkkkkkkkkkkkkkkkk]]??kkkkkkkkkkkkfffUUUMMMMMMMMMMMMMMMMMMMMMMMMRRRgggtttttttttii&&ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttccRRtttttttttnnnWWWMMMMMMMMMMMMMMMMMMMMMMMMSSSooovv'' ppmmffvvvZZZMMMMMMMMMMMMMMMMMMMMMMMMUUUvvvvvz00eevvxx]]]MMMMMMMMMMMMMMMMMMMMMMMMUUU|||99QQ""$$___MMMMMMMMMMMMMMM}MMMMMMMMMUUUyyyMM00**22{{|^^^MMMMMMMMMMMMMMM MMM^MMMMMMRRRjjjyyyQQ llzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzqq--//XXXMMMMMMMMMMMM*MMMMMMMMM%MMMcOOOWWW]]]]]]RR|$$DD]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]&&@@CMMM=MMM MMMqspeakers-1.8/optimizer.cpp000066400000000000000000000122361477675101000161220ustar00rootroot00000000000000#include #include "optimizer.h" #include "mainwindow.h" #include "undocommands.h" Optimizer::Optimizer(const Speaker& speaker, SealedBox *box, int sibling, QObject* parent) : speaker(speaker), box(box), type(BOX_SEALED), sibling(sibling), mainwindow(static_cast(parent)) { } Optimizer::Optimizer(const Speaker &speaker, PortedBox *box, int sibling, QObject *parent) : speaker(speaker), box(box), type(BOX_PORTED), sibling(sibling), mainwindow(static_cast(parent)) { } Optimizer::Optimizer(const Speaker &speaker, BandPassBox *box, int sibling, QObject *parent) : speaker(speaker), box(box), type(BOX_BANDPASS), sibling(sibling), mainwindow(static_cast(parent)) { } void Optimizer::genericOptimizeBox() { if (type == BOX_SEALED) { SealedBox *b = (SealedBox *)box; double qr = 0.707 / speaker.getQts(); double vr = pow(qr, 2.0) - 1; if (nullptr == mainwindow) { b->setVolume(speaker.getVas() * sibling / vr); } else { SealedVolumeCommand* com = new SealedVolumeCommand(b->getVolume(), speaker.getVas() * sibling / vr, mainwindow); mainwindow->getCommandStack()->beginMacro(QObject::tr("optimizing sealed box")); mainwindow->getCommandStack()->push(com); mainwindow->getCommandStack()->endMacro(); } } else if (type == BOX_PORTED) { /* approx. "natural max flat", a good starting point */ double vb = (20 * speaker.getVas() * sibling * pow(speaker.getQts(), 3.3)); double fb = speaker.getFs() * pow(speaker.getVas() * sibling / vb, 0.31); portedAlignVb_Fb(vb, fb, QObject::tr("applying 'max flat' alignment")); } else { /* default optimization for 0dB ripple (s) and 0dB gain (pa)*/ double s = 0.7; double pa = 0.0; bandpassAlignS_Pa(s, pa); } } void Optimizer::portedAlignBessel() { double vb = 8.0707 * pow(speaker.getQts(), 2.5848) * speaker.getVas() * sibling; double fb = 0.3552 * pow(speaker.getQts(), -0.9649) * speaker.getFs(); portedAlignVb_Fb(vb, fb, QObject::tr("applying Bessel alignment")); } void Optimizer::portedAlignBullock() { double qts = speaker.getQts(); double vb = qts * speaker.getVas() * sibling * (4.96 * qts - 0.136); double fb = speaker.getFs(); portedAlignVb_Fb(vb, fb, QObject::tr("applying Bullock alignment")); } void Optimizer::portedAlignKeele_Hoge() { double vb = speaker.getVas() * sibling * 5.2358 * pow(speaker.getQts(), 2.1687); double fb = speaker.getFs(); portedAlignVb_Fb(vb, fb, QObject::tr("applying Keele & Hoge alignment")); } void Optimizer::portedAlignLegendre() { double vb = 10.728 * pow(speaker.getQts(), 2.4186) * speaker.getVas() * sibling; double fb = 0.3802 * pow(speaker.getQts(), -1.0657) * speaker.getFs(); portedAlignVb_Fb(vb, fb, QObject::tr("applying Legendre alignment")); } void Optimizer::portedAlignModerate_Inf() { /* use M4 Moderate alignment (see http://www.mzbinden.ch/ventedalignments/index.html) */ double vb = (2.52 * speaker.getQts() - 0.35) * speaker.getVas() * sibling; double fb = 0.32 * sqrt((1.0/pow(speaker.getQts(), 2.0)) + 3.38) * speaker.getFs(); portedAlignVb_Fb(vb, fb, QObject::tr("applying Zbinden alignment")); } void Optimizer::portedAlignVb_Fb(double vb, double fb, const QString& title) { PortedBox *b = (PortedBox *)box; if (nullptr == mainwindow) { b->setBoxVolume(vb); b->setResFreq(fb); b->updatePorts(speaker.getSd() * sibling, speaker.getXmax()); } else { QUndoStack* stack = mainwindow->getCommandStack(); stack->beginMacro(title); PortedVolumeCommand* com1 = new PortedVolumeCommand(b->getBoxVolume(), vb, mainwindow); stack->push(com1); PortedResFreqCommand* com2 = new PortedResFreqCommand(b->getResFreq(), fb, mainwindow); stack->push(com2); stack->endMacro(); } } void Optimizer::bandpassAlignS_Pa(double s, double pa) { BandPassBox *b = (BandPassBox *)box; /* see http://www.diysubwoofers.org/bnd/4thord1.htm */ double qbp = pow((pow(10.0,(-pa/40.0)) * 2 * s ), -1); double fb = qbp * speaker.getFs() / speaker.getQts(); double vf = pow(2 * s * speaker.getQts(), 2) * speaker.getVas() * sibling; double vr = speaker.getVas() * sibling / (pow(qbp / speaker.getQts(), 2) - 1); if (nullptr == mainwindow) { b->setSealedBoxVolume(vr); b->setPortedBoxVolume(vf); b->setPortedBoxResFreq(fb); b->updatePortedBoxPorts(speaker.getSd() * sibling, speaker.getXmax()); } else { QUndoStack* stack = mainwindow->getCommandStack(); stack->beginMacro(QObject::tr("applying bandpass box alignment")); BPSealedVolumeCommand* com1 = new BPSealedVolumeCommand(b->getSealedBoxVolume(), vr, mainwindow); stack->push(com1); BPPortedVolumeCommand* com2 = new BPPortedVolumeCommand(b->getPortedBoxVolume(), vf, mainwindow); stack->push(com2); BPPortedResFreqCommand* com3 = new BPPortedResFreqCommand(b->getPortedBoxResFreq(), fb, mainwindow); stack->push(com3); stack->endMacro(); } } qspeakers-1.8/optimizer.h000066400000000000000000000017201477675101000155630ustar00rootroot00000000000000#ifndef OPTIMIZER_H #define OPTIMIZER_H #include "mainwindow.h" #include "speaker.h" #include "box.h" #include "sealedbox.h" #include "portedbox.h" #include "bandpassbox.h" class Optimizer { public: Optimizer(const Speaker &speaker, SealedBox *box, int sibling, QObject* parent = nullptr); Optimizer(const Speaker &speaker, PortedBox *box, int sibling, QObject* parent = nullptr); Optimizer(const Speaker &speaker, BandPassBox *box, int sibling, QObject* parent = nullptr); void genericOptimizeBox(); void portedAlignModerate_Inf(); void portedAlignLegendre(); void portedAlignBessel(); void portedAlignBullock(); void portedAlignKeele_Hoge(); void bandpassAlignS_Pa(double s, double pa); void portedAlignVb_Fb(double vb, double fb, const QString &title); private: Speaker speaker; Box *box; int type; int sibling; /* number of speakers (not push-pull!) */ MainWindow* mainwindow; }; #endif // OPTIMIZER_H qspeakers-1.8/plot.cpp000066400000000000000000000136121477675101000150550ustar00rootroot00000000000000#include "plot.h" #include #if QT_VERSION < QT_VERSION_CHECK(6,0,0) using namespace QtCharts; #endif Plot::Plot(QWidget *parent) : QChartView(parent), xmin(10.0), xmax(1000.0), vLine(nullptr), vLine3db(nullptr), vLabel3db(nullptr) { setCursor(Qt::CrossCursor); initializeChart(); initializeCurve(); initializeScales(); } Plot::Plot(QString title, QWidget *parent) : QChartView(parent), xmin(10.0), xmax(1000.0), vLine(nullptr), vLine3db(nullptr), vLabel3db(nullptr) { setCursor(Qt::CrossCursor); initializeChart(title); initializeCurve(); initializeScales(); } Plot::~Plot() { curve->clear(); delete curve; delete chart; delete vLine; delete vLine3db; delete vLabel3db; } void Plot::appendPointF(const QPointF &pointf) { curve->append(pointf); } void Plot::plot(const QList x, QList y) { QList samples; for (int i = 0; i < x.size(); i++) { QPointF p(x[i], y[i]); curve->append(p); } } void Plot::clear() { curve->clear(); } void Plot::setUseOpenGL(bool enable) { curve->setUseOpenGL(enable); } void Plot::initializeCurve() { curve = new QLineSeries(chart); chart->addSeries(curve); } void Plot::draw3dbVLine() { double x = curveXfromY(-3.0); double y1 = 10.0, y2 = -40.0; QPointF value1(x, y1); QPointF point1 = chart->mapToPosition(value1); QPointF value2 = QPointF(x, y2); QPointF point2 = chart->mapToPosition(value2); QLineF line (point1, point2); if (vLine3db) { this->scene()->removeItem(vLine3db); delete vLine3db; } vLine3db = this->scene()->addLine(line, QPen(Qt::DashLine)); if (vLabel3db) { this->scene()->removeItem(vLabel3db); delete vLabel3db; } QString label = QString(tr("%1 dB at %2 Hz")).arg(-3.0).arg(x); vLabel3db = this->scene()->addSimpleText(label); QPointF pos = chart->mapToPosition(value1); vLabel3db->setPos(pos); } void Plot::resizeEvent(QResizeEvent *event) { QChartView::resizeEvent(event); draw3dbVLine(); } bool Plot::viewportEvent(QEvent *event) { switch (event->type()) { case QEvent::ToolTip: return false; default: break; } return QChartView::viewportEvent(event); } void Plot::mouseMoveEvent(QMouseEvent *event) { if (event->buttons() != Qt::LeftButton) return; QPoint pos = event->pos(); QPointF val = chart->mapToValue(pos); double y = curveYfromX(val.x()); QString label = QString(tr("%1 dB at %2 Hz")).arg(y).arg(val.x()); #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) QToolTip::showText(event->globalPos(), label, this, QRect(), 10000); #else QToolTip::showText(event->globalPosition().toPoint(), label, this, QRect(), 10000); #endif drawVLine(pos); event->accept(); } void Plot::mousePressEvent(QMouseEvent *event) { if (event->buttons() != Qt::LeftButton) return; QPoint pos = event->pos(); QPointF val = chart->mapToValue(pos); double y = curveYfromX(val.x()); QString label = QString(tr("%1 dB at %2 Hz")).arg(round(y)).arg(round(val.x())); #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) QToolTip::showText(event->globalPos(), label, this, QRect(), 10000); #else QToolTip::showText(event->globalPosition().toPoint(), label, this, QRect(), 10000); #endif drawVLine(pos); event->accept(); } void Plot::mouseReleaseEvent(QMouseEvent *event) { if (vLine) { this->scene()->removeItem(vLine); delete vLine; vLine = nullptr; } event->accept(); } double Plot::curveXfromY(double y) { double x = 1.0; QList list = curve->points(); for (int i = 0; i < list.size() - 1; i++) { QPointF p1 = list.at(i); QPointF p2 = list.at(i+1); if (p1.y() <= y && p2.y() > y) { x = p1.x(); break; } } return x; } double Plot::curveYfromX(double x) { double y = 0.0; QList list = curve->points(); for (int i = 0; i < list.size() - 1; i++) { QPointF p1 = list.at(i); QPointF p2 = list.at(i+1); if (p1.x() <= x && p2.x() > x) { y = p1.y(); break; } } return y; } void Plot::drawVLine(QPoint pos) { QPointF val = chart->mapToValue(pos); /* redraw dashed vertical line */ double x = val.x(); QValueAxis* yaxis0 = qobject_cast(chart->axes(Qt::Vertical, curve).at(0)); double ymin = yaxis0->min(); double ymax = yaxis0->max(); QPointF value1(x, ymin); QPointF point1 = chart->mapToPosition(value1); QPointF value2(x, ymax); QPointF point2 = chart->mapToPosition(value2); QLineF line (point1, point2); if (vLine) { this->scene()->removeItem(vLine); delete vLine; } vLine = this->scene()->addLine(line, QPen(Qt::DashLine)); } double Plot::getXmax() const { return xmax; } QLineSeries* Plot::series() const { return curve; } double Plot::getXmin() const { return xmin; } void Plot::initializeChart(const QString& title) { chart = new QChart(); chart->setTitle(title); chart->legend()->hide(); this->setChart(chart); this->setRenderHint(QPainter::Antialiasing); } void Plot::initializeScales() { QLogValueAxis *XAxis = new QLogValueAxis(); XAxis->setBase(10.0); XAxis->setLabelFormat("%g"); XAxis->setTitleText(tr("Frequency [Hz]")); XAxis->setMax(xmax); XAxis->setMin(xmin); XAxis->setMinorTickCount(8); chart->addAxis(XAxis, Qt::AlignBottom); curve->attachAxis(XAxis); QValueAxis *YAxis = new QValueAxis(); YAxis->setTitleText(tr("Sound pressure [dB]")); YAxis->setLabelFormat("%g"); YAxis->setMax(10); YAxis->setMin(-40); YAxis->setTickCount(6); YAxis->setMinorTickCount(1); chart->addAxis(YAxis, Qt::AlignLeft); curve->attachAxis(YAxis); } qspeakers-1.8/plot.h000066400000000000000000000022431477675101000145200ustar00rootroot00000000000000#ifndef PLOT_H #define PLOT_H #include class Plot : public QChartView { Q_OBJECT public: Plot(QWidget *parent = 0); Plot(QString title, QWidget *parent = 0); ~Plot(); void appendPointF(const QPointF& pointf); void plot(const QList x, QListy); void clear(void); void setUseOpenGL(bool enable = true); void draw3dbVLine(); double getXmin() const; double getXmax() const; QLineSeries* series() const; protected: void initializeScales(); void initializeChart(const QString& title = nullptr); void initializeCurve(); void resizeEvent(QResizeEvent *event); bool viewportEvent(QEvent *event); void mouseMoveEvent(QMouseEvent *event); void mousePressEvent(QMouseEvent* event); void mouseReleaseEvent(QMouseEvent* event); double curveXfromY(double y); double curveYfromX(double x); void drawVLine(QPoint pos); private: QLineSeries *curve; QChart *chart; double xmin; double xmax; QGraphicsSimpleTextItem *pointerLabel; QGraphicsLineItem *vLine; QGraphicsLineItem *vLine3db; QGraphicsSimpleTextItem *vLabel3db; }; #endif // PLOT_H qspeakers-1.8/portedbox.cpp000066400000000000000000000131151477675101000161030ustar00rootroot00000000000000#include #include #include #include "portedbox.h" PortedBox::PortedBox(double volume, double resfreq, unsigned int portnum, double portdiam, double portlen) : box(volume) { setResFreq(resfreq); portNum = portnum; setPortDiam(portdiam); setPortLen(portlen); slotActivated = false; } void PortedBox::setBoxVolume(double vol) { box.setVolume(vol); } void PortedBox::setPortNum(unsigned int value) { portNum = value; } void PortedBox::setPortLen(double len) { portLen = double ((int)(len * 100) / 100.0); } void PortedBox::setPortDiam(double diam) { portDiam = double ((int)(diam * 100) / 100.0); } void PortedBox::setSlotWidth(double width) { slotWidth = double ((int)(width * 100) / 100.0); } void PortedBox::setResFreq(double value) { resFreq = double ((int)(value * 100) / 100.0); } void PortedBox::setSlotPortActivated(bool enable) { slotActivated = enable; } double PortedBox::getBoxVolume() const { return box.getVolume(); } unsigned int PortedBox::getPortNum() const { return portNum; } double PortedBox::getPortLen() const { if (!slotActivated) return portLen; double x = getSlotWidth() / getSlotHeight(); if (x < 1) { x = getSlotHeight() / getSlotWidth(); } /* estimated from https://sites.google.com/site/francisaudio69/ */ return double ((int)((1.1 - log10(x + 1.1) * 0.35) * portLen * 100) / 100.0); } double PortedBox::getPortDiam() const { return portDiam; } bool PortedBox::getSlotPortActivated() const { return slotActivated; } double PortedBox::getSlotWidth() const { return slotWidth; } double PortedBox::getSlotHeight() const { /* width is manual, height is computed from eq. diam. */ return double ((int)((M_PI * pow(portDiam, 2.0)) / (4.0 * slotWidth) * 100) / 100.0); } double PortedBox::getResFreq() const { return resFreq; } void PortedBox::updatePorts(double sd, double xmax) { /* compute minimum port diameter and optionaly set it */ double vol = sd * xmax * 0.001; /* m³ */ double dmin = 100 * (20.3 * pow((pow(vol, 2.0) / getResFreq()), 0.25)) / sqrt(getPortNum()); /* cm */ setPortDiam(dmin); updateSlots(); updatePortsLength(); } void PortedBox::updateSlots() { /* compute square slot */ double diam = getPortDiam(); double s = sqrt(M_PI * pow(diam, 2.0) / 4.0); /* consider "width" over "height" and reset if too small */ if (slotWidth == 0.0) slotWidth = double ((int)(s * 100) / 100.0); } void PortedBox::updatePortsLength() { /* compute resulting length */ double diam = getPortDiam(); double res = getResFreq(); double vol = getBoxVolume(); double num = getPortNum(); double plen = ((23562.5 * pow(diam, 2.0)) * num / (vol * pow(res, 2.0))) - (K * diam); setPortLen(plen); } QDomElement PortedBox::toDomElement(QDomDocument& doc) const { QLocale c(QLocale::C); QDomElement e = Box::toDomElement(doc); e.setAttribute("type", "ported"); e.setAttribute("res", c.toString(resFreq)); QDomElement b = box.toDomElement(doc); e.appendChild(b); QDomElement p = doc.createElement("port"); p.setAttribute("num", c.toString(portNum)); p.setAttribute("len", c.toString(portLen)); p.setAttribute("diam", c.toString(portDiam)); p.setAttribute("width", c.toString(slotWidth)); p.setAttribute("slot", c.toString(slotActivated ? 1 : 0)); e.appendChild(p); return e; } void PortedBox::fromDomElement(const QDomElement &e) { QLocale c(QLocale::C); Box::fromDomElement(e); if (e.attribute("type") != "ported") { qWarning() << __func__ << "wrong box type! (not ported, giving up)"; return; } resFreq = c.toDouble(e.attribute("res")); QDomElement b = e.elementsByTagName("box").at(0).toElement(); box.fromDomElement(b); QDomElement p = e.elementsByTagName("port").at(0).toElement(); portNum = c.toUInt(p.attribute("num")); portLen = c.toDouble(p.attribute("len")); portDiam = c.toDouble(p.attribute("diam")); slotWidth = c.toDouble(p.attribute("width")); slotActivated = c.toUInt(p.attribute("slot")); } void PortedBox::render(QPainter *painter, const QRectF &area) const { QFont orig = painter->font(); #define PORTED_PARAMS 5 QString params[PORTED_PARAMS]; qreal tab = area.left() + BOX_RENDER_MARGINS; qreal realwidth = area.width() - 2 * BOX_RENDER_MARGINS; painter->drawRoundedRect(area.toRect(), 5, 5); params[0] = QObject::tr("Volume: %1 L").arg(QString::number(getBoxVolume(), 'f', 2)); if (!slotActivated) { params[1] = QObject::tr("Port Diameter: %1 cm").arg(QString::number(getPortDiam(), 'f', 1)); } else { params[1] = QObject::tr("Slot port: %1 x %2 cm").arg(QString::number(getSlotWidth(), 'f', 1), QString::number(getSlotHeight(), 'f', 1)); } params[2] = QObject::tr("Port Length: %1 cm").arg(QString::number(getPortLen(), 'f', 1)); params[3] = QObject::tr("Port #: %1").arg(QString::number(getPortNum())); params[4] = QObject::tr("Fb: %1 Hz").arg(QString::number(getResFreq())); QFont font; font.setBold(false); painter->setFont(font); for (int i = 0; i < PORTED_PARAMS; i++) { QString text = params[i]; QTextOption option(Qt::AlignVCenter|Qt::AlignLeft); qreal textwidth = painter->boundingRect(QRect(0, 0, realwidth, 0), text, option).width() + BOX_RENDER_MARGINS; QRectF where(tab, area.top(), qMax(realwidth / PORTED_PARAMS, textwidth), area.height()); painter->drawText(where, text, option); tab += where.width(); } painter->setFont(orig); } qspeakers-1.8/portedbox.h000066400000000000000000000025551477675101000155560ustar00rootroot00000000000000#ifndef PORTEDBOX_H #define PORTEDBOX_H #include #include #include #include #include "sealedbox.h" #define K 0.732 /* correction factor for a half flanged disposed port */ class PortedBox : public Box { public: PortedBox(double volume = 0.01, double resfreq = 1, unsigned int portnum = 1, double portdiam = 0, double portlen = 0); void setBoxVolume(double vol); void setPortNum(unsigned int value); void setPortLen(double len); void setPortDiam(double diam); void setSlotWidth(double width); void setResFreq(double value); void setSlotPortActivated(bool enable); double getBoxVolume(void) const; unsigned int getPortNum() const; double getPortLen(void) const; double getPortDiam(void) const; bool getSlotPortActivated(void) const; double getSlotWidth() const; double getSlotHeight() const; double getResFreq() const; void updateSlots(); void updatePorts(double sd, double xmax); void updatePortsLength(); QDomElement toDomElement(QDomDocument& doc) const; void fromDomElement(const QDomElement& e); void render(QPainter *painter, const QRectF& area) const; private: SealedBox box; double resFreq; unsigned int portNum; double portLen; double portDiam; double slotWidth; bool slotActivated; }; #endif // PORTEDBOX_H qspeakers-1.8/portedbox_cutting_template.scad000066400000000000000000000103771477675101000216720ustar00rootroot00000000000000/* loudspeaker __VENDOR__ __MODEL__ */ loudspeaker_number = __NUMBER__; margin = __MARGIN__; /* mm */ loudspeaker_diameter = __DIAMETER__; /* mm */ internal_ported_box_volume = __PORTEDBOXVOLUME__; /* dm³ (Liter) */ ported_box_port_number = __PORTEDBOXPORTNUMBER__; ported_box_port_slot_activated = __PORTEDBOXPORTSLOTACTIVATED__; ported_box_port_slot_width = __PORTEDBOXPORTSLOTWIDTH__; /* mm */ ported_box_port_slot_height = __PORTEDBOXPORTSLOTHEIGHT__; /* mm */ ported_box_port_diameter = __PORTEDBOXPORTDIAMETER__; /* mm */ ported_box_port_length = __PORTEDBOXPORTLENGTH__; /* mm */ internal_ported_box_width = loudspeaker_diameter + margin; /* mm (x)*/ internal_ported_box_golden = max((ported_box_port_diameter + margin) + ((loudspeaker_diameter + margin) * loudspeaker_number), 1.618 * internal_ported_box_width); /* mm (z)*/ internal_ported_box_alt = internal_ported_box_volume * 1000000 / (internal_ported_box_width * internal_ported_box_golden); /* mm (y)*/ internal_ported_box_height = max(internal_ported_box_golden, internal_ported_box_alt); internal_ported_box_depth = min(internal_ported_box_golden, internal_ported_box_alt); saw_thick = __SAWTHICK__; /* saw cut thick in mm */ wood_thick = __WOODTHICK__; /* board thick in mm */ vertical_center = (internal_ported_box_height + (2 * wood_thick)) / 2; horizontal_center = (internal_ported_box_width + (2 * wood_thick)) / 2; module board(width, height) { square(size = [width, height], center = false); } module speaker(diam, x, y){ translate([x, y, 0]) circle($fn=360, d=diam, true); } module port(diam, slot, width, height, x, y) { if (slot == true) { translate([x, y, 0]) { square(size = [width, height], center = false); } } else { translate([x, y, 0]) { circle($fn=360, d=diam, true); } } } module board_speaker_port(width, height, diam){ difference() { board(width, height); /* calculate ports distribition */ port_placing = (internal_ported_box_width + (2 * wood_thick)) / (ported_box_port_number + 1); for (i = [1:ported_box_port_number]) { if (ported_box_port_slot_activated == false) { /* circular ports, center is used */ port(ported_box_port_diameter, ported_box_port_slot_activated, ported_box_port_slot_width, ported_box_port_slot_height, i * port_placing, wood_thick + margin + ported_box_port_diameter / 2); } else { /* slot ports, left corner is used */ port(ported_box_port_diameter, ported_box_port_slot_activated, ported_box_port_slot_width, ported_box_port_slot_height, (i * port_placing) - (ported_box_port_slot_width / 2), wood_thick); } } for (i = [0:loudspeaker_number-1]) { if (ported_box_port_slot_activated == false) { speaker(diam, width / 2, margin + (diam / 2) + (ported_box_port_diameter + margin) + i * (diam + margin)); } else { speaker(diam, width / 2, margin + (diam / 2) + ported_box_port_slot_height + i * (diam + margin)); } } } } /* boards */ front_width = internal_ported_box_width + (2 * wood_thick); /* mm */ front_height = internal_ported_box_height + (2 * wood_thick); /* mm */ side_depth = internal_ported_box_depth; /* mm */ side_height = internal_ported_box_height; /* mm */ top_width = front_width; /* mm */ top_depth = side_depth; /* mm */ /* two times */ for (i = [0:1]) { translate([0, i*(max(front_height,front_width,side_depth,side_height) + saw_thick), 0]) { /* one board with speaker */ translate([0, 0, 0]) board_speaker_port(front_width, front_height, loudspeaker_diameter); /* one back board */ translate([1 * (front_width + saw_thick), 0, 0]) board(front_width, front_height); /* two side boards */ for (j = [0:1]) { translate([2 * (front_width + saw_thick) + j * (side_depth + saw_thick), 0, 0]) board(side_depth, side_height); } /* two top/bottom boards */ for (j = [0:1]) { translate([j * (top_width + saw_thick) + (2 * (side_depth + saw_thick)) + (2 * (front_width + saw_thick)), 0, 0]) board(top_width, top_depth); } } } qspeakers-1.8/portedbox_template.scad000066400000000000000000000076321477675101000201350ustar00rootroot00000000000000/* loudspeaker __VENDOR__ __MODEL__ */ loudspeaker_number = __NUMBER__; margin = __MARGIN__; /* mm */ loudspeaker_diameter = __DIAMETER__; /* mm */ internal_ported_box_volume = __PORTEDBOXVOLUME__; /* dm³ (Liter) */ ported_box_port_number = __PORTEDBOXPORTNUMBER__; ported_box_port_slot_activated = __PORTEDBOXPORTSLOTACTIVATED__; ported_box_port_slot_width = __PORTEDBOXPORTSLOTWIDTH__; /* mm */ ported_box_port_slot_height = __PORTEDBOXPORTSLOTHEIGHT__; /* mm */ ported_box_port_diameter = __PORTEDBOXPORTDIAMETER__; /* mm */ ported_box_port_length = __PORTEDBOXPORTLENGTH__; /* mm */ wood_thick = __WOODTHICK__; /* mm */ wood_color = "wheat"; internal_ported_box_width = loudspeaker_diameter + margin; /* mm (x)*/ internal_ported_box_golden = max((ported_box_port_diameter + margin) + ((loudspeaker_diameter + margin) * loudspeaker_number), 1.618 * internal_ported_box_width); /* mm (z)*/ internal_ported_box_alt = internal_ported_box_volume * 1000000 / (internal_ported_box_width * internal_ported_box_golden); /* mm (y)*/ internal_ported_box_height = max(internal_ported_box_golden, internal_ported_box_alt); internal_ported_box_depth = min(internal_ported_box_golden, internal_ported_box_alt); vertical_center = (internal_ported_box_height + (2 * wood_thick)) / 2; horizontal_center = (internal_ported_box_width + (2 * wood_thick)) / 2; module speaker_hole(diameter, x, z) { translate([x, 0, z]) { rotate([90, 0, 0]) { color("transparent") { cylinder($fn=360, h = wood_thick, r1 = diameter / 2, r2 = diameter / 2, center=true); } } } } module port_hole(diameter, slot, width, height, x, z) { if (ported_box_port_slot_activated == true) { translate([x, 0, z]) { color("transparent") { cube([width, wood_thick, height]); } } } else { translate([x, 0, z]) { rotate([90, 0, 0]) { color("transparent") { cylinder($fn=360, h = wood_thick, r1 = diameter / 2, r2 = diameter / 2, center=true); } } } } } module closed_enclosure(width, height, depth) { difference() { /* external dimentions */ color(wood_color) { cube([width + (2 * wood_thick), depth + (2 * wood_thick), height + (2 * wood_thick)]); } /* internal dimentions */ translate([wood_thick, wood_thick, wood_thick]) { color(wood_color) { cube([width, depth, height]); } } } } difference() { closed_enclosure(internal_ported_box_width, internal_ported_box_height, internal_ported_box_depth); /* calculate ports distribution */ port_placing = (internal_ported_box_width + (2 * wood_thick)) / (ported_box_port_number + 1); for (i = [1:ported_box_port_number]) { if (ported_box_port_slot_activated == false) { /* circular ports, center is used */ port_hole(ported_box_port_diameter, ported_box_port_slot_activated, ported_box_port_slot_width, ported_box_port_slot_height, i * port_placing, wood_thick + margin + ported_box_port_diameter / 2); } else { /* slot ports, left corner is used */ port_hole(ported_box_port_diameter, ported_box_port_slot_activated, ported_box_port_slot_width, ported_box_port_slot_height, (i * port_placing) - (ported_box_port_slot_width / 2), wood_thick); } } /* loudpeakers distribution */ for (i = [0:loudspeaker_number-1]) { if (ported_box_port_slot_activated == false) { speaker_hole(loudspeaker_diameter, horizontal_center, margin + (loudspeaker_diameter / 2) + (ported_box_port_diameter + margin) + i * (loudspeaker_diameter + margin)); } else { speaker_hole(loudspeaker_diameter, horizontal_center, margin + (loudspeaker_diameter / 2) + ported_box_port_slot_height + i * (loudspeaker_diameter + margin)); } } } qspeakers-1.8/projectproperties.cpp000066400000000000000000000017511477675101000176630ustar00rootroot00000000000000#include #include #include "projectproperties.h" QDomElement ProjectProperties::toDomElement(QDomDocument &doc) const { QDomElement props = doc.createElement("properties"); QDomElement t = doc.createElement("title"); QDomText tval = doc.createTextNode(this->title); t.appendChild(tval); QDomElement n = doc.createElement("note"); QDomText nval = doc.createTextNode(this->note); n.appendChild(nval); props.appendChild(t); props.appendChild(n); return props; } void ProjectProperties::fromDomElement(const QDomElement &el) { QDomNodeList titles = el.elementsByTagName("title"); if (!titles.isEmpty()) { QDomElement t = titles.at(0).toElement(); title = t.text(); } QDomNodeList notes = el.elementsByTagName("note"); if (!notes.isEmpty()) { QDomElement n = notes.at(0).toElement(); note = n.text(); } } void ProjectProperties::clear() { title = ""; note = ""; } qspeakers-1.8/projectproperties.h000066400000000000000000000005371477675101000173310ustar00rootroot00000000000000#ifndef PROJECTPROPERTIES_H #define PROJECTPROPERTIES_H #include #include #include class ProjectProperties { public: QDomElement toDomElement(QDomDocument &doc) const; void fromDomElement(const QDomElement &el); void clear(); QString title; QString note; }; #endif // PROJECTPROPERTIES_H qspeakers-1.8/propertiesdialog.cpp000066400000000000000000000011531477675101000174500ustar00rootroot00000000000000#include "propertiesdialog.h" #include "ui_propertiesdialog.h" PropertiesDialog::PropertiesDialog(QWidget *parent) : QDialog(parent), ui(new Ui::PropertiesDialog) { ui->setupUi(this); } PropertiesDialog::~PropertiesDialog() { delete ui; } void PropertiesDialog::setTitle(const QString &title) { ui->titleLineEdit->setText(title); } void PropertiesDialog::setNote(const QString ¬e) { ui->noteTextEdit->setPlainText(note); } QString PropertiesDialog::getTitle() { return ui->titleLineEdit->text(); } QString PropertiesDialog::getNote() { return ui->noteTextEdit->toPlainText(); } qspeakers-1.8/propertiesdialog.h000066400000000000000000000007141477675101000171170ustar00rootroot00000000000000#ifndef PROPERTIESDIALOG_H #define PROPERTIESDIALOG_H #include namespace Ui { class PropertiesDialog; } class PropertiesDialog : public QDialog { Q_OBJECT public: explicit PropertiesDialog(QWidget *parent = 0); ~PropertiesDialog(); void setTitle(const QString& title); void setNote(const QString& note); QString getTitle(); QString getNote(); private: Ui::PropertiesDialog *ui; }; #endif // PROPERTIESDIALOG_H qspeakers-1.8/propertiesdialog.ui000066400000000000000000000037411477675101000173100ustar00rootroot00000000000000 PropertiesDialog 0 0 400 164 Project Properties Title Note Qt::Horizontal QDialogButtonBox::Cancel|QDialogButtonBox::Ok buttonBox accepted() PropertiesDialog accept() 248 254 157 274 buttonBox rejected() PropertiesDialog reject() 316 260 286 274 qspeakers-1.8/qspeakers.1000066400000000000000000000011071477675101000154470ustar00rootroot00000000000000.TH "QSPEAKERS" "1" .SH "NAME" qspeakers \(em simulate common loudspeaker enclosures .SH "SYNOPSIS" .PP \fBqspeakers\fR [file.qsp] .SH "DESCRIPTION" .PP This manual page documents the \fBqspeakers\fR program. .PP \fBqspeakers\fR is a graphical program that simulates common loudspeaker enclosures such as sealed-system, ported-system and symmetric bandpass-system. .PP \fBqspeakers\fR displays the expected frequency response curve of a system, given the loudspeaker Thiele / Small parameters and the enclosure parameters. .\" created by instant / docbook-to-man qspeakers-1.8/qspeakers.desktop000066400000000000000000000011251477675101000167600ustar00rootroot00000000000000[Desktop Entry] Name=QSpeakers Name[fr]=QSpeakers GenericName=Loudspeaker Enclosure Design Tool GenericName[fr]=Outil de conception d'enceinte acoustique Comment=Simulate an optimizes common loudspeaker enclosures Comment[fr]=Simule et optimise des enceintes acoustiques classiques Keywords=do it yourself;diy;box;loudspeaker;woofer;audio;simulation;acoustics Keywords[fr]=bricolage;diy;boîte;haut-parleur;boomer;audio;simulation;acoustique TryExec=qspeakers Exec=qspeakers %f Icon=qspeakers Terminal=false Type=Application Categories=Science;Education;Physics; MimeType=application/x-qspeakers; qspeakers-1.8/qspeakers.ico000066400000000000000000000410761477675101000160720ustar00rootroot00000000000000@@ (B(@ @  MMMMMMMMM3MMMyMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMOMMMMMMMMMMMMoMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM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TMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM^^^[[[ ;;;iiiSSSPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPYYYddd***222hhhUUUNNNMMMMMMMMMMMMMMMMMMMMMMMMMMM___hhh&&&HHHnnnSSSQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQPPPOOOOOONOOOOOOOOPPPQQQQQQQQQQQQQQQQQQQQQQQQPPPWWWppp<<<HHHoooSSSNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMYYYxxx@@@"""hhhlllQQQQQQQQQQQQQQQRRRQQQNNNHHHAAA;;;666555HIJBDD333555:::@@@GGGMMMQQQRRRQQQQQQQQQQQQRRRoooggg$$$+++oooiiiPPPNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMQQQssssss,,,PPP]]]QQQRRRRRRRRRPPPIII<<=222+++'''&&&%%%(((=??9::&&&&&&&&&'''+++111;;;GGGOOORRRRRRRRRQQQ\\\```(((...jjj|||XXXPPPNNNMMMMMMMMMMMMMMMMMMMMMMMMNNNPPPZZZxxx@@@###...]]]kkkRRRRRRRRRQQQHHH899,,,'''&&&&&&''''''&&&&&&((('''&&&'''(((((((((((())),,,666EEEPPPSSSRRRRRRbbb|||WWWDDDFFF\\\^^^RRRQQQOOOMMMMMMMMMMMMMMMMMMMMMMMMNNNQQQRRR^^^}}}qqqvvvmmmTTTSSSSSSNNN===--.((((((((('''%%%###########################$$$&&&)))*********...:::KKKSSSSSSSSS]]]wwwsssZZZRRRSSSRRROOOMMMMMMMMMMMMMMMMMMMMMMMMNNNQQQSSSRRRVVVgggzzzqqq\\\SSSSSSSSSHHH555***))))))'''$$$###$$$%%%&&&&&&''''''''''''&&&&&&&&&%%%$$$&&&))),,,,,,,,,333EEERRRSSSRRRSSSXXX]]]\\\WWWSSSRRRSSSSSSRRROOOMMMMMMMMMMMMMMMMMMMMMMMMNNNQQQSSSSSSSSSRRRSSSSSSSSSRRRSSSSSSSSSEEE111++++++)))%%%###%%%&&&''''''''''''''''''''''''(('(((((((((((('''&&&&&&+++......111AAAQRRTTTSSSSSSSSSSSSSSSSSSSSSSSSSSSRRROOOMMMMMMMMMMMMMMMMMMMMMMMMNNNRRRTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTDDD000,,,---((($$$%%%'''''''''''''&&(''*((++*,,,,,,,++*)()('(''((()(())))))(((&&&***///000122@AARRRTTTTTTTTTTTTTTTTTTTTTTTTTTTSSSOOOMMMMMMMMMMMMMMMMMMMMMMMMNNNRRRUUUUUUUUUUUUUUUUUUUUUUUUUUUFGG111...---(((%%%'''((((((('')((---19<1LR-]h(jz$p#q$l~&ao)PZ,=B,/0+)(*)(*********((()))000222333CCCTTTUUUUUUUUUUUUUUUUUUUUUUUUSSSOOOMMMMMMMMMMMMMMMMMMMMMMMMNNNRRRUUUUUUUUUUUUUUUUUUUUUVVVKKK444//////(((&&&((((((((()((0113JO,m} x'S^+57+***********))))))111333555GHHVVVUUUUUUUUUUUUUUUUUUUUUTTTOOOMMMMMMMMMMMMMMMMMMMMMMMMNNNRRRUUUUUUUUUUUUUUUUUUVVVQQR999111000)))&&&(((((((((,++6CF-p |'LU+./*))******)))***333555999NNNVVVUUUUUUUUUUUUUUUUUUTTTOOOMMMMMMMMMMMMMMMMMMMMMMMMNNNSSSVVVVVVVVVVVVVVVVVVWXXIJK666222+++&&&)))))))))0006W_  ct+57++*++++++***,,,666999GHHVWWVVVVVVVVVVVVVVVVVVTTTOOOMMMMMMMMMMMMMMMMMMMMMMMMNNNSSSVVVVVVVVVVVVVVVXXXTTTNQQCDD///'''))))))))(2237`k m*8;,**,,,,,,***000ABBFHIOQQXYYVVVVVVVVVVVVVVVUUUOOOMMMMMMMMMMMMMMMMMMMMMMMMNNNSSSWWWWWWWWWWWWWWWXYYCDD???:::)))((())))))1008akm+57++*,,,,,,+++899;<>>EFFZ[[YYYXXXXXXXXXVVVPPPMMMMMMMMMMMMMMMMMMMMMMMMNNNTTTXXXXXXXXXYYYYZZ@@@;;;222((())))))10/7jw  }_qO^M[Xho q*47,++,,,+++222@@@AAAWXX[[[XXXXXXXXXVVVPPPMMMMMMMMMMMMMMMMMMMMMMMMNNNUUUXXXXXXXXX\\\TTT===<<<,,,((()))*));EH GR)+!!!!!! %&9Ah~ "MX,++++++++--->>>BBBPQQ^__XXXXXXXXXWWWPPPMMMMMMMMMMMMMMMMMMMMMMMMOOOUUUYYYYYYYYY___MNN>>>:::)))))))))/--9cm  t27! ! !!!!!!!!!!!!!!!! (*Wh  h{+12,++,,,+++:::CCCKKK`aaYYYYYYYYYWWWPPPMMMMMMMMMMMMMMMMMMMMMMMMOOOUUUYYYYYYZZZaaaHII@@@777((()))(((677, 16!!!!!!!!!!!!!!!!!!!!!!!!!! &'^r w&=B+**+++***555EEEHHH_``[\\YYYYYYWWWPPPMMMMMMMMMMMMMMMMMMMMMMMMOOOVVVZZZZZZ\\\`aaFFFBBB333'''(((('':DGJW! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 38 w }!JT+*)******111FFFHHH^__^^^ZZZZZZWWWPPPMMMMMMMMMMMMMMMMMMMMMMMMOOOVVVZZZZZZ]]^``aFFFCCC000'''(((*((;SX }+.! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! "#Wh ~Ub*++******...FFFIII]]^`aaZZZZZZXXXPPPMMMMMMMMMMMMMMMMMMMMMMMMOOOVVV[[[ZZZ____``GGGDDD...'''(((,)):]ecw ""!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! AK ~}|),,******,,,FFFJJJ]]]bbcZZZ[[[XXXQQQMMMMMMMMMMMMMMMMMMMMMMMMOOOWWW[[[[[[`aa`aaHHHEEE...&&&''',))9ak Td! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 7=y }|zy]m(,-))()))+++FFFLLL]^^dee[[[\\\YYYQQQMMMMMMMMMMMMMMMMMMMMMMMMOOOWWW\\\[[[aaabccIJJGGG...&&&&&&+((9`k Sb! !!!###%&&&''&''&''&''&''&''&&&###!!!! 6<w ~|{ywvZj'+,((((((+++GGGMNN_``eee[[[\\\YYYQQQMMMMMMMMMMMMMMMMMMMMMMMMOOOWWW\\\\\\aaaeffLLLHHH///%%%&&&*'':Zc]p!""$$$355;==;==;==;==;==;==;==<==666&&&! >Gx{yxvutTc')*(''''',,,JJJOOObcceee[[[\\\ZZZQQQMMMMMMMMMMMMMMMMMMMMMMMMOOOXXX]]]\\\```ijjOOOKKK333$$$%%%'%%:PUq),//.PRRVXXUXXUXXUXXUXXUXXUXXVXXRTT333!""O]yxvusrpKW'''&&&&&&---MMMRRRfggdee\\\]]]ZZZQQQMMMMMMMMMMMMMMMMMMMMMMMMOOOXXX]]]]]]___lmmSTTMMM888###$$$$##8AC! BL110beeruuqttpttpttpttpttqttruufii666/2fzwusrpoj ?G&%%&&&%%%222QQQTUUkllccc]]]]]]ZZZQQQMMMMMMMMMMMMMMMMMMMMMMMMOOOXXX^^^^^^^^^mnnZZZOOO@@@%%%######233.vm$25NNN}TVU(,-O\strpoml`s"36%$$%%%$$$:::TTTYYYoppa`a^^^^^^[[[QQQMMMMMMMMMMMMMMMMMMMMMMMMPPPYYY^^^^^^^^]jkkdeeQQQIII)))""""""(''9[c ^q'36FGFlooprsKLL*./GRnspomlji~P]#')$##$$$%%%EEEVVV`aapqq^^^^^^^^^[[[QQQMMMMMMMMMMMMMMMMMMMMMMMMOOOYYY^^^^^^^^^effmnoTTTPPP111 !!!"!!6>@$ dx ;B*./656=>=>>>766+-.#26Q^lqomljh~g|au9@""""""!!!+++PPPXWWjkkkll^^^^^^^^^[[[RRRMMMMMMMMMMMMMMMMMMMMMMMMOOOYYY_________bbbrss]]]TTTAAA!!! (''7^h u]oIS?F=DCMSafzpomljh~f|ezcxO]!'(!!!!!!!!!999XXX\\\suueff_________\\\RRRMMMMMMMMMMMMMMMMMMMMMMMMOOOZZZ```_________oopijjVVVPPP+++ 28:*s   } | z wrpq q pnlji~g}ezcxbvZk49! %%%LLL[[[fggtuuaaa______```]]]RRRMMMMMMMMMMMMMMMMMMMMMMMMOOOZZZ`````````___fgguvv]]]]^^BBB! 6GK z  ~ | z x v t s r p n ljhf|ezcxav`t\n>F !888_``___suulmm___`````````]]]RRRMMMMMMMMMMMMMMMMMMMMMMMMOOOZZZ```````````````sttnpp]_`XYY///$$#5QWy ~ | z x w u s q p n l j hg}ezcxbv`s^r[mCN#$'''STT_bbjkkxzzccc````````````]]]RRRMMMMMMMMMMMMMMMMMMMMMMMMOOOZZZaaaaaaaaaaaa```gggy{{^__[[[LLL###$%%4NTs z y w u s q p n l j h g} e{cybv`t^r]pXjBK#%DDD___]^^xyzmnn```aaaaaaaaaaaa^^^RRRMMMMMMMMMMMMMMMMMMMMMMMMOOOZZZaaaaaaaaaaaaaaaaaarssuww^^^\\\BBB!!!1DI&hxt t q p n l j i g} e{ cy av`t^q\p[mSb:B !888]]]aaarssxzzcccaaaaaaaaaaaaaaa^^^SSSMMMMMMMMMMMMMMMMMMMMMMMMOOO[[[bbbbbbbbbbbbbbbbbbdddz{{opp___\\\<<<*13-S\hzn l j h f} e{ cx av _t ^r \pZmUeFP,0333[[[ccclmm~hiiaaabbbbbbbbbbbbbbb^^^SSSMMMMMMMMMMMMMMMMMMMMMMMMOOO[[[bbbcccccccccccccccbbbiii~lmm```]]]<<<*47+MU#]kcudydxbw`t^r[nXiQ^CL/3222ZZZdddjkkoppbbbcccccccccccccccccc___SSSMMMMMMMMMMMMMMMMMMMMMMMMOOO\\\cccccccccccccccccccccbbbmnnmmmbbb___CCC!%&&25'=B%CK#FN"EM!AH!9? /3#$:::]]]fffkkktuucccccccccccccccccccccccc___SSSMMMMMMMMMMMMMMMMMMMMMMMMOOO\\\cccccccccccccccccccccccccccopppqqdddcccOOO+++###GGGcccgggnnnvwwdddcccccccccccccccccccccccc___SSSMMMMMMMMMMMMMMMMMMMMMMMMPPP\\\ccccccccccccccccccccccccccccccoppwxxgggfff^^^BBB$$$:::ZZZhhhiiituuuvvdddccccccccccccccccccccccccccc```SSSMMMMMMMMMMMMMMMMMMMMMMMMPPP]]]dddddddddddddddddddddddddddddddddlllnnnhhhggg\\\DDD+++ &&&>>>XXXgggjjjnnn}qrrddddddddddddddddddddddddddddddddd```SSSMMMMMMMMMMMMMMMMMMMMMMMMPPP]]]dddeeeeeeeeeeeeeeeeeeeeeeeeeeeeeedddhhhy{{|}}nnnjjjiiidddXXXHHH888---&&&######%%%+++555DDDTTTcccjjjlllnnnz{{kkkdddeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee```SSSMMMMMMMMMMMMMMMMMMMMMMMMPPP]]]eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeennn~rssmmmlllllkjjjgggddd______dddgggjjjlllmmmnnnrrr}~~sssfffeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeaaaSSSMMMMMMMMMMMMMMMMMMMMMMMMPPP^^^eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeefffoop~zz{tuuqrqppp_``^^_pppqqqtuuyzzsssgggeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeaaaSSSMMMMMMMMMMMMMMMMMMMMMMMMPPP^^^ffffffffffffffffffffffffffffffffffffffffffffffffffffffkkkuuu~wxxmmnffgffeffffffffffffffffffffffffffffffffffffffffffffffffbbbSSSMMMMMMMMMMMMMMMMMMMMMMMMPPPaaakkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkjjjjjjjjjlllooorrsuuvwwwwwwuvvssspppmmmkkkjjjjjjkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkfffUUUMMMMMMMMMMMMMMMMMMMMMMMMRRRgggttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttnnnWWWMMMMMMMMMMMMMMMMMMMMMMMMSSSooovvvZZZMMMMMMMMMMMMMMMMMMMMMMMMUUUvvv]]]MMMMMMMMMMMMMMMMMMMMMMMMUUU|||___MMMMMMMMMMMMMMM}MMMMMMMMMUUUyyy^^^MMMMMMMMMMMMMMM MMM^MMMMMMRRRjjjyyyzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzqqqXXXMMMMMMMMMMMM*MMMMMMMMM%MMMcOOOWWW]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]ZZZQQQMMM~MMM=MMM MMMqspeakers-1.8/qspeakers.png000066400000000000000000001415661477675101000161110ustar00rootroot00000000000000PNG  IHDRzTXtRaw profile type exifxmP[ ;y@qʤ`ǟiҩصUJYL,V[Mw^}u.`t` tÁ)ȞaW#-(.9l"H ʵr~:O9Lq[lo+ydtd(1:$Xȿ=aZ#iCCPICC profilex}=H@_?D)+fNvQZ"TB&~A$Qp-8XupqU?@'E)IExwq7*L5q@,#Lܪ B(%fsw1}ѫM8 xxf9GXIRω' #e8̈IGbJJ BbKGD pHYsodtIME   IDATxYl[YvylٖʮyTwU:f @c OyjFnTI ]]YeYDIs}x|H5PeS*$eȑW꒐UȽsB|'|ᇻRV m|駩_LOOWjQvcr8݅LL&C*"LJl*??q^WpELLLKnV"9vq\x<n7PBBUWTD"A:&ż]я~__$-ĄWnݺP\Jzq\躎%!!QFz0,˲V" HL&mBیywkvq={Vۿ[ѤW.SZ^׋0 [qI⒐ErW" ma.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J)*U`Ň)Hד!5aZ(V !o%6'DT.I 녵`-'QrY661+-RxJK%+J Kt2hXf)v6MSZqJRzTc䉑%ɈZtf)R;NABBKk zd)R\0;NC׋~rѣGM6$&jRnL&,,,(rR3) 6{TٕڷaCjkkSshii^ӎ y6[S": R֌{M*dWP@6nŕ\-B;bEE2J=.22+;_zPץhxDǚ_:e54K/"Jh4 GSJH+\2 x| ̌"&MggdۈL&CVQw٬a6L&5^U6Qd{\[ QK4 WE(fD=`E.׫z^RF!y\aǙLF2h'N<R\bĄbBf&IH̐zRK y\Mt:@ÎMח(A)8\(E")FjcP(!SrU*zhW.!;#RjExsiPIENDB`qspeakers-1.8/qspeakers.pro000066400000000000000000000074651477675101000161240ustar00rootroot00000000000000#------------------------------------------------- # # Project created by QtCreator 2014-09-23T08:12:05 # #------------------------------------------------- QT += core gui xml widgets printsupport charts CONFIG += c++17 VERSION = 1.8 REVISION = $$system(git describe --long --tags 2>/dev/null || echo "stable") TARGET = qspeakers TEMPLATE = app QMAKE_CXXFLAGS += -Wall -Wextra -pedantic win32-g++:HOST=__mswin unix:HOST=__unix CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG_OUTPUT win32-g++:contains(QMAKE_HOST.arch, x86_64):{ message("Host is 64bit") } unix { isEmpty(PREFIX): PREFIX = /usr/local isEmpty(BINDIR): BINDIR = $$PREFIX/bin isEmpty(DATADIR): DATADIR = $$PREFIX/share } win32-g++ { isEmpty(PREFIX): PREFIX = "C:/Program Files/QSpeakers" isEmpty(BINDIR): BINDIR = $$PREFIX isEmpty(DATADIR): DATADIR = $$PREFIX } config.input = config.h.in config.output = config.h QMAKE_SUBSTITUTES += config SOURCES += main.cpp \ mainwindow.cpp \ projectproperties.cpp \ propertiesdialog.cpp \ speakerdialog.cpp \ speakerdb.cpp \ speaker.cpp \ importexport.cpp \ box.cpp \ sealedbox.cpp \ portedbox.cpp \ bandpassbox.cpp \ plot.cpp \ listdialog.cpp \ searchdialog.cpp \ system.cpp \ optimizer.cpp \ bandpassdialog.cpp \ scaddialog.cpp HEADERS += mainwindow.h \ projectproperties.h \ propertiesdialog.h \ speakerdialog.h \ speakerdb.h \ speaker.h \ importexport.h \ box.h \ sealedbox.h \ portedbox.h \ bandpassbox.h \ plot.h \ listdialog.h \ searchdialog.h \ system.h \ optimizer.h \ bandpassdialog.h \ scaddialog.h \ undocommands.h FORMS += mainwindow.ui \ propertiesdialog.ui \ speakerdialog.ui \ listdialog.ui \ searchdialog.ui \ bandpassdialog.ui isEmpty(QMAKE_LRELEASE):QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease TRANSLATIONS += \ qspeakers_en.ts \ qspeakers_fr.ts LOCALE_DIR = locale updateqm.input = TRANSLATIONS updateqm.output = $$LOCALE_DIR/${QMAKE_FILE_BASE}.qm updateqm.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm $$LOCALE_DIR/${QMAKE_FILE_BASE}.qm updateqm.CONFIG += no_link target_predeps QMAKE_EXTRA_COMPILERS += updateqm unix { MANPAGE = "qspeakers.1" manpage.input = MANPAGE manpage.output = $${MANPAGE}.gz manpage.commands = gzip --to-stdout ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT} manpage.CONFIG += no_link target_predeps QMAKE_EXTRA_COMPILERS += manpage } translations.files = $$OUT_PWD/$${LOCALE_DIR} database.files = "qspeakers_db.xml" scad.files = sealedbox_template.scad portedbox_template.scad bandpassbox_template.scad \ sealedbox_cutting_template.scad portedbox_cutting_template.scad bandpassbox_cutting_template.scad unix { target.path = $$BINDIR manual.path = $$DATADIR/man/man1 manual.files = $$OUT_PWD/$${MANPAGE}.gz manual.CONFIG = no_check_exist database.path = $$DATADIR/qspeakers translations.path = $$DATADIR/$${TARGET} mime.path = $$DATADIR/mime/packages mime.files = application-x-$${TARGET}.xml desktop.path = $$DATADIR/applications desktop.files = $${TARGET}.desktop icon.path = $$DATADIR/icons/hicolor/scalable/apps icon.files = qspeakers.svg scad.path = $$DATADIR/$${TARGET} metainfo.path = $$DATADIR/metainfo metainfo.files = rocks.noise.qspeakers.metainfo.xml INSTALLS += target \ icon \ manual \ database \ translations \ mime \ desktop \ scad \ metainfo } win32-g++ { target.path = $$BINDIR database.path = $$DATADIR translations.path = $$DATADIR/$${TARGET} scad.path = $$DATADIR/$${TARGET} RC_ICONS += qspeakers.ico INSTALLS += target \ database \ translations \ scad } qspeakers-1.8/qspeakers.svg000066400000000000000000000757001477675101000161200ustar00rootroot00000000000000 image/svg+xmlOpenclipart image/svg+xml qspeakers-1.8/qspeakers_db.xml000066400000000000000000003454501477675101000165700ustar00rootroot00000000000000 qspeakers-1.8/qspeakers_en.ts000066400000000000000000001111331477675101000164200ustar00rootroot00000000000000 BandpassDialog Alignment Curve gain (dB) Curve ripple (0.7 = 0dB) ListDialog Please select an item MainWindow Loudspeaker number vendor model 0 Hz Vas: L m Ohm 1 Sealed enclosure 1st order filter Simple, safe enclosure good for several speakers. Enclosure volume Ported enclosure 2nd order filter Popular enclosure type to enhance bass for most speakers. Enclosure volume (Vb) Enclosure filter resonance (Fb) Number of ports Port diameter cm Slot port x Port length Bandpass enclosure 4th order filter Enclosure for subwoofer, mostly used in 2:1, 5:1 and 7:1 systems. Sealed enclosure volume Ported enclosure volume Ported enclosure filter resonance Project Edit Ported alignments About Speaker Exports Ctrl+I Save Ctrl+S Ctrl+E Print Print the current project Ctrl+P Quit Quit the application Ctrl+Q About QSpeakers Ctrl+A New New speaker parameters Ctrl+N Search Search a speaker Optimize Optimize frequency response Ctrl+O Modify Modify the current speaker Ctrl+M Remove Remove the current speaker Bessel Linear phase and fast transient response alignment Extended bass response with minimum ripple Boom box butterworth 4th order alignment Super boom box butterworth 4th order alignment Bandpass alignment Undo Undo action Ctrl+U Redo Redo action Ctrl+R 3D OpenScad 2D OpenScad Curve Plot Properties Zbinden M4 Spl: dB Fs: Qts: Dia: Z: Vc: Moderate alignment (infinite baffle) Legendre Open... Open a speaker project Save the current project Save copy... Save the current project in a copy Hoge BB4 Bullock SBB4 Recently opened Sealed volume frequency response Ported volume frequency response Bandpass volumes frequency response Export File QSpeakers project (*.qsp) untitled.qsp Project not saved Current project has not been saved. Continue anyway? The current project has not been saved. Continue anyway? Import File Warning Could not open project! The current project has not been saved. Exit anyway? Export for Gnuplot Gnuplot data (*.dat) Export for 3D OpenSCAD OpenSCAD script (*.scad) Export for 2D OpenSCAD Removal confirmation Do you really want to remove this loudspeaker from the database? QSpeakers version %1 (%2) This program simulates common acoustical enclosures behaviour to help designing loudspeaker systems. This program is free software, copyright (C) 2014 Benoit Rouits <brouits@free.fr> and released under the GNU General Public Lisence version 3. It is delivered as is in the hope it can be useful, but with NO WARRANTY at all. Unsaved speaker Speaker driver %1 is not present in the database. Do you want to insert it before to continue? Plot Frequency [Hz] Sound pressure [dB] %1 dB at %2 Hz PropertiesDialog Project Properties Title Note QObject Sealed Volume: %1 L Sealed Vol. %1 L Ported Volume: %1 L Ported Vol. %1 L Port Diameter: %1 cm Port Diam. %1 cm Port Length: %1 cm Port Len. %1 cm Port #: %1 Port Num. %1 Fb: %1 Hz Fb %1 Hz Volume: %1 L Vol. %1 L Slot port: %1 x %2 cm Slot port %1 x %2 cm Loudspeaker(s): sealed Sealed ported bandpass Enclosure: optimizing sealed box applying 'max flat' alignment applying Bessel alignment applying Bullock alignment applying Keele & Hoge alignment applying Legendre alignment applying Zbinden alignment applying bandpass box alignment Loudspeaker enclosure computation program. Spl: %1 dB Fs: %1 Hz Qts: %1 Vas: %1 L Dia: %1 m Xmax: %1 mm Z: %1 Ohm Re: %1 Ohm Vc: %1 ScadDialog Loudspeaker margin (mm) Wood thick (mm) Saw thick (mm) SearchDialog Loudspeaker parameter is between and SpeakerDialog Loudspeaker Vendor speaker vendor name Model speaker name or reference number Fs (Hz) Qts Vas (L) Dia cutout (m) Z (Ohm) Sd (m²) Re (Ohm) Le (mH) Xmax (mm) Qms Qes Spl (dB) Pe (W) BL (Tm) Voice Coil (#) main Project file to work on. qspeakers-1.8/qspeakers_fr.ts000066400000000000000000001107441477675101000164340ustar00rootroot00000000000000 BandpassDialog Alignment Alignement Curve gain (dB) Gain de la courbe (dB) Curve ripple (0.7 = 0dB) Oscillation de la courbe (0.7 = 0dB) ListDialog Please select an item Veuillez sélectionner un item MainWindow Loudspeaker Haut-parleur number nombre vendor constructeur model modèle 0 0 Hz Hz Vas: Vas : L L m m Ohm Ohm 1 1 Sealed enclosure Enceinte close 1st order filter filtre du premier ordre Simple, safe enclosure good for several speakers. Enceinte simple et sûre, bonne pour certains haut-parleurs. Enclosure volume Volume de l'enceinte Ported enclosure Enceinte à évent 2nd order filter filtre du second ordre Popular enclosure type to enhance bass for most speakers. Type d'enceinte réputé pour améliorer la réponse en basses pour la plupart des haut-parleurs. Enclosure volume (Vb) Volume de l'enceinte (Vb) Enclosure filter resonance (Fb) Résonnance de l'enceinte (Fb) Number of ports Nombre d'évents Port diameter Diamètre d'évent cm cm Slot port Laminaire x multiply sign x Port length Longueur d'évent Bandpass enclosure Caisson passe-bande 4th order filter filtre du quatrième ordre Enclosure for subwoofer, mostly used in 2:1, 5:1 and 7:1 systems. Enceinte pour subwoofer, souvent utilisée pour les systèmes 2:1, 5:1 et 7:1. Sealed enclosure volume Volume de l'enceinte close Ported enclosure volume Volume de l'enceinte à évent Ported enclosure filter resonance Résonnance de l'enceinte à évent Project Projet Edit Éditer Ported alignments Alignements avec évent About À propos Speaker Haut-parleur Exports Exports Ctrl+I Ctrl+I Save Enregistrer Ctrl+S Ctrl+S Ctrl+E Ctrl+E Print Imprimer Print the current project Imprime le projet Ctrl+P Ctrl+P Quit Quitter Quit the application Quitte l'application Ctrl+Q Ctrl+Q About QSpeakers À propos de QSpeakers Ctrl+A Ctrl+A New Nouveau New speaker parameters Nouveau haut-parleur Ctrl+N Ctrl+N Search Rechercher Search a speaker Recherche un haut-parleur Optimize Optimiser Optimize frequency response Optimise la réponse en fréquence Ctrl+O Ctrl+O Modify Modifier Modify the current speaker Modifie le haut-parleur Ctrl+M Ctrl+M Remove Retirer Remove the current speaker Retire le haut-parleur Bessel Bessel Linear phase and fast transient response alignment Alignement à phase linéaire et réponse en transitoire rapide Extended bass response with minimum ripple Réponse étendue en grave avec un minimum d'oscillation Boom box butterworth 4th order alignment Alignement Butterworth du 4è ordre «Boom box» Super boom box butterworth 4th order alignment Alignement Butterworth du 4è ordre «Super boom box» Undo Défaire Undo action Défaire Ctrl+U Redo Refaire Redo action Refaire Ctrl+R 3D OpenScad OpenScad 3D 2D OpenScad OpenScad 2D Curve Plot Courbe Properties Propriétés Zbinden M4 M4 Zbinden Spl: Spl : dB dB Fs: Fs : Qts: Qts : Dia: Dia : Z: Z : Vc: Vc : Moderate alignment (infinite baffle) Alignement modéré (sur baffle infini) Bandpass alignment Alignement caisson passe-bande Legendre Legendre Open... Ouvrir... Open a speaker project Ouvre un projet Save the current project Enregistre le projet Save copy... Enregistrer une copie... Save the current project in a copy Enregistre une copie du projet Hoge BB4 BB4 Hoge Bullock SBB4 SBB4 Bullock Recently opened Récemment ouvert Sealed volume frequency response Réponse fréquentielle de l'enceinte close Ported volume frequency response Réponse fréquentielle de l'enceinte à évent Bandpass volumes frequency response Réponse fréquentielle du caisson passe-bande Export File Exporter le fichier QSpeakers project (*.qsp) Projet QSpeakers (*.qsp) untitled.qsp sans_nom.qsp Project not saved Projet non enregistré Current project has not been saved. Continue anyway? Le projet actuel n'a pas été enregistré. Continuer quand-même ? Import File Importer un fichier Warning Attention Could not open project! Impossible d'ouvrir le projet ! The current project has not been saved. Exit anyway? Le projet actuel n'a pas été enregistré. Quitter malgré tout ? Export for Gnuplot Exporter pour Gnuplot Gnuplot data (*.dat) Données Gnuplot (*.dat) Export for 3D OpenSCAD Export 3D pour OpenSCAD OpenSCAD script (*.scad) Script OpenSCAD (*.scad) Export for 2D OpenSCAD Export 2D pour OpenSCAD Removal confirmation Confirmation de la suppression Do you really want to remove this loudspeaker from the database? Voulez-vous vraiment retirer ce haut-parleur de la base de données ? QSpeakers version %1 (%2) This program simulates common acoustical enclosures behaviour to help designing loudspeaker systems. This program is free software, copyright (C) 2014 Benoit Rouits <brouits@free.fr> and released under the GNU General Public Lisence version 3. It is delivered as is in the hope it can be useful, but with NO WARRANTY at all. Unsaved speaker Haut-parleur non enregistré Speaker driver %1 is not present in the database. Do you want to insert it before to continue? Le haut-parleur %1 n'est pas présent dans la base de données. Voulez-vous l'insérer avant de continuer ? Plot Frequency [Hz] Fréquence [Hz] Sound pressure [dB] Pression sonore [dB] %1 dB at %2 Hz %1 dB à %2 Hz PropertiesDialog Project Properties Propriétés du projet Title Titre Note Note QObject Sealed Volume: %1 L Volume Clos : %1 L Ported Volume: %1 L Volume avec évent : %1 L Port Diameter: %1 cm Diamètre Évent : %1 cm Port Length: %1 cm Longueur Évent : %1 cm Port #: %1 Nombre Évent(s) : %1 Fb: %1 Hz Fb : %1 Hz Volume: %1 L Volume : %1 L Slot port: %1 x %2 cm Évent laminaire : %1 x %2 cm Loudspeaker(s): Haut-parleur(s) : sealed close ported à évent bandpass passe-bande Enclosure: Enceinte : optimizing sealed box optimisation de l'enceinte close applying 'max flat' alignment application de l'alignement 'max flat' applying Bessel alignment application de l'alignement Bessel applying Bullock alignment application de l'alignement Bullock applying Keele & Hoge alignment application de l'alignement Keele & Hoge applying Legendre alignment application de l'alignement Legendre applying Zbinden alignment application de l'alignement Zbinden applying bandpass box alignment application de l'alignement de l'enceinte passe-bande Loudspeaker enclosure computation program. Programme de calcul d'enceintes acoustiques. Spl: %1 dB Spl : %1 dB Fs: %1 Hz Fs : %1 Hz Qts: %1 Qts : %1 Vas: %1 L Vas : %1 L Dia: %1 m Dia : %1 m Xmax: %1 mm Xmax : %1 mm Z: %1 Ohm Z : %1 Ohm Re: %1 Ohm Re : %1 Ohm Vc: %1 Vc : %1 ScadDialog Loudspeaker margin (mm) Marge du haut-parleur (mm) Wood thick (mm) Épaisseur du bois (mm) Saw thick (mm) Épaisseur de la scie (mm) SearchDialog Loudspeaker parameter Paramètre de haut-parleur is between est entre and et SpeakerDialog Loudspeaker Haut-parleur Vendor Constructeur speaker vendor name nom du constructeur de haut-parleur Model Modèle speaker name or reference number nom ou numéro de référence du haut-parleur Fs (Hz) Fs (Hz) Qts Qts Vas (L) Vas (L) Dia cutout (m) Dia découpe (m) Z (Ohm) Z (Ohm) Sd (m²) Sd (m²) Re (Ohm) Re (Ohm) Le (mH) Le (mH) Xmax (mm) Xmax (mm) Qms Qms Qes Qes Spl (dB) Spl (dB) Pe (W) Pe (W) BL (Tm) BL (Tm) Voice Coil (#) Nb de voix (#) main Project file to work on. Fichier du projet sur lequel travailler. qspeakers-1.8/rocks.noise.qspeakers.metainfo.xml000066400000000000000000000052411477675101000221470ustar00rootroot00000000000000 rocks.noise.qspeakers fr.free.brouits.qspeakers QSpeakers Loudspeaker design software Science Education Physics do it yourself diy box loudspeaker woofer audio simulation acoustics FSFAP GPL-3.0-or-later

QSpeakers is a simple graphical program that simulates common acoustical enclosures behaviour to help designing loudspeaker systems, based on the loudspeaker driver's Thiele / Small parameters and the chosen enclosure type.

This software is mostly useful for do-it-yourself loudspeaker enthusiasts, acoustics teaching, and to a lesser extent, for loudspeaker engineering.

qspeakers.desktop #bab0ab #3d3846 The main window http://brouits.free.fr/qspeakers/qspeakers.png http://brouits.free.fr/qspeakers/ https://paypal.me/brouits https://github.com/be1/qspeakers https://github.com/be1/qspeakers/issues Benoît Rouits fr.free.brouits.qspeakers qspeakers application/x-qspeakers
qspeakers-1.8/scaddialog.cpp000066400000000000000000000034471477675101000161760ustar00rootroot00000000000000#include "scaddialog.h" #include #include #include #include ScadDialog::ScadDialog(int num, QWidget *parent) : QDialog(parent) { QFormLayout *lytMain = new QFormLayout(this); for (int i = 0; i < num; ++i) { QLabel *label = nullptr; QSpinBox *spinBox = new QSpinBox(this); spinBox->setMinimum(1); spinBox->setMaximum(1000); switch (i) { case 0: label = new QLabel(tr("Loudspeaker margin (mm)"), this); spinBox->setValue(50); break; case 1: label = new QLabel(tr("Wood thick (mm)"), this); spinBox->setValue(20); break; case 2: label = new QLabel(tr("Saw thick (mm)"), this); spinBox->setValue(1); break; default: break; } lytMain->addRow(label, spinBox); m_fields << spinBox; } QDialogButtonBox *buttonBox = new QDialogButtonBox ( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this ); lytMain->addWidget(buttonBox); bool conn = connect(buttonBox, &QDialogButtonBox::accepted, this, &ScadDialog::accept); Q_ASSERT(conn); conn = connect(buttonBox, &QDialogButtonBox::rejected, this, &ScadDialog::reject); Q_ASSERT(conn); setLayout(lytMain); } QList ScadDialog::getValues(int num, QWidget *parent, bool *ok) { ScadDialog *dialog = new ScadDialog(num, parent); QList list; const int ret = dialog->exec(); if (ok) *ok = !!ret; if (ret) { foreach (auto field, dialog->m_fields) { list << field->value(); } } dialog->deleteLater(); return list; } qspeakers-1.8/scaddialog.h000066400000000000000000000005521477675101000156350ustar00rootroot00000000000000#ifndef SCADDIALOG_H #define SCADDIALOG_H #include class QSpinBox; class QLabel; class ScadDialog : public QDialog { Q_OBJECT public: explicit ScadDialog(int num, QWidget *parent = nullptr); static QList getValues(int num, QWidget *parent, bool *ok = nullptr); private: QList m_fields; }; #endif // SCADDIALOG_H qspeakers-1.8/sealedbox.cpp000066400000000000000000000025461477675101000160510ustar00rootroot00000000000000#include #include #include "sealedbox.h" SealedBox::SealedBox(double vol) { setVolume(vol); } void SealedBox::setVolume(double vol) { volume = double ((int)(vol * 100) / 100.0); } double SealedBox::getVolume() const { return volume; } QDomElement SealedBox::toDomElement(QDomDocument& doc) const { QDomElement e = Box::toDomElement(doc); e.setAttribute("type", "sealed"); QLocale c(QLocale::C); e.setAttribute("volume", c.toString(volume)); return e; } void SealedBox::fromDomElement(const QDomElement &e) { Box::fromDomElement(e); if (e.attribute("type") != "sealed") { qWarning() << __func__ << "wrong box type! (not sealed, giving up)"; return; } QLocale c(QLocale::C); volume = c.toDouble(e.attribute("volume")); } void SealedBox::render(QPainter *painter, const QRectF &area) const { QFont orig = painter->font(); painter->drawRoundedRect(area.toRect(), 5, 5); QFont font; font.setBold(false); painter->setFont(font); QString text = QObject::tr("Volume: %1 L").arg(QString::number(getVolume(), 'f', 2)); QRectF where(area.left() + BOX_RENDER_MARGINS, area.top(), area.width() - 2 * BOX_RENDER_MARGINS, area.height()); QTextOption option(Qt::AlignVCenter|Qt::AlignLeft); painter->drawText(where, text, option); painter->setFont(orig); } qspeakers-1.8/sealedbox.h000066400000000000000000000007671477675101000155210ustar00rootroot00000000000000#ifndef SEALEDBOX_H #define SEALEDBOX_H #include #include #include #include #include "box.h" class SealedBox : public Box { public: SealedBox(double vol = 0.01); void setVolume(double vol); double getVolume(void) const; QDomElement toDomElement(QDomDocument& doc) const; void fromDomElement(const QDomElement& e); void render(QPainter *painter, const QRectF& area) const; private: double volume; }; #endif // SEALEDBOX_H qspeakers-1.8/sealedbox_cutting_template.scad000066400000000000000000000050631477675101000216260ustar00rootroot00000000000000/* loudspeaker __VENDOR__ __MODEL__ */ loudspeaker_number = __NUMBER__; margin = __MARGIN__; /* mm */ loudspeaker_diameter = __DIAMETER__; /* mm */ internal_closed_box_volume = __SEALEDBOXVOLUME__; /* dm³ (Liter) */ internal_closed_box_width = loudspeaker_diameter + margin; /* mm (x)*/ internal_closed_box_golden = max((loudspeaker_diameter + margin) * loudspeaker_number, 1.618 * internal_closed_box_width); /* mm (z)*/ internal_closed_box_alt = internal_closed_box_volume * 1000000 / (internal_closed_box_width * internal_closed_box_golden); /* mm (y)*/ internal_closed_box_height = max(internal_closed_box_golden, internal_closed_box_alt); /* mm (z) */ internal_closed_box_depth = min(internal_closed_box_golden, internal_closed_box_alt); /* mm (y) */ saw_thick = __SAWTHICK__; /* saw cut thick in mm */ wood_thick = __WOODTHICK__; /* board thick in mm */ vertical_center = (internal_closed_box_height + (2 * wood_thick)) / 2; horizontal_center = (internal_closed_box_width + (2 * wood_thick)) / 2; module board(width, height) { square(size = [width, height], center = false); } module speaker(diam, x, y){ translate([x, y, 0]) circle($fn=360, d=diam, true); } module board_speaker(width, height, diam){ difference() { board(width, height); for (i = [0:loudspeaker_number-1]) { speaker(diam, width / 2, margin + (diam / 2) + i * (diam + margin)); } } } /* boards */ front_width = internal_closed_box_width + (2 * wood_thick); /* mm */ front_height = internal_closed_box_height + (2 * wood_thick); /* mm */ side_depth = internal_closed_box_depth; /* mm */ side_height = internal_closed_box_height; /* mm */ top_width = front_width; /* mm */ top_depth = side_depth; /* mm */ /* two times */ for (i = [0:1]) { translate([0, i*(max(front_height,front_width,side_depth,side_height) + saw_thick), 0]) { /* one board with speaker */ translate([0, 0, 0]) board_speaker(front_width, front_height, loudspeaker_diameter); /* one back board */ translate([1 * (front_width + saw_thick), 0, 0]) board(front_width, front_height); /* two side boards */ for (j = [0:1]) { translate([2 * (front_width + saw_thick) + j * (side_depth + saw_thick), 0, 0]) board(side_depth, side_height); } /* two top/bottom boards */ for (j = [0:1]) { translate([j * (top_width + saw_thick) + (2 * (side_depth + saw_thick)) + (2 * (front_width + saw_thick)), 0, 0]) board(top_width, top_depth); } } } qspeakers-1.8/sealedbox_template.scad000066400000000000000000000037401477675101000200710ustar00rootroot00000000000000/* loudspeaker __VENDOR__ __MODEL__ */ loudspeaker_number = __NUMBER__; margin = __MARGIN__; /* mm */ loudspeaker_diameter = __DIAMETER__; /* mm */ internal_closed_box_volume = __SEALEDBOXVOLUME__; /* dm³ (Liter) */ wood_thick = __WOODTHICK__; /* mm */ wood_color = "wheat"; internal_closed_box_width = loudspeaker_diameter + margin; /* mm (x)*/ internal_closed_box_golden = max((loudspeaker_diameter + margin) * loudspeaker_number, 1.618 * internal_closed_box_width); /* mm (z)*/ internal_closed_box_alt = internal_closed_box_volume * 1000000 / (internal_closed_box_width * internal_closed_box_golden); /* mm (y)*/ internal_closed_box_height = max(internal_closed_box_golden, internal_closed_box_alt); /* mm (z) */ internal_closed_box_depth = min(internal_closed_box_golden, internal_closed_box_alt); /* mm (y) */ vertical_center = (internal_closed_box_height + (2 * wood_thick)) / 2; horizontal_center = (internal_closed_box_width + (2 * wood_thick)) / 2; module speaker_hole(diameter, x, z) { translate([x, 0, z]) { rotate([90, 0, 0]) { color("transparent") { cylinder($fn=360, h = 2 * wood_thick, r1 = diameter / 2, r2 = diameter / 2, center=true); } } } } module closed_enclosure(width, height, depth) { difference() { /* external dimentions */ color(wood_color) { cube([width + (2 * wood_thick), depth + (2 * wood_thick), height + (2 * wood_thick)]); } /* internal dimentions */ translate([wood_thick, wood_thick, wood_thick]) { color(wood_color) { cube([width, depth, height]); } } } } difference() { closed_enclosure(internal_closed_box_width, internal_closed_box_height, internal_closed_box_depth); /* loudpeakers distribution */ for (i = [0:loudspeaker_number-1]) { speaker_hole(loudspeaker_diameter, horizontal_center, margin + (loudspeaker_diameter / 2) + i * (loudspeaker_diameter + margin)); } } qspeakers-1.8/searchdialog.cpp000066400000000000000000000015401477675101000165210ustar00rootroot00000000000000#include "searchdialog.h" #include "ui_searchdialog.h" SearchDialog::SearchDialog(QWidget *parent) : QDialog(parent), ui(new Ui::SearchDialog) { ui->setupUi(this); QStringList params = QString("Fs,Qts,Vas,Dia,Z,Sd,Re,Xmax,Le,Qms,Qes,Spl,Pe,BL").split(','); ui->searchComboBox->addItems(params); connect(this, &SearchDialog::accepted, this, &SearchDialog::onAccepted); connect(this, &SearchDialog::rejected, this, &SearchDialog::onRejected); } SearchDialog::~SearchDialog() { delete ui; } void SearchDialog::onAccepted() { QString param = ui->searchComboBox->currentText(); double min = ui->searchMinDoubleSpinBox->value(); double max = ui->searchMaxdoubleSpinBox->value(); QString p = param.toLower(); emit searchRequested(p, min, max); } void SearchDialog::onRejected() { emit searchCancelled(); } qspeakers-1.8/searchdialog.h000066400000000000000000000007271477675101000161740ustar00rootroot00000000000000#ifndef SEARCHDIALOG_H #define SEARCHDIALOG_H #include namespace Ui { class SearchDialog; } class SearchDialog : public QDialog { Q_OBJECT public: explicit SearchDialog(QWidget *parent = 0); ~SearchDialog(); signals: void searchRequested(const QString& param, double min, double max); void searchCancelled(); private slots: void onAccepted(); void onRejected(); private: Ui::SearchDialog *ui; }; #endif // SEARCHDIALOG_H qspeakers-1.8/searchdialog.ui000066400000000000000000000052531477675101000163610ustar00rootroot00000000000000 SearchDialog 0 0 194 213 0 0 Loudspeaker parameter Qt::AlignCenter is between Qt::AlignCenter 3 and Qt::AlignCenter 3 Qt::Horizontal QDialogButtonBox::Cancel|QDialogButtonBox::Ok searchButtonBox accepted() SearchDialog accept() 248 254 157 274 searchButtonBox rejected() SearchDialog reject() 316 260 286 274 qspeakers-1.8/speaker.cpp000066400000000000000000000212011477675101000155220ustar00rootroot00000000000000#include "speaker.h" #include #include #include #include Speaker::Speaker() : fs(0.0), vas(0.0), re(0.0), qts(0.0), sd(0.0), z(0.0), qms(0.0), qes(0.0), spl(0.0), pe(0.0), le(0.0), xmax(0.0), bl(0.0), vc(1), dia(0.0) { } Speaker::Speaker(const Speaker ©) { this->fs = copy.getFs(); this->vas = copy.getVas(); this->re = copy.getRe(); this->qts = copy.getQts(); this->sd = copy.getSd(); this->z = copy.getZ(); this->qms = copy.getQms(); this->qes = copy.getQes(); this->spl = copy.getSpl(); this->pe = copy.getPe(); this->le = copy.getLe(); this->xmax = copy.getXmax(); this->bl = copy.getBL(); this->vc = copy.getVc(); this->dia = copy.getDia(); this->vendor = copy.getVendor(); this->model = copy.getModel(); } Speaker::~Speaker() { /* nothing to do, just for QMetatype */ } Speaker &Speaker::operator=(const Speaker ©) { this->fs = copy.getFs(); this->vas = copy.getVas(); this->re = copy.getRe(); this->qts = copy.getQts(); this->sd = copy.getSd(); this->z = copy.getZ(); this->qms = copy.getQms(); this->qes = copy.getQes(); this->spl = copy.getSpl(); this->pe = copy.getPe(); this->le = copy.getLe(); this->xmax = copy.getXmax(); this->bl = copy.getBL(); this->vc = copy.getVc(); this->dia = copy.getDia(); this->vendor = copy.getVendor(); this->model = copy.getModel(); return *this; } /* https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ */ static bool almostEqualRelative(double a, double b, double maxRelDiff = DBL_EPSILON) { double diff = fabs(a - b); a = fabs(a); b = fabs(b); double largest = (b > a) ? b : a; if (diff <= largest * maxRelDiff) return true; return false; } bool Speaker::operator==(const Speaker& r) const { return almostEqualRelative(fs, r.getFs()) && almostEqualRelative(vas, r.getVas()) && almostEqualRelative(re, r.getRe()) && almostEqualRelative(qts, r.getQts()) && almostEqualRelative(sd, r.getSd()) && almostEqualRelative(z, r.getZ()) && almostEqualRelative(qms, r.getQms()) && almostEqualRelative(qes, r.getQes()) && almostEqualRelative(spl, r.getSpl()) && almostEqualRelative(pe, r.getPe()) && almostEqualRelative(le, r.getLe()) && almostEqualRelative(xmax, r.getXmax()) && almostEqualRelative(bl, r.getBL()) && almostEqualRelative(dia, r.getDia()) && vc == r.getVc(); } bool Speaker::operator!=(const Speaker& r) const { return !(*this == r); } bool Speaker::isValid() const { return !vendor.isNull() && !model.isNull(); } void Speaker::setVendor(const QString &vnd) { vendor = vnd; } void Speaker::setModel(const QString &mdl) { model = mdl; } void Speaker::setFs(double val) { fs = val; } void Speaker::setVas(double val) { vas = val; } void Speaker::setRe(double val) { re = val; } void Speaker::setQts(double val) { qts = val; } void Speaker::setSd(double val) { sd = val; } void Speaker::setXmax(double val) { xmax = val; } void Speaker::setZ(double val) { z = val; } void Speaker::setLe(double val) { le = val; } void Speaker::setQms(double val) { qms = val; } void Speaker::setQes(double val) { qes = val; } void Speaker::setSpl(double val) { spl = val; } void Speaker::setPe(double val) { pe = val; } void Speaker::setBL(double val) { bl = val; } void Speaker::setDia(double val) { dia = val; } void Speaker::setVc(int val) { vc = val; } void Speaker::computeEmptyParams() { if ((qes && qms) || (qes && qts) || (qms && qts)) { if (!qts) { qDebug() << "computing qts"; qts = (qes * qms) / (qes + qms); } else if (!qms && qts != qes) { qDebug() << "computing qms"; qms = - (qts * qes) / (qts - qes); } else if (!qes && qts != qms) { qDebug() << "computing qes"; qes = - (qts * qms) / (qts - qms); } } if (fs && re && qes && vas && sd) { if (!bl) { qDebug() << "computing bl"; const double rho = 1.204; // Kg/m³ @ +20° Celsius const double c = 343.5; // m/s @ +20° Celsius double mms = 1. / (pow(2. * M_PI * fs, 2) * ((vas / 1000.) / (rho * pow(c, 2.) * pow(sd, 2.)))); bl = sqrt(2 * M_PI * fs * re * mms / qes); } } //FIXME other computations } QString Speaker::getVendor() const { return vendor; } QString Speaker::getModel() const { return model; } double Speaker::getFs() const { return fs; } double Speaker::getVas() const { return vas; } double Speaker::getRe() const { return re; } double Speaker::getQts() const { return qts; } double Speaker::getSd() const { return sd; } double Speaker::getXmax() const { return xmax; } double Speaker::getZ() const { return z; } double Speaker::getLe() const { return le; } double Speaker::getQms() const { return qms; } double Speaker::getQes() const { return qes; } double Speaker::getSpl() const { return spl; } double Speaker::getPe() const { return pe; } double Speaker::getBL() const { return bl; } double Speaker::getDia() const { return dia; } int Speaker::getVc() const { return vc; } QDomElement Speaker::toDomElement(QDomDocument &doc) const { QDomElement e = doc.createElement("speaker"); e.setAttribute("vendor", vendor); e.setAttribute("model", model); QLocale c(QLocale::C); e.setAttribute("fs", c.toString(fs)); e.setAttribute("vas", c.toString(vas)); e.setAttribute("re", c.toString(re)); e.setAttribute("qts", c.toString(qts)); e.setAttribute("sd", c.toString(sd)); e.setAttribute("xmax", c.toString(xmax)); e.setAttribute("z", c.toString(z)); e.setAttribute("le", c.toString(le)); e.setAttribute("qms", c.toString(qms)); e.setAttribute("qes", c.toString(qes)); e.setAttribute("spl", c.toString(spl)); e.setAttribute("pe", c.toString(pe)); e.setAttribute("bl", c.toString(bl)); e.setAttribute("dia", c.toString(dia)); e.setAttribute("vc", c.toString(vc)); return e; } void Speaker::fromDomElement(const QDomElement &el) { vendor = el.attribute("vendor"); model = el.attribute("model"); QLocale c(QLocale::C); fs = c.toDouble(el.attribute("fs")); vas = c.toDouble(el.attribute("vas")); re = c.toDouble(el.attribute("re")); qts = c.toDouble(el.attribute("qts")); sd = c.toDouble(el.attribute("sd")); xmax = c.toDouble(el.attribute("xmax")); z = c.toDouble(el.attribute("z")); le = c.toDouble(el.attribute("le")); qms = c.toDouble(el.attribute("qms")); qes = c.toDouble(el.attribute("qes")); spl = c.toDouble(el.attribute("spl")); pe = c.toDouble(el.attribute("pe")); bl = c.toDouble(el.attribute("bl")); dia = c.toDouble(el.attribute("dia")); vc = c.toInt(el.attribute("vc")); /* for older db compatibility */ vc = vc ? vc : 1; } void Speaker::render(QPainter *painter, const QRectF &area) { QFont orig = painter->font(); painter->drawRoundedRect(area.toRect(), 5, 5); #define PARAMLEN 9 QString params[PARAMLEN]; params[0] = QObject::tr("Spl: %1 dB").arg(getSpl()); params[1] = QObject::tr("Fs: %1 Hz").arg(getFs()); params[2] = QObject::tr("Qts: %1").arg(getQts()); params[3] = QObject::tr("Vas: %1 L").arg(getVas()); params[4] = QObject::tr("Dia: %1 m").arg(getDia()); params[5] = QObject::tr("Xmax: %1 mm").arg(getXmax()); params[6] = QObject::tr("Z: %1 Ohm").arg(getZ()); params[7] = QObject::tr("Re: %1 Ohm").arg(getRe()); params[8] = QObject::tr("Vc: %1").arg(getVc()); const int margins = 13; /* pixels */ qreal tab = area.left() + margins; qreal realwidth = area.width() - 2 * margins; QString text = getVendor() + " " + getModel(); QRectF where(tab, area.top(), realwidth, area.height() / 2); QTextOption option(Qt::AlignCenter); QFont font; font.setBold(true); painter->setFont(font); painter->drawText(where, text, option); for (int i = 0; i < PARAMLEN; i++) { where.setRect(tab, area.top() + area.height() / 2., realwidth / PARAMLEN, area.height() / 2.); text = params[i]; QFont font; font.setBold(false); painter->setFont(font); option.setAlignment(Qt::AlignVCenter|Qt::AlignLeft); painter->drawText(where, text, option); tab += realwidth / PARAMLEN; } painter->setFont(orig); } qspeakers-1.8/speaker.h000066400000000000000000000046111477675101000151750ustar00rootroot00000000000000#ifndef SPEAKER_H #define SPEAKER_H #include #include #include #include #include #include #include class Speaker { public: Speaker(); Speaker(const Speaker& copy); ~Speaker(); Speaker& operator=(const Speaker& copy); bool operator!=(const Speaker& r) const; bool operator==(const Speaker& r) const; bool isValid(void) const; void setVendor(const QString& vnd); void setModel(const QString& mdl); void setFs(double val); void setVas(double val); void setRe(double val); void setQts(double val); void setSd(double val); void setXmax(double val); void setZ(double val); void setLe(double val); void setQms(double val); void setQes(double val); void setSpl(double val); void setPe(double val); void setBL(double val); void setDia(double val); void setVc(int val); void computeEmptyParams(void); QString getVendor() const; QString getModel() const; double getFs(void) const; double getVas(void) const; double getRe(void) const; double getQts(void) const; double getSd(void) const; double getXmax() const; double getZ() const; double getLe() const; double getQms() const; double getQes() const; double getSpl() const; double getPe() const; double getBL() const; double getDia() const; int getVc() const; QDomElement toDomElement(QDomDocument& doc) const; void fromDomElement(const QDomElement& el); void render(QPainter *painter, const QRectF& area); private: QString vendor; QString model; // TSPs double fs; // Hz (resonance frequency) double vas; // L (equivalent volume of air) double re; // Ohm (DC resistance) double qts; // unitless (total Q) double sd; // m² (effective piston area) double z; // Ohm (nominal impedance) double qms; // unitless (mechanical Q) double qes; // unitless (electrical Q) double spl; // dB (sensitivity at 1W power input, in 1m distance) // Voice coil parameters double pe; // W (max power in normal use) double le; // mH (voice coil inductance) double xmax; // mm (linear excursion) double bl; // Tm (force factor) int vc; // number of voice coils // Mechanical data double dia; // m (cutout diameter) }; Q_DECLARE_METATYPE(Speaker) #endif // SPEAKER_H qspeakers-1.8/speakerdb.cpp000066400000000000000000000340571477675101000160450ustar00rootroot00000000000000#include "speakerdb.h" #include #include #include #include #include #if QT_VERSION >= QT_VERSION_CHECK(5,0,0) #include #endif #include #include #include #include #include #include #include #include #include QString SpeakerDb::getPath(void) { #if QT_VERSION >= QT_VERSION_CHECK(6,0,0) QString prefix = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation); #elif QT_VERSION >= QT_VERSION_CHECK(5,0,0) QString prefix = QStandardPaths::writableLocation(QStandardPaths::DataLocation); #else QString prefix = QDesktopServices::storageLocation(QDesktopServices::DataLocation); #endif QDir dir(prefix); if (!dir.exists()) dir.mkpath(prefix); QString path = prefix + QDir::separator() + DB_FILENAME; return path; } QDomDocument SpeakerDb::getDoc(void) { QDomImplementation impl = QDomDocument().implementation(); QString name = "QSpeakers"; QString publicId = "-//HEREWE//DTD QSpeakers 1.0 //EN"; QString systemId = "http://def.herewe.org/DTD/qspeakers1.dtd"; QDomDocument doc(impl.createDocumentType(name, publicId, systemId)); doc.appendChild(doc.createComment("QSpeakers db of Thiele-Small parameters")); return doc; } QString SpeakerDb::getPkgDbPath() { #ifdef __mswin return QCoreApplication::applicationDirPath() + QDir::separator() + DB_FILENAME; #else return PKG_DB; #endif } QList SpeakerDb::getModelsByVendor(const QString& vendor, int *maxchars) { int len = 0; QString path = getPath(); QFile file(path); QDomDocument doc = getDoc(); if (file.exists()) { file.open(QIODevice::ReadOnly); doc.setContent(&file); file.close(); } QDomNodeList speakers = doc.elementsByTagName("speaker"); QList list; for (int i = 0; i < speakers.size(); i++) { QDomNode s = speakers.at(i); QDomElement spk = s.toElement(); QString vnd = spk.attribute("vendor"); QString mdl = spk.attribute("model"); if (vnd == vendor) list.append(mdl); if (mdl.length() > len) len = mdl.length(); } if (maxchars) *maxchars = len; std::sort(list.begin(), list.end()); return list; } QList SpeakerDb::getByVendor(const QString &vendor) { QString path = getPath(); QFile file(path); QDomDocument doc = getDoc(); if (file.exists()) { file.open(QIODevice::ReadOnly); doc.setContent(&file); file.close(); } QDomNodeList xspeakers = doc.elementsByTagName("speaker"); QList speakers; for (int i = 0; i < xspeakers.size(); i++) { QDomNode s = xspeakers.at(i); QDomElement spk = s.toElement(); if (spk.attribute("vendor") == vendor) { Speaker speaker; speaker.fromDomElement(spk); speakers.append(speaker); } } return speakers; } QList SpeakerDb::getByValue(QString var, double min, double max) { QString path = getPath(); QFile file(path); QDomDocument doc = getDoc(); if (file.exists()) { file.open(QIODevice::ReadOnly); doc.setContent(&file); file.close(); } QDomNodeList xspeakers = doc.elementsByTagName("speaker"); QList speakers; for (int i = 0; i < xspeakers.size(); i++) { QDomNode s = xspeakers.at(i); QDomElement spk = s.toElement(); QLocale c(QLocale::C); if (c.toDouble(spk.attribute(var)) >= min && c.toDouble(spk.attribute(var)) <= max) { Speaker speaker; speaker.fromDomElement(spk); speakers.append(speaker); } } return speakers; } /* two-way merge, where user db is prioritized (return true if had to resolve conflict) */ bool SpeakerDb::merge(QFile &with) { if (!with.exists()) return false; bool ret = false; QString path = getPath(); QFile file(path); QDomDocument doc = getDoc(); QDomDocument xml = getDoc(); if (file.exists()) { file.open(QIODevice::ReadOnly); doc.setContent(&file); file.close(); } with.open(QIODevice::ReadOnly); xml.setContent(&with); with.close(); QDomNodeList speakerlist = doc.elementsByTagName("speaker"); QDomNodeList withlist = xml.elementsByTagName("speaker"); QDomDocument temp = getDoc(); QDomElement troot = temp.createElement("speakers"); temp.appendChild(troot); /* first way */ qDebug() << "looking " + with.fileName(); for (int i = 0; i < withlist.size(); i++) { bool conflict = false; QDomNode s_ = withlist.at(i); QDomElement spk_ = s_.toElement(); QString vnd_ = spk_.attribute("vendor"); QString mdl_ = spk_.attribute("model"); qDebug() << " element " + with.fileName() + ": " + vnd_ + ":" + mdl_; qDebug() << " looking " + file.fileName(); for (int j = 0; j < speakerlist.size(); j++) { QDomNode s = speakerlist.at(j); QDomElement spk = s.toElement(); QString vnd = spk.attribute("vendor"); QString mdl = spk.attribute("model"); //qDebug() << " element " + file.fileName() + ": " + vnd + ":" + mdl; if ((vnd.toUpper() == vnd_.toUpper()) && (mdl.toUpper() == mdl_.toUpper())) { qDebug() << " CONFLICT!"; conflict = true; ret = true; /* copy the element from user's db to the temporary xml */ qDebug() << " import " + vnd + ":" + mdl; QDomElement t = spk.cloneNode(true).toElement(); t.normalize(); troot.appendChild(t); break; } } if (conflict) continue; /* no conflict, so append the new speaker */ qDebug() << " import " + vnd_ + ":" + mdl_; QDomElement t_ = spk_.cloneNode(true).toElement(); t_.normalize(); troot.appendChild(t_); } /* prepend temp in merged */ QDomDocument merged(temp); QDomElement mroot = merged.firstChildElement("speakers"); QDomNodeList templist = temp.elementsByTagName("speaker"); /* second way */ qDebug() << "looking " + file.fileName(); for (int i = 0; i < speakerlist.size(); i++) { bool already = false; QDomNode s = speakerlist.at(i); QDomElement spk = s.toElement(); QString vnd = spk.attribute("vendor"); QString mdl = spk.attribute("model"); qDebug() << " element " + file.fileName() + ": " + vnd + ":" + mdl; qDebug() << " looking " + with.fileName(); for (int j = 0; j < templist.size(); j++) { QDomNode s_ = templist.at(j); QDomElement spk_ = s_.toElement(); QString vnd_ = spk_.attribute("vendor"); QString mdl_ = spk_.attribute("model"); //qDebug() << " element " + with.fileName() + ": " + vnd_ + ":" + mdl_; if ((vnd.toUpper() == vnd_.toUpper()) && (mdl.toUpper() == mdl_.toUpper())) { already = true; qDebug() << " ALREADY!"; break; } } if (already) continue; /* not already inserted, so append the old speaker */ qDebug() << " import " + vnd + ":" + mdl; QDomElement m = spk.cloneNode(true).toElement(); m.normalize(); mroot.appendChild(m); } QDomNodeList mergedlist = merged.elementsByTagName("speaker"); /* write back */ QFile wfile(path); wfile.open(QIODevice::WriteOnly); wfile.write(merged.toByteArray()); wfile.close(); return ret; } QDateTime SpeakerDb::lastModified() { QFileInfo info(getPath()); qDebug() << info.filePath() + ":" + info.lastModified().toString(); return info.lastModified(); } QDateTime SpeakerDb::pkgInstalled() { QFile pkg_db(getPkgDbPath()); if (pkg_db.exists()) { QFileInfo info(PKG_DB); qDebug() << info.filePath() + ": " + info.lastModified().toString(); return info.lastModified(); } /* necessary if app not 'prod' installed */ QFile cwd_db("./" DB_FILENAME); if (cwd_db.exists()) { QFileInfo info("./" DB_FILENAME); qDebug() << info.filePath() + ": " + info.lastModified().toString(); return info.lastModified(); } /* necessary if app not 'prod' installed, but in my qspeakers source dir */ QFile source_db("../qspeakers/" DB_FILENAME); if (source_db.exists()) { QFileInfo info("../qspeakers/" DB_FILENAME); qDebug() << info.filePath() + ":" + info.lastModified().toString(); return info.lastModified(); } qWarning() << "no pkg db found, returning current datetime as db access!"; return QDateTime(); } QString SpeakerDb::pkgPath() { QFile pkg_db(getPkgDbPath()); if (pkg_db.exists()) return getPkgDbPath(); /* necessary if not 'prod' installed */ QFile cwd_db("./" DB_FILENAME); if (cwd_db.exists()) return "./" DB_FILENAME; /* necessary if not 'prod' installed, but in qspeakers source dir */ QFile source_db("../qspeakers/" DB_FILENAME); if (source_db.exists()) return "../qspeakers/" DB_FILENAME; qWarning() << "no pkg db found, return empty path!"; return QString(); } QList SpeakerDb::getByFs(double min, double max) { return getByValue("fs", min, max); } QList SpeakerDb::getByDia(double min, double max) { return getByValue("dia", min, max); } QList SpeakerDb::getByZ(double min, double max) { return getByValue("z", min, max); } QList SpeakerDb::getBySd(double min, double max) { return getByValue("sd", min, max); } QList SpeakerDb::getByVas(double min, double max) { return getByValue("vas", min, max); } QList SpeakerDb::getByQts(double min, double max) { return getByValue("qts", min, max); } QList SpeakerDb::getByQes(double min, double max) { return getByValue("qes", min, max); } QList SpeakerDb::getByQms(double min, double max) { return getByValue("qms", min, max); } QList SpeakerDb::getByRe(double min, double max) { return getByValue("re", min, max); } QList SpeakerDb::getByXmax(double min, double max) { return getByValue("xmax", min, max); } QList SpeakerDb::getBySpl(double min, double max) { return getByValue("spl", min, max); } QList SpeakerDb::getByPe(double min, double max) { return getByValue("pe", min, max); } QList SpeakerDb::getByBL(double min, double max) { return getByValue("bl", min, max); } QList SpeakerDb::getByVc(int min, int max) { return getByValue("vc", min, max); } QList SpeakerDb::getVendors(int* maxchars) { int len = 0; QString path = getPath(); QFile file(path); QDomDocument doc= getDoc(); if (file.exists()) { file.open(QIODevice::ReadOnly); doc.setContent(&file); file.close(); } QDomNodeList speakers = doc.elementsByTagName("speaker"); QList list; for (int i = 0; i < speakers.size(); i++) { QDomNode s = speakers.at(i); QDomElement spk = s.toElement(); QString vnd = spk.attribute("vendor"); if (list.contains(vnd)) /* avoid duplicates */ continue; list.append(vnd); if (vnd.length() > len) len = vnd.length(); } if (maxchars) *maxchars = len; std::sort(list.begin(), list.end()); return list; } bool SpeakerDb::exists() { QString path = getPath(); QFile file(path); return file.exists(); } void SpeakerDb::insertOrReplace(const QString& vendor, const QString& model, const Speaker& speaker) { QString path = getPath(); QFile file(path); QDomDocument doc = getDoc(); QDomDocument xml = getDoc(); QDomElement wroot = xml.createElement("speakers"); xml.appendChild(wroot); if (file.exists()) { file.open(QIODevice::ReadOnly); doc.setContent(&file); file.close(); } QDomNodeList speakerlist = doc.elementsByTagName("speaker"); for (int i = 0; i < speakerlist.size(); i++) { QDomNode s = speakerlist.at(i); QDomElement spk = s.toElement(); QString vnd = spk.attribute("vendor"); QString mdl = spk.attribute("model"); if ((vnd == vendor) && (mdl == model)) /* 'delete' it for future insert */ continue; /* copy the element to the writeable xml, otherwise we will have a messy loop */ QDomElement w = spk.cloneNode(true).toElement(); w.normalize(); wroot.appendChild(w); } if (speaker.isValid()) { /* append the new speaker */ QDomElement n = speaker.toDomElement(xml); if (speaker.getVendor() != vendor || speaker.getModel() != model) qDebug() << "inserted/updated speaker vendor or name changed."; n.normalize(); wroot.appendChild(n); } /* write back */ QFile wfile(path); wfile.open(QIODevice::WriteOnly); wfile.write(xml.toByteArray()); wfile.close(); } void SpeakerDb::removeByVendorAndModel(const QString &vendor, const QString &model) { return insertOrReplace(vendor, model, Speaker()); } Speaker SpeakerDb::getByVendorAndModel(const QString &vendor, const QString &model) { QString path = getPath(); QFile file(path); QDomDocument doc = getDoc(); if (file.exists()) { file.open(QIODevice::ReadOnly); doc.setContent(&file); file.close(); } QDomNodeList speakers = doc.elementsByTagName("speaker"); Speaker speaker; for (int i = 0; i < speakers.size(); i++) { QDomNode s = speakers.at(i); QDomElement spk = s.toElement(); QString vnd = spk.attribute("vendor"); QString mdl = spk.attribute("model"); if ((vnd == vendor) && (mdl == model)) { speaker.fromDomElement(spk); break; } } return speaker; } qspeakers-1.8/speakerdb.h000066400000000000000000000037451477675101000155120ustar00rootroot00000000000000#ifndef SPEAKERDB_H #define SPEAKERDB_H #include #include #include #include #include #include "speaker.h" #include "config.h" class SpeakerDb { public: static bool exists(void); static void insertOrReplace(const QString& vendor, const QString& name, const Speaker& speaker); static void removeByVendorAndModel(const QString& vendor, const QString& model); static Speaker getByVendorAndModel(const QString& vendor, const QString& model); static QList getVendors(int *maxchars = nullptr); static QList getModelsByVendor(const QString& vendor, int* maxchars = nullptr); static QList getByVendor(const QString& vendor); static QList getByFs(double min, double max); static QList getByDia(double min, double max); static QList getByZ(double min, double max); static QList getBySd(double min, double max); static QList getByVas(double min, double max); static QList getByQts(double min, double max); static QList getByQes(double min, double max); static QList getByQms(double min, double max); static QList getByRe(double min, double max); static QList getByXmax(double min, double max); static QList getBySpl(double min, double max); static QList getByPe(double min, double max); static QList getByBL(double min, double max); static QList getByVc(int min, int max); static QList getByValue(QString var, double min, double max); static bool merge(QFile& with); static QDateTime lastModified(void); static QDateTime pkgInstalled(void); static QString pkgPath(void); private: static QString getPath(void); static QDomDocument getDoc(void); static QString getPkgDbPath(void); #define DB_FILENAME "qspeakers_db.xml" #define PKG_DB DATADIR "/qspeakers/" DB_FILENAME }; #endif // SPEAKERDB_H qspeakers-1.8/speakerdialog.cpp000066400000000000000000000077301477675101000167150ustar00rootroot00000000000000#include #include #include "speakerdialog.h" #include "ui_speakerdialog.h" #include "speaker.h" #include "speakerdb.h" SpeakerDialog::SpeakerDialog(QWidget *parent) : QDialog(parent), ui(new Ui::SpeakerDialog) { ui->setupUi(this); /* do not enable 'ok' since model and vendor are empty */ ui->speakerButtonBox->button(QDialogButtonBox::Ok)->setEnabled(false); connect(this, &SpeakerDialog::accepted, this, &SpeakerDialog::onSpeakerAccepted); connect(this, &SpeakerDialog::rejected, this, &SpeakerDialog::onSpeakerRejected); connect(ui->vendorLineEdit, &QLineEdit::textChanged, this, &SpeakerDialog::onVendorTextChanged); connect(ui->modelLineEdit, &QLineEdit::textChanged, this, &SpeakerDialog::onModelTextChanged); } SpeakerDialog::SpeakerDialog(const Speaker &edit, QWidget *parent) : QDialog(parent), ui(new Ui::SpeakerDialog) { ui->setupUi(this); ui->fsDoubleSpinBox->setValue(edit.getFs()); ui->qtsDoubleSpinBox->setValue(edit.getQts()); ui->vasDoubleSpinBox->setValue(edit.getVas()); ui->zDoubleSpinBox->setValue(edit.getZ()); ui->diaDoubleSpinBox->setValue(edit.getDia()); ui->reDoubleSpinBox->setValue(edit.getRe()); ui->sdDoubleSpinBox->setValue(edit.getSd()); ui->xmaxDoubleSpinBox->setValue(edit.getXmax()); ui->leDoubleSpinBox->setValue(edit.getLe()); ui->qmsDoubleSpinBox->setValue(edit.getQms()); ui->qesDoubleSpinBox->setValue(edit.getQes()); ui->splDoubleSpinBox->setValue(edit.getSpl()); ui->peDoubleSpinBox->setValue(edit.getPe()); ui->blDoubleSpinBox->setValue(edit.getBL()); ui->vcSpinBox->setValue(edit.getVc()); oldVendor = edit.getVendor(); oldModel = edit.getModel(); ui->vendorLineEdit->setText(oldVendor); ui->modelLineEdit->setText(oldModel); connect(this, &SpeakerDialog::accepted, this, &SpeakerDialog::onSpeakerAccepted); connect(this, &SpeakerDialog::rejected, this, &SpeakerDialog::onSpeakerRejected); connect(ui->vendorLineEdit, &QLineEdit::textChanged, this, &SpeakerDialog::onVendorTextChanged); connect(ui->modelLineEdit, &QLineEdit::textChanged, this, &SpeakerDialog::onModelTextChanged); } SpeakerDialog::~SpeakerDialog() { delete ui; } void SpeakerDialog::onVendorTextChanged(QString text) { if (text.isEmpty()) ui->speakerButtonBox->button(QDialogButtonBox::Ok)->setEnabled(false); else if (!ui->modelLineEdit->text().isEmpty()) ui->speakerButtonBox->button(QDialogButtonBox::Ok)->setEnabled(true); } void SpeakerDialog::onModelTextChanged(QString text) { if (text.isEmpty()) ui->speakerButtonBox->button(QDialogButtonBox::Ok)->setEnabled(false); else if (!ui->vendorLineEdit->text().isEmpty()) ui->speakerButtonBox->button(QDialogButtonBox::Ok)->setEnabled(true); } void SpeakerDialog::onSpeakerAccepted() { Speaker spk; QString vendor = ui->vendorLineEdit->text(); QString model = ui->modelLineEdit->text(); spk.setVendor(vendor); spk.setModel(model); spk.setFs(ui->fsDoubleSpinBox->value()); spk.setVas(ui->vasDoubleSpinBox->value()); spk.setQts(ui->qtsDoubleSpinBox->value()); spk.setZ(ui->zDoubleSpinBox->value()); spk.setDia(ui->diaDoubleSpinBox->value()); spk.setRe(ui->reDoubleSpinBox->value()); spk.setSd(ui->sdDoubleSpinBox->value()); spk.setXmax(ui->xmaxDoubleSpinBox->value()); spk.setLe(ui->leDoubleSpinBox->value()); spk.setQms(ui->qmsDoubleSpinBox->value()); spk.setQes(ui->qesDoubleSpinBox->value()); spk.setSpl(ui->splDoubleSpinBox->value()); spk.setPe(ui->peDoubleSpinBox->value()); spk.setBL(ui->blDoubleSpinBox->value()); spk.setVc(ui->vcSpinBox->value()); spk.computeEmptyParams(); if (oldVendor.isEmpty() || oldModel.isEmpty()) { SpeakerDb::insertOrReplace(vendor, model, spk); } else { SpeakerDb::insertOrReplace(oldVendor, oldModel, spk); } emit speakerInserted(spk); } void SpeakerDialog::onSpeakerRejected() { emit speakerCancelled(); } qspeakers-1.8/speakerdialog.h000066400000000000000000000012441477675101000163540ustar00rootroot00000000000000#ifndef SPEAKERDIALOG_H #define SPEAKERDIALOG_H #include #include "speaker.h" namespace Ui { class SpeakerDialog; } class SpeakerDialog : public QDialog { Q_OBJECT public: explicit SpeakerDialog(QWidget *parent = 0); SpeakerDialog(const Speaker& edit, QWidget *parent = 0); ~SpeakerDialog(); signals: void speakerInserted(Speaker spk); void speakerCancelled(); private slots: void onVendorTextChanged(QString text); void onModelTextChanged(QString text); void onSpeakerAccepted(); void onSpeakerRejected(); private: Ui::SpeakerDialog *ui; QString oldVendor; QString oldModel; }; #endif // SPEAKERDIALOG_H qspeakers-1.8/speakerdialog.ui000066400000000000000000000232341477675101000165450ustar00rootroot00000000000000 SpeakerDialog 0 0 400 561 Loudspeaker true 0 0 366 577 QFormLayout::AllNonFixedFieldsGrow Vendor speaker vendor name Model speaker name or reference number Fs (Hz) 6 999.990000000000009 Qts 6 Vas (L) 6 9999.989999999999782 Dia cutout (m) 6 99.998999999999995 Z (Ohm) 6 Sd (m²) 6 Re (Ohm) 6 Le (mH) 6 Xmax (mm) 6 Qms 6 Qes 6 Spl (dB) 6 999.990000000000009 Pe (W) 6 999.990000000000009 BL (Tm) 6 Voice Coil (#) 1 2 true Qt::Horizontal QDialogButtonBox::Cancel|QDialogButtonBox::Ok speakerButtonBox accepted() SpeakerDialog accept() 248 254 157 274 speakerButtonBox rejected() SpeakerDialog reject() 316 260 286 274 qspeakers-1.8/system.cpp000066400000000000000000000101011477675101000154110ustar00rootroot00000000000000#include #include #include #include "system.h" #define Q 7 /* common ported box resonance quality loss */ #define QL 10000 /* common box losses */ System::System(const Speaker& s, const SealedBox *b, unsigned int number) : speaker(s), box(b), type(BOX_SEALED), sibling(number) { } System::System(const Speaker& s, const PortedBox *b, unsigned int number) : speaker(s), box(b), type(BOX_PORTED), sibling(number) { } System::System(const Speaker& s, const BandPassBox *b, unsigned int number) : speaker(s), box(b), type(BOX_BANDPASS), sibling(number) { } double System::response(double f) { if (type == BOX_SEALED) { SealedBox *b = (SealedBox *)box; double vr = speaker.getVas() * sibling / b->getVolume(); double qr = sqrt(vr + 1.0); double qtc = qr * speaker.getQts(); double fb = qr * speaker.getFs(); double fr = pow(f / fb, 2.0); double db = 10 * log10(pow(fr, 2.0) / (pow(fr - 1, 2.0) + fr/pow(qtc, 2.0))); return db; } else if (type == BOX_PORTED) { PortedBox *b = (PortedBox *)box; double A = pow(b->getResFreq() / speaker.getFs(), 2.0); double B = A / speaker.getQts() + b->getResFreq() / (Q * speaker.getFs() * speaker.getQts()); double C = 1.0 + A + (speaker.getVas() * sibling / b->getBoxVolume()) + b->getResFreq() / (Q * speaker.getFs() * speaker.getQts()); double D = 1.0 / speaker.getQts() + b->getResFreq() / (Q * speaker.getFs()); double fn2 = pow(f / speaker.getFs(), 2.0); double fn4 = pow(fn2, 2.0); double db = 10 * log10(pow(fn4, 2.0) / (pow(fn4 - C * fn2 + A, 2.0) + fn2 * pow(D * fn2 - B, 2.0))); return db; } else { BandPassBox *b = (BandPassBox *)box; double A = pow(1.0 / (b->getPortedBoxResFreq()), 2.0) * pow(f, 4.0); double B = ((1 / QL + (speaker.getFs() / b->getPortedBoxResFreq()) / speaker.getQts()) / b->getPortedBoxResFreq()) * pow(f, 3.0); double C = (((1 + speaker.getVas() * sibling / b->getSealedBoxVolume() + speaker.getVas() * sibling / b->getPortedBoxVolume()) * speaker.getFs() / b->getPortedBoxResFreq() + (1 / speaker.getQts()) / QL) * speaker.getFs() / b->getPortedBoxResFreq() + 1) * pow(f, 2.0); double D = ((1 / speaker.getQts() + (speaker.getFs() / b->getPortedBoxResFreq()) / QL * (speaker.getVas() * sibling / b->getSealedBoxVolume() + 1)) * speaker.getFs()) * f; double E = (speaker.getVas() * sibling / b->getSealedBoxVolume() + 1) * pow(speaker.getFs(), 2); double G = A - C + E; double H = -B + D; double db = 20 * log10(pow(f, 2.0) / sqrt(pow(G, 2.0) + pow(H, 2.0))); return db; } } void System::render(QPainter *painter, const QRectF& area) { QFont orig = painter->font(); qreal textHeight = painter->fontMetrics().height(); QTextOption option(Qt::AlignLeft); QRectF elementArea(area); const int elements = 2; QFont font; font.setBold(true); painter->setFont(font); elementArea.moveTop(elementArea.y() + textHeight); /* start after first line */ elementArea.setHeight((area.height() - textHeight) / elements); elementArea.setHeight(elementArea.height() - 2 * textHeight); /* each element has 2 header lines */ /* elements */ elementArea.moveTop(elementArea.y() + textHeight); /* blank line */ painter->drawText(elementArea, QObject::tr("Loudspeaker(s): ") + QString::number(sibling), option); elementArea.moveTop(elementArea.y() + textHeight); speaker.render(painter, elementArea); elementArea.moveTop(elementArea.y() + elementArea.height()); elementArea.moveTop(elementArea.y() + textHeight); /* blank line */ QString boxstr = type == BOX_SEALED ? QObject::tr("sealed") : type == BOX_PORTED ? QObject::tr("ported") : QObject::tr("bandpass"); painter->drawText(elementArea, QObject::tr("Enclosure: ") + boxstr, option); elementArea.moveTop(elementArea.y() + textHeight); box->render(painter, elementArea); painter->setFont(orig); } qspeakers-1.8/system.h000066400000000000000000000011751477675101000150710ustar00rootroot00000000000000#ifndef SYSTEM_H #define SYSTEM_H #include "speaker.h" #include "box.h" #include "sealedbox.h" #include "portedbox.h" #include "bandpassbox.h" class System { public: System(const Speaker &s, const SealedBox *b, unsigned int number = 1); System(const Speaker &s, const PortedBox *b, unsigned int number = 1); System(const Speaker &s, const BandPassBox *b, unsigned int number = 1); double response(double f); void render(QPainter *painter, const QRectF& area); private: Speaker speaker; const Box* box; int type; int sibling; /* number of same drivers (not for push-pull!) */ }; #endif // SYSTEM_H qspeakers-1.8/undocommands.h000066400000000000000000000213401477675101000162300ustar00rootroot00000000000000#ifndef UNDOCOMMANDS_H #define UNDOCOMMANDS_H #include #include "mainwindow.h" class GenericCommand: public QUndoCommand { public: GenericCommand(QObject *parent) : manual(true), mainwindow(static_cast(parent)) {} void undo() override { this->manual = false; } void redo() override { this->manual = false; } protected: bool manual; MainWindow* mainwindow; }; class NumberCommand: public GenericCommand { public: NumberCommand(int older, int newer, QObject *parent) : GenericCommand(parent) { this->older = older; this->newer = newer; } void undo() override { this->mainwindow->changeSpeakerNumber(older); GenericCommand::undo(); } void redo() override { this->mainwindow->changeSpeakerNumber(newer); GenericCommand::redo(); } private: int older; int newer; }; class VendorCommand: public GenericCommand { public: VendorCommand(const QString& older, const QString& newer, const Speaker& oldspeaker, QObject *parent) : GenericCommand(parent) { this->oldspeaker = oldspeaker; this->older = older; this->newer = newer; } void undo() override { this->mainwindow->changeVendor(older, oldspeaker); GenericCommand::undo(); } void redo() override { this->mainwindow->changeVendor(newer, Speaker()); GenericCommand::redo(); } private: Speaker oldspeaker; QString older; QString newer; }; class ModelCommand: public GenericCommand { public: ModelCommand(const QString& older, const QString& newer, QObject *parent) : GenericCommand(parent) { this->older = older; this->newer = newer; } void undo() override { this->mainwindow->changeModel(older); GenericCommand::undo(); } void redo() override { this->mainwindow->changeModel(newer); GenericCommand::redo(); } private: QString older; QString newer; }; class SealedVolumeCommand: public GenericCommand { public: SealedVolumeCommand(double older, double newer, QObject *parent) : GenericCommand(parent) { this->older = older; this->newer = newer; } void undo() override { this->mainwindow->changeSealedVolume(older); GenericCommand::undo(); } void redo() override { this->mainwindow->changeSealedVolume(newer); GenericCommand::redo(); } protected: double older; double newer; }; class PortedVolumeCommand: public GenericCommand { public: PortedVolumeCommand(double older, double newer, QObject *parent) : GenericCommand(parent) { this->older = older; this->newer = newer; } void undo() override { this->mainwindow->changePortedVolume(older); GenericCommand::undo(); } void redo() override { this->mainwindow->changePortedVolume(newer); GenericCommand::redo(); } protected: double older; double newer; }; class PortedResFreqCommand: public GenericCommand { public: PortedResFreqCommand(double older, double newer, QObject *parent) : GenericCommand(parent) { this->older = older; this->newer = newer; } void undo() override { this->mainwindow->changePortedResFreq(older); GenericCommand::undo(); } void redo() override { this->mainwindow->changePortedResFreq(newer); GenericCommand::redo(); } protected: double older; double newer; }; class PortedPortNumberCommand: public GenericCommand { public: PortedPortNumberCommand(unsigned int older, unsigned int newer, QObject *parent) : GenericCommand(parent) { this->older = older; this->newer = newer; } void undo() override { this->mainwindow->changePortedPortNumber(older); GenericCommand::undo(); } void redo() override { this->mainwindow->changePortedPortNumber(newer); GenericCommand::redo(); } protected: unsigned int older; unsigned int newer; }; class PortedPortDiamCommand: public GenericCommand { public: PortedPortDiamCommand(double older, double newer, QObject *parent) : GenericCommand(parent) { this->older = older; this->newer = newer; } void undo() override { this->mainwindow->changePortedPortDiam(older); GenericCommand::undo(); } void redo() override { this->mainwindow->changePortedPortDiam(newer); GenericCommand::redo(); } protected: double older; double newer; }; class PortedSlotPortCommand: public GenericCommand { public: PortedSlotPortCommand(bool older, bool newer, QObject *parent) : GenericCommand(parent) { this->older = older; this->newer = newer; } void undo() override { this->mainwindow->changePortedSlotPortActivation(older); GenericCommand::undo(); } void redo() override { this->mainwindow->changePortedSlotPortActivation(newer); GenericCommand::redo(); } protected: bool older; bool newer; }; class PortedSlotWidthCommand: public GenericCommand { public: PortedSlotWidthCommand(double older, double newer, QObject *parent) : GenericCommand(parent) { this->older = older; this->newer = newer; } void undo() override { this->mainwindow->changePortedSlotWidth(older); GenericCommand::undo(); } void redo() override { this->mainwindow->changePortedSlotWidth(newer); GenericCommand::redo(); } protected: double older; double newer; }; class BPSealedVolumeCommand: public SealedVolumeCommand { public: BPSealedVolumeCommand(double older, double newer, QObject *parent) : SealedVolumeCommand(older, newer, parent) {} void undo() override { this->mainwindow->changeBPSealedVolume(this->older); GenericCommand::undo(); } void redo() override { this->mainwindow->changeBPSealedVolume(this->newer); GenericCommand::redo(); } }; class BPPortedVolumeCommand: public PortedVolumeCommand { public: BPPortedVolumeCommand(double older, double newer, QObject *parent) :PortedVolumeCommand(older, newer, parent) {} void undo() override { this->mainwindow->changeBPPortedVolume(older); GenericCommand::undo(); } void redo() override { this->mainwindow->changeBPPortedVolume(newer); GenericCommand::redo(); } }; class BPPortedResFreqCommand: public PortedResFreqCommand { public: BPPortedResFreqCommand(double older, double newer, QObject *parent) : PortedResFreqCommand(older, newer, parent) {} void undo() override { this->mainwindow->changeBPPortedResFreq(older); GenericCommand::undo(); } void redo() override { this->mainwindow->changeBPPortedResFreq(newer); GenericCommand::redo(); } }; class BPPortedPortNumberCommand: public PortedPortNumberCommand { public: BPPortedPortNumberCommand(unsigned int older, unsigned int newer, QObject *parent) : PortedPortNumberCommand(older, newer, parent) {} void undo() override { this->mainwindow->changeBPPortedPortNumber(older); GenericCommand::undo(); } void redo() override { this->mainwindow->changeBPPortedPortNumber(newer); GenericCommand::redo(); } }; class BPPortedPortDiamCommand: public PortedPortDiamCommand { public: BPPortedPortDiamCommand(double older, double newer, QObject *parent) : PortedPortDiamCommand(older, newer, parent) {} void undo() override { this->mainwindow->changeBPPortedPortDiam(older); GenericCommand::undo(); } void redo() override { this->mainwindow->changeBPPortedPortDiam(newer); GenericCommand::redo(); } }; class BPPortedSlotPortCommand: public PortedSlotPortCommand { public: BPPortedSlotPortCommand(bool older, bool newer, QObject* parent) : PortedSlotPortCommand(older, newer, parent) {} void undo() override { this->mainwindow->changeBPPortedSlotPortActivation(older); GenericCommand::undo(); } void redo() override { this->mainwindow->changeBPPortedSlotPortActivation(newer); GenericCommand::redo(); } }; class BPPortedSlotWidthCommand: public PortedSlotWidthCommand { public: BPPortedSlotWidthCommand(double older, double newer, QObject* parent) : PortedSlotWidthCommand(older, newer, parent) {} void undo() override { this->mainwindow->changeBPPortedSlotWidth(older); GenericCommand::undo(); } void redo() override { this->mainwindow->changeBPPortedSlotWidth(newer); GenericCommand::redo(); } }; #endif // UNDOCOMMANDS_H