Compare commits

..

26 Commits
v0.2 ... master

Author SHA1 Message Date
Alexander Diamadis eb537f3f31
Syntaxfehler korrigiert 2 years ago
Alexander Diamadis 25532365ac
Readme angepasst 2 years ago
Alexander Diamadis 1c8e612fa9 Kleine Änderungen auf v1.4 2 years ago
Alexander Diamadis 69e0c868b0
Automatic Update Check, resolve #5 4 years ago
Alexander Diamadis edfa94ec34
Prepare v1.3 4 years ago
Alexander Diamadis fbfeb8ec66
Small Changes 4 years ago
Alexander Diamadis 071f522f6d Merge pull request 'Gain Structure Optimization Option added' (#4) from dev-gain-structure into master
Reviewed-on: #4
4 years ago
Alexander Diamadis 510949b059 Merge branch 'master' into dev-gain-structure 4 years ago
Alexander Diamadis 48df7e77d7 Gain Structure Optimization Option added 4 years ago
Alexander Diamadis c33bfb5f8c Added Windows Installer Script 4 years ago
Alexander Diamadis 51a376ef4a
Prepare Version 1.2 4 years ago
Alexander Diamadis cbb7f0534a
Prepare Version 1.2 4 years ago
Alexander Diamadis 179edcfc19
fixed #3 4 years ago
Alexander Diamadis e2d8e82699
Optimized Installer creating on macos 4 years ago
Alexander Diamadis 28cd75e781
Calculation Enhancement, fixed #2 4 years ago
Alexander Diamadis deb7278a36 Commit hash changed from decimal to hexadecimal 4 years ago
Alexander Diamadis e61c79529a Small Installer fix 4 years ago
Alexander Diamadis cf2319decc Small Corrections for Windows Installer 4 years ago
Alexander Diamadis 67fd78c75b Corrections for Windows 4 years ago
Alexander Diamadis c05a694844
Added Loudness Analyzer 4 years ago
Alexander Diamadis 4161fac661 Added Analyzer Window 4 years ago
Alexander Diamadis 9bcd22a53c
Small Changes
Signed-off-by: Alexander Diamadis <alex@aldiserver.de>
4 years ago
Alexander Diamadis a53789a458
Added .app to gitignore 5 years ago
Alexander Diamadis 64c52e708b Layout changes and about dialog corrected 5 years ago
Alexander Diamadis 5f34ea8e82 Added libraryfile to installer 5 years ago
Alexander Diamadis ea95d5787a
Minor Improvements 5 years ago

5
.gitignore vendored

@ -1,4 +1,7 @@
.DS_Store
*.pro.user
build*
/installer/packages/com.dkmtech.pacalculator/data/*
/installer/packages/com.dkmtech.pacalculator/data/*
*.exe
*.app
*.dmg

@ -1,232 +1,549 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
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.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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 <http://www.gnu.org/licenses/>.
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:
<program> Copyright (C) <year> <name of author>
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 <http://www.gnu.org/licenses/>.
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 <http://www.gnu.org/philosophy/why-not-lgpl.html>.
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.

@ -1,2 +1,19 @@
# pa-calculator
# PA Calculator
Der PA Calculator dient der Berechnung von Limiterwerten für PA-Anlagen, sowie einem Tool, welches eine Stapelverarbeitung von Lautheitsanalysen sowie einer Korrekturempfehlung durchführen kann.
## Einrichten der Build-Umgebung
1. Installation von QT Version > 6.4.2 mit QT Installation Framework
2. (Auf Windows) Installation msvc2019 oder neuer
3. Installation 7zip
4. Umgebungsvariablen hinzufügen (Qt Binaries, 7-Zip, QtInstallerFramework)
## Release einer neuen Version
Zum Kompilieren einer neuen Version sind folgende Schritte zu beachten:
Die neue Version vor Kompilierung in folgenden Dateien anpassen:
* source/PA_Calculator.pro
* installer/config/config_xxx.xml
* installer/packages/com.dkmtech.pacalculator/meta/package.xml
Im Release-Modus Projekt kompilieren.
Im Anschluss Datei installer/createInstaller_xxx ausführen -> setup.exe

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<Installer>
<Name>PA Calculator</Name>
<Version>0.2</Version>
<Version>1.4.0</Version>
<Title>PA Calculator Installer</Title>
<Publisher>DKM-Tech</Publisher>
<StartMenuDir>PA Tools</StartMenuDir>
<TargetDir>@ApplicationsDirX64@\DKM-Tech\PA Calculator</TargetDir>
<StartMenuDir>DKM-Tech</StartMenuDir>
<TargetDir>@ApplicationsDir@/PA Calculator</TargetDir>
</Installer>

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<Installer>
<Name>PA Calculator</Name>
<Version>1.4.0</Version>
<Title>PA Calculator Installer</Title>
<Publisher>DKM-Tech</Publisher>
<StartMenuDir>DKM-Tech</StartMenuDir>
<TargetDir>@ApplicationsDirX64@/PA Calculator</TargetDir>
</Installer>

@ -0,0 +1,26 @@
#!/bin/sh
releaseFolder=$(find ../ -path "*-Release" -type d)
fileName="${releaseFolder}/PA Calculator.app"
if [[ -e $fileName ]]; then
rm -rf "PA Calculator.app"
rm -rf "Install PA Calculator.app"
rm -rf setup64bit.dmg
cp -R "${fileName}" "PA Calculator.app"
macdeployqt 'PA Calculator.app'
VERSION=$(grep VERSION= "../source/PA_Calculator.pro" | awk -F= '{print $2;exit}')
echo "verwendet Version $VERSION"
DATE=$(date +%F)
sed -i '' 's/<Version>.*<\/Version>/<Version>'"$VERSION"'<\/Version>/g' packages/com.dkmtech.pacalculator/meta/package.xml
sed -i '' 's/<ReleaseDate>.*<\/ReleaseDate>/<ReleaseDate>'"$DATE"'<\/ReleaseDate>/g' packages/com.dkmtech.pacalculator/meta/package.xml
rm -rf packages/com.dkmtech.pacalculator/data
mkdir packages/com.dkmtech.pacalculator/data
cp -R 'PA Calculator.app' 'packages/com.dkmtech.pacalculator/data/PA Calculator.app'
binarycreator -c config/config_mac.xml -p packages 'Install PA Calculator'
rm -rf 'PA Calculator.app'
hdiutil create -srcfolder "Install PA Calculator.app" setup64bit.dmg
rm -rf "Install PA Calculator.app"
echo "Done"
else
echo "Could not find PA Calculator.app. Please build it first!"
fi

@ -0,0 +1,20 @@
@echo off
del /s /q setup64bit.exe
echo "Ändern Sie alle notwendigen Einstellungen!"
packages\com.dkmtech.pacalculator\meta\package.xml
cd ..
FOR /F "tokens=* USEBACKQ" %%F IN (`dir /b *-Release`) DO (
set releaseFolder=%%F
)
cd %releaseFolder%\Release
del /s /q ..\..\installer\packages\com.dkmtech.pacalculator\data\*
mkdir ..\..\installer\packages\com.dkmtech.pacalculator\data\setup
copy "PA Calculator.exe" "..\..\installer\packages\com.dkmtech.pacalculator\data\setup\PA Calculator.exe"
cd ..\..\installer\packages\com.dkmtech.pacalculator\data\setup
windeployqt --translations de,en "PA Calculator.exe"
7z a -r ../setup *
cd ..
rmdir /s /q setup
cd ..\..\..\
binarycreator -c config\config_win.xml -p packages setup64bit.exe
del /s packages\com.dkmtech.pacalculator\data\setup.7z

@ -2,9 +2,9 @@
<Package>
<DisplayName>Installer</DisplayName>
<Description>DKM-Tech Software Installer</Description>
<Version>0.2</Version>
<ReleaseDate>2021-11-07</ReleaseDate>
<Version>1.1</Version>
<ReleaseDate>2022-02-06</ReleaseDate>
<Name>com.dkmtech.installer</Name>
<Virtual>true</Virtual>
<UpdateText>First Installer</UpdateText>
<UpdateText>DKM-Tech Installer</UpdateText>
</Package>

@ -0,0 +1,24 @@
function Component()
{
}
Component.prototype.createOperations = function()
{
try {
// call the base create operations function
component.createOperations();
if (installer.value("os") == "win") {
var userProfile = installer.environmentVariable("USERPROFILE");
installer.setValue("UserProfile", userProfile);
component.addOperation("Copy", "@TargetDir@\\Technik-AG.palib", "@UserProfile@\\Documents\\Technik-AG.palib");
component.addOperation("GlobalConfig", "DKM-Tech", "PA-Calculator", "library/path", "@UserProfile@\\Documents\\Technik-AG.palib");
}else if (nstaller.value("os") == "mac"){
var userProfile = installer.environmentVariable("USERPROFILE");
installer.setValue("UserProfile", userProfile);
component.addOperation("Copy", "@TargetDir@/Technik-AG.palib", "@UserProfile@/Documents/Technik-AG.palib");
component.addOperation("GlobalConfig", "DKM-Tech", "PA-Calculator", "library/path", "@UserProfile@/Documents/Technik-AG.palib");
}
} catch (e) {
print(e);
}
}

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<Package>
<DisplayName>Technik-AG Library</DisplayName>
<Description>Install pre-filled Library File with Devices of Technik-AG</Description>
<Description xml:lang="de_de">Library-Datei mit Geräten der Technik-AG des GSG Daun</Description>
<Version>2</Version>
<ReleaseDate>2022-03-14</ReleaseDate>
<Name>com.dkmtech.libraryfile</Name>
<Default>false</Default>
<Script>installscript.qs</Script>
</Package>

@ -11,7 +11,8 @@ Component.prototype.createOperations = function()
try {
var userProfile = installer.environmentVariable("USERPROFILE");
installer.setValue("UserProfile", userProfile);
component.addOperation("CreateShortcut", "@TargetDir@\\PA_Calculator.exe", "@UserProfile@\\Desktop\\PA Calculator.lnk");
component.addOperation("CreateShortcut", "@TargetDir@\\PA Calculator.exe", "@UserProfile@\\Desktop\\PA Calculator.lnk");
component.addOperation("CreateShortcut", "@TargetDir@\\PA Calculator.exe", "@StartMenuDir@/PA Calculator.lnk","workingDirectory=@TargetDir@","description=Start PA-Calculator");
} catch (e) {
// Do nothing if key doesn't exist
}
@ -19,4 +20,4 @@ Component.prototype.createOperations = function()
} catch (e) {
print(e);
}
}
}

@ -1,232 +1,549 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
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.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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 <http://www.gnu.org/licenses/>.
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:
<program> Copyright (C) <year> <name of author>
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 <http://www.gnu.org/licenses/>.
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 <http://www.gnu.org/philosophy/why-not-lgpl.html>.
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.

@ -2,8 +2,8 @@
<Package>
<DisplayName>PA-Calculator</DisplayName>
<Description>Install PA-Calculator</Description>
<Version>1.0.0</Version>
<ReleaseDate>2021-11-07</ReleaseDate>
<Version>1.4.0</Version>
<ReleaseDate>2023-11-26</ReleaseDate>
<Licenses>
<License name="GNU GENERAL PUBLIC LICENSE" file="license.txt" />
</Licenses>

@ -0,0 +1,22 @@
*.asv
*.m~
*.mex*
*.o
*.obj
*.dll
*.so
*.dylib
*.a
*.lib
*.exe
*.map
*.rsp
*.tmw
*.mat
sil/
interface/_coder_*_info.*
coderassumptions/
target/
build/
debug/
*.slxc

@ -0,0 +1,783 @@
/* Copyright 2019 The Mathworks, Inc. */
/* Copied from
* fullfile(matlabroot,'extern','include','coder','coder_array','coder_array_rtw_cpp11.h') */
#ifndef _mw_coder_array_cpp11_h
#define _mw_coder_array_cpp11_h
// Usage:
//
// coder::array<T, N>: T base type of data, N number of dimensions
//
// coder::array()
// : default constructor
// coder::array(coder::array const &)
// : copy constructor (always make a deep copy of other array)
// coder::array(T const *data, SizeType const *sz)
// : Set data with sizes of this array.
// : (Data is not copied, data is not deleted)
// coder::array::operator = (coder coder::array &)
// : Assign into this array;
// : delete its previous contents (if owning the data.)
// set(T const *data, SizeType sz1, SizeType sz2, ...)
// : Set data with dimensions.
// : (Data is not copied, data is not deleted)
// set_size(SizeType sz1, SizeType sz2, ...)
// : Set sizes of array. Reallocate memory of data if needed.
// bool is_owner() : Return true if the data is owned by the class.
// void set_owner(b) : Set if the data is owned by the class.
// SizeType capacity() : How many entries are reserved by memory allocation.
// reshape( SizeType sz1, SizeType sz2, ...)
// : Reshape array to a different ND shape. Do not copy the data.
// : The number of elements must not be changed (numel()==sz1*sz2*...)
// : Return the array with possibly new number of dimensions.
// clear() : Reset array to be empty.
// SizeType numel() : Return the number of elements.
// operator [] (SizeType index) : Extract element at linear index (0 based.)
// size(SizeType dimension) : Size of array of the provided dimension.
// SizeType * size() : Return the pointer to all the sizes of this array.
// SizeType index(SizeType i1, SizeType i2, ...)
// : Compute the linear index from ND index (i1,i2,...)
// at(SizeType i1, SizeType i2, ...) : The element at index (i1,i2,...)
#include <cassert>
#include <cstring>
#include <iterator>
#include <string>
#include <vector>
#ifndef INT32_T
#include "rtwtypes.h"
#endif
namespace coder {
#ifndef CODER_ARRAY_NEW_DELETE
#define CODER_ARRAY_NEW_DELETE
#define CODER_NEW(T, N) new T[N]
#define CODER_DELETE(P) delete[](P)
#endif
using SizeType = int32_T;
namespace std = ::std;
namespace detail {
#ifndef CODER_ARRAY_DATA_PTR_DEFINED
template <typename T, typename SZ>
class data_ptr {
public:
using value_type = T;
using size_type = SZ;
data_ptr()
: data_(nullptr)
, size_(0)
, capacity_(0)
, owner_(false) {
}
data_ptr(T* _data, SZ _sz)
: data_(_data)
, size_(_sz)
, capacity_(_sz)
, owner_(false) {
}
data_ptr(data_ptr const& _other)
: data_(_other.owner_ ? nullptr : _other.data_)
, size_(_other.owner_ ? 0 : _other.size_)
, capacity_(_other.owner_ ? 0 : _other.capacity_)
, owner_(_other.owner_) {
if (owner_) {
resize(_other.size_);
(void)std::copy(_other.data_, _other.data_ + size_, data_);
}
}
~data_ptr() {
if (owner_) {
CODER_DELETE(data_);
}
}
SZ capacity() const {
return capacity_;
}
void reserve(SZ _n) {
if (_n > capacity_) {
T* const new_data{CODER_NEW(T, _n)};
(void)std::copy(data_, data_ + size_, new_data);
if (owner_) {
CODER_DELETE(data_);
}
data_ = new_data;
capacity_ = _n;
owner_ = true;
}
}
void resize(SZ _n) {
reserve(_n);
size_ = _n;
}
private:
// Prohibit use of assignment operator to prevent subtle bugs
void operator=(data_ptr<T, SZ> const& _other);
public:
void set(T* _data, SZ _sz) {
if (owner_) {
CODER_DELETE(data_);
}
data_ = _data;
size_ = _sz;
owner_ = false;
capacity_ = size_;
}
void copy(T const* const _data, SZ _size) {
if (data_ == _data) {
size_ = _size;
return;
}
if (owner_) {
CODER_DELETE(data_);
}
data_ = CODER_NEW(T, _size);
owner_ = true;
size_ = _size;
capacity_ = size_;
(void)std::copy(_data, _data + _size, data_);
}
void copy(data_ptr<T, SZ> const& _other) {
copy(_other.data_, _other.size_);
}
operator T*() {
return &data_[0];
}
operator T const *() const {
return &data_[0];
}
T& operator[](SZ _index) {
return data_[_index];
}
T const& operator[](SZ _index) const {
return data_[_index];
}
T* operator->() {
return data_;
}
T const* operator->() const {
return data_;
}
bool is_null() const {
return data_ == nullptr;
}
void clear() {
if (owner_) {
CODER_DELETE(data_);
}
data_ = nullptr;
size_ = 0;
capacity_ = 0;
owner_ = false;
}
bool is_owner() const {
return owner_;
}
void set_owner(bool _b) {
owner_ = _b;
}
private:
T* data_;
SZ size_;
SZ capacity_;
bool owner_;
};
#endif
} // namespace detail
// Implementing the random access iterator class so coder::array can be
// used in STL iterators.
template <typename T>
class array_iterator : public std::iterator<std::random_access_iterator_tag,
typename T::value_type,
typename T::size_type> {
public:
array_iterator()
: arr_(nullptr)
, i_(0) {
}
array_iterator(array_iterator<T> const& other)
: arr_(other.arr_)
, i_(other.i_) {
}
~array_iterator() {
}
typename T::value_type& operator*() const {
return (*arr_)[i_];
}
typename T::value_type* operator->() const {
return &(*arr_)[i_];
}
typename T::value_type& operator[](typename T::size_type _di) const {
return (*arr_)[i_ + _di];
}
array_iterator<T>& operator++() {
++i_;
return *this;
}
array_iterator<T>& operator--() {
--i_;
return *this;
}
array_iterator<T> operator++(int) {
array_iterator<T> cp{*this};
++i_;
return cp;
}
array_iterator<T> operator--(int) {
array_iterator<T> cp{*this};
--i_;
return cp;
}
array_iterator<T>& operator=(array_iterator<T> const& _other) {
this->i_ = _other.i_;
return *this;
}
bool operator==(array_iterator<T> const& _other) const {
return i_ == _other.i_;
}
bool operator!=(array_iterator<T> const& _other) const {
return i_ != _other.i_;
}
bool operator<(array_iterator<T> const& _other) const {
return i_ < _other.i_;
}
bool operator>(array_iterator<T> const& _other) const {
return i_ > _other.i_;
}
bool operator<=(array_iterator<T> const& _other) const {
return i_ <= _other.i_;
}
bool operator>=(array_iterator<T> const& _other) const {
return i_ >= _other.i_;
}
array_iterator<T> operator+(typename T::size_type _add) const {
array_iterator<T> cp{*this};
cp.i_ += _add;
return cp;
}
array_iterator<T>& operator+=(typename T::size_type _add) {
this->i_ += _add;
return *this;
}
array_iterator<T> operator-(typename T::size_type _subtract) const {
array_iterator<T> cp{*this};
cp.i_ -= _subtract;
return cp;
}
array_iterator<T>& operator-=(typename T::size_type _subtract) {
this->i_ -= _subtract;
return *this;
}
typename T::size_type operator-(array_iterator<T> const& _other) const {
return static_cast<typename T::size_type>(this->i_ - _other.i_);
}
array_iterator(T* _arr, typename T::size_type _i)
: arr_(_arr)
, i_(_i) {
}
private:
T* arr_;
typename T::size_type i_;
};
// Const version of the array iterator.
template <typename T>
class const_array_iterator : public std::iterator<std::random_access_iterator_tag,
typename T::value_type,
typename T::size_type> {
public:
const_array_iterator()
: arr_(nullptr)
, i_(0) {
}
const_array_iterator(const_array_iterator<T> const& other)
: arr_(other.arr_)
, i_(other.i_) {
}
~const_array_iterator() {
}
typename T::value_type const& operator*() const {
return (*arr_)[i_];
}
typename T::value_type const* operator->() const {
return &(*arr_)[i_];
}
typename T::value_type const& operator[](typename T::size_type _di) const {
return (*arr_)[i_ + _di];
}
const_array_iterator<T>& operator++() {
++i_;
return *this;
}
const_array_iterator<T>& operator--() {
--i_;
return *this;
}
const_array_iterator<T> operator++(int) {
const_array_iterator<T> copy{*this};
++i_;
return copy;
}
const_array_iterator<T> operator--(int) {
const_array_iterator copy{*this};
--i_;
return copy;
}
const_array_iterator<T>& operator=(const_array_iterator<T> const& _other) {
this->i_ = _other.i_;
return *this;
}
bool operator==(const_array_iterator<T> const& _other) const {
return i_ == _other.i_;
}
bool operator!=(const_array_iterator<T> const& _other) const {
return i_ != _other.i_;
}
bool operator<(const_array_iterator<T> const& _other) const {
return i_ < _other.i_;
}
bool operator>(const_array_iterator<T> const& _other) const {
return i_ > _other.i_;
}
bool operator<=(const_array_iterator<T> const& _other) const {
return i_ <= _other.i_;
}
bool operator>=(const_array_iterator<T> const& _other) const {
return i_ >= _other.i_;
}
const_array_iterator<T> operator+(typename T::size_type _add) const {
const_array_iterator<T> cp{*this};
cp.i_ += _add;
return cp;
}
const_array_iterator<T>& operator+=(typename T::size_type _add) {
this->i_ += _add;
return *this;
}
const_array_iterator<T> operator-(typename T::size_type _subtract) const {
const_array_iterator<T> cp{*this};
cp.i_ -= _subtract;
return cp;
}
const_array_iterator<T>& operator-=(typename T::size_type _subtract) {
this->i_ -= _subtract;
return *this;
}
typename T::size_type operator-(const_array_iterator<T> const& _other) const {
return static_cast<typename T::size_type>(this->i_ - _other.i_);
}
const_array_iterator(T const* _arr, typename T::size_type _i)
: arr_(_arr)
, i_(_i) {
}
private:
T const* arr_;
typename T::size_type i_;
typename T::size_type n_;
};
namespace detail {
// detail::numel<N>: Compile-time product of the given size vector of length N.
template <int N>
class numel {
public:
template <typename SZ>
static SZ compute(SZ _size[]) {
return _size[N - 1] * numel<N - 1>::compute(_size);
}
};
template <>
class numel<0> {
public:
template <typename SZ>
static SZ compute(SZ[]) {
return 1;
}
};
// Compute the product for a set of numeric arguments: product<int32_T>(10, 20, 30, ...) =>
// 10*20*30*...
template <typename SZ, typename First, typename... Rest>
struct product_i {
static SZ compute(First _f, Rest... _rest) {
return _f * product_i<SZ, Rest...>::compute(_rest...);
}
};
template <typename SZ, typename Last>
struct product_i<SZ, Last> {
static SZ compute(Last _l) {
return _l;
}
};
template <typename SZ, typename... Args>
SZ product(Args... args) {
return product_i<SZ, Args...>::compute(args...);
}
// Compute flat index from (column-major) ND size vector and a list of indices.
template <int I>
class index_nd {
public:
template <typename SZ>
static SZ compute(SZ const _size[], SZ const _indices[]) {
SZ const weight{numel<I - 1>::compute(_size)};
return weight * _indices[I - 1] + index_nd<I - 1>::compute(_size, _indices);
}
};
template <>
class index_nd<0> {
public:
template <typename SZ>
static SZ compute(SZ[], SZ[]) {
return 0;
}
};
template <bool Cond>
struct match_dimensions {};
template <>
struct match_dimensions<true> {
static void check() {
}
};
} // namespace detail
// Base class for code::array. SZ is the type used for sizes (currently int32_t.)
// Overloading up to 10 dimensions (not using variadic templates to
// stay compatible with C++98.)
template <typename T, typename SZ, int N>
class array_base {
public:
using value_type = T;
using size_type = SZ;
array_base() {
(void)::memset(size_, 0, sizeof(SZ) * N);
}
array_base(T* _data, SZ const* _sz)
: data_(_data, coder::detail::numel<N>::compute(_sz)) {
(void)std::copy(_sz, _sz + N, size_);
}
array_base& operator=(array_base const& _other) {
data_.copy(_other.data_);
(void)std::copy(_other.size_, _other.size_ + N, size_);
return *this;
}
template <typename... Dims>
void set(T* _data, Dims... dims) {
coder::detail::match_dimensions<N == sizeof...(dims)>::check();
data_.set(_data, coder::detail::product<SZ>(dims...));
set_size_i<0>(dims...);
}
bool is_owner() const {
return data_.is_owner();
}
void set_owner(bool b) {
data_.set_owner(b);
}
SZ capacity() const {
return data_.capacity();
}
private:
template <SZ _i, typename First, typename... Rest>
void set_size_i(First f, Rest... rest) {
size_[_i] = f;
set_size_i<_i + 1, Rest...>(rest...);
}
template <SZ _i, typename Last>
void set_size_i(Last l) {
size_[_i] = l;
}
public:
template <typename... Dims>
void set_size(Dims... dims) {
coder::detail::match_dimensions<N == sizeof...(dims)>::check();
set_size_i<0>(dims...);
ensureCapacity(numel());
}
template <SizeType N1>
array_base<T, SZ, N1> reshape_n(SZ const (&_ns)[N1]) const {
array_base<T, SZ, N1> reshaped{const_cast<T*>(&data_[0]), _ns};
return reshaped;
}
template <typename... Dims>
array_base<T, SZ, static_cast<SZ>(sizeof...(Dims))> reshape(Dims... dims) const {
SZ const ns[]{static_cast<SZ>(dims)...};
return reshape_n(ns);
}
T& operator[](SZ _index) {
return data_[_index];
}
T const& operator[](SZ _index) const {
return data_[_index];
}
void clear() {
data_.clear();
}
T* data() {
return data_;
}
T const* data() const {
return data_;
}
SZ const* size() const {
return &size_[0];
}
SZ size(SZ _index) const {
return size_[_index];
}
SZ numel() const {
return coder::detail::numel<N>::compute(size_);
}
template <typename... Dims>
SZ index(Dims... _dims) const {
coder::detail::match_dimensions<N == sizeof...(_dims)>::check();
SZ const indices[]{static_cast<SZ>(_dims)...};
return coder::detail::index_nd<static_cast<SZ>(sizeof...(_dims))>::compute(size_, indices);
}
template <typename... Dims>
T& at(Dims... _i) {
coder::detail::match_dimensions<N == sizeof...(_i)>::check();
return data_[index(_i...)];
}
template <typename... Dims>
T const& at(Dims... _i) const {
coder::detail::match_dimensions<N == sizeof...(_i)>::check();
return data_[index(_i...)];
}
array_iterator<array_base<T, SZ, N>> begin() {
return array_iterator<array_base<T, SZ, N>>(this, 0);
}
array_iterator<array_base<T, SZ, N>> end() {
return array_iterator<array_base<T, SZ, N>>(this, this->numel());
}
const_array_iterator<array_base<T, SZ, N>> begin() const {
return const_array_iterator<array_base<T, SZ, N>>(this, 0);
}
const_array_iterator<array_base<T, SZ, N>> end() const {
return const_array_iterator<array_base<T, SZ, N>>(this, this->numel());
}
protected:
coder::detail::data_ptr<T, SZ> data_;
SZ size_[N];
private:
void ensureCapacity(SZ _newNumel) {
if (_newNumel > data_.capacity()) {
SZ i{data_.capacity()};
if (i < 16) {
i = 16;
}
while (i < _newNumel) {
if (i > 1073741823) {
i = MAX_int32_T;
} else {
i *= 2;
}
}
data_.reserve(i);
}
data_.resize(_newNumel);
}
};
// The standard coder::array class with base type and number of dimensions.
template <typename T, int N>
class array : public array_base<T, SizeType, N> {
private:
using Base = array_base<T, SizeType, N>;
public:
array()
: Base() {
}
array(array<T, N> const& _other)
: Base(_other) {
}
array(Base const& _other)
: Base(_other) {
}
array(T* _data, SizeType const* _sz)
: Base(_data, _sz) {
}
};
// Specialize on char_T (row vector) for better support on strings.
template <>
class array<char_T, 2> : public array_base<char_T, SizeType, 2> {
private:
using Base = array_base<char_T, SizeType, 2>;
public:
array()
: array_base() {
}
array(array<char_T, 2> const& _other)
: Base(_other) {
}
array(Base const& _other)
: Base(_other) {
}
array(std::string const& _str) {
operator=(_str);
}
array(char_T const* const _str) {
operator=(_str);
}
array(std::vector<char_T> const& _vec) {
SizeType const n{static_cast<SizeType>(_vec.size())};
set_size(1, n);
data_.copy(&_vec[0], n);
}
array& operator=(std::string const& _str) {
SizeType const n{static_cast<SizeType>(_str.size())};
set_size(1, n);
data_.copy(_str.c_str(), n);
return *this;
}
array& operator=(char_T const* const _str) {
SizeType const n{static_cast<SizeType>(strlen(_str))};
set_size(1, n);
data_.copy(_str, n);
return *this;
}
operator std::string() const {
return std::string(static_cast<char const*>(&(*this)[0]), static_cast<int>(size(1)));
}
};
// Specialize on 2 dimensions for better support interactions with
// std::vector and row vectors.
template <typename T>
class array<T, 2> : public array_base<T, SizeType, 2> {
private:
using Base = array_base<T, SizeType, 2>;
public:
array()
: Base() {
}
array(array<T, 2> const& _other)
: Base(_other) {
}
array(Base const& _other)
: Base(_other) {
}
array(std::vector<T> const& _vec) {
operator=(_vec);
}
array& operator=(std::vector<T> const& _vec) {
SizeType n{static_cast<SizeType>(_vec.size())};
Base::set_size(1, n);
Base::data_.copy(&_vec[0], n);
return *this;
}
operator std::vector<T>() const {
T const* p{&Base::data_[0]};
return std::vector<T>(p, p + Base::numel());
}
};
// Specialize on 1 dimension for better support with std::vector and
// column vectors.
template <typename T>
class array<T, 1> : public array_base<T, SizeType, 1> {
private:
using Base = array_base<T, SizeType, 1>;
public:
array()
: Base() {
}
array(array<T, 1> const& _other)
: Base(_other) {
}
array(Base const& _other)
: Base(_other) {
}
array(std::vector<T> const& _vec) {
operator=(_vec);
}
array& operator=(std::vector<T> const& _vec) {
SizeType n{static_cast<SizeType>(_vec.size())};
Base::set_size(n);
Base::data_.copy(&_vec[0], n);
return *this;
}
operator std::vector<T>() const {
T const* p{&Base::data_[0]};
return std::vector<T>(p, p + Base::numel());
}
};
} // namespace coder
#endif

@ -0,0 +1,34 @@
/* Copyright 2020 The Mathworks, Inc. */
/* Copied from fullfile(matlabroot,'extern','include','coder','coder_array','coder_bounded_array.h') */
#ifndef _mw_coder_bounded_array_h
#define _mw_coder_bounded_array_h
#ifdef MATLAB_MEX_FILE
#include "tmwtypes.h"
#else
#include "rtwtypes.h"
#endif
namespace coder {
#if __cplusplus >= 201103L
using SizeType = int32_T;
#else
typedef int32_T SizeType;
#endif
// Bounded array
template <typename T, SizeType UpperBoundSize, SizeType NumDims>
struct bounded_array {
T data[UpperBoundSize];
SizeType size[NumDims];
};
template <typename T, SizeType NumDims>
struct empty_bounded_array {
SizeType size[NumDims];
};
} // namespace coder
#endif

@ -0,0 +1,34 @@
//
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
// File: designKWeightingFilter.h
//
// MATLAB Coder version : 5.2
// C/C++ source code generated on : 05-Feb-2022 12:14:13
//
#ifndef DESIGNKWEIGHTINGFILTER_H
#define DESIGNKWEIGHTINGFILTER_H
// Include Files
#include "rtwtypes.h"
#include <cstddef>
#include <cstdlib>
// Function Declarations
namespace coder {
namespace audio {
namespace internal {
void convertToFs(float sos_48kHz[6], float Fs);
}
} // namespace audio
} // namespace coder
#endif
//
// File trailer for designKWeightingFilter.h
//
// [EOF]
//

@ -0,0 +1,29 @@
//
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
// File: getLoudness.h
//
// MATLAB Coder version : 5.2
// C/C++ source code generated on : 05-Feb-2022 12:14:13
//
#ifndef GETLOUDNESS_H
#define GETLOUDNESS_H
// Include Files
#include "rtwtypes.h"
#include "coder_array.h"
#include <cstddef>
#include <cstdlib>
// Function Declarations
extern void getLoudness(const coder::array<float, 2U> &data, float fs,
coder::array<float, 2U> &loudness);
#endif
//
// File trailer for getLoudness.h
//
// [EOF]
//

@ -0,0 +1,24 @@
//
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
// File: getLoudness_data.h
//
// MATLAB Coder version : 5.2
// C/C++ source code generated on : 05-Feb-2022 12:14:13
//
#ifndef GETLOUDNESS_DATA_H
#define GETLOUDNESS_DATA_H
// Include Files
#include "rtwtypes.h"
#include <cstddef>
#include <cstdlib>
#endif
//
// File trailer for getLoudness_data.h
//
// [EOF]
//

@ -0,0 +1,27 @@
//
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
// File: getLoudness_initialize.h
//
// MATLAB Coder version : 5.2
// C/C++ source code generated on : 05-Feb-2022 12:14:13
//
#ifndef GETLOUDNESS_INITIALIZE_H
#define GETLOUDNESS_INITIALIZE_H
// Include Files
#include "rtwtypes.h"
#include <cstddef>
#include <cstdlib>
// Function Declarations
extern void getLoudness_initialize();
#endif
//
// File trailer for getLoudness_initialize.h
//
// [EOF]
//

@ -0,0 +1,27 @@
//
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
// File: getLoudness_terminate.h
//
// MATLAB Coder version : 5.2
// C/C++ source code generated on : 05-Feb-2022 12:14:13
//
#ifndef GETLOUDNESS_TERMINATE_H
#define GETLOUDNESS_TERMINATE_H
// Include Files
#include "rtwtypes.h"
#include <cstddef>
#include <cstdlib>
// Function Declarations
extern void getLoudness_terminate();
#endif
//
// File trailer for getLoudness_terminate.h
//
// [EOF]
//

@ -0,0 +1,22 @@
//
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
// File: getLoudness_types.h
//
// MATLAB Coder version : 5.2
// C/C++ source code generated on : 05-Feb-2022 12:14:13
//
#ifndef GETLOUDNESS_TYPES_H
#define GETLOUDNESS_TYPES_H
// Include Files
#include "rtwtypes.h"
#endif
//
// File trailer for getLoudness_types.h
//
// [EOF]
//

@ -0,0 +1,34 @@
//
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
// File: rtGetInf.h
//
// MATLAB Coder version : 5.2
// C/C++ source code generated on : 05-Feb-2022 12:14:13
//
#ifndef RTGETINF_H
#define RTGETINF_H
// Include Files
#include "rtwtypes.h"
#ifdef __cplusplus
extern "C" {
#endif
extern real_T rtGetInf(void);
extern real32_T rtGetInfF(void);
extern real_T rtGetMinusInf(void);
extern real32_T rtGetMinusInfF(void);
#ifdef __cplusplus
}
#endif
#endif
//
// File trailer for rtGetInf.h
//
// [EOF]
//

@ -0,0 +1,32 @@
//
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
// File: rtGetNaN.h
//
// MATLAB Coder version : 5.2
// C/C++ source code generated on : 05-Feb-2022 12:14:13
//
#ifndef RTGETNAN_H
#define RTGETNAN_H
// Include Files
#include "rtwtypes.h"
#ifdef __cplusplus
extern "C" {
#endif
extern real_T rtGetNaN(void);
extern real32_T rtGetNaNF(void);
#ifdef __cplusplus
}
#endif
#endif
//
// File trailer for rtGetNaN.h
//
// [EOF]
//

@ -0,0 +1,36 @@
//
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
// File: rt_nonfinite.h
//
// MATLAB Coder version : 5.2
// C/C++ source code generated on : 05-Feb-2022 12:14:13
//
#ifndef RT_NONFINITE_H
#define RT_NONFINITE_H
// Include Files
#include "rtwtypes.h"
#ifdef __cplusplus
extern "C" {
#endif
extern real_T rtInf;
extern real_T rtMinusInf;
extern real_T rtNaN;
extern real32_T rtInfF;
extern real32_T rtMinusInfF;
extern real32_T rtNaNF;
#ifdef __cplusplus
}
#endif
#endif
//
// File trailer for rt_nonfinite.h
//
// [EOF]
//

@ -0,0 +1,48 @@
//
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
// File: rtwtypes.h
//
// MATLAB Coder version : 5.2
// C/C++ source code generated on : 05-Feb-2022 12:14:13
//
#ifndef RTWTYPES_H
#define RTWTYPES_H
/*=======================================================================*
* Fixed width word size data types: *
* int64_T - signed 64 bit integers *
* uint64_T - unsigned 64 bit integers *
*=======================================================================*/
#if defined(__APPLE__)
#ifndef INT64_T
#define INT64_T long
#define FMT64 "l"
#if defined(__LP64__) && !defined(INT_TYPE_64_IS_LONG)
#define INT_TYPE_64_IS_LONG
#endif
#endif
#endif
#if defined(__APPLE__)
#ifndef UINT64_T
#define UINT64_T unsigned long
#define FMT64 "l"
#if defined(__LP64__) && !defined(INT_TYPE_64_IS_LONG)
#define INT_TYPE_64_IS_LONG
#endif
#endif
#endif
// Include Files
#include "tmwtypes.h"
#endif
//
// File trailer for rtwtypes.h
//
// [EOF]
//

@ -0,0 +1,31 @@
//
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
// File: sum.h
//
// MATLAB Coder version : 5.2
// C/C++ source code generated on : 05-Feb-2022 12:14:13
//
#ifndef SUM_H
#define SUM_H
// Include Files
#include "rtwtypes.h"
#include "coder_array.h"
#include <cstddef>
#include <cstdlib>
// Function Declarations
namespace coder {
void sum(const ::coder::array<float, 2U> &x, float y_data[], int y_size[2]);
}
#endif
//
// File trailer for sum.h
//
// [EOF]
//

@ -0,0 +1,838 @@
/*
* @(#)tmwtypes.h generated by: makeheader 5.1.5 Fri Dec 27 18:07:22 2013
*
* built from: ../../src/include/copyright.h
* ../../src/include/tmwtypes.h
*/
#if defined(_MSC_VER)
# pragma once
#endif
#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3))
# pragma once
#endif
#ifndef tmwtypes_h
#define tmwtypes_h
/*
* Copyright 1984-2003 The MathWorks, Inc.
* All Rights Reserved.
*/
/* Copyright 1995-2013 The MathWorks, Inc. */
#ifndef __TMWTYPES__
#define __TMWTYPES__
/*
* File : tmwtypes.h
* Abstract:
* Data types for use with MATLAB/SIMULINK and the Real-Time Workshop.
*
* When compiling stand-alone model code, data types can be overridden
* via compiler switches.
*
* Define NO_FLOATS to eliminate reference to real_T, etc.
*/
#include <limits.h>
#ifdef __APPLE_CC__
#include <stdbool.h>
#endif
#define LOGICAL_IS_A_TYPE
#define SPARSE_GENERALIZATION
#ifdef NO_FLOATS
# define double double_not_allowed
# define float float_not_allowed
#endif /*NO_FLOATS*/
#ifndef NO_FLOATS
#ifndef __MWERKS__
# ifdef __STDC__
# include <float.h>
# else
# define FLT_MANT_DIG 24
# define DBL_MANT_DIG 53
# endif
#endif
#endif /*NO_FLOATS*/
/*
* The following data types cannot be overridden when building MEX files.
*/
#ifdef MATLAB_MEX_FILE
# undef CHARACTER_T
# undef INTEGER_T
# undef BOOLEAN_T
# undef REAL_T
# undef TIME_T
#endif
/*
* The uchar_T, ushort_T and ulong_T types are needed for compilers which do
* not allow defines to be specified, at the command line, with spaces in them.
*/
typedef unsigned char uchar_T;
typedef unsigned short ushort_T;
typedef unsigned long ulong_T;
#if (defined(_MSC_VER) && _MSC_VER >= 1500) \
|| defined(__x86_64__) || defined(__LP64__) \
|| defined(__LCC64__)
typedef unsigned long long ulonglong_T;
#endif
/*=======================================================================*
* Fixed width word size data types: *
* int8_T, int16_T, int32_T - signed 8, 16, or 32 bit integers *
* uint8_T, uint16_T, uint32_T - unsigned 8, 16, or 32 bit integers *
* real32_T, real64_T - 32 and 64 bit floating point numbers *
*=======================================================================*/
/* When used with Real Time Workshop generated code, this
* header file can be used with a variety of compilers.
*
* The compiler could be for an 8 bit embedded processor that
* only had 8 bits per integer and 16 bits per long.
* In that example, a 32 bit integer size is not even available.
* This header file should be robust to that.
*
* For the case of an 8 bit processor, the preprocessor
* may be limited to 16 bit math like its target. That limitation
* would mean that 32 bit comparisons can't be done accurately.
* To increase robustness to this, comparisons are done against
* smaller values first. An inaccurate 32 bit comparison isn't
* attempted if the 16 bit comparison has already succeeded.
*
* Limitations on preprocessor math can also be stricter than
* for the target. There are known cases where a compiler
* targeting processors with 64 bit longs can't do accurate
* preprocessor comparisons on more than 32 bits.
*/
/* Determine the number of bits for int, long, short, and char.
* If one fails to be determined, set the number of bits to -1
*/
#ifndef TMW_BITS_PER_INT
# if INT_MAX == 0x7FL
# define TMW_BITS_PER_INT 8
# elif INT_MAX == 0x7FFFL
# define TMW_BITS_PER_INT 16
# elif INT_MAX == 0x7FFFFFFFL
# define TMW_BITS_PER_INT 32
# else
# define TMW_BITS_PER_INT -1
# endif
#endif
#ifndef TMW_BITS_PER_LONG
# if LONG_MAX == 0x7FL
# define TMW_BITS_PER_LONG 8
# elif LONG_MAX == 0x7FFFL
# define TMW_BITS_PER_LONG 16
# elif LONG_MAX == 0x7FFFFFFFL
# define TMW_BITS_PER_LONG 32
# else
# define TMW_BITS_PER_LONG -1
# endif
#endif
#ifndef TMW_BITS_PER_SHRT
# if SHRT_MAX == 0x7FL
# define TMW_BITS_PER_SHRT 8
# elif SHRT_MAX == 0x7FFFL
# define TMW_BITS_PER_SHRT 16
# elif SHRT_MAX == 0x7FFFFFFFL
# define TMW_BITS_PER_SHRT 32
# else
# define TMW_BITS_PER_SHRT -1
# endif
#endif
#ifndef TMW_BITS_PER_SCHAR
# if SCHAR_MAX == 0x7FL
# define TMW_BITS_PER_SCHAR 8
# elif SCHAR_MAX == 0x7FFFL
# define TMW_BITS_PER_SCHAR 16
# elif SCHAR_MAX == 0x7FFFFFFFL
# define TMW_BITS_PER_SCHAR 32
# else
# define TMW_BITS_PER_SCHAR -1
# endif
#endif
#ifndef TMW_CHAR_SIGNED
# if SCHAR_MAX == CHAR_MAX
# define TMW_CHAR_SIGNED 1
# else
# define TMW_CHAR_SIGNED 0
# endif
#endif
/* It is common for one or more of the integer types
* to be the same size. For example, on many embedded
* processors, both shorts and ints are 16 bits. On
* processors used for workstations, it is quite common
* for both int and long to be 32 bits.
* When there is more than one choice for typdef'ing
* a portable type like int16_T or uint32_T, in
* concept, it should not matter which choice is made.
* However, some style guides and some code checking
* tools do identify and complain about seemingly
* irrelevant differences. For example, a code
* checking tool may complain about an implicit
* conversion from int to short even though both
* are 16 bits. To reduce these types of
* complaints, it is best to make int the
* preferred choice when more than one is available.
*/
#ifndef INT8_T
# if TMW_BITS_PER_INT == 8
# define INT8_T int
# elif TMW_BITS_PER_LONG == 8
# define INT8_T long
# elif TMW_BITS_PER_SCHAR == 8
# define INT8_T signed char
# elif TMW_BITS_PER_SHRT == 8
# define INT8_T short
# endif
#endif
#ifdef INT8_T
typedef INT8_T int8_T;
#endif
#ifndef UINT8_T
# if TMW_BITS_PER_INT == 8
# define UINT8_T unsigned int
# elif TMW_BITS_PER_LONG == 8
# define UINT8_T unsigned long
# elif TMW_BITS_PER_SCHAR == 8
# define UINT8_T unsigned char
# elif TMW_BITS_PER_SHRT == 8
# define UINT8_T unsigned short
# endif
#endif
#ifdef UINT8_T
typedef UINT8_T uint8_T;
#endif
#ifndef INT16_T
# if TMW_BITS_PER_INT == 16
# define INT16_T int
# elif TMW_BITS_PER_LONG == 16
# define INT16_T long
# elif TMW_BITS_PER_SCHAR == 16
# define INT16_T signed char
# elif TMW_BITS_PER_SHRT == 16
# define INT16_T short
# endif
#endif
#ifdef INT16_T
typedef INT16_T int16_T;
#endif
#ifndef UINT16_T
# if TMW_BITS_PER_INT == 16
# define UINT16_T unsigned int
# elif TMW_BITS_PER_LONG == 16
# define UINT16_T unsigned long
# elif TMW_BITS_PER_SCHAR == 16
# define UINT16_T unsigned char
# elif TMW_BITS_PER_SHRT == 16
# define UINT16_T unsigned short
# endif
#endif
#ifdef UINT16_T
typedef UINT16_T uint16_T;
#endif
#ifndef INT32_T
# if TMW_BITS_PER_INT == 32
# define INT32_T int
# elif TMW_BITS_PER_LONG == 32
# define INT32_T long
# elif TMW_BITS_PER_SCHAR == 32
# define INT32_T signed char
# elif TMW_BITS_PER_SHRT == 32
# define INT32_T short
# endif
#endif
#ifdef INT32_T
typedef INT32_T int32_T;
#endif
#ifndef UINT32_T
# if TMW_BITS_PER_INT == 32
# define UINT32_T unsigned int
# elif TMW_BITS_PER_LONG == 32
# define UINT32_T unsigned long
# elif TMW_BITS_PER_SCHAR == 32
# define UINT32_T unsigned char
# elif TMW_BITS_PER_SHRT == 32
# define UINT32_T unsigned short
# endif
#endif
#ifdef UINT32_T
typedef UINT32_T uint32_T;
#endif
/* The following is used to emulate smaller integer types when only
* larger types are available. For example, compilers for TI C3x/C4x DSPs
* define char and short to be 32 bits, so 8 and 16 bits are not directly
* available. This target is commonly used with RTW rapid prototyping.
* Other DSPs define char to be 16 bits, so 8 bits is not directly
* available.
*/
#ifndef INT8_T
# ifdef INT16_T
# define INT8_T INT16_T
typedef INT8_T int8_T;
# else
# ifdef INT32_T
# define INT8_T INT32_T
typedef INT8_T int8_T;
# endif
# endif
#endif
#ifndef UINT8_T
# ifdef UINT16_T
# define UINT8_T UINT16_T
typedef UINT8_T uint8_T;
# else
# ifdef UINT32_T
# define UINT8_T UINT32_T
typedef UINT8_T uint8_T;
# endif
# endif
#endif
#ifndef INT16_T
# ifdef INT32_T
# define INT16_T INT32_T
typedef INT16_T int16_T;
# endif
#endif
#ifndef UINT16_T
# ifdef UINT32_T
# define UINT16_T UINT32_T
typedef UINT16_T uint16_T;
# endif
#endif
#ifndef NO_FLOATS
#ifndef REAL32_T
# ifndef __MWERKS__
# if FLT_MANT_DIG >= 23
# define REAL32_T float
# endif
# else
# define REAL32_T float
# endif
#endif
#ifdef REAL32_T
typedef REAL32_T real32_T;
#endif
#ifndef REAL64_T
# ifndef __MWERKS__
# if DBL_MANT_DIG >= 52
# define REAL64_T double
# endif
# else
# define REAL64_T double
# endif
#endif
#ifdef REAL64_T
typedef REAL64_T real64_T;
#endif
#endif /* NO_FLOATS*/
/*=======================================================================*
* Fixed width word size data types: *
* int64_T - signed 64 bit integers *
* uint64_T - unsigned 64 bit integers *
*=======================================================================*/
#ifndef INT64_T
# if defined(__APPLE__)
# define INT64_T long long
# define FMT64 "ll"
# if defined(__LP64__) && !defined(INT_TYPE_64_IS_LONG)
# define INT_TYPE_64_IS_LONG
# endif
# elif defined(__x86_64__) || defined(__LP64__)
# define INT64_T long
# define FMT64 "l"
# if !defined(INT_TYPE_64_IS_LONG)
# define INT_TYPE_64_IS_LONG
# endif
# elif defined(_MSC_VER) || (defined(__BORLANDC__) && __BORLANDC__ >= 0x530) \
|| (defined(__WATCOMC__) && __WATCOMC__ >= 1100)
# define INT64_T __int64
# define FMT64 "I64"
# elif defined(__GNUC__) || defined(TMW_ENABLE_INT64) \
|| defined(__LCC64__)
# define INT64_T long long
# define FMT64 "ll"
# endif
#endif
#if defined(INT64_T)
# if defined(__GNUC__) && \
((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >=9)))
__extension__
# endif
typedef INT64_T int64_T;
#endif
#ifndef UINT64_T
# if defined(__APPLE__)
# define UINT64_T unsigned long long
# define FMT64 "ll"
# if defined(__LP64__) && !defined(INT_TYPE_64_IS_LONG)
# define INT_TYPE_64_IS_LONG
# endif
# elif defined(__x86_64__) || defined(__LP64__)
# define UINT64_T unsigned long
# define FMT64 "l"
# if !defined(INT_TYPE_64_IS_LONG)
# define INT_TYPE_64_IS_LONG
# endif
# elif defined(_MSC_VER) || (defined(__BORLANDC__) && __BORLANDC__ >= 0x530) \
|| (defined(__WATCOMC__) && __WATCOMC__ >= 1100)
# define UINT64_T unsigned __int64
# define FMT64 "I64"
# elif defined(__GNUC__) || defined(TMW_ENABLE_INT64) \
|| defined(__LCC64__)
# define UINT64_T unsigned long long
# define FMT64 "ll"
# endif
#endif
#if defined(_WIN64) || (defined(__APPLE__) && defined(__LP64__)) \
|| defined(__x86_64__) \
|| defined(__LP64__)
# define INT_TYPE_64_IS_SUPPORTED
#endif
#if defined(UINT64_T)
# if defined(__GNUC__) && \
((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >=9)))
__extension__
# endif
typedef UINT64_T uint64_T;
#endif
/*===========================================================================*
* Format string modifiers for using size_t variables in printf statements. *
*===========================================================================*/
#ifndef FMT_SIZE_T
# if defined( __GNUC__ ) || defined(_STDC_C99)
# define FMT_SIZE_T "z"
# elif defined (__WATCOMC__)
# define FMT_SIZE_T "l"
# elif defined (_WIN32 )
# define FMT_SIZE_T "I"
# else
# define FMT_SIZE_T "l"
# endif
#endif
#ifndef FMT_PTRDIFF_T
# if defined(__APPLE__)
# define FMT_PTRDIFF_T "l"
# elif defined( __GNUC__ ) || defined(_STDC_C99)
# define FMT_PTRDIFF_T "t"
# elif defined (__WATCOMC__)
# define FMT_PTRDIFF_T "l"
# elif defined (_WIN32 )
# define FMT_PTRDIFF_T "I"
# else
# define FMT_PTRDIFF_T "l"
# endif
#endif
/*===========================================================================*
* General or logical data types where the word size is not guaranteed. *
* real_T - possible settings include real32_T or real64_T *
* time_T - possible settings include real64_T or uint32_T *
* boolean_T *
* char_T *
* int_T *
* uint_T *
* byte_T *
*===========================================================================*/
#ifndef NO_FLOATS
#ifndef REAL_T
# ifdef REAL64_T
# define REAL_T real64_T
# else
# ifdef REAL32_T
# define REAL_T real32_T
# endif
# endif
#endif
#ifdef REAL_T
typedef REAL_T real_T;
#endif
#ifndef TIME_T
# ifdef REAL_T
# define TIME_T real_T
# endif
#endif
#ifdef TIME_T
typedef TIME_T time_T;
#endif
#endif /* NO_FLOATS */
#ifndef BOOLEAN_T
# if defined(UINT8_T)
# define BOOLEAN_T UINT8_T
# else
# define BOOLEAN_T unsigned int
# endif
#endif
typedef BOOLEAN_T boolean_T;
#ifndef CHARACTER_T
# define CHARACTER_T char
#endif
typedef CHARACTER_T char_T;
#ifndef INTEGER_T
# define INTEGER_T int
#endif
typedef INTEGER_T int_T;
#ifndef UINTEGER_T
# define UINTEGER_T unsigned
#endif
typedef UINTEGER_T uint_T;
#ifndef BYTE_T
# define BYTE_T unsigned char
#endif
typedef BYTE_T byte_T;
/*===========================================================================*
* Define Complex Structures *
*===========================================================================*/
#ifndef NO_FLOATS
#ifndef CREAL32_T
# ifdef REAL32_T
typedef struct {
real32_T re, im;
} creal32_T;
# define CREAL32_T creal32_T
# endif
#endif
#ifndef CREAL64_T
# ifdef REAL64_T
typedef struct {
real64_T re, im;
} creal64_T;
# define CREAL64_T creal64_T
# endif
#endif
#ifndef CREAL_T
# ifdef REAL_T
typedef struct {
real_T re, im;
} creal_T;
# define CREAL_T creal_T
# endif
#endif
#endif /* NO_FLOATS */
#ifndef CINT8_T
# ifdef INT8_T
typedef struct {
int8_T re, im;
} cint8_T;
# define CINT8_T cint8_T
# endif
#endif
#ifndef CUINT8_T
# ifdef UINT8_T
typedef struct {
uint8_T re, im;
} cuint8_T;
# define CUINT8_T cuint8_T
# endif
#endif
#ifndef CINT16_T
# ifdef INT16_T
typedef struct {
int16_T re, im;
} cint16_T;
# define CINT16_T cint16_T
# endif
#endif
#ifndef CUINT16_T
# ifdef UINT16_T
typedef struct {
uint16_T re, im;
} cuint16_T;
# define CUINT16_T cuint16_T
# endif
#endif
#ifndef CINT32_T
# ifdef INT32_T
typedef struct {
int32_T re, im;
} cint32_T;
# define CINT32_T cint32_T
# endif
#endif
#ifndef CUINT32_T
# ifdef UINT32_T
typedef struct {
uint32_T re, im;
} cuint32_T;
# define CUINT32_T cuint32_T
# endif
#endif
#ifndef CINT64_T
# ifdef INT64_T
typedef struct {
int64_T re, im;
} cint64_T;
# define CINT64_T cint64_T
# endif
#endif
#ifndef CUINT64_T
# ifdef UINT64_T
typedef struct {
uint64_T re, im;
} cuint64_T;
# define CUINT64_T cuint64_T
# endif
#endif
/*=======================================================================*
* Min and Max: *
* int8_T, int16_T, int32_T - signed 8, 16, or 32 bit integers *
* uint8_T, uint16_T, uint32_T - unsigned 8, 16, or 32 bit integers *
*=======================================================================*/
#define MAX_int8_T ((int8_T)(127)) /* 127 */
#define MIN_int8_T ((int8_T)(-128)) /* -128 */
#define MAX_uint8_T ((uint8_T)(255)) /* 255 */
#define MIN_uint8_T ((uint8_T)(0))
#define MAX_int16_T ((int16_T)(32767)) /* 32767 */
#define MIN_int16_T ((int16_T)(-32768)) /* -32768 */
#define MAX_uint16_T ((uint16_T)(65535)) /* 65535 */
#define MIN_uint16_T ((uint16_T)(0))
#define MAX_int32_T ((int32_T)(2147483647)) /* 2147483647 */
#define MIN_int32_T ((int32_T)(-2147483647-1)) /* -2147483648 */
#define MAX_uint32_T ((uint32_T)(0xFFFFFFFFU)) /* 4294967295 */
#define MIN_uint32_T ((uint32_T)(0))
#if defined(_MSC_VER) || (defined(__BORLANDC__) && __BORLANDC__ >= 0x530) \
|| (defined(__WATCOMC__) && __WATCOMC__ >= 1100) \
|| defined(__LCC64__)
# ifdef INT64_T
# define MAX_int64_T ((int64_T)(9223372036854775807LL))
# define MIN_int64_T ((int64_T)(-9223372036854775807LL-1LL))
# endif
# ifdef UINT64_T
# define MAX_uint64_T ((uint64_T)(0xFFFFFFFFFFFFFFFFULL))
# define MIN_uint64_T ((uint64_T)(0))
# endif
#else
# ifdef INT64_T
# ifdef INT_TYPE_64_IS_LONG
# define MAX_int64_T ((int64_T)(9223372036854775807L))
# define MIN_int64_T ((int64_T)(-9223372036854775807L-1L))
# else
# define MAX_int64_T ((int64_T)(9223372036854775807LL))
# define MIN_int64_T ((int64_T)(-9223372036854775807LL-1LL))
# endif
# endif
# ifdef UINT64_T
# ifdef INT_TYPE_64_IS_LONG
# define MAX_uint64_T ((uint64_T)(0xFFFFFFFFFFFFFFFFUL))
# define MIN_uint64_T ((uint64_T)(0))
# else
# define MAX_uint64_T ((uint64_T)(0xFFFFFFFFFFFFFFFFULL))
# define MIN_uint64_T ((uint64_T)(0))
# endif
# endif
#endif
#ifdef _MSC_VER
/* Conversion from unsigned __int64 to double is not implemented in windows
* and results in a compile error, thus the value must first be cast to
* signed __int64, and then to double.
*
* If the 64 bit int value is greater than 2^63-1, which is the signed int64 max,
* the macro below provides a workaround for casting a uint64 value to a double
* in windows.
*/
# define uint64_to_double(u) ( ((u) > _I64_MAX) ? \
(double)(__int64)((u) - _I64_MAX - 1) + (double)_I64_MAX + 1: \
(double)(__int64)(u) )
/* The following inline function should only be used in the macro double_to_uint64,
* as it only handles the specfic range of double between 2^63 and 2^64-1 */
__forceinline
uint64_T double_to_uint64_helper(double d) {
union double_to_uint64_union_type {
double dd;
uint64_T i64;
} di;
di.dd = d;
return (((di.i64 & 0x000fffffffffffff) | 0x0010000000000000) << 11);
}
/* The largest double value that can be cast to uint64 in windows is the
* signed int64 max, which is 2^63-1. The macro below provides
* a workaround for casting large double values to uint64 in windows.
*/
/* The magic number 18446744073709551616.0 is 2^64 */
/* The magic number 9223372036854775808.0 is 2^63 */
# define double_to_uint64(d) ( ((d) >= 18446744073709551616.0) ? \
0xffffffffffffffffULL : \
((d) < 0.0) ? 0ULL : \
((d) >= 9223372036854775808.0) ? \
double_to_uint64_helper(d) : \
(unsigned __int64)(d) )
#else
# define uint64_to_double(u) ((double)(u))
# if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__TICCSC__)
/* double_to_uint64 defined only for MSVC and UNIX */
# else
# define double_to_uint64(d) ( ((d) > 0xffffffffffffffffULL) ? \
(unsigned long long) 0xffffffffffffffffULL : \
((d) < 0) ? (unsigned long long) 0 : (unsigned long long)(d) )
# endif
#endif
#if !defined(__cplusplus) && !defined(__bool_true_false_are_defined)
#ifndef _bool_T
#define _bool_T
typedef boolean_T bool;
#ifndef false
#define false (0)
#endif
#ifndef true
#define true (1)
#endif
#endif /* _bool_T */
#endif /* !__cplusplus */
/*
* This software assumes that the code is being compiled on a target using a
* 2's complement representation for signed integer values.
*/
#if ((SCHAR_MIN + 1) != -SCHAR_MAX)
#error "This code must be compiled using a 2's complement representation for signed integer values"
#endif
/*
* Maximum length of a MATLAB identifier (function/variable/model)
* including the null-termination character.
*/
#define TMW_NAME_LENGTH_MAX 64
/*
* Maximum values for indices and dimensions
*/
#include <stddef.h>
#ifdef MX_COMPAT_32
typedef int mwSize;
typedef int mwIndex;
typedef int mwSignedIndex;
#else
typedef size_t mwSize; /* unsigned pointer-width integer */
typedef size_t mwIndex; /* unsigned pointer-width integer */
typedef ptrdiff_t mwSignedIndex; /* a signed pointer-width integer */
#endif
#if (defined(_LP64) || defined(_WIN64)) && !defined(MX_COMPAT_32)
/* Currently 2^48 based on hardware limitations */
# define MWSIZE_MAX 281474976710655UL
# define MWINDEX_MAX 281474976710655UL
# define MWSINDEX_MAX 281474976710655L
# define MWSINDEX_MIN -281474976710655L
#else
# define MWSIZE_MAX 2147483647UL
# define MWINDEX_MAX 2147483647UL
# define MWSINDEX_MAX 2147483647L
# define MWSINDEX_MIN -2147483647L
#endif
#define MWSIZE_MIN 0UL
#define MWINDEX_MIN 0UL
/** UTF-16 character type */
#if (defined(__cplusplus) && (__cplusplus >= 201103L)) || (defined(_HAS_CHAR16_T_LANGUAGE_SUPPORT) && _HAS_CHAR16_T_LANGUAGE_SUPPORT)
typedef char16_t CHAR16_T;
#elif defined(_MSC_VER)
typedef wchar_t CHAR16_T;
#else
typedef UINT16_T CHAR16_T;
#endif
#endif /* __TMWTYPES__ */
#endif /* tmwtypes_h */

@ -0,0 +1,786 @@
/* Copyright 2019 The Mathworks, Inc. */
/* Copied from
* fullfile(matlabroot,'extern','include','coder','coder_array','coder_array_rtw_cpp11.h') */
#ifndef _mw_coder_array_cpp11_h
#define _mw_coder_array_cpp11_h
// Usage:
//
// coder::array<T, N>: T base type of data, N number of dimensions
//
// coder::array()
// : default constructor
// coder::array(coder::array const &)
// : copy constructor (always make a deep copy of other array)
// coder::array(T const *data, SizeType const *sz)
// : Set data with sizes of this array.
// : (Data is not copied, data is not deleted)
// coder::array::operator = (coder coder::array &)
// : Assign into this array;
// : delete its previous contents (if owning the data.)
// set(T const *data, SizeType sz1, SizeType sz2, ...)
// : Set data with dimensions.
// : (Data is not copied, data is not deleted)
// set_size(SizeType sz1, SizeType sz2, ...)
// : Set sizes of array. Reallocate memory of data if needed.
// bool is_owner() : Return true if the data is owned by the class.
// void set_owner(b) : Set if the data is owned by the class.
// SizeType capacity() : How many entries are reserved by memory allocation.
// reshape( SizeType sz1, SizeType sz2, ...)
// : Reshape array to a different ND shape. Do not copy the data.
// : The number of elements must not be changed (numel()==sz1*sz2*...)
// : Return the array with possibly new number of dimensions.
// clear() : Reset array to be empty.
// SizeType numel() : Return the number of elements.
// operator [] (SizeType index) : Extract element at linear index (0 based.)
// size(SizeType dimension) : Size of array of the provided dimension.
// SizeType * size() : Return the pointer to all the sizes of this array.
// SizeType index(SizeType i1, SizeType i2, ...)
// : Compute the linear index from ND index (i1,i2,...)
// at(SizeType i1, SizeType i2, ...) : The element at index (i1,i2,...)
#include <cassert>
#include <cstring>
#include <iterator>
#include <string>
#include <vector>
#ifndef INT32_T
#include "rtwtypes.h"
#endif
namespace coder {
#ifndef CODER_ARRAY_NEW_DELETE
#define CODER_ARRAY_NEW_DELETE
#define CODER_NEW(T, N) new T[N]
#define CODER_DELETE(P) delete[](P)
#endif
#ifndef CODER_ARRAY_SIZE_TYPE_DEFINED
using SizeType = int;
#endif
namespace std = ::std;
namespace detail {
#ifndef CODER_ARRAY_DATA_PTR_DEFINED
template <typename T, typename SZ>
class data_ptr {
public:
using value_type = T;
using size_type = SZ;
data_ptr()
: data_(nullptr)
, size_(0)
, capacity_(0)
, owner_(false) {
}
data_ptr(T* _data, SZ _sz)
: data_(_data)
, size_(_sz)
, capacity_(_sz)
, owner_(false) {
}
data_ptr(data_ptr const& _other)
: data_(_other.owner_ ? nullptr : _other.data_)
, size_(_other.owner_ ? 0 : _other.size_)
, capacity_(_other.owner_ ? 0 : _other.capacity_)
, owner_(_other.owner_) {
if (owner_) {
resize(_other.size_);
(void)std::copy(_other.data_, _other.data_ + size_, data_);
}
}
~data_ptr() {
if (owner_) {
CODER_DELETE(data_);
}
}
SZ capacity() const {
return capacity_;
}
void reserve(SZ _n) {
if (_n > capacity_) {
T* const new_data{CODER_NEW(T, _n)};
(void)std::copy(data_, data_ + size_, new_data);
if (owner_) {
CODER_DELETE(data_);
}
data_ = new_data;
capacity_ = _n;
owner_ = true;
}
}
void resize(SZ _n) {
reserve(_n);
size_ = _n;
}
private:
// Prohibit use of assignment operator to prevent subtle bugs
void operator=(data_ptr<T, SZ> const& _other);
public:
void set(T* _data, SZ _sz) {
if (owner_) {
CODER_DELETE(data_);
}
data_ = _data;
size_ = _sz;
owner_ = false;
capacity_ = size_;
}
void copy(T const* const _data, SZ _size) {
if (data_ == _data) {
size_ = _size;
return;
}
if (owner_) {
CODER_DELETE(data_);
}
data_ = CODER_NEW(T, _size);
owner_ = true;
size_ = _size;
capacity_ = size_;
(void)std::copy(_data, _data + _size, data_);
}
void copy(data_ptr<T, SZ> const& _other) {
copy(_other.data_, _other.size_);
}
operator T*() {
return &data_[0];
}
operator T const *() const {
return &data_[0];
}
T& operator[](SZ _index) {
return data_[_index];
}
T const& operator[](SZ _index) const {
return data_[_index];
}
T* operator->() {
return data_;
}
T const* operator->() const {
return data_;
}
bool is_null() const {
return data_ == nullptr;
}
void clear() {
if (owner_) {
CODER_DELETE(data_);
}
data_ = nullptr;
size_ = 0;
capacity_ = 0;
owner_ = false;
}
bool is_owner() const {
return owner_;
}
void set_owner(bool _b) {
owner_ = _b;
}
private:
T* data_;
SZ size_;
SZ capacity_;
bool owner_;
};
#endif
} // namespace detail
// Implementing the random access iterator class so coder::array can be
// used in STL iterators.
template <typename T>
class array_iterator : public std::iterator<std::random_access_iterator_tag,
typename T::value_type,
typename T::size_type> {
public:
array_iterator()
: arr_(nullptr)
, i_(0) {
}
array_iterator(array_iterator<T> const& other)
: arr_(other.arr_)
, i_(other.i_) {
}
~array_iterator() {
}
typename T::value_type& operator*() const {
return (*arr_)[i_];
}
typename T::value_type* operator->() const {
return &(*arr_)[i_];
}
typename T::value_type& operator[](typename T::size_type _di) const {
return (*arr_)[i_ + _di];
}
array_iterator<T>& operator++() {
++i_;
return *this;
}
array_iterator<T>& operator--() {
--i_;
return *this;
}
array_iterator<T> operator++(int) {
array_iterator<T> cp{*this};
++i_;
return cp;
}
array_iterator<T> operator--(int) {
array_iterator<T> cp{*this};
--i_;
return cp;
}
array_iterator<T>& operator=(array_iterator<T> const& _other) {
this->i_ = _other.i_;
return *this;
}
bool operator==(array_iterator<T> const& _other) const {
return i_ == _other.i_;
}
bool operator!=(array_iterator<T> const& _other) const {
return i_ != _other.i_;
}
bool operator<(array_iterator<T> const& _other) const {
return i_ < _other.i_;
}
bool operator>(array_iterator<T> const& _other) const {
return i_ > _other.i_;
}
bool operator<=(array_iterator<T> const& _other) const {
return i_ <= _other.i_;
}
bool operator>=(array_iterator<T> const& _other) const {
return i_ >= _other.i_;
}
array_iterator<T> operator+(typename T::size_type _add) const {
array_iterator<T> cp{*this};
cp.i_ += _add;
return cp;
}
array_iterator<T>& operator+=(typename T::size_type _add) {
this->i_ += _add;
return *this;
}
array_iterator<T> operator-(typename T::size_type _subtract) const {
array_iterator<T> cp{*this};
cp.i_ -= _subtract;
return cp;
}
array_iterator<T>& operator-=(typename T::size_type _subtract) {
this->i_ -= _subtract;
return *this;
}
typename T::size_type operator-(array_iterator<T> const& _other) const {
return static_cast<typename T::size_type>(this->i_ - _other.i_);
}
array_iterator(T* _arr, typename T::size_type _i)
: arr_(_arr)
, i_(_i) {
}
private:
T* arr_;
typename T::size_type i_;
};
// Const version of the array iterator.
template <typename T>
class const_array_iterator : public std::iterator<std::random_access_iterator_tag,
typename T::value_type,
typename T::size_type> {
public:
const_array_iterator()
: arr_(nullptr)
, i_(0) {
}
const_array_iterator(const_array_iterator<T> const& other)
: arr_(other.arr_)
, i_(other.i_) {
}
~const_array_iterator() {
}
typename T::value_type const& operator*() const {
return (*arr_)[i_];
}
typename T::value_type const* operator->() const {
return &(*arr_)[i_];
}
typename T::value_type const& operator[](typename T::size_type _di) const {
return (*arr_)[i_ + _di];
}
const_array_iterator<T>& operator++() {
++i_;
return *this;
}
const_array_iterator<T>& operator--() {
--i_;
return *this;
}
const_array_iterator<T> operator++(int) {
const_array_iterator<T> copy{*this};
++i_;
return copy;
}
const_array_iterator<T> operator--(int) {
const_array_iterator copy{*this};
--i_;
return copy;
}
const_array_iterator<T>& operator=(const_array_iterator<T> const& _other) {
this->i_ = _other.i_;
return *this;
}
bool operator==(const_array_iterator<T> const& _other) const {
return i_ == _other.i_;
}
bool operator!=(const_array_iterator<T> const& _other) const {
return i_ != _other.i_;
}
bool operator<(const_array_iterator<T> const& _other) const {
return i_ < _other.i_;
}
bool operator>(const_array_iterator<T> const& _other) const {
return i_ > _other.i_;
}
bool operator<=(const_array_iterator<T> const& _other) const {
return i_ <= _other.i_;
}
bool operator>=(const_array_iterator<T> const& _other) const {
return i_ >= _other.i_;
}
const_array_iterator<T> operator+(typename T::size_type _add) const {
const_array_iterator<T> cp{*this};
cp.i_ += _add;
return cp;
}
const_array_iterator<T>& operator+=(typename T::size_type _add) {
this->i_ += _add;
return *this;
}
const_array_iterator<T> operator-(typename T::size_type _subtract) const {
const_array_iterator<T> cp{*this};
cp.i_ -= _subtract;
return cp;
}
const_array_iterator<T>& operator-=(typename T::size_type _subtract) {
this->i_ -= _subtract;
return *this;
}
typename T::size_type operator-(const_array_iterator<T> const& _other) const {
return static_cast<typename T::size_type>(this->i_ - _other.i_);
}
const_array_iterator(T const* _arr, typename T::size_type _i)
: arr_(_arr)
, i_(_i) {
}
private:
T const* arr_;
typename T::size_type i_;
typename T::size_type n_;
};
namespace detail {
// detail::numel<N>: Compile-time product of the given size vector of length N.
template <int N>
class numel {
public:
template <typename SZ>
static SZ compute(SZ _size[]) {
return _size[N - 1] * numel<N - 1>::compute(_size);
}
};
template <>
class numel<0> {
public:
template <typename SZ>
static SZ compute(SZ[]) {
return 1;
}
};
// Compute the product for a set of numeric arguments: product<int32_T>(10, 20, 30, ...) =>
// 10*20*30*...
template <typename SZ, typename First, typename... Rest>
struct product_i {
static SZ compute(First _f, Rest... _rest) {
return _f * product_i<SZ, Rest...>::compute(_rest...);
}
};
template <typename SZ, typename Last>
struct product_i<SZ, Last> {
static SZ compute(Last _l) {
return _l;
}
};
template <typename SZ, typename... Args>
SZ product(Args... args) {
return product_i<SZ, Args...>::compute(args...);
}
// Compute flat index from (column-major) ND size vector and a list of indices.
template <int I>
class index_nd {
public:
template <typename SZ>
static SZ compute(SZ const _size[], SZ const _indices[]) {
SZ const weight{numel<I - 1>::compute(_size)};
return weight * _indices[I - 1] + index_nd<I - 1>::compute(_size, _indices);
}
};
template <>
class index_nd<0> {
public:
template <typename SZ>
static SZ compute(SZ[], SZ[]) {
return 0;
}
};
template <bool Cond>
struct match_dimensions {};
template <>
struct match_dimensions<true> {
static void check() {
}
};
} // namespace detail
// Base class for code::array. SZ is the type used for sizes (currently int32_t.)
// Overloading up to 10 dimensions (not using variadic templates to
// stay compatible with C++98.)
template <typename T, typename SZ, int N>
class array_base {
public:
using value_type = T;
using size_type = SZ;
array_base() {
(void)::memset(size_, 0, sizeof(SZ) * N);
}
array_base(T* _data, SZ const* _sz)
: data_(_data, coder::detail::numel<N>::compute(_sz)) {
(void)std::copy(_sz, _sz + N, size_);
}
array_base& operator=(array_base const& _other) {
data_.copy(_other.data_);
(void)std::copy(_other.size_, _other.size_ + N, size_);
return *this;
}
template <typename... Dims>
void set(T* _data, Dims... dims) {
coder::detail::match_dimensions<N == sizeof...(dims)>::check();
data_.set(_data, coder::detail::product<SZ>(dims...));
set_size_i<0>(dims...);
}
bool is_owner() const {
return data_.is_owner();
}
void set_owner(bool b) {
data_.set_owner(b);
}
SZ capacity() const {
return data_.capacity();
}
private:
template <SZ _i, typename First, typename... Rest>
void set_size_i(First f, Rest... rest) {
size_[_i] = f;
set_size_i<_i + 1, Rest...>(rest...);
}
template <SZ _i, typename Last>
void set_size_i(Last l) {
size_[_i] = l;
}
public:
template <typename... Dims>
void set_size(Dims... dims) {
coder::detail::match_dimensions<N == sizeof...(dims)>::check();
set_size_i<0>(dims...);
ensureCapacity(numel());
}
template <SizeType N1>
array_base<T, SZ, N1> reshape_n(SZ const (&_ns)[N1]) const {
array_base<T, SZ, N1> reshaped{const_cast<T*>(&data_[0]), _ns};
return reshaped;
}
template <typename... Dims>
array_base<T, SZ, static_cast<SZ>(sizeof...(Dims))> reshape(Dims... dims) const {
SZ const ns[]{static_cast<SZ>(dims)...};
return reshape_n(ns);
}
T& operator[](SZ _index) {
return data_[_index];
}
T const& operator[](SZ _index) const {
return data_[_index];
}
void clear() {
data_.clear();
}
T* data() {
return data_;
}
T const* data() const {
return data_;
}
SZ const* size() const {
return &size_[0];
}
SZ size(SZ _index) const {
return size_[_index];
}
SZ numel() const {
return coder::detail::numel<N>::compute(size_);
}
template <typename... Dims>
SZ index(Dims... _dims) const {
coder::detail::match_dimensions<N == sizeof...(_dims)>::check();
SZ const indices[]{static_cast<SZ>(_dims)...};
return coder::detail::index_nd<static_cast<SZ>(sizeof...(_dims))>::compute(size_, indices);
}
template <typename... Dims>
T& at(Dims... _i) {
coder::detail::match_dimensions<N == sizeof...(_i)>::check();
return data_[index(_i...)];
}
template <typename... Dims>
T const& at(Dims... _i) const {
coder::detail::match_dimensions<N == sizeof...(_i)>::check();
return data_[index(_i...)];
}
array_iterator<array_base<T, SZ, N> > begin() {
return array_iterator<array_base<T, SZ, N> >(this, 0);
}
array_iterator<array_base<T, SZ, N> > end() {
return array_iterator<array_base<T, SZ, N> >(this, this->numel());
}
const_array_iterator<array_base<T, SZ, N> > begin() const {
return const_array_iterator<array_base<T, SZ, N> >(this, 0);
}
const_array_iterator<array_base<T, SZ, N> > end() const {
return const_array_iterator<array_base<T, SZ, N> >(this, this->numel());
}
protected:
coder::detail::data_ptr<T, SZ> data_;
SZ size_[N];
private:
void ensureCapacity(SZ _newNumel) {
if (_newNumel > data_.capacity()) {
SZ i{data_.capacity()};
if (i < 16) {
i = 16;
}
while (i < _newNumel) {
if (i > 1073741823) {
i = MAX_int32_T;
} else {
i *= 2;
}
}
data_.reserve(i);
}
data_.resize(_newNumel);
}
};
// The standard coder::array class with base type and number of dimensions.
template <typename T, int N>
class array : public array_base<T, SizeType, N> {
private:
using Base = array_base<T, SizeType, N>;
public:
array()
: Base() {
}
array(array<T, N> const& _other)
: Base(_other) {
}
array(Base const& _other)
: Base(_other) {
}
array(T* _data, SizeType const* _sz)
: Base(_data, _sz) {
}
};
// Specialize on char_T (row vector) for better support on strings.
template <>
class array<char_T, 2> : public array_base<char_T, SizeType, 2> {
private:
using Base = array_base<char_T, SizeType, 2>;
public:
array()
: array_base() {
}
array(array<char_T, 2> const& _other)
: Base(_other) {
}
array(Base const& _other)
: Base(_other) {
}
array(std::string const& _str) {
operator=(_str);
}
array(char_T const* const _str) {
operator=(_str);
}
array(std::vector<char_T> const& _vec) {
SizeType const n{static_cast<SizeType>(_vec.size())};
set_size(1, n);
data_.copy(&_vec[0], n);
}
array& operator=(std::string const& _str) {
SizeType const n{static_cast<SizeType>(_str.size())};
set_size(1, n);
data_.copy(_str.c_str(), n);
return *this;
}
array& operator=(char_T const* const _str) {
SizeType const n{static_cast<SizeType>(strlen(_str))};
set_size(1, n);
data_.copy(_str, n);
return *this;
}
operator std::string() const {
return std::string(static_cast<char const*>(&(*this)[0]), static_cast<int>(size(1)));
}
};
// Specialize on 2 dimensions for better support interactions with
// std::vector and row vectors.
template <typename T>
class array<T, 2> : public array_base<T, SizeType, 2> {
private:
using Base = array_base<T, SizeType, 2>;
public:
array()
: Base() {
}
array(array<T, 2> const& _other)
: Base(_other) {
}
array(Base const& _other)
: Base(_other) {
}
array(std::vector<T> const& _vec) {
operator=(_vec);
}
array& operator=(std::vector<T> const& _vec) {
SizeType n{static_cast<SizeType>(_vec.size())};
Base::set_size(1, n);
Base::data_.copy(&_vec[0], n);
return *this;
}
operator std::vector<T>() const {
T const* p{&Base::data_[0]};
return std::vector<T>(p, p + Base::numel());
}
};
// Specialize on 1 dimension for better support with std::vector and
// column vectors.
template <typename T>
class array<T, 1> : public array_base<T, SizeType, 1> {
private:
using Base = array_base<T, SizeType, 1>;
public:
array()
: Base() {
}
array(array<T, 1> const& _other)
: Base(_other) {
}
array(Base const& _other)
: Base(_other) {
}
array(std::vector<T> const& _vec) {
operator=(_vec);
}
array& operator=(std::vector<T> const& _vec) {
SizeType n{static_cast<SizeType>(_vec.size())};
Base::set_size(n);
Base::data_.copy(&_vec[0], n);
return *this;
}
operator std::vector<T>() const {
T const* p{&Base::data_[0]};
return std::vector<T>(p, p + Base::numel());
}
};
} // namespace coder
#endif

@ -0,0 +1,30 @@
//
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
//
// designKWeightingFilter.h
//
// Code generation for function 'designKWeightingFilter'
//
#ifndef DESIGNKWEIGHTINGFILTER_H
#define DESIGNKWEIGHTINGFILTER_H
// Include files
#include "rtwtypes.h"
#include <cstddef>
#include <cstdlib>
// Function Declarations
namespace coder {
namespace audio {
namespace internal {
void convertToFs(float sos_48kHz[6], float Fs);
}
} // namespace audio
} // namespace coder
#endif
// End of code generation (designKWeightingFilter.h)

@ -0,0 +1,25 @@
//
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
//
// getLoudness.h
//
// Code generation for function 'getLoudness'
//
#ifndef GETLOUDNESS_H
#define GETLOUDNESS_H
// Include files
#include "rtwtypes.h"
#include "coder_array.h"
#include <cstddef>
#include <cstdlib>
// Function Declarations
extern void getLoudness(const coder::array<float, 2U> &data, float fs,
coder::array<float, 2U> &loudness);
#endif
// End of code generation (getLoudness.h)

@ -0,0 +1,20 @@
//
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
//
// getLoudness_data.h
//
// Code generation for function 'getLoudness_data'
//
#ifndef GETLOUDNESS_DATA_H
#define GETLOUDNESS_DATA_H
// Include files
#include "rtwtypes.h"
#include <cstddef>
#include <cstdlib>
#endif
// End of code generation (getLoudness_data.h)

@ -0,0 +1,23 @@
//
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
//
// getLoudness_initialize.h
//
// Code generation for function 'getLoudness_initialize'
//
#ifndef GETLOUDNESS_INITIALIZE_H
#define GETLOUDNESS_INITIALIZE_H
// Include files
#include "rtwtypes.h"
#include <cstddef>
#include <cstdlib>
// Function Declarations
extern void getLoudness_initialize();
#endif
// End of code generation (getLoudness_initialize.h)

@ -0,0 +1,23 @@
//
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
//
// getLoudness_terminate.h
//
// Code generation for function 'getLoudness_terminate'
//
#ifndef GETLOUDNESS_TERMINATE_H
#define GETLOUDNESS_TERMINATE_H
// Include files
#include "rtwtypes.h"
#include <cstddef>
#include <cstdlib>
// Function Declarations
extern void getLoudness_terminate();
#endif
// End of code generation (getLoudness_terminate.h)

@ -0,0 +1,18 @@
//
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
//
// getLoudness_types.h
//
// Code generation for function 'getLoudness'
//
#ifndef GETLOUDNESS_TYPES_H
#define GETLOUDNESS_TYPES_H
// Include files
#include "rtwtypes.h"
#endif
// End of code generation (getLoudness_types.h)

@ -0,0 +1,30 @@
//
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
//
// rtGetInf.h
//
// Code generation for function 'getLoudness'
//
#ifndef RTGETINF_H
#define RTGETINF_H
// Include files
#include "rtwtypes.h"
#ifdef __cplusplus
extern "C" {
#endif
extern real_T rtGetInf(void);
extern real32_T rtGetInfF(void);
extern real_T rtGetMinusInf(void);
extern real32_T rtGetMinusInfF(void);
#ifdef __cplusplus
}
#endif
#endif
// End of code generation (rtGetInf.h)

@ -0,0 +1,28 @@
//
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
//
// rtGetNaN.h
//
// Code generation for function 'getLoudness'
//
#ifndef RTGETNAN_H
#define RTGETNAN_H
// Include files
#include "rtwtypes.h"
#ifdef __cplusplus
extern "C" {
#endif
extern real_T rtGetNaN(void);
extern real32_T rtGetNaNF(void);
#ifdef __cplusplus
}
#endif
#endif
// End of code generation (rtGetNaN.h)

@ -0,0 +1,32 @@
//
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
//
// rt_nonfinite.h
//
// Code generation for function 'getLoudness'
//
#ifndef RT_NONFINITE_H
#define RT_NONFINITE_H
// Include files
#include "rtwtypes.h"
#ifdef __cplusplus
extern "C" {
#endif
extern real_T rtInf;
extern real_T rtMinusInf;
extern real_T rtNaN;
extern real32_T rtInfF;
extern real32_T rtMinusInfF;
extern real32_T rtNaNF;
#ifdef __cplusplus
}
#endif
#endif
// End of code generation (rt_nonfinite.h)

@ -0,0 +1,44 @@
//
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
//
// rtwtypes.h
//
// Code generation for function 'getLoudness'
//
#ifndef RTWTYPES_H
#define RTWTYPES_H
/*=======================================================================*
* Fixed width word size data types: *
* int64_T - signed 64 bit integers *
* uint64_T - unsigned 64 bit integers *
*=======================================================================*/
#if defined(__APPLE__)
#ifndef INT64_T
#define INT64_T long
#define FMT64 "l"
#if defined(__LP64__) && !defined(INT_TYPE_64_IS_LONG)
#define INT_TYPE_64_IS_LONG
#endif
#endif
#endif
#if defined(__APPLE__)
#ifndef UINT64_T
#define UINT64_T unsigned long
#define FMT64 "l"
#if defined(__LP64__) && !defined(INT_TYPE_64_IS_LONG)
#define INT_TYPE_64_IS_LONG
#endif
#endif
#endif
// Include files
#include "tmwtypes.h"
#endif
// End of code generation (rtwtypes.h)

@ -0,0 +1,27 @@
//
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
//
// sum.h
//
// Code generation for function 'sum'
//
#ifndef SUM_H
#define SUM_H
// Include files
#include "rtwtypes.h"
#include "coder_array.h"
#include <cstddef>
#include <cstdlib>
// Function Declarations
namespace coder {
void sum(const ::coder::array<float, 2U> &x, float y_data[], int y_size[2]);
}
#endif
// End of code generation (sum.h)

@ -0,0 +1,886 @@
/*
* Copyright 1984-2018 The MathWorks, Inc.
*/
#if defined(_MSC_VER)
# pragma once
#endif
#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3))
# pragma once
#endif
#ifndef tmwtypes_h
#define tmwtypes_h
#ifndef __TMWTYPES__
#define __TMWTYPES__
/*
* File : tmwtypes.h
* Abstract:
* Data types for use with MATLAB/SIMULINK and the Real-Time Workshop.
*
* When compiling stand-alone model code, data types can be overridden
* via compiler switches.
*
* Define NO_FLOATS to eliminate reference to real_T, etc.
*/
#ifdef MW_LIBTOOLING
#include "mwstdint.h"
#endif
#include <limits.h>
/* __STDC_VERSION__ version check below means "check for a C99 compiler".
Visual Studio (checked on versions 2015 and 2017) does
not define __STDC_VERSION__, however it has stdbool.h available,
thus a separate check for _MSC_VER below.
*/
#if defined(__APPLE_CC__) \
|| (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) \
|| (defined(_MSC_VER) && (_MSC_VER >= 1900))
#ifndef tmwtypes_do_not_include_stdbool
#include <stdbool.h>
#endif
#endif
#define LOGICAL_IS_A_TYPE
#define SPARSE_GENERALIZATION
#ifdef NO_FLOATS
# define double double_not_allowed
# define float float_not_allowed
#endif /*NO_FLOATS*/
#ifndef NO_FLOATS
#ifndef __MWERKS__
# ifdef __STDC__
# include <float.h>
# else
# ifndef FLT_MANT_DIG
# define FLT_MANT_DIG 24
# endif
# ifndef DBL_MANT_DIG
# define DBL_MANT_DIG 53
# endif
# endif
#endif
#endif /*NO_FLOATS*/
/*
* The following data types cannot be overridden when building MEX files.
*/
#ifdef MATLAB_MEX_FILE
# undef CHARACTER_T
# undef INTEGER_T
# undef BOOLEAN_T
# undef REAL_T
# undef TIME_T
#endif
/*
* The uchar_T, ushort_T and ulong_T types are needed for compilers which do
* not allow defines to be specified, at the command line, with spaces in them.
*/
typedef unsigned char uchar_T;
typedef unsigned short ushort_T;
typedef unsigned long ulong_T;
#if (defined(_MSC_VER) && _MSC_VER >= 1500) \
|| defined(__x86_64__) || defined(__LP64__) \
|| defined(__LCC64__)
typedef unsigned long long ulonglong_T;
#endif
/*=======================================================================*
* Fixed width word size data types: *
* int8_T, int16_T, int32_T - signed 8, 16, or 32 bit integers *
* uint8_T, uint16_T, uint32_T - unsigned 8, 16, or 32 bit integers *
* real32_T, real64_T - 32 and 64 bit floating point numbers *
*=======================================================================*/
/* When used with Real Time Workshop generated code, this
* header file can be used with a variety of compilers.
*
* The compiler could be for an 8 bit embedded processor that
* only had 8 bits per integer and 16 bits per long.
* In that example, a 32 bit integer size is not even available.
* This header file should be robust to that.
*
* For the case of an 8 bit processor, the preprocessor
* may be limited to 16 bit math like its target. That limitation
* would mean that 32 bit comparisons can't be done accurately.
* To increase robustness to this, comparisons are done against
* smaller values first. An inaccurate 32 bit comparison isn't
* attempted if the 16 bit comparison has already succeeded.
*
* Limitations on preprocessor math can also be stricter than
* for the target. There are known cases where a compiler
* targeting processors with 64 bit longs can't do accurate
* preprocessor comparisons on more than 32 bits.
*/
/* Determine the number of bits for int, long, short, and char.
* If one fails to be determined, set the number of bits to -1
*/
#ifndef TMW_BITS_PER_INT
# if INT_MAX == 0x7FL
# define TMW_BITS_PER_INT 8
# elif INT_MAX == 0x7FFFL
# define TMW_BITS_PER_INT 16
# elif INT_MAX == 0x7FFFFFFFL
# define TMW_BITS_PER_INT 32
# else
# define TMW_BITS_PER_INT -1
# endif
#endif
#ifndef TMW_BITS_PER_LONG
# if LONG_MAX == 0x7FL
# define TMW_BITS_PER_LONG 8
# elif LONG_MAX == 0x7FFFL
# define TMW_BITS_PER_LONG 16
# elif LONG_MAX == 0x7FFFFFFFL
# define TMW_BITS_PER_LONG 32
# else
# define TMW_BITS_PER_LONG -1
# endif
#endif
#ifndef TMW_BITS_PER_SHRT
# if SHRT_MAX == 0x7FL
# define TMW_BITS_PER_SHRT 8
# elif SHRT_MAX == 0x7FFFL
# define TMW_BITS_PER_SHRT 16
# elif SHRT_MAX == 0x7FFFFFFFL
# define TMW_BITS_PER_SHRT 32
# else
# define TMW_BITS_PER_SHRT -1
# endif
#endif
#ifndef TMW_BITS_PER_SCHAR
# if SCHAR_MAX == 0x7FL
# define TMW_BITS_PER_SCHAR 8
# elif SCHAR_MAX == 0x7FFFL
# define TMW_BITS_PER_SCHAR 16
# elif SCHAR_MAX == 0x7FFFFFFFL
# define TMW_BITS_PER_SCHAR 32
# else
# define TMW_BITS_PER_SCHAR -1
# endif
#endif
#ifndef TMW_CHAR_SIGNED
# if SCHAR_MAX == CHAR_MAX
# define TMW_CHAR_SIGNED 1
# else
# define TMW_CHAR_SIGNED 0
# endif
#endif
/* It is common for one or more of the integer types
* to be the same size. For example, on many embedded
* processors, both shorts and ints are 16 bits. On
* processors used for workstations, it is quite common
* for both int and long to be 32 bits.
* When there is more than one choice for typdef'ing
* a portable type like int16_T or uint32_T, in
* concept, it should not matter which choice is made.
* However, some style guides and some code checking
* tools do identify and complain about seemingly
* irrelevant differences. For example, a code
* checking tool may complain about an implicit
* conversion from int to short even though both
* are 16 bits. To reduce these types of
* complaints, it is best to make int the
* preferred choice when more than one is available.
*/
#ifndef INT8_T
# if defined(MW_LIBTOOLING)
# define INT8_T int8_t
# elif TMW_BITS_PER_INT == 8
# define INT8_T int
# elif TMW_BITS_PER_LONG == 8
# define INT8_T long
# elif TMW_BITS_PER_SCHAR == 8
# define INT8_T signed char
# elif TMW_BITS_PER_SHRT == 8
# define INT8_T short
# endif
#endif
#ifdef INT8_T
typedef INT8_T int8_T;
#endif
#ifndef UINT8_T
# if defined(MW_LIBTOOLING)
# define UINT8_T uint8_t
# elif TMW_BITS_PER_INT == 8
# define UINT8_T unsigned int
# elif TMW_BITS_PER_LONG == 8
# define UINT8_T unsigned long
# elif TMW_BITS_PER_SCHAR == 8
# define UINT8_T unsigned char
# elif TMW_BITS_PER_SHRT == 8
# define UINT8_T unsigned short
# endif
#endif
#ifdef UINT8_T
typedef UINT8_T uint8_T;
#endif
#ifndef INT16_T
# if defined(MW_LIBTOOLING)
# define INT16_T int16_t
# elif TMW_BITS_PER_INT == 16
# define INT16_T int
# elif TMW_BITS_PER_LONG == 16
# define INT16_T long
# elif TMW_BITS_PER_SCHAR == 16
# define INT16_T signed char
# elif TMW_BITS_PER_SHRT == 16
# define INT16_T short
# endif
#endif
#ifdef INT16_T
typedef INT16_T int16_T;
#endif
#ifndef UINT16_T
# if defined(MW_LIBTOOLING)
# define UINT16_T uint16_t
# elif TMW_BITS_PER_INT == 16
# define UINT16_T unsigned int
# elif TMW_BITS_PER_LONG == 16
# define UINT16_T unsigned long
# elif TMW_BITS_PER_SCHAR == 16
# define UINT16_T unsigned char
# elif TMW_BITS_PER_SHRT == 16
# define UINT16_T unsigned short
# endif
#endif
#ifdef UINT16_T
typedef UINT16_T uint16_T;
#endif
#ifndef INT32_T
# if defined(MW_LIBTOOLING)
# define INT32_T int32_t
# elif TMW_BITS_PER_INT == 32
# define INT32_T int
# elif TMW_BITS_PER_LONG == 32
# define INT32_T long
# elif TMW_BITS_PER_SCHAR == 32
# define INT32_T signed char
# elif TMW_BITS_PER_SHRT == 32
# define INT32_T short
# endif
#endif
#ifdef INT32_T
typedef INT32_T int32_T;
#endif
#ifndef UINT32_T
# if defined(MW_LIBTOOLING)
# define UINT32_T uint32_t
# elif TMW_BITS_PER_INT == 32
# define UINT32_T unsigned int
# elif TMW_BITS_PER_LONG == 32
# define UINT32_T unsigned long
# elif TMW_BITS_PER_SCHAR == 32
# define UINT32_T unsigned char
# elif TMW_BITS_PER_SHRT == 32
# define UINT32_T unsigned short
# endif
#endif
#ifdef UINT32_T
typedef UINT32_T uint32_T;
#endif
/* The following is used to emulate smaller integer types when only
* larger types are available. For example, compilers for TI C3x/C4x DSPs
* define char and short to be 32 bits, so 8 and 16 bits are not directly
* available. This target is commonly used with RTW rapid prototyping.
* Other DSPs define char to be 16 bits, so 8 bits is not directly
* available.
*/
#ifndef INT8_T
# ifdef INT16_T
# define INT8_T INT16_T
typedef INT8_T int8_T;
# else
# ifdef INT32_T
# define INT8_T INT32_T
typedef INT8_T int8_T;
# endif
# endif
#endif
#ifndef UINT8_T
# ifdef UINT16_T
# define UINT8_T UINT16_T
typedef UINT8_T uint8_T;
# else
# ifdef UINT32_T
# define UINT8_T UINT32_T
typedef UINT8_T uint8_T;
# endif
# endif
#endif
#ifndef INT16_T
# ifdef INT32_T
# define INT16_T INT32_T
typedef INT16_T int16_T;
# endif
#endif
#ifndef UINT16_T
# ifdef UINT32_T
# define UINT16_T UINT32_T
typedef UINT16_T uint16_T;
# endif
#endif
#ifndef NO_FLOATS
#ifndef REAL32_T
# ifndef __MWERKS__
# if FLT_MANT_DIG >= 23
# define REAL32_T float
# endif
# else
# define REAL32_T float
# endif
#endif
#ifdef REAL32_T
typedef REAL32_T real32_T;
#endif
#ifndef REAL64_T
# ifndef __MWERKS__
# if DBL_MANT_DIG >= 52
# define REAL64_T double
# endif
# else
# define REAL64_T double
# endif
#endif
#ifdef REAL64_T
typedef REAL64_T real64_T;
#endif
#endif /* NO_FLOATS*/
/*=======================================================================*
* Fixed width word size data types: *
* int64_T - signed 64 bit integers *
* uint64_T - unsigned 64 bit integers *
*=======================================================================*/
# if defined(MW_LIBTOOLING)
# ifdef INT64_T
# undef INT64_T
# endif
# define INT64_T int64_t
# ifdef UINT64_T
# undef UINT64_T
# endif
# define UINT64_T uint64_t
# endif
#if !defined(INT64_T) || !defined(UINT64_T) || !defined(FMT64)
# if defined(__APPLE__) || defined(__clang__)
# ifndef INT64_T
# define INT64_T long long
# endif
# ifndef UINT64_T
# define UINT64_T unsigned long long
# endif
# ifndef FMT64
# define FMT64 "ll"
# endif
# if defined(__LP64__) && !defined(INT_TYPE_64_IS_LONG)
# define INT_TYPE_64_IS_LONG
# endif
# elif (defined(__x86_64__) || defined(__LP64__))&& !defined(__MINGW64__)
# ifndef INT64_T
# define INT64_T long
# endif
# ifndef UINT64_T
# define UINT64_T unsigned long
# endif
# ifndef FMT64
# define FMT64 "l"
# endif
# if !defined(INT_TYPE_64_IS_LONG)
# define INT_TYPE_64_IS_LONG
# endif
# elif defined(_MSC_VER) || (defined(__BORLANDC__) && __BORLANDC__ >= 0x530) \
|| (defined(__WATCOMC__) && __WATCOMC__ >= 1100)
# ifndef INT64_T
# define INT64_T __int64
# endif
# ifndef UINT64_T
# define UINT64_T unsigned __int64
# endif
# ifndef FMT64
# define FMT64 "I64"
# endif
# elif defined(__GNUC__) || defined(TMW_ENABLE_INT64) \
|| defined(__LCC64__)
# ifndef INT64_T
# define INT64_T long long
# endif
# ifndef UINT64_T
# define UINT64_T unsigned long long
# endif
# ifndef FMT64
# define FMT64 "ll"
# endif
# endif
#endif
#if defined(INT64_T)
# if defined(__GNUC__) && \
((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >=9)))
__extension__
# endif
typedef INT64_T int64_T;
#endif
#if defined(_WIN64) || (defined(__APPLE__) && defined(__LP64__)) \
|| defined(__x86_64__) \
|| defined(__LP64__)
# define INT_TYPE_64_IS_SUPPORTED
#endif
#if defined(UINT64_T)
# if defined(__GNUC__) && \
((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >=9)))
__extension__
# endif
typedef UINT64_T uint64_T;
#endif
/*===========================================================================*
* Format string modifiers for using size_t variables in printf statements. *
*===========================================================================*/
#ifndef FMT_SIZE_T
# if (defined( __GNUC__ ) || defined(_STDC_C99))&& !defined(__MINGW64__)
# define FMT_SIZE_T "z"
# elif defined (__WATCOMC__)
# define FMT_SIZE_T "l"
# elif defined (_WIN32 )
# define FMT_SIZE_T "I"
# else
# define FMT_SIZE_T "l"
# endif
#endif
#ifndef FMT_PTRDIFF_T
# if defined(__APPLE__)
# define FMT_PTRDIFF_T "l"
# elif defined( __GNUC__ ) || defined(_STDC_C99)
# define FMT_PTRDIFF_T "t"
# elif defined (__WATCOMC__)
# define FMT_PTRDIFF_T "l"
# elif defined (_WIN32 )
# define FMT_PTRDIFF_T "I"
# else
# define FMT_PTRDIFF_T "l"
# endif
#endif
/*===========================================================================*
* General or logical data types where the word size is not guaranteed. *
* real_T - possible settings include real32_T or real64_T *
* time_T - possible settings include real32_T or real64_T *
* boolean_T *
* char_T *
* int_T *
* uint_T *
* byte_T *
*===========================================================================*/
#ifndef NO_FLOATS
#ifndef REAL_T
# ifdef REAL64_T
# define REAL_T real64_T
# else
# ifdef REAL32_T
# define REAL_T real32_T
# endif
# endif
#endif
#ifdef REAL_T
typedef REAL_T real_T;
#endif
#ifndef TIME_T
# ifdef REAL_T
# define TIME_T real_T
# endif
#endif
#ifdef TIME_T
typedef TIME_T time_T;
#endif
#endif /* NO_FLOATS */
#ifndef BOOLEAN_T
# if defined(UINT8_T)
# define BOOLEAN_T UINT8_T
# else
# define BOOLEAN_T unsigned int
# endif
#endif
typedef BOOLEAN_T boolean_T;
#ifndef CHARACTER_T
# define CHARACTER_T char
#endif
typedef CHARACTER_T char_T;
#ifndef INTEGER_T
# define INTEGER_T int
#endif
typedef INTEGER_T int_T;
#ifndef UINTEGER_T
# define UINTEGER_T unsigned
#endif
typedef UINTEGER_T uint_T;
#ifndef BYTE_T
# define BYTE_T unsigned char
#endif
typedef BYTE_T byte_T;
/*===========================================================================*
* Define Complex Structures *
*===========================================================================*/
#ifndef NO_FLOATS
#ifndef CREAL32_T
# ifdef REAL32_T
typedef struct {
real32_T re, im;
} creal32_T;
# define CREAL32_T creal32_T
# endif
#endif
#ifndef CREAL64_T
# ifdef REAL64_T
typedef struct {
real64_T re, im;
} creal64_T;
# define CREAL64_T creal64_T
# endif
#endif
#ifndef CREAL_T
# ifdef REAL_T
typedef struct {
real_T re, im;
} creal_T;
# define CREAL_T creal_T
# endif
#endif
#endif /* NO_FLOATS */
#ifndef CINT8_T
# ifdef INT8_T
typedef struct {
int8_T re, im;
} cint8_T;
# define CINT8_T cint8_T
# endif
#endif
#ifndef CUINT8_T
# ifdef UINT8_T
typedef struct {
uint8_T re, im;
} cuint8_T;
# define CUINT8_T cuint8_T
# endif
#endif
#ifndef CINT16_T
# ifdef INT16_T
typedef struct {
int16_T re, im;
} cint16_T;
# define CINT16_T cint16_T
# endif
#endif
#ifndef CUINT16_T
# ifdef UINT16_T
typedef struct {
uint16_T re, im;
} cuint16_T;
# define CUINT16_T cuint16_T
# endif
#endif
#ifndef CINT32_T
# ifdef INT32_T
typedef struct {
int32_T re, im;
} cint32_T;
# define CINT32_T cint32_T
# endif
#endif
#ifndef CUINT32_T
# ifdef UINT32_T
typedef struct {
uint32_T re, im;
} cuint32_T;
# define CUINT32_T cuint32_T
# endif
#endif
#ifndef CINT64_T
# ifdef INT64_T
typedef struct {
int64_T re, im;
} cint64_T;
# define CINT64_T cint64_T
# endif
#endif
#ifndef CUINT64_T
# ifdef UINT64_T
typedef struct {
uint64_T re, im;
} cuint64_T;
# define CUINT64_T cuint64_T
# endif
#endif
/*=======================================================================*
* Min and Max: *
* int8_T, int16_T, int32_T - signed 8, 16, or 32 bit integers *
* uint8_T, uint16_T, uint32_T - unsigned 8, 16, or 32 bit integers *
*=======================================================================*/
#define MAX_int8_T ((int8_T)(127)) /* 127 */
#define MIN_int8_T ((int8_T)(-128)) /* -128 */
#define MAX_uint8_T ((uint8_T)(255)) /* 255 */
#define MIN_uint8_T ((uint8_T)(0))
#define MAX_int16_T ((int16_T)(32767)) /* 32767 */
#define MIN_int16_T ((int16_T)(-32768)) /* -32768 */
#define MAX_uint16_T ((uint16_T)(65535)) /* 65535 */
#define MIN_uint16_T ((uint16_T)(0))
#define MAX_int32_T ((int32_T)(2147483647)) /* 2147483647 */
#define MIN_int32_T ((int32_T)(-2147483647-1)) /* -2147483648 */
#define MAX_uint32_T ((uint32_T)(0xFFFFFFFFU)) /* 4294967295 */
#define MIN_uint32_T ((uint32_T)(0))
#if defined(_MSC_VER) || (defined(__BORLANDC__) && __BORLANDC__ >= 0x530) \
|| (defined(__WATCOMC__) && __WATCOMC__ >= 1100) \
|| defined(__LCC64__)
# ifdef INT64_T
# define MAX_int64_T ((int64_T)(9223372036854775807LL))
# define MIN_int64_T ((int64_T)(-9223372036854775807LL-1LL))
# endif
# ifdef UINT64_T
# define MAX_uint64_T ((uint64_T)(0xFFFFFFFFFFFFFFFFULL))
# define MIN_uint64_T ((uint64_T)(0))
# endif
#else
# ifdef INT64_T
# ifdef INT_TYPE_64_IS_LONG
# define MAX_int64_T ((int64_T)(9223372036854775807L))
# define MIN_int64_T ((int64_T)(-9223372036854775807L-1L))
# else
# define MAX_int64_T ((int64_T)(9223372036854775807LL))
# define MIN_int64_T ((int64_T)(-9223372036854775807LL-1LL))
# endif
# endif
# ifdef UINT64_T
# ifdef INT_TYPE_64_IS_LONG
# define MAX_uint64_T ((uint64_T)(0xFFFFFFFFFFFFFFFFUL))
# define MIN_uint64_T ((uint64_T)(0))
# else
# define MAX_uint64_T ((uint64_T)(0xFFFFFFFFFFFFFFFFULL))
# define MIN_uint64_T ((uint64_T)(0))
# endif
# endif
#endif
#if (defined(_MSC_VER) && !defined(__clang__))
/* Conversion from unsigned __int64 to double is not implemented in Visual Studio
* and results in a compile error, thus the value must first be cast to
* signed __int64, and then to double.
*
* If the 64 bit int value is greater than 2^63-1, which is the signed int64 max,
* the macro below provides a workaround for casting a uint64 value to a double
* in windows.
*/
# define uint64_to_double(u) ( ((u) > _I64_MAX) ? \
(double)(__int64)((u) - _I64_MAX - 1) + (double)_I64_MAX + 1: \
(double)(__int64)(u) )
/* The following inline function should only be used in the macro double_to_uint64,
* as it only handles the specfic range of double between 2^63 and 2^64-1 */
__forceinline
uint64_T double_to_uint64_helper(double d) {
union double_to_uint64_union_type {
double dd;
uint64_T i64;
} di;
di.dd = d;
return (((di.i64 & 0x000fffffffffffff) | 0x0010000000000000) << 11);
}
/* The largest double value that can be cast to uint64 in windows is the
* signed int64 max, which is 2^63-1. The macro below provides
* a workaround for casting large double values to uint64 in windows.
*/
/* The magic number 18446744073709551616.0 is 2^64 */
/* The magic number 9223372036854775808.0 is 2^63 */
# define double_to_uint64(d) ( ((d) >= 18446744073709551616.0) ? \
0xffffffffffffffffULL : \
((d) >= 0.0) ? \
((d) >= 9223372036854775808.0) ? \
double_to_uint64_helper(d) : \
(unsigned __int64)(d) : \
0ULL )
#else
# define uint64_to_double(u) ((double)(u))
# if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__TICCSC__)
/* double_to_uint64 defined only for MSVC and UNIX */
# else
# define double_to_uint64(d) ( ((d) >= 18446744073709551616.0) ? \
(unsigned long long) 0xffffffffffffffffULL : \
((d) >= 0) ? (unsigned long long)(d) : (unsigned long long) 0 )
# endif
#endif
#if !defined(__cplusplus) && !defined(__bool_true_false_are_defined)
#ifndef _bool_T
#define _bool_T
typedef boolean_T bool;
#ifndef false
#define false (0)
#endif
#ifndef true
#define true (1)
#endif
#endif /* _bool_T */
#endif /* !__cplusplus */
/*
* This software assumes that the code is being compiled on a target using a
* 2's complement representation for signed integer values.
*/
#if ((SCHAR_MIN + 1) != -SCHAR_MAX)
#error "This code must be compiled using a 2's complement representation for signed integer values"
#endif
/*
* Maximum length of a MATLAB identifier (function/variable/model)
* including the null-termination character.
*/
#define TMW_NAME_LENGTH_MAX 64
/*
* Maximum values for indices and dimensions
*/
#include <stddef.h>
#ifdef MX_COMPAT_32
typedef int mwSize;
typedef int mwIndex;
typedef int mwSignedIndex;
#else
typedef size_t mwSize; /* unsigned pointer-width integer */
typedef size_t mwIndex; /* unsigned pointer-width integer */
typedef ptrdiff_t mwSignedIndex; /* a signed pointer-width integer */
#endif
/* for the individual dim */
#ifndef SLSIZE_SLINDEX
#define SLSIZE_SLINDEX
#ifdef INT_TYPE_64_IS_SUPPORTED
typedef int64_T SLIndex;
typedef int64_T SLSize;
#else
typedef int SLIndex;
typedef int SLSize;
#endif
#endif
/* for the total size */
#define SLIndexType size_t
#define INVALID_SIZET_VALUE (std::numeric_limits<SLIndexType>::max())
#define MAX_VALID_SIZET_VALUE (std::numeric_limits<SLIndexType>::max() -1)
#if (defined(_LP64) || defined(_WIN64)) && !defined(MX_COMPAT_32)
/* Currently 2^48 based on hardware limitations */
# define MWSIZE_MAX 281474976710655UL
# define MWINDEX_MAX 281474976710655UL
# define MWSINDEX_MAX 281474976710655L
# define MWSINDEX_MIN -281474976710655L
#else
# define MWSIZE_MAX 2147483647UL
# define MWINDEX_MAX 2147483647UL
# define MWSINDEX_MAX 2147483647L
# define MWSINDEX_MIN -2147483647L
#endif
#define MWSIZE_MIN 0UL
#define MWINDEX_MIN 0UL
/** UTF-16 character type */
#if (defined(__cplusplus) && (__cplusplus >= 201103L)) || (defined(_HAS_CHAR16_T_LANGUAGE_SUPPORT) && _HAS_CHAR16_T_LANGUAGE_SUPPORT)
typedef char16_t CHAR16_T;
#define U16_STRING_LITERAL_PREFIX u
#elif defined(_MSC_VER)
typedef wchar_t CHAR16_T;
#define U16_STRING_LITERAL_PREFIX L
#else
typedef UINT16_T CHAR16_T;
#endif
#endif /* __TMWTYPES__ */
#endif /* tmwtypes_h */

@ -0,0 +1,694 @@
/*
Copyright (c) 2019, Dimitri Diakopoulos All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBNYQUIST_COMMON_H
#define LIBNYQUIST_COMMON_H
#include <memory>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <stdint.h>
#include <cassert>
#include <type_traits>
#include <numeric>
#include <array>
#include <map>
#include <random>
namespace nqr
{
/////////////////
// Util Macros //
/////////////////
#define F_ROUND(x) ((x) > 0 ? (x) + 0.5f : (x) - 0.5f)
#define D_ROUND(x) ((x) > 0 ? (x) + 0.5 : (x) - 0.5)
#define NO_COPY(C) C(const C &) = delete; C & operator = (const C &) = delete
#define NO_MOVE(C) NO_COPY(C); C(C &&) = delete; C & operator = (const C &&) = delete
///////////////////////
// Endian Operations //
///////////////////////
#if defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || defined(_M_IX86)
#define CPU_X86 1
#endif
#if defined(__arm__) || defined(_M_ARM)
#define CPU_ARM 1
#endif
#if defined(CPU_X86) && defined(CPU_ARM)
#error CPU_X86 and CPU_ARM both defined.
#endif
#if !defined(ARCH_CPU_BIG_ENDIAN) && !defined(ARCH_CPU_LITTLE_ENDIAN)
#if CPU_X86 || CPU_ARM || (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
#define ARCH_CPU_LITTLE_ENDIAN
#elif defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
#define ARCH_CPU_BIG_ENDIAN
#else
#error ARCH_CPU_BIG_ENDIAN or ARCH_CPU_LITTLE_ENDIAN should be defined.
#endif
#endif
#if defined(ARCH_CPU_BIG_ENDIAN) && defined(ARCH_CPU_LITTLE_ENDIAN)
#error ARCH_CPU_BIG_ENDIAN and ARCH_CPU_LITTLE_ENDIAN both defined.
#endif
static inline uint16_t Swap16(uint16_t value)
{
return (uint16_t)((value >> 8) | (value << 8));
}
static inline uint32_t Swap24(uint32_t value)
{
return (((value & 0x00ff0000) >> 16) |
((value & 0x0000ff00)) |
((value & 0x000000ff) << 16)) & 0x00FFFFFF;
}
static inline uint32_t Swap32(uint32_t value)
{
return (((value & 0x000000ff) << 24) |
((value & 0x0000ff00) << 8) |
((value & 0x00ff0000) >> 8) |
((value & 0xff000000) >> 24));
}
static inline uint64_t Swap64(uint64_t value)
{
return (((value & 0x00000000000000ffLL) << 56) |
((value & 0x000000000000ff00LL) << 40) |
((value & 0x0000000000ff0000LL) << 24) |
((value & 0x00000000ff000000LL) << 8) |
((value & 0x000000ff00000000LL) >> 8) |
((value & 0x0000ff0000000000LL) >> 24) |
((value & 0x00ff000000000000LL) >> 40) |
((value & 0xff00000000000000LL) >> 56));
}
template<typename T>
inline bool isOdd(const T x)
{
return (x & 0x1);
}
#ifdef ARCH_CPU_LITTLE_ENDIAN
#define Read16(n) (n)
#define Read24(n) (n)
#define Read32(n) (n)
#define Read64(n) (n)
#define Write16(n) (n)
#define Write24(n) (n)
#define Write32(n) (n)
#define Write64(n) (n)
#else
#define Read16(n) Swap16(n)
#define Read24(n) Swap24(n)
#define Read32(n) Swap32(n)
#define Read64(n) Swap64(n)
#define Write16(n) Swap16(n)
#define Write24(n) Swap24(n)
#define Write32(n) Swap32(n)
#define Write64(n) Swap64(n)
#endif
inline uint64_t Pack(uint32_t a, uint32_t b)
{
uint64_t tmp = (uint64_t) b << 32 | (uint64_t) a;
#ifdef ARCH_CPU_LITTLE_ENDIAN
return tmp;
#else
return Swap64(tmp);
#endif
}
inline uint32_t Pack(uint16_t a, uint16_t b)
{
uint32_t tmp = (uint32_t) b << 16 | (uint32_t) a;
#ifdef ARCH_CPU_LITTLE_ENDIAN
return tmp;
#else
return Swap32(tmp);
#endif
}
inline uint16_t Pack(uint8_t a, uint8_t b)
{
uint16_t tmp = (uint16_t) b << 8 | (uint16_t) a;
#ifdef ARCH_CPU_LITTLE_ENDIAN
return tmp;
#else
return Swap16(tmp);
#endif
}
// http://www.dsprelated.com/showthread/comp.dsp/136689-1.php
inline int32_t Pack(uint8_t a, uint8_t b, uint8_t c)
{
// uint32_t tmp = ((c & 0x80) ? (0xFF << 24) : 0x00 << 24) | (c << 16) | (b << 8) | (a << 0); // alternate method
int32_t x = (c << 16) | (b << 8) | (a << 0);
auto sign_extended = (x) | (!!((x) & 0x800000) * 0xff000000);
#ifdef ARCH_CPU_LITTLE_ENDIAN
return sign_extended;
#else
Swap32(sign_extended);
#endif
}
inline std::array<uint8_t, 3> Unpack(uint32_t a)
{
static std::array<uint8_t, 3> output;
#ifdef ARCH_CPU_LITTLE_ENDIAN
output[0] = a >> 0;
output[1] = a >> 8;
output[2] = a >> 16;
#else
output[0] = a >> 16;
output[1] = a >> 8;
output[2] = a >> 0;
#endif
return output;
}
//////////////////////////
// Resampling Utilities //
//////////////////////////
// This is a naieve implementation of a resampling filter where a lerp is used as a bad low-pass.
// It very far from the ideal case and should be used with caution (or not at all) on signals that matter.
// It is included here to upsample 44.1k to 48k for the purposes of microphone input => Opus, where the the
// nominal frequencies of speech are particularly far from Nyquist.
inline void linear_resample(const double rate, const std::vector<float> & input, std::vector<float> & output, const uint32_t samplesToProcess)
{
double virtualReadIndex = 0;
double a, b, i, sample;
uint32_t n = samplesToProcess - 1;
while (n--)
{
uint32_t readIndex = static_cast<uint32_t>(virtualReadIndex);
i = virtualReadIndex - readIndex;
a = input[readIndex + 0];
b = input[readIndex + 1];
sample = (1.0 - i) * a + i * b; // linear interpolate
output.push_back(static_cast<float>(sample));
virtualReadIndex += rate;
}
}
inline double sample_hermite_4p_3o(double x, double * y)
{
static double c0, c1, c2, c3;
c0 = y[1];
c1 = (1.0 / 2.0)*(y[2] - y[0]);
c2 = (y[0] - (5.0 / 2.0)*y[1]) + (2.0*y[2] - (1.0 / 2.0)*y[3]);
c3 = (1.0 / 2.0)*(y[3] - y[0]) + (3.0 / 2.0)*(y[1] - y[2]);
return ((c3*x + c2)*x + c1)*x + c0;
}
inline void hermite_resample(const double rate, const std::vector<float> & input, std::vector<float> & output, const uint32_t samplesToProcess)
{
double virtualReadIndex = 1;
double i, sample;
uint32_t n = samplesToProcess - 1;
while (n--)
{
uint32_t readIndex = static_cast<uint32_t>(virtualReadIndex);
i = virtualReadIndex - readIndex;
double samps[4] = { input[readIndex - 1], input[readIndex], input[readIndex + 1], input[readIndex + 2] };
sample = sample_hermite_4p_3o(i, samps); // cubic hermite interpolate over 4 samples
output.push_back(static_cast<float>(sample));
virtualReadIndex += rate;
}
}
//////////////////////////
// Conversion Utilities //
//////////////////////////
enum DitherType
{
DITHER_NONE,
DITHER_TRIANGLE
};
class Dither
{
std::uniform_real_distribution<float> distribution;
std::mt19937 gen;
float previous;
DitherType d;
public:
Dither(DitherType d) : distribution(-0.5f, +0.5f), previous(0.f), d(d) {}
float operator()(float s)
{
if (d == DITHER_TRIANGLE)
{
const float value = distribution(gen);
s = s + value - previous;
previous = value;
return s;
}
else return s;
}
};
// Signed maxes, defined for readabilty/convenience
#define NQR_INT16_MAX 32767.f
#define NQR_INT24_MAX 8388608.f
#define NQR_INT32_MAX 2147483648.f
static const float NQR_BYTE_2_FLT = 1.0f / 127.0f;
#define int8_to_float32(s) ((float) (s) * NQR_BYTE_2_FLT)
#define uint8_to_float32(s)(((float) (s) - 128) * NQR_BYTE_2_FLT)
#define int16_to_float32(s) ((float) (s) / NQR_INT16_MAX)
#define int24_to_float32(s) ((float) (s) / NQR_INT24_MAX)
#define int32_to_float32(s) ((float) (s) / NQR_INT32_MAX)
#define float32_to_int8(s) (float) (s * 127.f)
#define float32_to_uint8(s) (float) ((s * 127.f) + 128)
#define float32_to_int16(s) (float) (s * NQR_INT16_MAX)
#define float32_to_int24(s) (float) (s * NQR_INT24_MAX)
#define float32_to_int32(s) (float) (s * NQR_INT32_MAX)
//@todo add 12, 20 for flac
enum PCMFormat
{
PCM_U8,
PCM_S8,
PCM_16,
PCM_24,
PCM_32,
PCM_64,
PCM_FLT,
PCM_DBL,
PCM_END
};
template<class T> T clamp(T a, T mn, T mx) { return std::max(std::min(a, mx), mn); }
// Src data is aligned to PCMFormat
// @todo normalize?
void ConvertToFloat32(float * dst, const uint8_t * src, const size_t N, PCMFormat f);
// Src data is always aligned to 4 bytes (WavPack, primarily)
void ConvertToFloat32(float * dst, const int32_t * src, const size_t N, PCMFormat f);
// Src data is always aligned to 2 bytes (IMA ADPCM, primarily)
void ConvertToFloat32(float * dst, const int16_t * src, const size_t N, PCMFormat f);
void ConvertFromFloat32(uint8_t * dst, const float * src, const size_t N, PCMFormat f, DitherType t = DITHER_NONE);
int GetFormatBitsPerSample(PCMFormat f);
PCMFormat MakeFormatForBits(int bits, bool floatingPt, bool isSigned);
//////////////////////////
// User Data + File Ops //
//////////////////////////
struct AudioData
{
int channelCount;
int sampleRate;
double lengthSeconds;
size_t frameSize; // channels * bits per sample
std::vector<float> samples;
PCMFormat sourceFormat;
//@todo: add field: channel layout
//@todo: add field: lossy / lossless
//@todo: audio data loaded (for metadata only)
//@todo: bitrate (if applicable)
//@todo: original sample rate (if applicable)
};
struct StreamableAudioData : public AudioData
{
//@todo: add field: is this format streamable?
//@todo: hold file handle
};
struct NyquistFileBuffer
{
std::vector<uint8_t> buffer;
size_t size;
};
NyquistFileBuffer ReadFile(const std::string & pathToFile);
////////////////////
// Encoding Utils //
////////////////////
struct EncoderParams
{
int channelCount;
PCMFormat targetFormat;
DitherType dither;
};
enum EncoderError
{
NoError,
InsufficientSampleData,
FileIOError,
UnsupportedSamplerate,
UnsupportedChannelConfiguration,
UnsupportedBitdepth,
UnsupportedChannelMix,
BufferTooBig,
};
//////////////////////
// Wav Format Utils //
//////////////////////
enum WaveFormatCode
{
FORMAT_UNKNOWN = 0x0, // Unknown Wave Format
FORMAT_PCM = 0x1, // PCM Format
FORMAT_ADPCM = 0x2, // Microsoft ADPCM Format
FORMAT_IEEE = 0x3, // IEEE float/double
FORMAT_ALAW = 0x6, // 8-bit ITU-T G.711 A-law
FORMAT_MULAW = 0x7, // 8-bit ITU-T G.711 µ-law
FORMAT_IMA_ADPCM = 0x11, // IMA ADPCM Format
FORMAT_EXT = 0xFFFE // Set via subformat
};
struct RiffChunkHeader
{
uint32_t id_riff; // Chunk ID: 'RIFF'
uint32_t file_size; // Entire file in bytes
uint32_t id_wave; // Chunk ID: 'WAVE'
};
struct WaveChunkHeader
{
uint32_t fmt_id; // Chunk ID: 'fmt '
uint32_t chunk_size; // Size in bytes
uint16_t format; // Format code
uint16_t channel_count; // Num interleaved channels
uint32_t sample_rate; // SR
uint32_t data_rate; // Data rate
uint16_t frame_size; // 1 frame = channels * bits per sample (also known as block align)
uint16_t bit_depth; // Bits per sample
};
struct BextChunk
{
uint32_t fmt_id; // Chunk ID: 'bext'
uint32_t chunk_size; // Size in bytes
uint8_t description[256]; // Description of the sound (ascii)
uint8_t origin[32]; // Name of the originator (ascii)
uint8_t origin_ref[32]; // Reference of the originator (ascii)
uint8_t orgin_date[10]; // yyyy-mm-dd (ascii)
uint8_t origin_time[8]; // hh-mm-ss (ascii)
uint64_t time_ref; // First sample count since midnight
uint32_t version; // Version of the BWF
uint8_t uimd[64]; // Byte 0 of SMPTE UMID
uint8_t reserved[188]; // 190 bytes, reserved for future use & set to NULL
};
struct FactChunk
{
uint32_t fact_id; // Chunk ID: 'fact'
uint32_t chunk_size; // Size in bytes
uint32_t sample_length; // number of samples per channel
};
struct ExtensibleData
{
uint16_t size;
uint16_t valid_bits_per_sample;
uint32_t channel_mask;
struct GUID
{
uint32_t data0;
uint16_t data1;
uint16_t data2;
uint16_t data3;
uint8_t data4[6];
};
};
template<class C, class R>
std::basic_ostream<C,R> & operator << (std::basic_ostream<C,R> & a, const WaveChunkHeader & b)
{
return a <<
"Format ID:\t\t" << b.fmt_id <<
"\nChunk Size:\t\t" << b.chunk_size <<
"\nFormat Code:\t\t" << b.format <<
"\nChannels:\t\t" << b.channel_count <<
"\nSample Rate:\t\t" << b.sample_rate <<
"\nData Rate:\t\t" << b.data_rate <<
"\nFrame Size:\t\t" << b.frame_size <<
"\nBit Depth:\t\t" << b.bit_depth << std::endl;
}
//@todo expose speaker/channel/layout masks in the API:
enum SpeakerChannelMask
{
SPEAKER_FRONT_LEFT = 0x00000001,
SPEAKER_FRONT_RIGHT = 0x00000002,
SPEAKER_FRONT_CENTER = 0x00000004,
SPEAKER_LOW_FREQUENCY = 0x00000008,
SPEAKER_BACK_LEFT = 0x00000010,
SPEAKER_BACK_RIGHT = 0x00000020,
SPEAKER_FRONT_LEFT_OF_CENTER = 0x00000040,
SPEAKER_FRONT_RIGHT_OF_CENTER = 0x00000080,
SPEAKER_BACK_CENTER = 0x00000100,
SPEAKER_SIDE_LEFT = 0x00000200,
SPEAKER_SIDE_RIGHT = 0x00000400,
SPEAKER_TOP_CENTER = 0x00000800,
SPEAKER_TOP_FRONT_LEFT = 0x00001000,
SPEAKER_TOP_FRONT_CENTER = 0x00002000,
SPEAKER_TOP_FRONT_RIGHT = 0x00004000,
SPEAKER_TOP_BACK_LEFT = 0x00008000,
SPEAKER_TOP_BACK_CENTER = 0x00010000,
SPEAKER_TOP_BACK_RIGHT = 0x00020000,
SPEAKER_RESERVED = 0x7FFC0000,
SPEAKER_ALL = 0x80000000
};
enum SpeakerLayoutMask
{
SPEAKER_MONO = (SPEAKER_FRONT_CENTER),
SPEAKER_STEREO = (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT),
SPEAKER_2POINT1 = (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY),
SPEAKER_SURROUND = (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_BACK_CENTER),
SPEAKER_QUAD = (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT),
SPEAKER_4POINT1 = (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT),
SPEAKER_5POINT1 = (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT),
SPEAKER_7POINT1 = (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_FRONT_LEFT_OF_CENTER | SPEAKER_FRONT_RIGHT_OF_CENTER),
SPEAKER_5POINT1_SURROUND = (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT),
SPEAKER_7POINT1_SURROUND = (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT),
};
//@todo verify mask values
inline int ComputeChannelMask(const size_t channels)
{
switch (channels)
{
case 1: return SPEAKER_MONO;
case 2: return SPEAKER_STEREO;
case 3: return SPEAKER_2POINT1;
case 4: return SPEAKER_QUAD;
case 5: return SPEAKER_4POINT1;
case 6: return SPEAKER_5POINT1;
default: return -1;
}
}
/////////////////////
// Chunk utilities //
/////////////////////
struct ChunkHeaderInfo
{
uint32_t offset; // Byte offset into chunk
uint32_t size; // Size of the chunk in bytes
};
inline uint32_t GenerateChunkCode(uint8_t a, uint8_t b, uint8_t c, uint8_t d)
{
#ifdef ARCH_CPU_LITTLE_ENDIAN
return ((uint32_t)((a) | ((b) << 8) | ((c) << 16) | (((uint32_t)(d)) << 24)));
#else
return ((uint32_t)((((uint32_t)(a)) << 24) | ((b) << 16) | ((c) << 8) | (d)));
#endif
}
inline char * GenerateChunkCodeChar(uint8_t a, uint8_t b, uint8_t c, uint8_t d)
{
auto chunk = GenerateChunkCode(a, b, c, d);
char * outArr = new char[4];
uint32_t t = 0x000000FF;
for (size_t i = 0; i < 4; i++)
{
outArr[i] = chunk & t;
chunk >>= 8;
}
return outArr;
}
inline ChunkHeaderInfo ScanForChunk(const std::vector<uint8_t> & fileData, uint32_t chunkMarker)
{
// D[n] aligned to 16 bytes now
const uint16_t * d = reinterpret_cast<const uint16_t *>(fileData.data());
for (size_t i = 0; i < fileData.size() / sizeof(uint16_t); i++)
{
// This will be in machine endianess
uint32_t m = Pack(Read16(d[i]), Read16(d[i + 1]));
if (m == chunkMarker)
{
uint32_t cSz = Pack(Read16(d[i + 2]), Read16(d[i + 3]));
return { (uint32_t(i * sizeof(uint16_t))), cSz }; // return i in bytes to the start of the data
}
else continue;
}
return { 0, 0 };
};
inline WaveChunkHeader MakeWaveHeader(const EncoderParams param, const int sampleRate)
{
WaveChunkHeader header;
int bitdepth = GetFormatBitsPerSample(param.targetFormat);
header.fmt_id = GenerateChunkCode('f', 'm', 't', ' ');
header.chunk_size = 16;
header.format = (param.targetFormat <= PCMFormat::PCM_32) ? WaveFormatCode::FORMAT_PCM : WaveFormatCode::FORMAT_IEEE;
header.channel_count = param.channelCount;
header.sample_rate = sampleRate;
header.data_rate = sampleRate * param.channelCount * (bitdepth / 8);
header.frame_size = param.channelCount * (bitdepth / 8);
header.bit_depth = bitdepth;
return header;
}
// @todo expose this in the FLAC API
inline std::map<int, std::string> GetFlacQualityTable()
{
return {
{ 0, "0 (Fastest)" },
{ 1, "1" },
{ 2, "2" },
{ 3, "3" },
{ 4, "4" },
{ 5, "5 (Default)" },
{ 6, "6" },
{ 7, "7" },
{ 8, "8 (Highest)" },
};
}
template <typename T>
inline void DeinterleaveStereo(T * c1, T * c2, T const * src, size_t count)
{
auto src_end = src + count;
while (src != src_end)
{
*c1 = src[0];
*c2 = src[1];
c1++;
c2++;
src += 2;
}
}
template<typename T>
void InterleaveChannels(const T * src, T * dest, size_t numFramesPerChannel, size_t numChannels, size_t N)
{
for (size_t ch = 0; ch < numChannels; ch++)
{
size_t x = ch;
const T * srcChannel = &src[ch * numFramesPerChannel];
for (size_t i = 0; i < N; i++)
{
dest[x] = srcChannel[i];
x += numChannels;
}
}
}
template<typename T>
void DeinterleaveChannels(const T * src, T * dest, size_t numFramesPerChannel, size_t numChannels, size_t N)
{
for (size_t ch = 0; ch < numChannels; ch++)
{
size_t x = ch;
T *destChannel = &dest[ch * numFramesPerChannel];
for (size_t i = 0; i < N; i++)
{
destChannel[i] = (T)src[x];
x += numChannels;
}
}
}
template <typename T>
void StereoToMono(const T * src, T * dest, size_t N)
{
for (size_t i = 0, j = 0; i < N; i += 2, ++j)
{
dest[j] = (src[i] + src[i + 1]) / 2.0f;
}
}
template <typename T>
void MonoToStereo(const T * src, T * dest, size_t N)
{
for (size_t i = 0, j = 0; i < N; ++i, j += 2)
{
dest[j] = src[i];
dest[j + 1] = src[i];
}
}
inline void TrimSilenceInterleaved(std::vector<float> & buffer, float v, bool fromFront, bool fromEnd)
{
//@todo implement me!
}
} // end namespace nqr
#endif

@ -0,0 +1,136 @@
/*
Copyright (c) 2019, Dimitri Diakopoulos All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef AUDIO_DECODER_H
#define AUDIO_DECODER_H
#include "Common.h"
#include <utility>
#include <map>
#include <memory>
#include <exception>
namespace nqr
{
struct BaseDecoder
{
virtual void LoadFromPath(nqr::AudioData * data, const std::string & path) = 0;
virtual void LoadFromBuffer(nqr::AudioData * data, const std::vector<uint8_t> & memory) = 0;
virtual std::vector<std::string> GetSupportedFileExtensions() = 0;
virtual ~BaseDecoder() {}
};
typedef std::pair< std::string, std::shared_ptr<nqr::BaseDecoder> > DecoderPair;
class NyquistIO
{
std::string ParsePathForExtension(const std::string & path) const;
std::shared_ptr<nqr::BaseDecoder> GetDecoderForExtension(const std::string & ext);
void BuildDecoderTable();
void AddDecoderToTable(std::shared_ptr<nqr::BaseDecoder> decoder);
std::map< std::string, std::shared_ptr<BaseDecoder> > decoderTable;
NO_MOVE(NyquistIO);
public:
NyquistIO();
~NyquistIO();
void Load(AudioData * data, const std::string & path);
void Load(AudioData * data, const std::vector<uint8_t> & buffer);
void Load(AudioData * data, const std::string & extension, const std::vector<uint8_t> & buffer);
bool IsFileSupported(const std::string & path) const;
};
struct UnsupportedExtensionEx : public std::runtime_error { UnsupportedExtensionEx() : std::runtime_error("Unsupported file extension") {} };
struct LoadPathNotImplEx : public std::runtime_error { LoadPathNotImplEx() : std::runtime_error("Loading from path not implemented") {} };
struct LoadBufferNotImplEx : public std::runtime_error { LoadBufferNotImplEx() : std::runtime_error("Loading from buffer not implemented") {} };
struct WavDecoder final : public nqr::BaseDecoder
{
WavDecoder() = default;
virtual ~WavDecoder() {}
virtual void LoadFromPath(nqr::AudioData * data, const std::string & path) override final;
virtual void LoadFromBuffer(nqr::AudioData * data, const std::vector<uint8_t> & memory) override final;
virtual std::vector<std::string> GetSupportedFileExtensions() override final;
};
struct WavPackDecoder final : public nqr::BaseDecoder
{
WavPackDecoder() = default;
virtual ~WavPackDecoder() override {};
virtual void LoadFromPath(nqr::AudioData * data, const std::string & path) override final;
virtual void LoadFromBuffer(nqr::AudioData * data, const std::vector<uint8_t> & memory) override final;
virtual std::vector<std::string> GetSupportedFileExtensions() override final;
};
struct VorbisDecoder final : public nqr::BaseDecoder
{
VorbisDecoder() = default;
virtual ~VorbisDecoder() override {}
virtual void LoadFromPath(nqr::AudioData * data, const std::string & path) override final;
virtual void LoadFromBuffer(nqr::AudioData * data, const std::vector<uint8_t> & memory) override final;
virtual std::vector<std::string> GetSupportedFileExtensions() override final;
};
struct OpusDecoder final : public nqr::BaseDecoder
{
OpusDecoder() = default;
virtual ~OpusDecoder() override {}
virtual void LoadFromPath(nqr::AudioData * data, const std::string & path) override final;
virtual void LoadFromBuffer(nqr::AudioData * data, const std::vector<uint8_t> & memory) override final;
virtual std::vector<std::string> GetSupportedFileExtensions() override final;
};
struct MusepackDecoder final : public nqr::BaseDecoder
{
MusepackDecoder() = default;
virtual ~MusepackDecoder() override {};
virtual void LoadFromPath(nqr::AudioData * data, const std::string & path) override final;
virtual void LoadFromBuffer(nqr::AudioData * data, const std::vector<uint8_t> & memory) override final;
virtual std::vector<std::string> GetSupportedFileExtensions() override final;
};
struct Mp3Decoder final : public nqr::BaseDecoder
{
Mp3Decoder() = default;
virtual ~Mp3Decoder() override {};
virtual void LoadFromPath(nqr::AudioData * data, const std::string & path) override final;
virtual void LoadFromBuffer(nqr::AudioData * data, const std::vector<uint8_t> & memory) override final;
virtual std::vector<std::string> GetSupportedFileExtensions() override final;
};
struct FlacDecoder final : public nqr::BaseDecoder
{
FlacDecoder() = default;
virtual ~FlacDecoder() override {}
virtual void LoadFromPath(nqr::AudioData * data, const std::string & path) override final;
virtual void LoadFromBuffer(nqr::AudioData * data, const std::vector<uint8_t> & memory) override final;
virtual std::vector<std::string> GetSupportedFileExtensions() override final;
};
} // end namespace nqr
#endif

@ -0,0 +1,44 @@
/*
Copyright (c) 2019, Dimitri Diakopoulos All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef NYQUIST_ENCODERS_H
#define NYQUIST_ENCODERS_H
#include "Common.h"
namespace nqr
{
// A simplistic encoder that takes a buffer of audio, conforms it to the user's
// EncoderParams preference, and writes to disk. Be warned, does not support resampling!
// @todo support dithering, samplerate conversion, etc.
int encode_wav_to_disk(const EncoderParams p, const AudioData * d, const std::string & path);
// Assume data adheres to EncoderParams, except for bit depth and fmt which are re-formatted
// to satisfy the Ogg/Opus spec.
int encode_opus_to_disk(const EncoderParams p, const AudioData * d, const std::string & path);
} // end namespace nqr
#endif // end NYQUIST_ENCODERS_H

@ -1,35 +1,39 @@
QT += core gui
QT += core gui multimedia network concurrent
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11
CONFIG+=sdk_no_version_check
# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
CONFIG += warn_off
SOURCES += \
about.cpp \
analyzer.cpp \
camp.cpp \
campmode.cpp \
cdac.cpp \
csong.cpp \
cspeaker.cpp \
delegatepathitem.cpp \
library.cpp \
main.cpp \
mainwindow.cpp
HEADERS += \
about.h \
analyzer.h \
camp.h \
campmode.h \
cdac.h \
csong.h \
cspeaker.h \
defines.h \
delegatepathitem.h \
library.h \
mainwindow.h
FORMS += \
about.ui \
analyzer.ui \
library.ui \
mainwindow.ui
@ -50,3 +54,48 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin
RESOURCES += \
resources.qrc
VERSION=1.4.0
QMAKE_TARGET_PRODUCT = "PA-Calculator"
QMAKE_TARGET_COMPANY = "DKM-Tech"
QMAKE_TARGET_COPYRIGHT = "Copyright (c) 2023 by Alexander Diamadis"
commit = $$system(git rev-parse --short=8 HEAD)
DEFINES += APP_VERSION=\"\\\"$${VERSION}\\\"\" \
APP_PRODUCT=\"\\\"$${QMAKE_TARGET_PRODUCT}\\\"\" \
APP_COMPANY=\"\\\"$${QMAKE_TARGET_COMPANY}\\\"\" \
APP_COMMIT=\"\\\"$${commit}\\\"\" \
APP_COPYRIGHT=\"\\\"$${QMAKE_TARGET_COPYRIGHT}\\\"\"
# Library Libnyquist
INCLUDEPATH += $$PWD/../libs/libnyquist/include
DEPENDPATH += $$PWD/../libs/libnyquist/include
macx: LIBS += -L$$PWD/../libs/libnyquist/lib-macx/ -llibnyquist
macx: PRE_TARGETDEPS += $$PWD/../libs/libnyquist/lib-macx/liblibnyquist.a
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../libs/libnyquist/lib-win32/ -llibnyquist
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../libs/libnyquist/lib-win32/ -llibnyquist_d
macx: LIBS += -L$$PWD/../libs/libnyquist/lib-macx/ -llibwavpack
macx: PRE_TARGETDEPS += $$PWD/../libs/libnyquist/lib-macx/liblibwavpack.a
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../libs/libnyquist/lib-win32/ -llibwavpack
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../libs/libnyquist/lib-win32/ -llibwavpack_d
# Library getLoudness
macx: INCLUDEPATH += $$PWD/../libs/getLoudness/macx
macx: DEPENDPATH += $$PWD/../libs/getLoudness/macx
macx: LIBS += -L$$PWD/../libs/getLoudness/macx/ -lgetLoudness
macx: PRE_TARGETDEPS += $$PWD/../libs/getLoudness/macx/libgetLoudness.a
win32: INCLUDEPATH += $$PWD/../libs/getLoudness/win32/
win32: DEPENDPATH += $$PWD/../libs/getLoudness/win32/
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../libs/getLoudness/win32/ -lgetLoudness
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../libs/getLoudness/win32/ -lgetLoudness_d

@ -1,15 +1,17 @@
#include "about.h"
#include "ui_about.h"
#include "defines.h"
about::about(QWidget *parent) :
QDialog(parent),
ui(new Ui::about)
{
ui->setupUi(this);
ui->label_nameVersion->setText(QString("PA Calculator ")+QString(PAC_VERSION));
ui->label_nameVersion->setText(QString("PA Calculator ")+APP_VERSION);
ui->label_QT_Version->setText(QString("Based on QT ")+QString(QT_VERSION_STR)+QString(" (")+QSysInfo::prettyProductName()+QString(", ")+QSysInfo::currentCpuArchitecture()+QString(")"));
ui->label_Copyright->setText(APP_COPYRIGHT);
ui->label_build->setText(QString("Build: ")+QString::fromStdString(__DATE__) +QString(" (")+APP_COMMIT+QString(")"));
}
about::~about()

@ -10,6 +10,24 @@
<height>307</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>639</width>
<height>307</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>639</width>
<height>307</height>
</size>
</property>
<property name="windowTitle">
<string>About PA Calculator</string>
</property>
@ -33,7 +51,7 @@
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<y>20</y>
<width>256</width>
<height>256</height>
</rect>
@ -59,14 +77,13 @@
<rect>
<x>290</x>
<y>10</y>
<width>231</width>
<height>21</height>
<width>331</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>21</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
@ -78,8 +95,8 @@
<property name="geometry">
<rect>
<x>290</x>
<y>70</y>
<width>271</width>
<y>50</y>
<width>321</width>
<height>16</height>
</rect>
</property>
@ -87,6 +104,83 @@
<string>Based on QT </string>
</property>
</widget>
<widget class="QLabel" name="label_Copyright">
<property name="geometry">
<rect>
<x>290</x>
<y>110</y>
<width>321</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Copyright (C) 2021 Alexander Diamadis</string>
</property>
</widget>
<widget class="QTextBrowser" name="textBrowser">
<property name="geometry">
<rect>
<x>290</x>
<y>170</y>
<width>341</width>
<height>91</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>7</pointsize>
</font>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;meta charset=&quot;utf-8&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Segoe UI'; font-size:7pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#ffffff;&quot;&gt;&lt;a name=&quot;license-text&quot;&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'Consolas','Monaco','Courier','monospace'; font-size:8pt; color:#5c5855; background-color:#ffffff;&quot;&gt;T&lt;/span&gt;&lt;span style=&quot; font-family:'Consolas','Monaco','Courier','monospace'; font-size:8pt; color:#5c5855; background-color:#ffffff;&quot;&gt;his 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.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Consolas','Monaco','Courier','monospace'; font-size:8pt; color:#5c5855; background-color:#ffffff;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#ffffff;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Monaco','Courier','monospace'; font-size:8pt; color:#5c5855; background-color:#ffffff;&quot;&gt;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.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Consolas','Monaco','Courier','monospace'; font-size:8pt; color:#5c5855; background-color:#ffffff;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#ffffff;&quot;&gt;&lt;span style=&quot; font-family:'Consolas','Monaco','Courier','monospace'; font-size:8pt; color:#5c5855; background-color:#ffffff;&quot;&gt;You should have received a copy of the GNU General Public License along with this program. If not, see &lt;/span&gt;&lt;a href=&quot;https://www.gnu.org/licenses/&quot;&gt;&lt;span style=&quot; font-family:'Courier New'; font-size:8pt; text-decoration: underline; color:#0000ff;&quot;&gt;https://www.gnu.org/licenses/&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'Consolas','Monaco','Courier','monospace'; font-size:8pt; color:#5c5855; background-color:#ffffff;&quot;&gt;.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="openLinks">
<bool>false</bool>
</property>
</widget>
<widget class="QLabel" name="label_build">
<property name="geometry">
<rect>
<x>290</x>
<y>80</y>
<width>321</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Build: </string>
</property>
</widget>
<widget class="QLabel" name="label_git">
<property name="geometry">
<rect>
<x>290</x>
<y>140</y>
<width>321</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Git-Repository: &lt;a href=&quot;https://git.aldiserver.de/DKM-Tech/pa-calculator&quot;&gt;git.aldiserver.de/DKM-Tech/pa-calculator&lt;/a&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</widget>
<resources>
<include location="resources.qrc"/>

@ -0,0 +1,94 @@
#include "analyzer.h"
#include "ui_analyzer.h"
#include "QFileDialog"
#include <QStandardPaths>
#include <QString>
#include <QDirIterator>
#include <QFileInfo>
#include <QDebug>
#include <QStringList>
#include "delegatepathitem.h"
analyzer::analyzer(QWidget *parent) :
QDialog(parent),
ui(new Ui::analyzer)
{
ui->setupUi(this);
countSongs=0;
firstAnalysisDone=false;
ui->tableWidget->setHorizontalHeaderLabels(QStringList() << "Filename"<<"Loudness in dBFS"<<"Peaklevel in dBFS"<<"corrected peak in dBFS"<<"required Correction");
ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
ui->tableWidget->horizontalHeader()->setSectionResizeMode(0,QHeaderView::Stretch);
}
analyzer::~analyzer()
{
delete ui;
if (countSongs>0){
delete [] songList;
}
}
void analyzer::on_pushButton_clicked()
{
QString folder=QFileDialog::getExistingDirectory(this,"Select the folder that is containing audio",QStandardPaths::writableLocation(QStandardPaths::DownloadLocation));
ui->lineEdit_path->setText(folder);
}
void analyzer::on_pushButton_calculate_clicked()
{
ui->pushButton_calculate->setDisabled(true);
ui->doubleSpinBox_preferredLoudness->setDisabled(true);
if (countSongs>0){
delete [] songList;
}
countSongs=0;
QDirIterator it_counter(ui->lineEdit_path->text(), {"*.mp3", "*.wav", "*.flac", "*.ogg" ,"*.opus", "*.wv", "*.mpc"}, QDir::NoFilter, QDirIterator::Subdirectories);
while (it_counter.next()!="") {
countSongs+=1;
}
QDirIterator it(ui->lineEdit_path->text(), {"*.mp3", "*.wav", "*.flac", "*.ogg" ,"*.opus", "*.wv", "*.mpc"}, QDir::NoFilter, QDirIterator::Subdirectories);
unsigned int k=0;
songList=new csong[countSongs];
float preferedLoudness=ui->doubleSpinBox_preferredLoudness->value();
ui->label_progress->setText(QString("0 of ")+QString::number(countSongs)+QString(" songs analyzed"));
ui->progressBar->setMaximum(countSongs);
while (it.hasNext()) {
QFileInfo f(it.next());
songList[k].setPath(f.absoluteFilePath());
songList[k].analyze(preferedLoudness);
k++;
ui->progressBar->setValue(k);
ui->label_progress->setText(QString::number(k)+QString(" of ")+QString::number(countSongs)+QString(" songs analyzed"));
QApplication::processEvents();
}
ui->label_progress->setText(QString("done"));
ui->tableWidget->setSortingEnabled(false);
ui->tableWidget->setRowCount(countSongs);
for (unsigned int i=0;i<countSongs;i++){
for (int k=0;k<5;k++){
ui->tableWidget->setItem(i,k,&songList[i].m_widgetItem[k]);
}
}
ui->tableWidget->setItemDelegateForColumn(0, new DelegatePathItem);
ui->pushButton_calculate->setDisabled(false);
ui->doubleSpinBox_preferredLoudness->setDisabled(false);
ui->tableWidget->setSortingEnabled(true);
ui->tableWidget->sortItems(0);
firstAnalysisDone=true;
}
void analyzer::on_doubleSpinBox_preferredLoudness_valueChanged(double arg1)
{
if (firstAnalysisDone){
for (unsigned int i=0; i<countSongs;i++){
songList[i].setNewPreferedLoudness(arg1);
}
}
}

@ -0,0 +1,37 @@
#ifndef ANALYZER_H
#define ANALYZER_H
#include <QDialog>
#include <QTableWidgetItem>
#include "csong.h"
namespace Ui {
class analyzer;
}
class analyzer : public QDialog
{
Q_OBJECT
public:
explicit analyzer(QWidget *parent = nullptr);
~analyzer();
private slots:
void on_pushButton_clicked();
void on_pushButton_calculate_clicked();
void on_doubleSpinBox_preferredLoudness_valueChanged(double arg1);
private:
Ui::analyzer *ui;
csong * songList;
unsigned int countSongs;
bool firstAnalysisDone;
};
#endif // ANALYZER_H

@ -0,0 +1,167 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>analyzer</class>
<widget class="QDialog" name="analyzer">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>836</width>
<height>658</height>
</rect>
</property>
<property name="windowTitle">
<string>Loudness Analyzer</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QFormLayout" name="formLayout">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<property name="formAlignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Folder containing Audio Files</string>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="lineEdit_path">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string>preferred Loudness</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="pushButton_calculate">
<property name="text">
<string>Calculate</string>
</property>
</widget>
</item>
<item row="3" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QProgressBar" name="progressBar">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_progress">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>ready</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QDoubleSpinBox" name="doubleSpinBox_preferredLoudness">
<property name="suffix">
<string> dBFS</string>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="minimum">
<double>-100.000000000000000</double>
</property>
<property name="maximum">
<double>0.000000000000000</double>
</property>
<property name="value">
<double>-18.000000000000000</double>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_recommendation">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QTableWidget" name="tableWidget">
<property name="textElideMode">
<enum>Qt::ElideLeft</enum>
</property>
<property name="rowCount">
<number>1</number>
</property>
<property name="columnCount">
<number>5</number>
</property>
<row/>
<column/>
<column/>
<column/>
<column/>
<column/>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

@ -0,0 +1,194 @@
#include "csong.h"
#include <QFileInfo>
#include "getLoudness.h"
#include "getLoudness_terminate.h"
#include "rt_nonfinite.h"
#include "coder_array.h"
#include <cmath>
csong::csong()
{
m_path="";
m_loudness=0;
m_peakLevel=0;
m_widgetItem=new QTableWidgetItem[5];
setWidgetProperties();
}
csong::csong(QString path)
{
m_path=path;
m_widgetItem=new QTableWidgetItem[5];
setWidgetProperties();
}
csong::~csong()
{
delete [] m_widgetItem;
}
void csong::analyze(float preferedLoudness)
{
using namespace nqr;
NyquistIO loader;
try {
std::shared_ptr<AudioData> fileData = std::make_shared<AudioData>();
#ifdef Q_OS_WIN
FILE * audioFile = fopen(m_path.toLatin1().constData(), "rb");
if (!audioFile)
{
throw std::runtime_error("file not found");
}
fseek(audioFile, 0, SEEK_END);
size_t lengthInBytes = ftell(audioFile);
fseek(audioFile, 0, SEEK_SET);
// Allocate temporary buffer
std::vector<uint8_t> fileBuffer(lengthInBytes);
size_t elementsRead = fread(fileBuffer.data(), 1, lengthInBytes, audioFile);
if (elementsRead == 0 || fileBuffer.size() < 64)
{
throw std::runtime_error("error reading file or file too small");
}
NyquistFileBuffer tempdata = {std::move(fileBuffer), elementsRead};
fclose(audioFile);
auto memory=tempdata;
#else
auto memory= ReadFile(m_path.toStdString());
#endif
QFileInfo fi(m_path);
loader.Load(fileData.get(),fi.suffix().toStdString(),memory.buffer);
coder::array<float, 2U> loudness;
loudness.set_size(1,1);
coder::array<float, 2U> data;
data.set_size(fileData->samples.size()/2,fileData->channelCount);
for (int idx0{0}; idx0 < data.size(0); idx0++) {
for (int idx1{0}; idx1 < data.size(1); idx1++) {
data[idx0 + data.size(0) * idx1] = fileData->samples[idx1+data.size(1)*idx0];
}
}
getLoudness(data,fileData->sampleRate,loudness);
//getLoudness_terminate();
m_loudness=loudness[0];
m_widgetItem[1].setData(Qt::EditRole,QVariant(m_loudness));
m_peakLevel=0;
for (unsigned int i=0;i<fileData->samples.size();i++){
if (abs(fileData->samples[i])>m_peakLevel){
m_peakLevel=abs(fileData->samples[i]);
}
}
m_peakLevel=linToDb(m_peakLevel);
if (m_peakLevel>0){
m_peakLevel=0;
}
m_widgetItem[2].setData(Qt::EditRole,QVariant(m_peakLevel));
m_correction=preferedLoudness-m_loudness;
m_widgetItem[4].setData(Qt::EditRole,QVariant(m_correction));
m_correctedPeakLevel=m_peakLevel+m_correction;
m_widgetItem[3].setData(Qt::EditRole,QVariant(m_correctedPeakLevel));
if (m_correctedPeakLevel>0){
m_widgetItem[3].setBackground(Qt::red);
}else {
m_widgetItem[3].setBackground(QBrush());
}
} catch (const UnsupportedExtensionEx & e)
{
//std::cerr << "Caught: " << e.what() << std::endl;
m_widgetItem[1].setText("Nicht unterstützte Dateiendung!");
m_widgetItem[2].setText("-");
m_widgetItem[3].setText("-");
m_widgetItem[4].setText("-");
}
catch (const LoadPathNotImplEx & e)
{
//std::cerr << "Caught: " << e.what() << std::endl;
}
catch (const LoadBufferNotImplEx & e)
{
//std::cerr << "Caught: " << e.what() << std::endl;
}
catch (const std::exception & e)
{
//std::cerr << "Caught: " << e.what() << std::endl;
m_widgetItem[1].setText("Nicht unterstützter Codec!");
m_widgetItem[2].setText("-");
m_widgetItem[3].setText("-");
m_widgetItem[4].setText("-");
}
}
void csong::setNewPreferedLoudness(float preferedLoudness)
{
m_correction=preferedLoudness-m_loudness;
m_widgetItem[4].setText(QString::number(m_correction));
m_correctedPeakLevel=m_peakLevel+m_correction;
m_widgetItem[3].setText(QString::number(m_correctedPeakLevel));
if (m_correctedPeakLevel>0){
m_widgetItem[3].setBackground(Qt::red);
}else {
m_widgetItem[3].setBackground(QBrush());
}
}
void csong::setPath(QString path)
{
m_path=path;
m_widgetItem[0].setText(m_path);
}
float csong::get_PeakLevel() const
{
return m_peakLevel;
}
float csong::get_Loudness() const
{
return m_loudness;
}
float csong::get_correctedPeakLevel() const
{
return m_correctedPeakLevel;
}
float csong::get_correction() const
{
return m_correction;
}
float csong::linToDb(float linValue)
{
return 20*std::log10(linValue);
}
void csong::setWidgetProperties()
{
for (int i=0;i<5;i++){
m_widgetItem[i].setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
m_widgetItem[i].setTextAlignment(Qt::AlignCenter);
}
m_widgetItem[0].setTextAlignment(Qt::AlignRight | Qt::AlignVCenter);
}
QString csong::get_path() const{
return m_path;
}

@ -0,0 +1,40 @@
#ifndef CSONG_H
#define CSONG_H
#include <QString>
#include <QTableWidgetItem>
#include "libnyquist/Decoders.h"
#include "rtwtypes.h"
#include <cstddef>
#include <cstdlib>
class csong
{
public:
csong();
csong(QString path);
~csong();
void analyze(float preferedLoudness);
void setNewPreferedLoudness(float preferedLoudness);
void setPath(QString path);
QString get_path() const;
float get_PeakLevel() const;
float get_Loudness() const;
float get_correctedPeakLevel() const;
float get_correction() const;
float requiredCorrection;
float linToDb(float linValue);
QTableWidgetItem* m_widgetItem;
private:
float m_peakLevel;
float m_loudness;
float m_correctedPeakLevel;
float m_correction;
QString m_path;
void setWidgetProperties();
};
#endif // CSONG_H

@ -1,7 +0,0 @@
#ifndef DEFINES_H
#define DEFINES_H
#define PAC_VERSION "0.2"
#endif // DEFINES_H

@ -0,0 +1,28 @@
#include "delegatepathitem.h"
#include <QPainter>
#include <QApplication>
void DelegatePathItem::paint(QPainter *painter, const QStyleOptionViewItem &option,
const QModelIndex &index) const
{
if (!index.isValid())
return;
QStyleOptionViewItem opt = option;
initStyleOption(&opt, index);
int padding = 3;
painter->save();
painter->setClipRect(opt.rect);
opt.rect = opt.rect.adjusted(padding, padding, -padding, -padding);
painter->drawText(opt.rect, Qt::AlignLeft | Qt::AlignVCenter,
opt.fontMetrics.elidedText(opt.text, Qt::ElideLeft,
opt.rect.width()));
painter->restore();
opt.rect = option.rect;
opt.textElideMode = Qt::ElideLeft;
opt.text = "";
QApplication::style()->drawControl(QStyle::CE_ItemViewItem, &opt, painter);
}

@ -0,0 +1,13 @@
#ifndef DELEGATEPATHITEM_H
#define DELEGATEPATHITEM_H
#include <QStyledItemDelegate>
class DelegatePathItem : public QStyledItemDelegate
{
public:
void paint(QPainter *painter, const QStyleOptionViewItem &option,
const QModelIndex &index) const;
};
#endif // DELEGATEPATHITEM_H

@ -17,6 +17,9 @@ library::library(QWidget *parent) :
unsaved=false;
speakerUnsaved=false;
dacUnsaved=false;
initAmps=false;
initDacs=false;
initSpeaker=false;
}
library::~library()
@ -73,8 +76,6 @@ cdac *library::getDacs()
void library::open()
{
ui->listWidget_ampView->setCurrentRow(0);
QSettings settings("DKM-Tech","Pa-Calculator");
if (settings.value("library/path","")==""){
settings.setValue("library/path",QFileDialog::getSaveFileName(this,"Select Library Storage File","","Pa Calculator Library File (*.palib)"));
@ -131,10 +132,6 @@ void library::refreshModeOverview()
}
}
}
//std::cerr<<"refreshModeOverview started"<<std::endl;
//printAllAmps();
}
void library::refreshSpeakerView()
@ -175,7 +172,7 @@ int library::getCurrentDacIndex()
void library::ampEdited()
{
if(unsaved==false){
if(ui->lineEdit_ampName->text()!=QString::fromStdString(m_pCamp[getCurrentAmpIndex()].getName()) && unsaved==false){
ui->listWidget_ampView->currentItem()->setText(ui->listWidget_ampView->currentItem()->text()+QString::fromStdString("*"));
unsaved =true;
}
@ -183,7 +180,7 @@ void library::ampEdited()
void library::speakerEdited()
{
if (speakerUnsaved==false){
if (ui->lineEdit_speakerName->text() != QString::fromStdString(m_pSpeaker[getCurrentSpeakerIndex()].getName()) && speakerUnsaved==false){
ui->listWidget_speakerView->currentItem()->setText(ui->listWidget_speakerView->currentItem()->text()+QString::fromStdString("*"));
speakerUnsaved =true;
}
@ -191,7 +188,7 @@ void library::speakerEdited()
void library::dacEdited()
{
if (dacUnsaved==false){
if (ui->lineEdit_dacName->text()!= QString::fromStdString(m_pDac[getCurrentDacIndex()].name()) && dacUnsaved==false){
ui->listWidget_dacView->currentItem()->setText(ui->listWidget_dacView->currentItem()->text()+QString::fromStdString("*"));
dacUnsaved =true;
}
@ -265,11 +262,18 @@ void library::on_listWidget_ampView_currentRowChanged(int currentRow)
ui->listWidget_modeSelector->setCurrentRow(0);
ui->lineEdit_ampName->setEnabled(true);
ui->doubleSpinBox_inputSensitivity->setEnabled(true);
ui->comboBox_sensUnit->setEnabled(true);
ui->lineEdit_modeName->setEnabled(true);
ui->listWidget_modeSelector->setEnabled(true);
ui->spinBox_ratedImp->setEnabled(true);
ui->spinBox_ratedPower->setEnabled(true);
}else
{
ui->lineEdit_ampName->setEnabled(false);
ui->doubleSpinBox_inputSensitivity->setEnabled(false);
}
}
@ -436,10 +440,10 @@ void library::on_listWidget_speakerView_currentRowChanged(int currentRow)
ui->spinBox_speakerHPF->setValue(m_pSpeaker[currentRow].getHPF());
ui->lineEdit_speakerName->setEnabled(true);
//ui->spinBox_speakerImp->setEnabled(true);
//ui->spinBox_speakerRMSPower->setEnabled(true);
//ui->spinBox_speakerPeakPower->setEnabled(true);
//ui->spinBox_speakerHPF->setEnabled(true);
ui->spinBox_speakerImp->setEnabled(true);
ui->spinBox_speakerRMSPower->setEnabled(true);
ui->spinBox_speakerPeakPower->setEnabled(true);
ui->spinBox_speakerHPF->setEnabled(true);
}else {
ui->lineEdit_speakerName->setEnabled(false);
@ -571,9 +575,11 @@ void library::on_listWidget_dacView_currentRowChanged(int currentRow)
ui->lineEdit_dacName->setText(QString::fromStdString(m_pDac[currentRow].name()));
ui->spinBox_dacOutputLevel->setValue(m_pDac[currentRow].outputLevel());
ui->lineEdit_dacName->setEnabled(true);
ui->spinBox_dacOutputLevel->setEnabled(true);
}else{
ui->lineEdit_dacName->setEnabled(false);
}
}

@ -128,6 +128,9 @@ private:
bool speakerUnsaved;
bool dacUnsaved;
bool initAmps;
bool initSpeaker;
bool initDacs;
};
#endif // LIBRARY_H

@ -106,6 +106,9 @@
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBox_sensUnit">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string>in Volt</string>
@ -136,7 +139,11 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_modeName"/>
<widget class="QLineEdit" name="lineEdit_modeName">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
@ -147,6 +154,9 @@
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="spinBox_ratedPower">
<property name="enabled">
<bool>false</bool>
</property>
<property name="suffix">
<string> W</string>
</property>
@ -167,6 +177,9 @@
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="spinBox_ratedImp">
<property name="enabled">
<bool>false</bool>
</property>
<property name="suffix">
<string> Ohm</string>
</property>
@ -184,7 +197,11 @@
</layout>
</item>
<item>
<widget class="QListWidget" name="listWidget_modeSelector"/>
<widget class="QListWidget" name="listWidget_modeSelector">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
@ -205,7 +222,7 @@
<item>
<widget class="QPushButton" name="pushButton_applyMode">
<property name="text">
<string>Apply</string>
<string>Apply mode</string>
</property>
</widget>
</item>
@ -281,7 +298,7 @@
<item row="1" column="1">
<widget class="QSpinBox" name="spinBox_speakerImp">
<property name="enabled">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="suffix">
<string> Ohm</string>
@ -304,7 +321,7 @@
<item row="2" column="1">
<widget class="QSpinBox" name="spinBox_speakerRMSPower">
<property name="enabled">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="suffix">
<string> W</string>
@ -327,7 +344,7 @@
<item row="3" column="1">
<widget class="QSpinBox" name="spinBox_speakerPeakPower">
<property name="enabled">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="suffix">
<string> W</string>
@ -350,7 +367,7 @@
<item row="4" column="1">
<widget class="QSpinBox" name="spinBox_speakerHPF">
<property name="enabled">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="suffix">
<string> Hz</string>
@ -429,6 +446,9 @@
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="spinBox_dacOutputLevel">
<property name="enabled">
<bool>false</bool>
</property>
<property name="suffix">
<string> dBU</string>
</property>
@ -454,8 +474,8 @@
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>244</x>
<y>444</y>
<x>250</x>
<y>473</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
@ -470,8 +490,8 @@
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>312</x>
<y>444</y>
<x>318</x>
<y>473</y>
</hint>
<hint type="destinationlabel">
<x>286</x>

@ -2,6 +2,10 @@
#include <QApplication>
#ifdef Q_OS_WIN
#pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup")
#endif
int main(int argc, char *argv[])
{
QApplication a(argc, argv);

@ -9,12 +9,26 @@
#include <QDataStream>
#include <QFileDialog>
#include "about.h"
#include "analyzer.h"
#include <QJsonDocument>
#include <Qfile>
#include <QJsonParseError>
#include <QJsonObject>
#include <QJsonArray>
#include <QDebug>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
manager = new QNetworkAccessManager();
checkUpdates();
m_ampCount=0;
m_pCAmp=Q_NULLPTR;
@ -67,6 +81,7 @@ void MainWindow::on_pushButton_requestLimiter_clicked()
return;
}
qreal vMaxSpeakerInRMS=20*std::log10(qSqrt(speakerImp*speakerRMS)/0.7746);
qreal vMaxSpeakerInPeak=20*std::log10(qSqrt(speakerImp*speakerPeak)/0.7746);
@ -90,6 +105,7 @@ void MainWindow::on_pushButton_requestLimiter_clicked()
qreal releaseTimeRMS=attackTimeRMS*8;
qreal releaseTimePeak=attackTimeRMS;
bool rmsRequired=true;
@ -97,6 +113,7 @@ void MainWindow::on_pushButton_requestLimiter_clicked()
QMessageBox msgBox(QMessageBox::Warning,"Amplifier can't deliver maximum RMS power","The maximum power level of the amplifier is below the maximum RMS power level of the speaker. To protect the speaker from a distorted signal the amplifier might deliver, a peak limiter is required with the amplifiers input sensitivty set as its threshold.");
msgBox.exec();
ui->label_thresholdRMS->setText(QString("not required"));
rmsRequired=false;
ui->label_attackTimeRMS->setText(QString::number(attackTimeRMS,'f',2)+QString(" ms"));
ui->label_releaseTimeRMS->setText(QString::number(releaseTimeRMS,'f',2)+QString(" ms"));
ui->label_UMaxSpeakerInRMS->setText(QString::number(vMaxSpeakerInRMS,'f',2)+QString(" dBU (")+QString::number(qSqrt(speakerImp*speakerRMS),'f',2)+QString(" V)"));
@ -111,8 +128,12 @@ void MainWindow::on_pushButton_requestLimiter_clicked()
}else if (vAmpsens_dBu<vMaxAmpInPeak){
QMessageBox msgBox(QMessageBox::Warning,"Amplifier can't deliver maximum peak power","The maximum power level of the amplifier is below the maximum peak power level of the speaker. To protect the speaker from a distorted signal the amplifier might deliver, a peak limiter is required with the amplifiers input sensitivty set as its threshold.");
msgBox.exec();
ui->label_thresholdRMS->setText(QString::number(thresholdRMS,'f',1)+QString(" dBFS"));
if (QString::number(thresholdRMS,'f',1)==QString::number(-18-(ui->spinBox_digitalNominalLevel->value()-vAmpsens_dBu),'f',1)){
ui->label_thresholdRMS->setText(QString("not required"));
rmsRequired=false;
}else{
ui->label_thresholdRMS->setText(QString::number(thresholdRMS,'f',1)+QString(" dBFS"));
}
ui->label_attackTimeRMS->setText(QString::number(attackTimeRMS,'f',2)+QString(" ms"));
ui->label_releaseTimeRMS->setText(QString::number(releaseTimeRMS,'f',2)+QString(" ms"));
ui->label_UMaxSpeakerInRMS->setText(QString::number(vMaxSpeakerInRMS,'f',2)+QString(" dBU (")+QString::number(qSqrt(speakerImp*speakerRMS),'f',2)+QString(" V)"));
@ -136,7 +157,20 @@ void MainWindow::on_pushButton_requestLimiter_clicked()
ui->label_UMaxAmpInPeak->setText(QString::number(vMaxAmpInPeak,'f',2)+QString(" dBU (")+QString::number(qPow(10,vMaxAmpInPeak/20)*0.7746,'f',2)+QString(" V)"));
}
if (ui->checkBox_optimizeGain->checkState()){
qreal diff=0;
qreal digitalHeadroom=ui->spinBox_digitalHeadroom->value();
while (thresholdPeak+diff+1<=-digitalHeadroom){
diff++;
}
ui->label_thresholdPeak->setText(QString::number(thresholdPeak+diff,'f',1)+QString(" dBFS"));
if (rmsRequired){
ui->label_thresholdRMS->setText(QString::number(thresholdRMS+diff,'f',1)+QString(" dBFS"));
}
ui->label_inputVolumeControl->setText(QString::number(-diff)+QString(" dB"));
}else {
ui->label_inputVolumeControl->setText(QString("0 dB"));
}
}
@ -312,6 +346,7 @@ void MainWindow::on_actionOpen_Library_triggered()
loadLibrary();
refreshLibraryAmps();
refreshLibrarySpeaker();
refreshLibraryDacs();
}
@ -342,3 +377,54 @@ void MainWindow::on_actionAbout_triggered()
aboutDialog.exec();
}
void MainWindow::on_actionOpen_Loudness_Analyzer_triggered()
{
analyzer analyzerWindow;
analyzerWindow.exec();
}
void MainWindow::on_checkBox_optimizeGain_stateChanged(int arg1)
{
if (ui->checkBox_optimizeGain->checkState()){
ui->spinBox_digitalHeadroom->setEnabled(true);
}else{
ui->spinBox_digitalHeadroom->setEnabled(false);
}
}
void MainWindow::checkUpdates()
{
QObject::connect(manager, &QNetworkAccessManager::finished,
this,&MainWindow::checkUpdatesFinished);
request.setUrl(QUrl("https://git.aldiserver.de/api/v1/repos/DKM-Tech/pa-calculator/releases?draft=false&pre-release=false&per_page=1&limit=1"));
manager->get(request);
}
void MainWindow::checkUpdatesFinished(QNetworkReply *reply)
{
if (reply->error()) {
//qDebug() << reply->errorString();
return;
}
QString ReplyText = reply->readAll();
QJsonDocument doc = QJsonDocument::fromJson(ReplyText.toUtf8());
QJsonArray array = doc.array();
QJsonObject obj=array.at(0).toObject();
QString current_version=obj.value("tag_name").toString().remove(0,1);
QString current_version_url=obj.value("html_url").toString();
QString installed_version = APP_VERSION;
installed_version=installed_version.mid(0,installed_version.lastIndexOf('.'));
//qDebug() << "Neueste Version: " <<current_version;
//qDebug() << "Installierte Version: " <<installed_version;
if (current_version!=installed_version){
QMessageBox msgBox;
msgBox.setTextFormat(Qt::RichText);
msgBox.setText("Es ist ein Update verfügbar!<br>Installierte Version: "+installed_version+"<br>Verfügbare Version: "+current_version+"<br> Du kannst das Update <a href='"+current_version_url+"'>hier</a> herunterladen.");
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.exec();
}
}

@ -6,6 +6,14 @@
#include "cspeaker.h"
#include <cdac.h>
#include <QThreadPool>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QFuture>
#include <QtConcurrent>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
@ -18,6 +26,7 @@ public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
private slots:
void on_ComboBox_selectSensUnit_currentIndexChanged(int index);
@ -40,6 +49,13 @@ private slots:
void on_actionAbout_triggered();
void on_actionOpen_Loudness_Analyzer_triggered();
void on_checkBox_optimizeGain_stateChanged(int arg1);
void checkUpdatesFinished(QNetworkReply *reply);
private:
Ui::MainWindow *ui;
cAmp* m_pCAmp;
@ -58,8 +74,12 @@ private:
void refreshLibraryDacs();
void checkUpdates();
void loadLibrary();
void saveLibrary();
QNetworkAccessManager *manager;
QNetworkRequest request;
QFuture<void> requestFuture;
};
#endif // MAINWINDOW_H

@ -6,10 +6,22 @@
<rect>
<x>0</x>
<y>0</y>
<width>1141</width>
<height>611</height>
<width>1606</width>
<height>639</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>1242</width>
<height>590</height>
</size>
</property>
<property name="windowTitle">
<string>PA Calculator</string>
</property>
@ -39,6 +51,9 @@
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QFormLayout" name="formLayout">
<property name="labelAlignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
@ -122,6 +137,19 @@
</item>
</widget>
</item>
<item row="4" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
@ -139,14 +167,14 @@
</property>
</widget>
</item>
<item row="6" column="0">
<item row="7" column="0">
<widget class="QLabel" name="label_20">
<property name="text">
<string>select mode</string>
</property>
</widget>
</item>
<item row="6" column="1">
<item row="7" column="1">
<widget class="QComboBox" name="comboBox_libraryAmoMode">
<property name="minimumSize">
<size>
@ -156,21 +184,13 @@
</property>
</widget>
</item>
<item row="4" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="7" column="1">
<item row="8" column="0" colspan="2">
<widget class="QPushButton" name="pushButton">
<property name="font">
<font>
<pointsize>14</pointsize>
</font>
</property>
<property name="text">
<string>Load Amp-Preset</string>
</property>
@ -183,6 +203,12 @@
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>408</width>
@ -200,6 +226,12 @@
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QFormLayout" name="formLayout_2">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<property name="labelAlignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
@ -292,39 +324,10 @@
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_21">
<item row="5" column="0">
<widget class="QLabel" name="label_24">
<property name="text">
<string>Load Speaker from library</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QComboBox" name="comboBox_librarySpeaker"/>
</item>
<item row="6" column="1">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="1">
<widget class="QPushButton" name="pushButton_loadSpeaker">
<property name="minimumSize">
<size>
<width>179</width>
<height>33</height>
</size>
</property>
<property name="text">
<string>Load Speaker-Preset</string>
<string>Number of speaker in parallel</string>
</property>
</widget>
</item>
@ -338,7 +341,48 @@
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_21">
<property name="text">
<string>Load Speaker from library</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QComboBox" name="comboBox_librarySpeaker"/>
</item>
<item row="8" column="0" colspan="2">
<widget class="QPushButton" name="pushButton_loadSpeaker">
<property name="minimumSize">
<size>
<width>179</width>
<height>33</height>
</size>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
</font>
</property>
<property name="text">
<string>Load Speaker-Preset</string>
</property>
</widget>
</item>
<item row="4" column="1">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="6" column="1">
<spacer name="verticalSpacer_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -351,13 +395,6 @@
</property>
</spacer>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_24">
<property name="text">
<string>Number of speaker in parallel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
@ -376,6 +413,9 @@
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QFormLayout" name="formLayout_3">
<property name="labelAlignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
@ -396,23 +436,6 @@
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_22">
<property name="text">
<string>Load DAC from library</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="comboBox_dacPreset"/>
</item>
<item row="4" column="1">
<widget class="QPushButton" name="pushButton_loadDac">
<property name="text">
<string>Load DAC-Preset</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_23">
<property name="text">
@ -420,19 +443,90 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_25">
<property name="text">
<string>Output Gain Structure</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="checkBox_optimizeGain">
<property name="text">
<string>Optimize</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="1">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_22">
<property name="text">
<string>Load DAC from library</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="comboBox_dacPreset"/>
</item>
<item row="6" column="0" colspan="2">
<widget class="QPushButton" name="pushButton_loadDac">
<property name="font">
<font>
<pointsize>14</pointsize>
</font>
</property>
<property name="text">
<string>Load DAC-Preset</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="spinBox_digitalHeadroom">
<property name="enabled">
<bool>true</bool>
</property>
<property name="suffix">
<string> dB</string>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>30</number>
</property>
<property name="value">
<number>5</number>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_26">
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string>Digital Headroom</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
@ -473,6 +567,12 @@
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<layout class="QFormLayout" name="formLayout_4">
<property name="labelAlignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="formAlignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<item row="4" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
@ -503,9 +603,15 @@
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_11">
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string>Threshold:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
@ -513,13 +619,15 @@
<property name="font">
<font>
<pointsize>15</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>0 dBFS</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="2" column="0">
@ -539,6 +647,9 @@
<property name="text">
<string>0 ms</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="3" column="0">
@ -558,9 +669,12 @@
<property name="text">
<string>0 ms</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="1" column="0">
<item row="6" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -591,6 +705,9 @@
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<layout class="QFormLayout" name="formLayout_5">
<property name="labelAlignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<item row="4" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
@ -631,13 +748,15 @@
<property name="font">
<font>
<pointsize>15</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>0 dBFS</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="2" column="0">
@ -657,6 +776,9 @@
<property name="text">
<string>0 ms</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="3" column="0">
@ -676,9 +798,12 @@
<property name="text">
<string>0 ms</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="1" column="1">
<item row="6" column="1">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -696,6 +821,44 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_6">
<property name="font">
<font>
<pointsize>16</pointsize>
</font>
</property>
<property name="title">
<string>Amplifier</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<layout class="QFormLayout" name="formLayout_6">
<property name="labelAlignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_27">
<property name="text">
<string>Input Volume Control:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_inputVolumeControl">
<property name="text">
<string>0 dB</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
@ -705,8 +868,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1141</width>
<height>24</height>
<width>1606</width>
<height>22</height>
</rect>
</property>
<widget class="QMenu" name="menuLibrary">
@ -723,8 +886,15 @@
</property>
<addaction name="actionAbout"/>
</widget>
<widget class="QMenu" name="menuLoudness_Analyzer">
<property name="title">
<string>Tools</string>
</property>
<addaction name="actionOpen_Loudness_Analyzer"/>
</widget>
<addaction name="menuPA_Calculator"/>
<addaction name="menuLibrary"/>
<addaction name="menuLoudness_Analyzer"/>
</widget>
<action name="actionEditLibrary">
<property name="text">
@ -746,6 +916,16 @@
<string>About</string>
</property>
</action>
<action name="actionOpen_Loudness_Analyzer">
<property name="text">
<string>Loudness Analyzer</string>
</property>
</action>
<action name="actionHelp">
<property name="text">
<string>Help</string>
</property>
</action>
</widget>
<resources/>
<connections/>

Loading…
Cancel
Save