pax_global_header00006660000000000000000000000064125753663530014531gustar00rootroot0000000000000052 comment=07472be65f29dca389399a2a5bd144118b42bfb9 laditools-1.1.0/000077500000000000000000000000001257536635300135225ustar00rootroot00000000000000laditools-1.1.0/.gitignore000066400000000000000000000000151257536635300155060ustar00rootroot00000000000000build/ *.pyc laditools-1.1.0/AUTHORS000066400000000000000000000003001257536635300145630ustar00rootroot00000000000000Marc-Olivier Barre Nedko Arnaudov Alessio Treglia Various ladiconf improvements by Krzysztof Foltman laditools-1.1.0/COPYING000066400000000000000000001045131257536635300145610ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . laditools-1.1.0/ChangeLog000066400000000000000000000007261257536635300153010ustar00rootroot000000000000002015-09-13 Alessio Treglia * Version 1.1.0: - Fix call to feed() - in python it takes just the string to feed, not the length too. 2012-05-18 Alessio Treglia * Version 1.0.1: - Bump Python requirment to 2.7 - Fix GtkTreeView's set_cursor() call to avoid ladi-control-center crashes, see Debian bug#671366 - Translations update - Small improvements to the buildsystem - Cosmetic fixes laditools-1.1.0/INSTALL000066400000000000000000000040171257536635300145550ustar00rootroot00000000000000LADI Tools - Linux Audio Desktop Integration Tools -------------------------------------------------- LADI Tools is a set of tools aiming to achieve the goals of the LADI project to improve desktop integration and user workflow of Linux audio system based on JACK and LADISH. Those tools take advantage of the DBus interfaces of JACK2 and LADISH to ease the configuration and use of your software studio. LADI Tools 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. For the complete text of the GNU General Public License version 3 see the file COPYING included in this tarball. How to get this software ------------------------ Bugfix updates and new releases are made available at: https://launchpad.net/laditools/+download Dependencies ------------ A version of the Python interpreter greater than or equal to 2.7 is needed to build, install and run LADI Tools. Python 3 support is not yet provided. Plus, the following dependencies must be satisfied: - GTK+3 (>= 3.2.2, http://www.gtk.org/) - python-enum (>= 0.4.4, http://pypi.python.org/pypi/enum/) - VTE (>= 0.30.1, http://ftp.gnome.org/pub/GNOME/sources/vte/) Here is a list of optional dependencies: - libappindicator (>= 0.4.1, http://unity.ubuntu.com/projects/appindicators/) Installation Instructions ------------------------- Build and install laditools is a very simple task: $ python setup.py install To install everything relative to an alternate root directory: $ python setup.py install --root=$ALTROOT For more information about the available options, simply type: $ python setup.py install --help install For information about distutils' advanced options, type: $ python setup.py --help If you're a package maintainer and need help with packaging you might want to ask on Freenode's channgels #jack or #LADI to either nedko or or quadrispro. laditools-1.1.0/MANIFEST.in000066400000000000000000000001551257536635300152610ustar00rootroot00000000000000recursive-include data *.svg *.ui *.desktop.in *.png *.1 include INSTALL COPYING NEWS ChangeLog include po/* laditools-1.1.0/NEWS000066400000000000000000000055331257536635300142270ustar00rootroot00000000000000LADI Tools - Linux Audio Desktop Integration Tools -------------------------------------------------- Laditools 1.0 «Lady "O"» This is the first stable release of LADI Tools. This document is an attempt to list the most relevant changes introduced since the latest almost-stable release candidate (was 1.0~rc2+20100724.gitf4d4a2). Please note it is strongly recommended to upgrade from any previous version as we will NOT provide bugfix updates for oldest snaphsot taken from the no longer used SVN repository. The Big Renaming ---------------- Apart from wladi and g15ladi, most of ladi* tools have been renamed: * ladicontrol -> ladi-control-center * ladilog -> ladi-system-log * laditray -> ladi-system-tray Moreover, a new component has joined the LADI Tools suite: ladi-player. LADI Player is a convenient, graphical VLC-style application providing an all-in-one control interface to start, stop and monitor JACK as well as the session handler. It also provides basic controls for managing studios. Goodbye PyGTK! -------------- All the code was ported to GTK+ 3 and the new GObject Introspection mechanism. Code refactoring and cleanup ---------------------------- The code has been reorganized in order to allow the use of Python objects by 3rd party applications. To start writing code using the classes provided by laditools, simply do the following: from laditools import * Two-in-one solution for LADI System Tray ---------------------------------------- Formerly laditray was an implementation of GtkStatusIcon to put a nice right-clickable icon into the system tray to allow users access JACK controls easy way. It's been mostly rewritten and now it shows an AppIndicator icon (if the library is available, see http://unity.ubuntu.com/projects/appindicators/), or fall back to the Freedesktop.org's old-fashioned System Tray Protocol Spec-compliant icon. Project's new homepage ---------------------- The project's homepage is now hosted by Launchpad.net: https://launchpad.net/laditools The code is hosted by repo.or.cz and it's available here for browsing: http://repo.or.cz/w/laditools.git Please use the following links to contact the development team: * Bugs and patches: https://bugs.launchpad.net/laditools * Translations: https://translations.launchpad.net/laditools Conclusions ----------- Enjoy your LADI system! ;-) Alessio Treglia laditools-1.1.0/README.md000066400000000000000000000036511257536635300150060ustar00rootroot00000000000000LADI Tools - Linux Audio Desktop Integration Tools -------------------------------------------------- LADI Tools is a set of tools aiming to achieve the goals of the LADI project to improve desktop integration and user workflow of Linux audio system based on JACK and LADISH. Those tools take advantage of the DBus interfaces of JACK2 and LADISH to ease the configuration and use of your software studio. In a near future, it should also be possible to use laditools to control JACK through an OSC interface. You will find in this suite : - The laditools python module - ladi-system-tray : a system tray icon that allows you to start, stop and monitor JACK, as well as start some JACK related apps (log viewer, connections...) - wmladi : a controller as a Window Maker dockapp which uses a menu similar to ladi-system-tray's - ladi-system-log : a JACK, LADISH and a2jmidid log viewer - ladi-control-center : a GUI to setup JACK's and laditools' configuration - ladi-player: compact front-end to that allows users to start, stop and monitor a LADI system. - g15ladi : a JACK monitor for g15 keyboards Enjoy ! License and credits ------------------- LADI Tools 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 . For the complete text of the GNU General Public License version 3 see the file COPYING included in this tarball. For a complete list of authors see the AUTHORS file. laditools-1.1.0/data/000077500000000000000000000000001257536635300144335ustar00rootroot00000000000000laditools-1.1.0/data/icons/000077500000000000000000000000001257536635300155465ustar00rootroot00000000000000laditools-1.1.0/data/icons/scalable/000077500000000000000000000000001257536635300173145ustar00rootroot00000000000000laditools-1.1.0/data/icons/scalable/apps/000077500000000000000000000000001257536635300202575ustar00rootroot00000000000000laditools-1.1.0/data/icons/scalable/apps/ladi-player.svg000066400000000000000000000301501257536635300232020ustar00rootroot00000000000000 image/svg+xml laditools-1.1.0/data/icons/scalable/apps/ladi-system-log.svg000066400000000000000000000513241257536635300240170ustar00rootroot00000000000000 image/svg+xml laditools-1.1.0/data/icons/scalable/apps/laditools.svg000066400000000000000000000260701257536635300227770ustar00rootroot00000000000000 image/svg+xml laditools-1.1.0/data/icons/scalable/status/000077500000000000000000000000001257536635300206375ustar00rootroot00000000000000laditools-1.1.0/data/icons/scalable/status/ladi-started.svg000066400000000000000000000301501257536635300237340ustar00rootroot00000000000000 image/svg+xml laditools-1.1.0/data/icons/scalable/status/ladi-starting.svg000066400000000000000000000310001257536635300241140ustar00rootroot00000000000000 image/svg+xml laditools-1.1.0/data/icons/scalable/status/ladi-stopped.svg000066400000000000000000000270311257536635300237500ustar00rootroot00000000000000 image/svg+xml laditools-1.1.0/data/jack_logo.svg000066400000000000000000000426341257536635300171150ustar00rootroot00000000000000 image/svg+xml JACK Audio Connection Kit laditools-1.1.0/data/ladi-control-center.desktop.in000066400000000000000000000003351257536635300223010ustar00rootroot00000000000000[Desktop Entry] _Name=LADI Control Center Type=Application _Comment=Configure the LADI system Terminal=false Exec=ladi-control-center Icon=preferences-system Categories=GNOME;GTK;Settings; _GenericName=LADI configuration laditools-1.1.0/data/ladi-player.desktop.in000066400000000000000000000003061257536635300206350ustar00rootroot00000000000000[Desktop Entry] _Name=LADI Player Type=Application _Comment=Control LADI system Terminal=false Exec=ladi-player Icon=ladi-player Categories=GTK;AudioVideo;Audio; _GenericName=LADI system controller laditools-1.1.0/data/ladi-player.ui000066400000000000000000001053111257536635300171760ustar00rootroot00000000000000 _Start A2J bridge Start A2J gtk-execute S_top A2J bridge Stop A2J gtk-stop _Reactivate A2J Restart A2J gtk-refresh _Start JACK server Start JACK gtk-execute Reset _Xruns Reset Xruns Clear Xruns and DSP load gtk-clear S_top JACK server Stop JACK gtk-stop _Reactivate JACK Restart JACK gtk-refresh _New studio... New Create new studio gtk-new _Delete studio... Delete Delete studio gtk-delete _Save studio Save Save the current studio gtk-save Rename studio Rename Rename the current studio gtk-edit Start the studio Start Start the loaded studio gtk-media-play Stop the studio Stop Stop the studio gtk-media-stop Unload the studio Unload Unload the current studio gtk-close _Reactivate ladishd Restart ladishd Restart ladishd gtk-refresh _Load studio... Load Load a studio gtk-open Session _editor gladish Open the session editor gladish _File log viewer Log Viewer Open the file log viewer gtk-file _LADI configuration Settings Configure LADI gtk-preferences True False gladish True False False LADI Player False False True False vertical True False False True False _Studio True True False gtk-new False new True False True gtk-open False load True False True gtk-save False save True False True gtk-delete False delete True False True False True False reactivate_ladishd True False True True False True False gtk-quit False True False True True accelgroup1 False True False _Controls True True False False True False _JACK True True False jack_start True False True True jack_stop True False True True jack_reset_xruns True False True True jack_reactivate True False True True False True False _A2J True True False a2j_start True False True True a2j_stop True False True True a2j_reactivate True False True True False True False Session _editor False gladish True False True image1 False File _log viewer False ladi-system-log True False True image2 False False True False ladi-control-center True False True True False True False _Help True True False gtk-about False True False True True False True 0 True False icons False new True False new toolbutton_new True False True load True False load toolbutton_load True False True save True False save toolbutton_save True False True delete True False delete toolbutton_remove True False True False True False False False rename True False rename toolbutton_rename True False True unload True False unload toolbutton_unload True False True stop True False stop toolbutton_stop True False True start True False True start toolbutton_start True False True False True False LADI status False True False 0 True 8 True False False True False False False gladish True False gladish toolbutton_launch_gladish True False True False False 1 laditools-1.1.0/data/ladi-system-log.desktop.in000066400000000000000000000003311257536635300214420ustar00rootroot00000000000000[Desktop Entry] _Name=LADI Log File Viewer Type=Application _Comment=View or monitor LADI log files Terminal=false Exec=ladi-system-log Icon=ladi-system-log Categories=GNOME;GTK;Settings; _GenericName=Log file viewer laditools-1.1.0/data/ladi-system-log.ui000066400000000000000000000135041257536635300200070ustar00rootroot00000000000000 600 500 True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK LADI Log Viewer ladi-system-log True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK False False 5 0 True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True True 1 True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 10 gtk-clear False True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK False True True False 0 Purge logs False True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK False True False 1 gtk-close False True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK False True True False 2 False False 2 laditools-1.1.0/data/ladi-system-tray.desktop.in000066400000000000000000000003271257536635300216450ustar00rootroot00000000000000[Desktop Entry] _Name=LADI System Tray Type=Application _Comment=Manage and configure JACK and ladish Terminal=false Exec=ladi-system-tray Icon=laditools Categories=GNOME;GTK;AudioVideo; _GenericName=LADI tray icon laditools-1.1.0/data/laditools.1000066400000000000000000000041501257536635300165070ustar00rootroot00000000000000.\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH LADITOOLS 1 "March 2012" "LADI Tools 1.0" "Linux Audio Desktop Integration" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME laditools \- tools to control and monitor LADI (JACK and ladish) systems .SH SYNOPSIS .B g15ladi .PP .B ladi-control-center .PP .B ladi-player .PP .B ladi-system-log .PP .B ladi-system-tray .PP .B wmladi .SH DESCRIPTION \fBLADITools\fP is a collection of tools aiming to achieve the goals of the LADI project to improve desktop integration and user workflow of GNU/Linux audio system based on JACK and LASH. Those tools take advantage of the D-Bus interfaces recently added to JACK and LASH to ease the configuration and use of those two great softwares. .PP The following tools are included: .TP .B g15ladi A JACK monitor for g15 keyboards. .TP .B ladi\-control\-center Graphical interface to setup JACK's configuration. .TP .B ladi\-player Compact front end to that allows users to start, stop and monitor a LADI system .TP .B ladi\-system\-log A JACK, LASH and a2jmidid log viewer. .TP .B ladi\-system\-tray System tray icon that allows users to start, stop and monitor JACK, as well as start some JACK related applications. .TP .B wmladi Window Maker dockapp which uses a menu similar to ladi\-system\-tray's. .SH AUTHOR laditools were written by Marc-Olivier Barre , Nedko Arnaudov and Alessio Treglia . .PP This manual page was written by Alessio Treglia , for the Debian project (but may be used by others). laditools-1.1.0/data/laditools_logo.svg000066400000000000000000000561471257536635300202030ustar00rootroot00000000000000 image/svg+xml LADITools Linux Audio Desktop Integration Tools laditools-1.1.0/data/laditools_logo_launchpad.svg000066400000000000000000000551141257536635300222130ustar00rootroot00000000000000 image/svg+xml LADITools Linux Audio Desktop Integration Tools laditools-1.1.0/g15ladi000077500000000000000000000165001257536635300147000ustar00rootroot00000000000000#!/usr/bin/python # LADITools - Linux Audio Desktop Integration Tools # g15ladi - A jack monitor for the g15 keyboard that uses the dbus interface # Copyright (C) 2012 Alessio Treglia # Copyright (C) 2007-2010, Marc-Olivier Barre # Copyright (C) 2007-2009, Nedko Arnaudov # # 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 . import sys import os import time import signal import argparse import laditools pipe_filename = "/dev/shm/g15log.pipe" class g15composer (object): text_justify_left = 0 text_justify_center = 1 text_justify_right = 2 text_size_small = 0 #text_size_medium = 1 text_size_large = 2 width = 160 height = 43 def __init__(self, pipe_filename, large): if large: self.size = self.text_size_large self.max_lines = 5 # 7 for small, 5 for large self.max_chars = 20 else: self.size = self.text_size_small self.max_lines = 7 self.max_chars = 40 self.pipe_filename = pipe_filename self.pid = os.spawnlp(os.P_NOWAIT, 'g15composer', 'g15composer', self.pipe_filename) #print "g15composer started" while not os.access(self.pipe_filename, os.F_OK): #print "Waiting pipe to appear..." time.sleep(1) self.pipe = file(self.pipe_filename, "w") os.remove(self.pipe_filename) #print "pipe unlinked" def __del__(self): self.pipe.close() #print "stopping g15composer..." os.kill(self.pid, signal.SIGTERM) os.waitpid(self.pid, 0) #print "g15composer stopped" def send_message(self, message): #print message, self.pipe.write(message) self.pipe.flush() def draw_lines(self, lines, x, y, justify): message = 'TO %u %u %u %u' % (x, y, self.size, justify) for line in lines: message += ' "%s "' % line.replace('"', "'").strip("\n") message += "\n" self.send_message(message) def draw_lines(self, lines, x, y, justify): message = 'TO %u %u %u %u' % (x, y, self.size, justify) for line in lines: message += ' "%s "' % line.replace('"', "'").strip("\n") message += "\n" self.send_message(message) def clear(self, ink): if ink: message = 'PC 1\n' else: message = 'PC 0\n' self.send_message(message) def draw_bar(self, x, y, width, height, ink, fill): if width < 0: width = self.width - width - x - 1 else: if width < 5: width = 5 if height < 3: height = 3 width -= 1 height -= 3 y += 1 if ink: ink = 1 else: ink = 0 self.send_message("DB %u %u %u %u %u %u %u 1\n" % (x, y, x + width, y + height, ink, fill * 1000, 1000)) class jackctl_g15(object): def __init__(self): self.jack = None self.g15 = g15composer(pipe_filename, False) self.started = False self.ladish = None def get_jack_info(self): if not self.jack: self.jack = laditools.JackController() if not self.jack.is_started(): return False, None, None, None, None, None realtime = self.jack.is_realtime() load = self.jack.get_load() xruns = self.jack.get_xruns() if xruns == 0: xruns_line = "no xruns" elif xruns == 1: xruns_line = "1 xrun" else: xruns_line = "%u xruns" % xruns rate = self.jack.get_sample_rate() if rate % 1000.0 == 0: rate_line = "Sample rate: %.0f Khz" % (rate / 1000.0) else: rate_line = "Sample rate: %.1f Khz" % (rate / 1000.0) latency_line = "Latency: %.1f ms" % self.jack.get_latency() return True, realtime, load, xruns_line, rate_line, latency_line def update(self): try: studio_name = None if not self.ladish: try: self.ladish = laditools.LadishProxy() except: pass try: studio_name = self.ladish.studio_name() except: pass started, realtime, load, xruns_line, rate_line, latency_line = self.get_jack_info() if started: self.started = True elif self.started: self.g15.clear(False) self.started = False if self.ladish: if studio_name: status_line = '"' + studio_name + '"' if started: status_line += " started" if realtime: status_line += " (RT)" else: status_line += " stopped" else: if started: status_line = "ladish is sick, jack started w/o studio" else: status_line = "No studio loaded" else: status_line = "JACK" if started: if realtime: status_line += " started in realtime mode" else: status_line += " started in non-realtime mode" else: status_line += " stopped" except Exception, e: print repr(e) status_line = "JACK cannot be connected" if self.jack: self.g15.clear(False) self.jack = None self.started = False self.g15.draw_lines([status_line], 0, 0, self.g15.text_justify_left) if self.started: self.g15.draw_lines(["DSP load"], 0, 12, self.g15.text_justify_left) self.g15.draw_bar(35, 12, 95, 5, True, load / 100.0) self.g15.draw_lines(["%.3f%%" % load], 135, 12, self.g15.text_justify_left) self.g15.draw_lines([xruns_line], 0, 22, self.g15.text_justify_left) self.g15.draw_lines([rate_line, latency_line], 0, 31, self.g15.text_justify_left) def run(self): while True: self.update() time.sleep(1) del self.g15 if __name__ == '__main__': parser = argparse.ArgumentParser(description='JACK monitor for g15 keyboards', epilog='This program is part of the LADITools suite.') parser.add_argument('--version', action='version', version="%(prog)s " + laditools.get_version_string()) parser.parse_args() jackctl_g15().run() sys.exit(0) laditools-1.1.0/gitcommit.sh000077500000000000000000000003161257536635300160550ustar00rootroot00000000000000#!/bin/sh COMMIT=`git log --color=never -1 --oneline | cut -d" " -f1` DATE=`git log --color=never -1 --date=iso | sed -ne "s/Date:\s\+\(.*\).*/\1/p" | cut -d" " -f1 | tr -d "-"` echo "$DATE".git"$COMMIT" laditools-1.1.0/ladi-control-center000077500000000000000000000636221257536635300173260ustar00rootroot00000000000000#!/usr/bin/python # LADITools - Linux Audio Desktop Integration Tools # ladi-control-center - A configuration GUI for your Linux Audio Desktop # Copyright (C) 2011-2012 Alessio Treglia # Copyright (C) 2007-2010, Marc-Olivier Barre # Copyright (C) 2007-2009, Nedko Arnaudov # Copyright (C) 2008, Krzysztof Foltman # # 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 . import os import sys import gettext import argparse from laditools import _gettext_domain gettext.install(_gettext_domain) from laditools import get_version_string from laditools import check_ladish from laditools import LadishProxy from laditools import LadishStatusType from laditools import LadishProxyError from laditools import JackConfigProxy from laditools import JackConfigParameter as parameter from laditools import LadiApp from gi.repository import Gtk from gi.repository import Gdk from gi.repository import GObject from laditools.gtk import find_data_file tooltips_active = True (COLUMN_NAME, COLUMN_PARAMETER, COLUMN_SHORTDESC, COLUMN_LONGDESC, COLUMN_ISSET) = range (5) def _check_ladish(): try: ret = check_ladish() except LadishProxyError as e: sys.stderr.write("%s\n" % str(e)) sys.stderr.flush() sys.exit(1) except Exception as e: sys.stderr.write(_("ladish proxy creation failed: %s\n") % str(e)) sys.stderr.flush() sys.exit(1) if ret == LadishStatusType.STUDIO_STOPPED: # Everything is OK, there's no need to print out a message #sys.stderr.write(_("ladish studio is loaded and not started\n")) #sys.stderr.flush() return False elif ret == LadishStatusType.NOT_AVAILABLE: sys.stderr.write(_("ladish is not available\n")) sys.stderr.flush() sys.exit(1) else: if ret == LadishStatusType.NO_STUDIO_LOADED: msg = _("JACK can only be configured with a loaded and stopped studio. Please create a new studio or load and stop an existing one.") sys.stderr.write(msg + "\n") title = _("No studio present") elif ret == LadishStatusType.STUDIO_RUNNING: msg = _("JACK can only be configured with a stopped studio. Please stop your studio first.") sys.stderr.write(msg + "\n") title = _("Studio is running") else: sys.stderr(_("Unexpected error!\n")) try: mdlg = Gtk.MessageDialog(type = Gtk.MessageType.ERROR, buttons = Gtk.ButtonsType.CLOSE, message_format = msg) mdlg.set_title(title) mdlg.run() mdlg.hide() except: pass finally: sys.stderr.flush() sys.exit(1) class configure_command(object): def __init__(self): pass def get_description(self): pass def get_window_title(self): return self.get_description(); def run(self, args): return self.activate() class parameter_enum_value(GObject.GObject): def __init__(self, is_fake_value, value, description): GObject.GObject.__init__(self) self.is_fake_value = is_fake_value self.value = value self.description = description def get_description(self): if self.is_fake_value: return self.description return str(self.value) + " - " + self.description class parameter_store(GObject.GObject): def __init__(self, param): GObject.GObject.__init__(self) self.param = param self.name = self.param.get_name() self.is_set, self.default_value, self.value = self.param.get_value() self.modified = False self.has_range = self.param.has_range() self.is_strict = self.param.is_strict_enum() self.is_fake_value = self.param.is_fake_values_enum() self.enum_values = [] if self.has_range: self.range_min, self.range_max = self.param.get_range() else: for enum_value in self.param.get_enum_values(): self.enum_values.append(parameter_enum_value(self.is_fake_value, enum_value[0], enum_value[1])) def get_name(self): return self.name def get_type(self): return self.param.get_type() def get_value(self): return self.value def get_default_value(self): if not self.is_fake_value: return str(self.default_value) for enum_value in self.get_enum_values(): if enum_value.value == self.default_value: return enum_value.get_description() return "???" def set_value(self, value): self.value = value self.modified = True def reset_value(self): self.value = self.default_value def get_short_description(self): return self.param.get_short_description() def maybe_save_value(self): if self.modified: self.param.set_value(self.value) self.modified = False def get_range(self): return self.range_min, self.range_max def has_enum(self): return len(self.enum_values) != 0 def is_strict_enum(self): return self.is_strict def get_enum_values(self): return self.enum_values GObject.type_register(parameter_store) def combobox_get_active_text(combobox, model_index = 0): model = combobox.get_model() active = combobox.get_active() if active < 0: return None return model[active][model_index] class cell_renderer_param(Gtk.CellRendererPixbuf): __gproperties__ = { "parameter": (GObject.TYPE_OBJECT, "Parameter", "Parameter", GObject.PARAM_READWRITE) } def __init__(self): Gtk.CellRendererPixbuf.__init__(self) self.parameter = None self.set_property('mode', Gtk.CellRendererMode.EDITABLE) self.set_property('mode', Gtk.CellRendererMode.ACTIVATABLE) self.renderer_text = Gtk.CellRendererText() self.renderer_toggle = Gtk.CellRendererToggle() self.renderer_combo = Gtk.CellRendererCombo() self.renderer_spinbutton = Gtk.CellRendererSpin() for r in (self.renderer_text, self.renderer_combo, self.renderer_spinbutton): r.connect("edited", self.on_edited) self.renderer = None self.edit_widget = None def do_set_property(self, pspec, value): if pspec.name == 'parameter': if value.get_type() == 'b': self.set_property('mode', Gtk.CellRendererMode.ACTIVATABLE) else: self.set_property('mode', Gtk.CellRendererMode.EDITABLE) else: sys.stderr.write(pspec.name) setattr(self, pspec.name, value) def do_get_property(self, pspec): return getattr(self, pspec.name) def choose_renderer(self): typechar = self.parameter.get_type() value = self.parameter.get_value() if typechar == "b": self.renderer = self.renderer_toggle self.renderer.set_activatable(True) self.renderer.set_active(value) self.renderer.set_property("xalign", 0.0) return if self.parameter.has_enum(): self.renderer = self.renderer_combo m = Gtk.ListStore(str, parameter_enum_value) for value in self.parameter.get_enum_values(): m.append([value.get_description(), value]) self.renderer.set_property("model",m) self.renderer.set_property('text-column', 0) self.renderer.set_property('editable', True) self.renderer.set_property('has_entry', not self.parameter.is_strict_enum()) value = self.parameter.get_value() if self.parameter.is_fake_value: text = "???" for enum_value in self.parameter.get_enum_values(): if enum_value.value == value: text = enum_value.get_description() break else: text = str(value) self.renderer.set_property('text', text) return if typechar == 'u' or typechar == 'i': self.renderer = self.renderer_spinbutton self.renderer.set_property('text', str(value)) self.renderer.set_property('editable', True) if self.parameter.has_range: range_min, range_max = self.parameter.get_range() self.renderer.set_property('adjustment', Gtk.Adjustment(value, range_min, range_max, 1, abs(int((range_max - range_min) / 10)))) else: self.renderer.set_property('adjustment', Gtk.Adjustment(value, 0, 100000, 1, 1000)) return self.renderer = self.renderer_text self.renderer.set_property('editable', True) self.renderer.set_property('text', self.parameter.get_value()) def do_render(self, ctx, widget, bg_area, cell_area, flags): self.choose_renderer() return self.renderer.render(ctx, widget, bg_area, cell_area, flags) def do_get_size(self, widget, cell_area=None): self.choose_renderer() return self.renderer.get_size(widget, cell_area) def do_activate(self, event, widget, path, background_area, cell_area, flags): self.choose_renderer() if self.parameter.get_type() == 'b': self.parameter.set_value(not self.parameter.get_value()) widget.get_model()[path][COLUMN_ISSET] = "modified" return True def on_edited(self, renderer, path, value_str): parameter = self.edit_parameter widget = self.edit_widget model = self.edit_tree.get_model() self.edit_widget = None typechar = parameter.get_type() if type(widget) == Gtk.ComboBox: value = combobox_get_active_text(widget, 1) if value == None: return value_str = value.value elif type(widget) == Gtk.ComboBoxText: enum_value = combobox_get_active_text(widget, 1) if enum_value: value_str = enum_value.value else: value_str = widget.get_active_text() if typechar == 'u' or typechar == 'i': try: value = int(value_str) except ValueError, e: # Hide the widget (because it may display something else than what user typed in) widget.hide() # Display the error mdlg = Gtk.MessageDialog(buttons = Gtk.ButtonsType.OK, message_format = "Invalid value. Please enter an integer number.") mdlg.run() mdlg.hide() # Return the focus back to the tree to prevent buttons from stealing it self.edit_tree.grab_focus() return else: value = value_str parameter.set_value(value) model[path][COLUMN_ISSET] = "modified" self.edit_tree.grab_focus() def do_start_editing(self, event, widget, path, background_area, cell_area, flags): # this happens when edit requested using keyboard if not event: event = Gdk.Event(Gdk.NOTHING) self.choose_renderer() ret = self.renderer.start_editing(event, widget, path, background_area, cell_area, flags) self.edit_widget = ret self.edit_tree = widget self.edit_parameter = self.parameter return ret GObject.type_register(cell_renderer_param) class jack_params_configure_command(configure_command): def __init__(self, jack, path): self.jack = jack self.path = path self.is_setting = False def reset_value(self, row_path): row = self.liststore[row_path] param = row[COLUMN_PARAMETER] param.reset_value() row[COLUMN_ISSET] = "reset" def do_row_activated(self, treeview, path, view_column): if view_column == self.tvcolumn_is_set: self.reset_value(path) def do_button_press_event(self, tree, event): if event.type != Gdk.EventType._2BUTTON_PRESS: return False # this is needed for proper double-click handling in the list; don't ask me why, I don't know # it's probably because _2BUTTON_PRESS event is still delivered to tree view, automatically deactivating # the newly created edit widget (which gets created on second BUTTON_PRESS but before _2BUTTON_PRESS) # deactivating the widget causes it to be deleted return True def do_key_press_event(self, tree, event): (row_path, cur) = self.treeview.get_cursor() # if Delete was pressed, reset the value #if event.get_state() == 0 and event.keyval == Gdk.KEY_Delete: if event.keyval == Gdk.KEY_Delete: self.reset_value(row_path) tree.queue_draw() return True # prevent ESC from activating the editor if event.string < " ": return False # single-key data entry: if the control is a text entry, spin button or combo box/combo box entry, # then edit the current and set the text value to what user has already typed in (row_path, cur) = self.treeview.get_cursor() param = self.liststore[row_path][COLUMN_PARAMETER] ptype = param.get_type() # we don't care about booleans if ptype == 'b': return False # accept only digits for integer input (or a minus, but only if it's a signed field) if ptype in ('i', 'u'): if not (event.string.isdigit() or (event.string == "-" and ptype == 'i')): return False # Start cell editing # MAYBE: call a specially crafted cell_renderer_param method for this self.treeview.set_cursor_on_cell(row_path, self.tvcolumn_value, self.renderer_value.renderer, True) # cell_renderer_param::on_start_editing() should set edit_widget. # if edit operation has failed (didn't create a widget), pass the key on # MAYBE: call a specially crafted cell_renderer_param method to do this check if self.renderer_value.edit_widget == None: return widget = self.renderer_value.edit_widget if type(widget) in (Gtk.Entry, Gtk.ComboBoxText): # (combo or plain) text entry - set the content and move the cursor to the end sl = len(event.string) widget.set_text(event.string) widget.select_region(sl, sl) return True if type(self.renderer_value.edit_widget) == Gtk.SpinButton: # spin button - set the value and move the cursor to the end if event.string == "-": # special case for minus sign (which can't be converted to float) widget.set_text(event.string) else: widget.set_value(float(event.string)) sl = len(widget.get_text()) widget.select_region(sl, sl) return True if type(self.renderer_value.edit_widget) == Gtk.ComboBox: # combo box - select the first item that starts with typed character model = widget.get_model() item = -1 iter = model.get_iter_root() while iter != None: if model.get_value(iter, 0).startswith(event.string): item = model.get_path(iter)[0] break iter = model.iter_next(iter) widget.set_active(item) return True return False def on_cursor_changed(self, tree): (row_path, cur) = self.treeview.get_cursor() if not self.is_setting and cur != None and cur.get_title() != self.tvcolumn_value.get_title(): self.is_setting = True try: self.treeview.set_cursor_on_cell(row_path, self.tvcolumn_value, self.renderer_value.renderer, False) finally: self.is_setting = False def ok_clicked(self, dlg): if self.renderer_value.edit_widget: self.renderer_value.edit_widget.editing_done() def _on_query_tooltip(self, treeview, x, y, keyboard_tip, tooltip): """Handle tooltips for the cells""" try: (path, column, out_x, out_y) = treeview.get_path_at_pos(x, y) if not path: return False except TypeError: return False # Horrible-fix to skip the treeview's header row intpath = int(path.to_string()) if intpath == 0: return False elif intpath > 0: path = Gtk.TreePath(str(intpath - 1)) text = '' if column.get_title() in (self.tvcolumn_value.get_title(), self.tvcolumn_parameter.get_title()): text = self.liststore[path][COLUMN_LONGDESC] elif column.get_title() == self.tvcolumn_is_set.get_title(): if self.liststore[path][COLUMN_ISSET] == "default": return False if self.liststore[path][COLUMN_ISSET] == 'set': text += _("Double-click to schedule reset of value to %s") % \ self.liststore[path][COLUMN_PARAMETER].get_default_value() else: text = _("Value will be reset to %s") % \ self.liststore[path][COLUMN_PARAMETER].get_default_value() else: return False tooltip.set_text(text) return True def do_destroy(self, *args): for row in self.liststore: param = row[COLUMN_PARAMETER] reset = (row[COLUMN_ISSET] == "reset") if reset: param.param.reset_value() else: if param.modified: param.maybe_save_value() def activate(self, *args, **kwargs): jack = self.jack self.liststore = Gtk.ListStore(GObject.TYPE_STRING, parameter_store, GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING) self.treeview = Gtk.TreeView(self.liststore) self.treeview.set_rules_hint(True) self.treeview.set_has_tooltip(True) self.treeview.set_enable_search(False) renderer_text = Gtk.CellRendererText() renderer_toggle = Gtk.CellRendererToggle() renderer_value = cell_renderer_param() self.renderer_value = renderer_value # save for use in event handler methods self.tvcolumn_parameter = Gtk.TreeViewColumn('Parameter', renderer_text, text=COLUMN_NAME) self.tvcolumn_is_set = Gtk.TreeViewColumn('Status', renderer_text, text=COLUMN_ISSET) self.tvcolumn_value = Gtk.TreeViewColumn('Value', renderer_value, parameter=COLUMN_PARAMETER) self.tvcolumn_description = Gtk.TreeViewColumn('Description', renderer_text, text=COLUMN_SHORTDESC) self.tvcolumn_value.set_resizable(True) self.tvcolumn_value.set_min_width(100) self.treeview.append_column(self.tvcolumn_parameter) self.treeview.append_column(self.tvcolumn_is_set) self.treeview.append_column(self.tvcolumn_value) self.treeview.append_column(self.tvcolumn_description) param_names = jack.get_param_names(self.path) for name in param_names: param = parameter(jack, self.path + [name]) store = parameter_store(param) if store.is_set: is_set = "set" else: is_set = "default" self.liststore.append([name, store, param.get_short_description(), param.get_long_description(), is_set]) self.treeview.connect("row-activated", self.do_row_activated) self.treeview.connect("cursor-changed", self.on_cursor_changed) self.treeview.connect("key-press-event", self.do_key_press_event) self.treeview.connect("button-press-event", self.do_button_press_event) if tooltips_active: self.treeview.connect("query-tooltip", self._on_query_tooltip) self.treeview.connect("destroy", self.do_destroy) if len(param_names): # move cursor to first row and 'value' column self.treeview.set_cursor(Gtk.TreePath(path=0), # path self.tvcolumn_value, # focus_column False) # start_editing return self.treeview class jack_engine_params_configure_command(jack_params_configure_command): def __init__(self, jack): jack_params_configure_command.__init__(self, jack, ['engine']) def get_description(self): return _('JACK engine') class jack_driver_params_configure_command(jack_params_configure_command): def __init__(self, jack): jack_params_configure_command.__init__(self, jack, ['driver']) def get_description(self): return _('JACK driver') def get_window_title(self): return _('JACK "%s" driver') % jack.get_selected_driver() class jack_internal_params_configure_command(jack_params_configure_command): def __init__(self, jack, name): self.name = name jack_params_configure_command.__init__(self, jack, ['internals', name]) def get_description(self): return _('JACK "%s"') % self.name class LadiControlCenter(LadiApp): _appname = 'ladi-control-center' _appname_long = _("LADI Control Center") _appid = 'org.linuxaudio.ladi.controlcenter' def quit(self, *args, **kwargs): self.window.destroy() Gtk.main_quit() @property def modules(self): return self._modules def __init__(self): LadiApp.__init__(self) jack = JackConfigProxy() # Init modules list modules = {'engine' : jack_engine_params_configure_command(jack), 'params' : jack_driver_params_configure_command(jack)} for internal in jack.read_container(['internals']): modules[str(internal)] = jack_internal_params_configure_command(jack, internal) self._modules = modules def _activate(self, **kwargs): if 'select' in kwargs: selected = kwargs['select'] else: selected = None # Init UI self.window = window = Gtk.Window.new(Gtk.WindowType.TOPLEVEL) vbox = Gtk.VBox() hbox = Gtk.HBox() notebook = Gtk.Notebook() vbox.pack_start(hbox, True, True, 12) hbox.pack_start(notebook, True, True, 2) window.set_title("LADI Settings") window.set_icon_name('preferences-system') window.set_resizable(True) notebook.set_tab_pos(Gtk.PositionType.LEFT) page_count = 0 modules = self.modules for mod in modules: treeview = modules[mod].run({}) container = Gtk.ScrolledWindow() container.set_min_content_width(400) container.set_min_content_height(400) container.set_policy(hscrollbar_policy=Gtk.PolicyType.AUTOMATIC, vscrollbar_policy=Gtk.PolicyType.AUTOMATIC) container.add(treeview) container.show_all() #vbox.show_all() try: tab_label = modules[mod].get_window_title() except: tab_label = modules[mod].get_description() notebook.append_page(container, Gtk.Label(tab_label)) if selected and selected == mod: notebook.set_current_page(page_count) page_count += 1 window.add(vbox) window.connect('destroy', self.quit) self.connect_signals_quit() def run(self, **kwargs): self._activate(**kwargs) self.window.show_all() Gtk.main() if __name__ == "__main__": _check_ladish() GObject.type_register(parameter_enum_value) parser = argparse.ArgumentParser(description=_('Convenient graphical interface for configuring JACK'), epilog=_('This program is part of the LADITools suite.')) parser.add_argument('-m', '--module', nargs=1, metavar='MODULE', help=_('select the module to configure')) parser.add_argument('-l', '--list-modules', action='store_true', help=_('list available modules')) parser.add_argument('--version', action='version', version="%(prog)s " + get_version_string()) options = parser.parse_args() app = LadiControlCenter() if options.list_modules and options.module: sys.stderr.write(_("Conflicting options, type %s --help for a list of options.") % sys.argv[0] + '\n') sys.stderr.flush() sys.exit(2) modules = app.modules if options.list_modules: sys.stderr.write(_("Available modules: ")) sys.stderr.write(' '.join(modules) + '\n') sys.stderr.flush() elif options.module: module = options.module[0] if not module in modules: sys.stderr.write(_("Module %(mod)s is not available, type '%(cmd)s -l' for a list of available modules.") % {'mod' : module, 'cmd' : sys.argv[0]} + "\n") sys.stderr.flush() sys.exit(2) else: app.run(select=module) else: app.run() sys.exit(0) laditools-1.1.0/ladi-player000077500000000000000000000334511257536635300156610ustar00rootroot00000000000000#!/usr/bin/python # LADITools - Linux Audio Desktop Integration Tools # laditray - System tray integration for LADI # Copyright (C) 2012 Alessio Treglia # # 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 . import os import sys import time import gettext import argparse from laditools import _gettext_domain gettext.install(_gettext_domain) from laditools import get_version_string from laditools import LadiConfiguration from laditools import LadiApp from gi.repository import Gtk from gi.repository import GObject from laditools import LadiManager from laditools.gtk import LadiManagerGtk from laditools.gtk import find_data_file timeout_add = GObject.timeout_add class LadiPlayer(LadiManagerGtk, LadiApp): _appname = 'ladi-player' _appname_long = _("LADI Player") _appid = 'org.linuxaudio.ladi.player' # Default configuration _default_config = { 'autostart' : False, } def on_about(self, *args): LadiManagerGtk.on_about(self, parent=self.window_main, version=get_version_string()) def quit(self, *args, **kwargs): self.global_config.set_config_section (self.appname, self.config_dict) self.global_config.save() Gtk.main_quit() def _run_select_studio_dialog(self, title, *args): studio_list = self.get_ladish_controller().studio_list() if not studio_list: dlg = Gtk.MessageDialog(None,Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT, Gtk.MessageType.INFO, Gtk.ButtonsType.CLOSE, _('No studio is available.')) dlg.set_transient_for(self.window_main) dlg.set_title(title) dlg.run() dlg.destroy() return None dlg = Gtk.Dialog() treeview = Gtk.TreeView() model = Gtk.ListStore(GObject.TYPE_STRING) renderer = Gtk.CellRendererText() column = Gtk.TreeViewColumn('Available studios', renderer, text=0) treeview.set_model(model) treeview.append_column(column) treeview.set_cursor(Gtk.TreePath(path=0), focus_column=column, start_editing=False) for studio in studio_list: model.append((studio,)) dlg.set_transient_for(self.window_main) dlg.set_modal(True) dlg.set_destroy_with_parent(True) dlg.set_title(title) dlg.get_content_area().pack_start(child=treeview, expand=True, fill=True, padding=10) dlg.add_button(Gtk.STOCK_OK, Gtk.ResponseType.OK) dlg.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL) dlg.show_all() response = dlg.run() ret = None if response == Gtk.ResponseType.OK: path, column = treeview.get_cursor() ret = model[path][0] dlg.hide() return ret def _toolbuttons_set_active(self, group, **kwargs): buttons = getattr(self, "%s_status_buttons" % group) if 'all' in kwargs: status = kwargs['all'] for button in buttons: buttons[button].set_sensitive(status) else: for button in kwargs: buttons[button].set_sensitive(kwargs[button]) def jack_is_started(self, *args, **kwargs): while True: try: return LadiManagerGtk.jack_is_started(self, *args, **kwargs) except: time.sleep(0.5) continue def ladish_toolbuttons_set_active(self, **kwargs): self._toolbuttons_set_active('ladish', **kwargs) def jack_toolbuttons_set_active(self, **kwargs): self._toolbuttons_set_active('jack', **kwargs) def a2j_toolbuttons_set_active(self, **kwargs): self._toolbuttons_set_active('a2j', **kwargs) def ladish_status_buttons_update(self): buttons = self.ladish_status_buttons # Setup ladish controls if self.ladish_is_available(): # Buttons "rename" and "unload" if self.studio_is_loaded(): self.ladish_toolbuttons_set_active(unload=True, rename=True) # Buttons "start" and "stop" if self.studio_is_started(): self.ladish_toolbuttons_set_active(start=False, stop=True, save=True) else: self.ladish_toolbuttons_set_active(start=True, stop=False, save=False) else: self.ladish_toolbuttons_set_active(start=True, stop=False, save=False, unload=False, rename=False) else: self.ladish_toolbuttons_set_active(all=False) def jack_status_buttons_update(self): if not self.jack_is_available(): return buttons = self.jack_status_buttons ladish_available = self.ladish_is_available() jack_started = self.jack_is_started() if jack_started: self.jack_toolbuttons_set_active(jack_start=False, jack_stop=(not ladish_available), jack_reset_xruns=True, jack_reactivate=True) else: self.jack_toolbuttons_set_active(jack_start=True, jack_stop=False, jack_reset_xruns=False, jack_reactivate=True) def a2j_status_buttons_update(self): if not self.a2j_is_available(): self.a2j_toolbuttons_set_active(all=False) return buttons = self.a2j_status_buttons ladish_available = self.ladish_is_available() a2j_started = self.a2j_is_started() if not ladish_available: if a2j_started: self.a2j_toolbuttons_set_active(a2j_start=False, a2j_stop=True, a2j_reactivate=True) else: self.a2j_toolbuttons_set_active(a2j_start=True, a2j_stop=False, a2j_reactivate=True) else: self.a2j_toolbuttons_set_active(a2j_start=False, a2j_stop=False, a2j_reactivate=True) def update_status_buttons(self): # Update widgets self.ladish_status_buttons_update() self.jack_status_buttons_update() self.a2j_status_buttons_update() # Update status label and window icon if self.jack_is_started(): self.window_main.set_icon_name("ladi-started") if self.jack_is_realtime(): status_text = "RT | " else: status_text = "" # Get DSP Load status_text += str (round (float (self.jack_get_load()),1)) + "% | " # Get Xruns status_text += str (self.jack_get_xruns()) # Set a started status self.status_label.set_label (status_text) else: self.window_main.set_icon_name("ladi-stopped") self.status_label.set_label(_('Stopped')) def update(self, *args, **kwargs): self.update_status_buttons() LadiManagerGtk.update(self, *args, **kwargs) return True def _set_starting_status(self): self.window_main.set_icon_name("ladi-starting") def action_ladish_new(self, action, *args): self.studio_new() def action_ladish_start(self, action, *args): if self.studio_is_loaded(): if not self.studio_is_started(): self._set_starting_status() self.studio_start() self.update_status_buttons() else: self._set_starting_status() self.jack_start() self.update_status_buttons() def action_ladish_save(self, action, *args): self.studio_save() def action_ladish_stop(self, action, *args): if self.jack_is_started() and self.studio_is_started(): self.studio_stop() self.update_status_buttons() def action_ladish_rename(self, action, *args): self.studio_rename() self.update_status_buttons() def action_ladish_load(self, action, *args): selection = self._run_select_studio_dialog(_('Load studio')) if selection: self.studio_load(studio=selection) return selection def action_ladish_delete(self, action, *args): selection = self._run_select_studio_dialog(_('Delete studio')) if selection: LadiManager.studio_delete(self, studio=selection) return selection def action_ladish_unload(self, action, *args): while True: try: if self.studio_is_loaded(): self.studio_unload() self.update_status_buttons() break except: time.sleep(0.5) continue def action_ladish_reactivate(self, action, *args): self.ladish_reactivate() def action_jack_start(self, action, *args): self._set_starting_status() self.jack_start() def action_jack_stop(self, action, *args): self.jack_stop() def action_jack_reset_xruns(self, action, *args): self.jack_reset_xruns() def action_jack_reactivate(self, action, *args): self.jack_reactivate() def action_a2j_start(self, action, *args): self.a2j_start() def action_a2j_stop(self, action, *args): self.a2j_stop() def action_a2j_reactivate(self, action, *args): self.a2j_reactivate() def action_launcher_launch(self, action, *args): self.launcher_exec(command=self._launcher_which(action.get_name())) def __init__(self): # Initialize app LadiApp.__init__(self) # Handle the configuration self.global_config = LadiConfiguration(self.appname, self._default_config) self.config_dict = self.global_config.get_config_section (self.appname) autostart = bool(eval(self.config_dict['autostart'])) LadiManagerGtk.__init__(self, autostart) # Handle signals self.connect_signals_quit() # Build the UI builder = Gtk.Builder() ui_path = find_data_file("ladi-player.ui") builder.add_from_file(ui_path) sys.stderr.write( _("Loading interface from %s\n") % ui_path) sys.stderr.flush() # Retrieve objects self.window_main = builder.get_object("window_main") actiongroup_ladish = builder.get_object("actiongroup_ladish") actiongroup_jack = builder.get_object("actiongroup_jack") actiongroup_a2j = builder.get_object("actiongroup_a2j") actiongroup_launcher = builder.get_object("actiongroup_launcher") self.status_label = builder.get_object('toolbutton_label_status') # Setup status buttons self.ladish_status_buttons = ladish_status_buttons = {} self.jack_status_buttons = jack_status_buttons = {} self.a2j_status_buttons = a2j_status_buttons = {} self.launcher_status_buttons = launcher_status_buttons = {} for action in actiongroup_ladish.list_actions(): ladish_status_buttons[action.get_name()] = action for action in actiongroup_jack.list_actions(): jack_status_buttons[action.get_name()] = action for action in actiongroup_a2j.list_actions(): a2j_status_buttons[action.get_name()] = action for action in actiongroup_launcher.list_actions(): launcher_status_buttons[action.get_name()] = action # Remove launchers for unavailable commands for command in launcher_status_buttons: if not self._launcher_which(command): launcher_status_buttons[command].set_active(False) # Accelerators # accelgroup = builder.get_object("accelgroup1") # action = actiongroup_launcher.get_action("gladish") # action.set_accel_group(accelgroup) # action.set_accel_path("menu_studio") # Get the initial status self.update () # Add the auto update callback self.auto_updater = timeout_add (250, self.update, None) builder.connect_signals(self) def run(self): self.window_main.show_all() Gtk.main() if __name__ == "__main__": parser = argparse.ArgumentParser(description=_('graphical front-end that allows users to start, stop and ' 'monitor JACK, as well as start some JACK related applications.'), epilog=_('This program is part of the LADITools suite.')) parser.add_argument('--version', action='version', version="%(prog)s " + get_version_string()) parser.parse_args() Gtk.init(None) LadiPlayer().run() sys.exit(0) laditools-1.1.0/ladi-system-log000077500000000000000000000170131257536635300164640ustar00rootroot00000000000000#!/usr/bin/python # LADITools - Linux Audio Desktop Integration Tools # ladi-system-log - A log viewer for your Linux Audio Desktop # Copyright (C) 2011-2012 Alessio Treglia # Copyright (C) 2007-2010, Marc-Olivier Barre # Copyright (C) 2007-2009, Nedko Arnaudov # # 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 . import os import sys import signal from subprocess import Popen, PIPE import pty import termios import tty import gettext import argparse from laditools import _gettext_domain gettext.install(_gettext_domain) from laditools import get_version_string from laditools import LadiConfiguration from laditools import LadiApp from gi.repository import Gtk from gi.repository import GObject from gi.repository import Vte from laditools.gtk import find_data_file timeout_add = GObject.timeout_add # Default configuration max_lines_default = 100 # Output the last lines def read_last(lfile, lines): chunk_size = lines * 60 lfile.seek(0, 2) endpos = lfile.tell() pos = endpos - chunk_size if pos < 0: pos = 0 backlog = '' backlog_size = 0 lines += 1 while pos >= 0 and backlog_size <= lines: lfile.seek(pos, 0) s = lfile.read(chunk_size) pos = pos - chunk_size backlog_size += s.count("\n") backlog = s + backlog backlog = backlog.strip().split("\n") if len(backlog) > lines: backlog = backlog[-lines:] lfile.seek(endpos, 0) return backlog class LadiSystemLog(LadiApp): _appname = 'ladi-system-log' _appname_long = _("LADI Log Viewer") _appid = 'org.linuxaudio.ladi.logviewer' _default_config = { 'max_lines' : max_lines_default } def __init__ (self): LadiApp.__init__(self) self.log_files = [ { 'name': 'JACK', 'config_name': 'jackdbus_log', 'config_default': os.sep.join([os.environ['HOME'], ".log", "jack", "jackdbus.log"]) }, { 'name': 'LADISH', 'config_name': 'ladish_log', 'config_default': os.sep.join([os.environ['HOME'], ".log", "ladish", "ladish.log"]) }, { 'name': 'A2J', 'config_name': 'a2j_log', 'config_default': os.sep.join([os.environ['HOME'], ".log", "a2j", "a2j.log"]) }, ] # Handle the configuration for log in self.log_files: self._default_config[log['config_name']] = log['config_default'] self.global_config = LadiConfiguration (self.appname, self._default_config) self.param_dict = self.global_config.get_config_section (self.appname) self.connect_signals_quit() for log in self.log_files[:]: log['logfile_path'] = self.param_dict[log['config_name']] # skip logfiles that dont exist if not os.access(log['logfile_path'], os.R_OK): self.log_files.remove(log) sys.stderr.write( _("Skipping '%s' because it does not exist\n") % log['logfile_path']) else: sys.stderr.write( _("Watching %s\n") % log['logfile_path']) sys.stderr.flush() max_lines_text = self.param_dict['max_lines'] self.max_lines = int (max_lines_text) # Load the glade file uifile = find_data_file('ladi-system-log.ui') builder = Gtk.Builder() builder.add_from_file(uifile) sys.stderr.write( _("Loading interface from %s\n") % uifile) sys.stderr.flush() # Get the ui ready for action self.event_dict = {"on_ladilog_ui_destroy" : self.quit, "on_ladilog_ui_delete" : self.on_delete, "on_close_button_clicked" : self.quit, "on_clear_button_clicked" : self.on_clear_text, "on_purge_button_clicked" : self.on_purge} builder.connect_signals(self.event_dict) self.ui = ui = builder.get_object("ladilog_ui") self.logview_notebook = builder.get_object ("ladilog_notebook") # Create our terminal and display it for log in self.log_files: log['scrolled_window'] = sw = Gtk.ScrolledWindow() log['term'] = term = Vte.Terminal.new () sw.set_policy(hscrollbar_policy=Gtk.PolicyType.AUTOMATIC, vscrollbar_policy=Gtk.PolicyType.ALWAYS) sw.add(term) sw.show() term.set_scroll_on_output(True) log["tab_label"] = Gtk.Label(label=log["name"]) self.logview_notebook.append_page(log["scrolled_window"], log["tab_label"]) # Make it do something... for log in self.log_files: try: log['log_file'] = open(log['logfile_path'], "rb") sys.stderr.write (_("Opening %s...\n") % log['logfile_path']) lines = read_last(log['log_file'], self.max_lines) for line in lines: line = line.strip('\r\n') + '\r\n' log["term"].feed(line) except ValueError: sys.stderr.write( _("You called Popen with invalid arguments... dumbass\n") ) except: sys.stderr.write( _("Unexpected error: %s\n") % (sys.exc_info ()[0])) finally: sys.stderr.flush() self.auto_updater = timeout_add(250, self.update, None) def update(self, user_data = None): # Append latest output to the buffer for log in self.log_files: line = log['log_file'].readline() while line: log["term"].feed(line + '\r') line = log['log_file'].readline() log['log_file'].seek(log['log_file'].tell()) return True def on_delete(self, widget=None, data=None): return False def quit (self, *args, **kwargs): self.global_config.set_config_section (self.appname, self.param_dict) self.global_config.save () Gtk.main_quit () def on_clear_text (self, data=None): current_view = self.logview_notebook.get_current_page () self.log_files[current_view]["term"].feed ("\033[2J\033[;f", -1) def on_purge (self, data=None): current_view = self.logview_notebook.get_current_page () # Opens the file in write anew mode thus clearing the file and close it right away open (self.log_files[current_view]['logfile_path'], "w+") self.log_files[current_view]["term"].feed ("\033[2J\033[;f", -1) def run (self): self.ui.show_all() Gtk.main () if __name__ == '__main__': parser = argparse.ArgumentParser(description=_('JACK, ladish and a2jmidid log viewer'), epilog=_('This program is part of the LADITools suite.')) parser.add_argument('--version', action='version', version="%(prog)s " + get_version_string()) parser.parse_args() Gtk.init(None) LadiSystemLog().run() sys.exit(0) laditools-1.1.0/ladi-system-tray000077500000000000000000000235011257536635300166610ustar00rootroot00000000000000#!/usr/bin/python # LADITools - Linux Audio Desktop Integration Tools # ladi-system-tray - System tray integration for LADI # Copyright (C) 2011-2012 Alessio Treglia # Copyright (C) 2007-2010, Marc-Olivier Barre # Copyright (C) 2007-2009, Nedko Arnaudov # # 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 . import os import sys import gettext import argparse from laditools import _gettext_domain gettext.install(_gettext_domain) from laditools import get_version_string from laditools import LadiConfiguration from laditools import LadiManager from laditools import LadiApp from gi.repository import Gtk from gi.repository import Gdk from gi.repository import GObject try: from gi.repository import AppIndicator3 except: AppIndicator3 = None from laditools.gtk import LadiMenu from laditools.gtk import find_data_file timeout_add = GObject.timeout_add class LadiStatusIcon (LadiMenu, LadiApp): _appname = 'ladi-system-tray' _appname_long = _("LADI System Tray") _appid = 'org.linuxaudio.ladi.systemtray' # Default configuration _default_config = { 'autostart' : False, } def on_about(self, *args): LadiMenu.on_about(self, version=get_version_string()) def quit(self, *args, **kwargs): # Some default config might need to be injected in the config file, # we handle all that before we quit. self.global_config.set_config_section (self.appname, self.config_dict) self.global_config.save () Gtk.main_quit() def set_tooltip_text(self, text): pass def __init__ (self, config_filename = None): # Handle the configuration self.icon_state = "" self.last_status_text = "" self.diagnose_text = None self.status_icons = {'started' : 'ladi-started', 'stopped' : 'ladi-stopped', 'starting' : 'ladi-starting'} self.global_config = LadiConfiguration(self.appname, self._default_config, config_filename) self.config_dict = self.global_config.get_config_section (self.appname) autostart = bool(eval(self.config_dict['autostart'])) # Build the UI LadiMenu.__init__(self, autostart, quit = self.quit) LadiApp.__init__(self) self.connect_signals_quit() def menu_activate(self, status_icon, button, activate_time, user_data=None): menu = self.create_menu() menu.popup (parent_menu_shell=None, parent_menu_item=None, func=self.position_menu, data=self, button=button, activate_time=activate_time) menu.reposition () def set_starting_status (self): self.set_tooltip_safe ("JACK is starting") self.set_icon ("starting") def set_tooltip_safe (self, text): if text != self.last_status_text: self.set_tooltip_text (text) self.last_status_text = text def run(self): Gtk.main () class LadiStatusTray(Gtk.StatusIcon, LadiStatusIcon): def __init__(self): LadiStatusIcon.__init__(self) GObject.GObject.__init__ (self) self.set_icon ("stopped") # Get the initial status self.update () # Add the auto update callback self.auto_updater = timeout_add (250, self.update, None) # Make the menu popup when the icon is right clicked self.connect ("popup-menu", self.menu_activate) self.set_title(self.appname_long) def do_button_press_event(self, event): if event.type != Gdk.EventType._2BUTTON_PRESS: return False self.on_menu_launch_handler(None, "gladish") return True def update (self, user_data = None): try: if self.jack_is_started(): # Get Realtime status if self.jack_is_realtime(): status_text = "RT | " else: status_text = "" # Get DSP Load status_text += str (round (float (self.jack_get_load()),1)) + "% | " # Get Xruns status_text += str (self.jack_get_xruns()) # Set a started status self.set_tooltip_safe (status_text) self.set_icon ("started") else: self.set_tooltip_safe ("JACK is stopped") self.set_icon ("stopped") self.clear_diagnose_text() except Exception, e: self.set_tooltip_safe ("JACK is sick") self.set_diagnose_text(repr(e)) self.set_icon ("stopped") self.clear_jack_proxies() finally: LadiManager.update(self) return True def set_icon (self, newstate): if self.icon_state == newstate: return self.icon_state = newstate self.set_from_icon_name(self.status_icons[newstate]) class LadiStatusIndicator(LadiStatusIcon): def update (self, user_data = None): try: if self.jack_is_started(): # Get Realtime status if self.jack_is_realtime(): status_text = "RT | " else: status_text = "" # Get DSP Load status_text += str (round (float (self.jack_get_load()),1)) + "% | " # Get Xruns status_text += str (self.jack_get_xruns()) # Set a started status self.set_tooltip_safe (status_text) self.set_icon ("started") else: self.set_tooltip_safe ("JACK is stopped") self.set_icon ("stopped") self.clear_diagnose_text() except Exception, e: self.set_tooltip_safe ("JACK is sick") self.set_diagnose_text(repr(e)) self.set_icon ("stopped") self.clear_jack_proxies() finally: LadiManager.update(self) return True def set_icon (self, newstate): if self.icon_state == newstate: return self.icon_state = newstate self.indicator.set_icon(self.status_icons[newstate]) def create_menu(self): menu_items = [] ladish_available = self.ladish_is_available() menu_items.append((Gtk.ImageMenuItem(_("LADI Player")), self.on_menu_launch_handler, "ladi-player")) if ladish_available: menu_items.append((Gtk.ImageMenuItem(_("Session editor")), self.on_menu_launch_handler, "gladish")) menu_items.append((Gtk.SeparatorMenuItem.new(),)) menu_items.append((Gtk.ImageMenuItem(_("Settings")), self.on_menu_launch_handler, "ladi-control-center")) menu_items.append((Gtk.ImageMenuItem(_("Log Viewer")), self.on_menu_launch_handler, "ladi-system-log")) menu_items.append((Gtk.SeparatorMenuItem.new(),)) if hasattr(self, 'on_about'): menu_items.append((Gtk.ImageMenuItem(_("About")), self.on_about, None)) menu_items.append((Gtk.ImageMenuItem(_("Quit")), self.on_menu_command, self.quit)) menu = Gtk.Menu() for menu_tuple in menu_items: item = menu_tuple[0] if len(menu_tuple) > 1: callback = menu_tuple[1] exec_path = menu_tuple[2] menu.append(item) if type(item) is not Gtk.SeparatorMenuItem: if callback in (self.studio_list_fill, self.configure_list_fill): item.set_submenu(Gtk.Menu()) item.connect("activate", callback, exec_path) menu.show_all() return menu def __init__(self): LadiStatusIcon.__init__(self) self.indicator = indicator = AppIndicator3.Indicator.new('ladi-indicator', find_data_file('scalable/apps/laditools.svg'), AppIndicator3.IndicatorCategory.APPLICATION_STATUS) self.menu = menu = self.create_menu() indicator.set_status(AppIndicator3.IndicatorStatus.ACTIVE) indicator.set_menu(menu) menu.show() # Get the initial status self.update () # Add the auto update callback self.auto_updater = timeout_add (250, self.update, None) if __name__ == "__main__": parser = argparse.ArgumentParser(description=_('system tray icon that allows users to start, stop and ' 'monitor JACK, as well as start some JACK related applications'), epilog=_('This program is part of the LADITools suite.')) parser.add_argument('--no-appindicator', action='store_true', help=_('Force fallback to system tray.')) parser.add_argument('--version', action='version', version="%(prog)s " + get_version_string()) args = parser.parse_args() Gtk.init(None) if (not args.no_appindicator) and AppIndicator3: LadiStatusIndicator().run() else: LadiStatusTray().run() sys.exit(0) laditools-1.1.0/laditools/000077500000000000000000000000001257536635300155145ustar00rootroot00000000000000laditools-1.1.0/laditools/__init__.py000066400000000000000000000032211257536635300176230ustar00rootroot00000000000000#!/usr/bin/python # LADITools - Linux Audio Desktop Integration Tools # Copyright (C) 2011-2012 Alessio Treglia # Copyright (C) 2007-2010, Marc-Olivier Barre # Copyright (C) 2007-2010, Nedko Arnaudov # # 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 . __version__ = (1, 0, 1) _gettext_domain = 'laditools' get_version_string = lambda: '.'.join((str(comp)) for comp in __version__) from .config import LadiConfiguration from .a2j import A2jController from .ladish import LadishProxy, LadishStatusType, LadishProxyError, check_ladish from .jack import JackController, JackConfigProxy, JackConfigParameter from .manager import LadiManager from .application import LadiApp from . import gtk __all__ = ["gtk", "LadiApp", "LadiConfiguration", "LadiManager", "A2jController", "LadishProxy", "LadishStatusType", "LadishProxyError", "check_ladish", "JackController", "JackConfigProxy", "JackConfigParameter"] laditools-1.1.0/laditools/a2j.py000066400000000000000000000025451257536635300165500ustar00rootroot00000000000000#!/usr/bin/python # LADITools - Linux Audio Desktop Integration Tools # Copyright (C) 2011-2012 Alessio Treglia # Copyright (C) 2007-2010, Marc-Olivier Barre # Copyright (C) 2007-2009, Nedko Arnaudov # # 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 . from .controller import LadiController name_base = 'org.gna.home.a2jmidid' iface_name = name_base + '.control' service_name = name_base obj_path = '/' class A2jController(LadiController): def __init__(self): LadiController.__init__(self, dbus_type='SessionBus', service_name=service_name, obj_path=obj_path, iface_name=iface_name) laditools-1.1.0/laditools/application.py000066400000000000000000000026331257536635300203750ustar00rootroot00000000000000#!/usr/bin/python # LADITools - Linux Audio Desktop Integration Tools # Copyright (C) 2011-2012 Alessio Treglia # # 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 . import signal class LadiApp(object): @property def appname(self): return self._appname @property def appname_long(self): return self._appname_long @property def appid(self): return self._appid def connect_signals_quit(self, signals=[], sig_handler=None): if not signals: signals = [signal.SIGTERM, signal.SIGINT] if not sig_handler: sig_handler = self.quit for sig in signals: signal.signal(sig, sig_handler) signal.signal(sig, sig_handler) def run(self): raise NotImplementedError def quit(self): raise NotImplementedError laditools-1.1.0/laditools/config.py000066400000000000000000000111241257536635300173320ustar00rootroot00000000000000#!/usr/bin/python # LADITools - Linux Audio Desktop Integration Tools # Copyright (C) 2011-2012 Alessio Treglia # Copyright (C) 2007-2010, Marc-Olivier Barre # Copyright (C) 2007-2009, Nedko Arnaudov # # 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 . from os import environ, sep, mkdir, path from os.path import exists from xdg import BaseDirectory as basedir import sys if sys.version_info.major == 3: from configparser import SafeConfigParser, MissingSectionHeaderError elif sys.version_info.major == 2: from ConfigParser import SafeConfigParser, MissingSectionHeaderError else: raise Exception("Unsupported Python's interpreter version.") try: import yaml except: yaml = None class MalformedConfigError(Exception): def __init__(self): Exception.__init__(self, """Malformed configuration file, \ delete the file '%s' and let me create a new one.""" % config_filename) # Note to users of the config class. Only applications should create an instance # of the config object. The ladimenu is *NOT* an application... class LadiConfiguration(SafeConfigParser): """Convenient class for parsing and updating configuration files. It is recommended to avoid abuses of these objects, only applications should create instances of this class. """ def _migrate_configuration(self): """Migrate configuration from old YAML coding style to the new one.""" try: with open (self.config_filename, 'r') as config_file: appdict = yaml.load (config_file) except: sys.stderr.write("Config file doesn't exist, creating a new one...\n") sys.stderr.flush() return 1 for section in appdict: if not section in self.sections(): self.add_section(section) for opt in appdict[section]: if not isinstance(opt, dict): self.set(section, opt, str(appdict[section][opt])) else: for k in opt: self.set(section, k, opt[k]) return 0 def __init__ (self, app_name, defaults = {}, filename = None): SafeConfigParser.__init__(self) # First setup default values for apps specified # by the call to the contructor self.set_config_section(app_name, defaults) self.config_dir = config_dir = path.join(basedir.xdg_config_home, 'laditools') if not filename: filename = app_name + '.conf' self.config_filename = config_filename = path.join(config_dir, filename) if not exists (config_dir): mkdir (config_dir, 0o755) try: self.read(config_filename) except MissingSectionHeaderError: if yaml: if self._migrate_configuration() == 0: self.save() else: # new empty file pass # go on otherwise except: raise MalformedConfigError() def get_config_section (self, app_name): """Returns the section named from the global configuration. If the section doesn't exist, returns an empty dictionary.""" appdict = {} if self.has_section(app_name): for opt in self.options(app_name): appdict[opt] = self.get(app_name, opt) return appdict # Saves the section named into the global config def set_config_section (self, app_name, param_dict): """Save the section named into the global configuration.""" if not self.has_section(app_name): self.add_section(app_name) for key in param_dict: value = param_dict[key] self.set(app_name, key, str(value)) # This writes the config file to the disk def save (self): """Write configuration to file.""" config_file = open (self.config_filename, 'w') self.write(config_file) config_file.close () laditools-1.1.0/laditools/controller.py000066400000000000000000000037201257536635300202530ustar00rootroot00000000000000#!/usr/bin/python # LADITools - Linux Audio Desktop Integration Tools # Copyright (C) 2012 Alessio Treglia # # 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 . import dbus import sys class LadiController(object): """Wrap common routines used by D-Bus objects. It is recommended to use one of the available implementations instead of creating instances of this class. """ def __init__(self, dbus_type, service_name, obj_path, iface_name, args = None): # Connect to the bus self.bus = getattr(dbus, dbus_type)() self.controller_obj = self.bus.get_object (service_name, obj_path) self.controller_iface = dbus.Interface (self.controller_obj, iface_name) def is_available (self): """Check if the service is available.""" try: self.is_started () return True except Exception, err: sys.stderr.write(str(err) + '\n') sys.stderr.flush() return False def is_started (self): """Check if the service is running.""" return self.controller_iface.is_started () def start(self): """Start the service.""" self.controller_iface.start() def stop(self): """Stop the service.""" self.controller_iface.stop() def kill(self): """Kill the service.""" self.controller_iface.exit() laditools-1.1.0/laditools/gtk/000077500000000000000000000000001257536635300163015ustar00rootroot00000000000000laditools-1.1.0/laditools/gtk/__init__.py000066400000000000000000000017531257536635300204200ustar00rootroot00000000000000#!/usr/bin/python # LADITools - Linux Audio Desktop Integration Tools # Copyright (C) 2011-2012 Alessio Treglia # # 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 . from .a2jmenu import A2jMenu from .manager import LadiManagerGtk from .menu import LadiMenu from .utils import find_data_file __all__ = ["A2jMenu", "LadiManagerGtk", "LadiMenu", "find_data_file"] laditools-1.1.0/laditools/gtk/a2jmenu.py000066400000000000000000000042531257536635300202200ustar00rootroot00000000000000#!/usr/bin/python # LADITools - Linux Audio Desktop Integration Tools # Copyright (C) 2011-2012 Alessio Treglia # Copyright (C) 2007-2010, Marc-Olivier Barre # Copyright (C) 2007-2009, Nedko Arnaudov # # 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 . from gi.repository import Gtk # TODO : somehow, we need stock icons. Nothing else can be used for ImageMenuItems class A2jMenu(object): def __init__(self): self.menu_items = [] self.menu_items.append((Gtk.ImageMenuItem(_("Start bridging")), self.on_menu_start)) self.menu_items.append((Gtk.ImageMenuItem(_("Stop bridging")), self.on_menu_stop)) self.menu_items.append((Gtk.SeparatorMenuItem(), None)) self.menu_items.append((Gtk.ImageMenuItem(_("Reactivate")), self.on_menu_reactivate)) self.menu_items.append((Gtk.ImageMenuItem(_("Quit")), self.on_menu_destroy)) self.menu = Gtk.Menu() for menu_tuple in self.menu_items: item, callback = menu_tuple self.menu.append(item) if callback: item.connect("activate", callback) self.menu.show_all() def on_menu_start(self, widget): self.set_starting_status() self.get_controller().start() def on_menu_stop(self, widget): self.get_controller().stop() def on_menu_reactivate(self, widget): self.get_controller().kill() def on_menu_destroy(self, widget): Gtk.main_quit() def menu_activate(self): self.menu.popup(None, None, None, 3, 0) self.menu.reposition() laditools-1.1.0/laditools/gtk/manager.py000066400000000000000000000117761257536635300203010ustar00rootroot00000000000000#!/usr/bin/python # LADITools - Linux Audio Desktop Integration Tools # Copyright (C) 2011-2012 Alessio Treglia # Copyright (C) 2007-2010: # * Marc-Olivier Barre # * Nedko Arnaudov # # 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 . import os import sys import subprocess from gi.repository import Gtk from gi.repository import GObject from gi.repository import GdkPixbuf from .. import _gettext_domain, get_version_string from .. import LadiManager from .utils import find_data_file class LadiManagerGtk(LadiManager): def __init__(self, jack_autostart): LadiManager.__init__(self, jack_autostart) def _launcher_which(self, command): for path in (':'.join(('.', os.getenv('PATH')))).split(':'): if command in os.listdir(path): return os.path.join(path, command) return None def set_diagnose_text(self, text): self.diagnose_text = text def clear_diagnose_text(self): self.diagnose_text = "" def name_dialog(self, title, label, oldname): dlg = Gtk.Dialog( title, None, Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT) dlg.add_buttons (Gtk.STOCK_CANCEL, Gtk.ResponseType.REJECT, Gtk.STOCK_OK, Gtk.ResponseType.ACCEPT) hbox = Gtk.HBox() hbox.pack_start(Gtk.Label(label), True, True, 0) entry = Gtk.Entry() entry.set_text(oldname) hbox.pack_start(entry, True, True, 0) dlg.vbox.pack_start(hbox, True, True, 0) dlg.show_all() #entry.set_activates_default(True) #dlg.set_default_response(Gtk.ResponseType.OK) ret = dlg.run() newname = entry.get_text().strip() dlg.destroy() if ret == Gtk.ResponseType.ACCEPT and newname and (newname not in self.studio_list()) and newname != oldname: return True, newname else: return False, oldname def studio_new(self, *args, **kwargs): accept, name = self.name_dialog(_("New studio"), _("Studio name"), "") if accept: LadiManager.studio_new(self, name=name) def studio_rename(self, *args, **kwargs): accept, name = self.name_dialog(_("Rename studio"), _("Studio name"), self.studio_name()) if accept: return LadiManager.studio_rename(self, name=name) return False def studio_delete(self, *args, **kwargs): if not 'studio' in kwargs: return False studio = kwargs['studio'] dlg = Gtk.MessageDialog(None, Gtk.DialogFlags.MODAL, Gtk.MessageType.ERROR, Gtk.ButtonsType.YES_NO, "") dlg.set_markup(_("Confirm studio delete")) dlg.format_secondary_text(_("Studio \"%s\" will be deleted. Are you sure?") % studio) ret = dlg.run() dlg.destroy() if ret == Gtk.ResponseType.YES: LadiManager.studio_delete(self, studio=studio) return True return False def studio_configure(self, item, event, module): LadiManager.launcher_exec(self, command=['%s' % self._launcher_which('ladi-control-center') , '-m', module]) def on_about(self, *args, **kwargs): logo_pixbuf = GdkPixbuf.Pixbuf.new_from_file(find_data_file("laditools_logo.svg")) copyright_str = u"""Copyright \xa9 2011-2012 Alessio Treglia Copyright \xa9 2007-2010 Marc-Olivier Barre Copyright \xa9 2007-2010 Nedko Arnaudov """ ad = Gtk.AboutDialog.new() if 'parent' in kwargs: ad.set_transient_for(kwargs['parent']) version_string = kwargs['version'] ad.set_program_name("LADITools") ad.set_comments(_("LADITools is a set of tools aiming to achieve the goals of the LADI project to improve desktop integration and user workflow of Linux audio system based on JACK and ladish.")) ad.set_logo(logo_pixbuf) ad.set_authors(["Marc-Olivier Barre", "Nedko Arnaudov", "Alessio Treglia"]) ad.set_copyright(copyright_str) ad.set_version(version_string) ad.set_license_type( Gtk.License.GPL_3_0) ad.set_translator_credits(_("translator-credits")) ad.set_website("https://launchpad.net/laditools/") ad.run() ad.destroy() laditools-1.1.0/laditools/gtk/menu.py000066400000000000000000000231031257536635300176160ustar00rootroot00000000000000#!/usr/bin/python # LADITools - Linux Audio Desktop Integration Tools # Copyright (C) 2011-2012 Alessio Treglia # Copyright (C) 2007-2010: # * Marc-Olivier Barre # * Nedko Arnaudov # # 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 . import os import sys import subprocess from gi.repository import Gtk from gi.repository import GObject from .. import _gettext_domain from .manager import LadiManagerGtk class LadiMenu(LadiManagerGtk): def __init__(self, jack_autostart, **kwargs): LadiManagerGtk.__init__(self, jack_autostart) self.handler = { 'quit' : Gtk.main_quit, } if 'quit_handler' in kwargs: self.handler['quit'] = kwargs['quit'] def on_menu_show_diagnose(self, widget, data=None): dlg = Gtk.MessageDialog(None, Gtk.DialogFlags.MODAL, Gtk.MessageType.ERROR, Gtk.ButtonsType.CLOSE, self.diagnose_text) dlg.set_title(_("Cannot communicate JACK D-Bus")) dlg.run() dlg.destroy() def on_menu_command(self, widget, function): try: function() except Exception, e: error = Gtk.MessageDialog(None, Gtk.DialogFlags.MODAL, Gtk.MessageType.ERROR, Gtk.ButtonsType.OK, _("Error executing ") + repr(function) + _("Unexpected error\n\n") + repr(e)) error.run() error.destroy() def on_menu_launch_handler(self, widget, command): commandline = command.split() commandline[0] = command = self._launcher_which(commandline[0]) if not command in self.proc_list: LadiManagerGtk.launcher_exec(self, command=commandline) else: LadiManagerGtk.launcher_kill(self, command=commandline) def menu_clear(self, menu): menu.foreach(lambda item,none: menu.remove(item), None) def configure_list_fill(self, widget, function): menu = widget.get_submenu() self.menu_clear(menu) try: jack = self.get_jack_configure() # 'engine' item item = Gtk.MenuItem(_("JACK engine")) item.show() menu.append(item) item.connect("button-release-event", function, "engine") # 'params' item item = Gtk.MenuItem(_('JACK "%s" driver') % jack.get_selected_driver()) item.show() menu.append(item) item.connect("button-release-event", function, "params") for internal in jack.read_container(['internals']): module = str(internal) item = Gtk.MenuItem(_('JACK "%s"') % module) item.show() menu.append(item) item.connect("button-release-event", function, module) except Exception, err: sys.stderr.write(str(err)) sys.stderr.flush() if not menu.get_children(): item = Gtk.MenuItem(_("Empty config list")) item.set_sensitive(False) item.show() menu.append(item) def studio_list_fill(self, widget, function): menu = widget.get_submenu() self.menu_clear(menu) try: for studio in self.studio_list(): item = Gtk.MenuItem(studio) item.show() menu.append(item) item.connect("button-release-event", function, studio) # "activate" is not used because of focus bug in pygtk except Exception, e: self.menu_clear(menu) item = Gtk.MenuItem(_("Error obtaining studio list")) item.set_sensitive(False) item.show() menu.append(item) if not menu.get_children(): item = Gtk.MenuItem(_("Empty studio list")) item.set_sensitive(False) item.show() menu.append(item) def create_menu(self): menu_items = [] ladish_available = self.ladish_is_available() jack_available = self.jack_is_available() a2j_available = self.a2j_is_available() if self.diagnose_text: menu_items.append((Gtk.ImageMenuItem(_("Diagnose")), self.on_menu_show_diagnose, None)) menu_items.append((Gtk.SeparatorMenuItem.new(), None, None)) if ladish_available: menu_items.append((Gtk.ImageMenuItem(_("Start gladish")), self.on_menu_launch_handler, "gladish")) menu_items.append((Gtk.ImageMenuItem("Configure ..."), self.configure_list_fill, self.studio_configure)) menu = Gtk.Menu() menu_items.append((Gtk.SeparatorMenuItem.new(),)) if ladish_available: menu_items.append((Gtk.ImageMenuItem(_("New studio...")), self.on_menu_command, self.studio_new)) menu_items.append((Gtk.ImageMenuItem(_("Load studio")), self.studio_list_fill, self.studio_load)) menu_items.append((Gtk.SeparatorMenuItem.new(), None, None)) if self.studio_is_loaded(): if self.studio_is_started(): menu_items.append((Gtk.ImageMenuItem(_("Stop studio")), self.on_menu_command, self.studio_stop)) menu_items.append((Gtk.ImageMenuItem(_("Save studio")), self.on_menu_command, self.studio_save)) else: menu_items.append((Gtk.ImageMenuItem(_("Start studio")), self.on_menu_command, self.studio_start)) menu_items.append((Gtk.ImageMenuItem(_("Rename studio")), self.on_menu_command, self.studio_rename)) menu_items.append((Gtk.ImageMenuItem(_("Unload studio")), self.on_menu_command, self.studio_unload)) else: menu_items.append((Gtk.ImageMenuItem(_("Start automatic studio")), self.on_menu_command, self.jack_start)) menu_items.append((Gtk.SeparatorMenuItem.new(), None, None)) menu_items.append((Gtk.ImageMenuItem(_("Delete studio")), self.studio_list_fill, self.studio_delete)) menu_items.append((Gtk.ImageMenuItem(_("Reactivate ladishd")), self.on_menu_command, self.ladish_reactivate)) menu_items.append((Gtk.SeparatorMenuItem.new(), None, None)) if jack_available: if not self.jack_is_started(): if not ladish_available: menu_items.append((Gtk.ImageMenuItem(_("Start JACK server")), self.on_menu_command, self.jack_start)) else: menu_items.append((Gtk.ImageMenuItem(_("Reset Xruns")), self.on_menu_command, self.jack_reset_xruns)) if not ladish_available: menu_items.append((Gtk.ImageMenuItem(_("Stop JACK server")), self.on_menu_command, self.jack_stop)) menu_items.append((Gtk.ImageMenuItem(_("Reactivate JACK")), self.on_menu_command, self.jack_reactivate)) menu_items.append((Gtk.SeparatorMenuItem.new(), None, None)) if a2j_available: # when a2jmidid is used in used with ladish, a2j script should be used # for managing bridge "active" lifetime if not ladish_available: if not self.a2j_is_started(): menu_items.append((Gtk.ImageMenuItem(_("Start A2J bridge")), self.on_menu_command, self.a2j_start)) else: menu_items.append((Gtk.ImageMenuItem(_("Stop A2J bridge")), self.on_menu_command, self.a2j_stop)) menu_items.append((Gtk.ImageMenuItem(_("Reactivate A2J")), self.on_menu_command, self.a2j_reactivate)) menu_items.append((Gtk.SeparatorMenuItem.new(), None, None)) if hasattr(self, 'on_about'): menu_items.append((Gtk.ImageMenuItem(_("About")), self.on_about, None)) menu_items.append((Gtk.ImageMenuItem(_("Quit")), self.on_menu_command, self.handler['quit'])) for menu_tuple in menu_items: item = menu_tuple[0] if len(menu_tuple) > 1: callback = menu_tuple[1] exec_path = menu_tuple[2] menu.append(item) if type(item) is not Gtk.SeparatorMenuItem: if callback in (self.studio_list_fill, self.configure_list_fill): item.set_submenu(Gtk.Menu()) item.connect("activate", callback, exec_path) menu.show_all() return menu def studio_load(self, item, event, studio): LadiManagerGtk.studio_load(self, item=item, event=event, studio=studio) def studio_delete(self, item, event, studio): LadiManagerGtk.studio_delete(self, item=item, event=event, studio=studio) def menu_activate(self): menu = self.create_menu() menu.popup(parent_menu_shell=None, parent_menu_item=None, func=None, data=None, button=3, activate_time=0) menu.reposition() laditools-1.1.0/laditools/gtk/utils.py000066400000000000000000000031131257536635300200110ustar00rootroot00000000000000#!/usr/bin/python # LADITools - Linux Audio Desktop Integration Tools # Copyright (C) 2011-2012 Alessio Treglia # Copyright (C) 2007-2010, Marc-Olivier Barre # Copyright (C) 2007-2010, Nedko Arnaudov # # 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 . import os import sys def find_data_file(path): start_dir = os.path.dirname(sys.argv[0]) if not start_dir: start_dir = "." paths = [ os.path.join(sys.path[0], 'data', path), os.path.join(sys.path[0], 'data', 'icons', path), os.path.join(sys.prefix, 'share', 'icons', 'hicolor', path), os.path.join(sys.prefix, 'share', 'laditools', path), os.path.join(sys.prefix, 'share', 'laditools', 'data', path), ] for path in paths: #print 'Checking "%s"...' % path if os.path.isfile(path): #print 'Found data file in "%s"' % path return path raise Exception('Data file "%s" not found' % path) laditools-1.1.0/laditools/jack.py000066400000000000000000000201021257536635300167710ustar00rootroot00000000000000#!/usr/bin/python # LADITools - Linux Audio Desktop Integration Tools # Copyright (C) 2011-2012 Alessio Treglia # Copyright (C) 2007-2010, Marc-Olivier Barre # Copyright (C) 2007-2009, Nedko Arnaudov # # 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 . import sys import dbus from .controller import LadiController name_base = 'org.jackaudio' ctrl_iface_name = name_base + '.JackControl' conf_iface_name = name_base + '.Configure' service_name = name_base + '.service' obj_path = '/org/jackaudio/Controller' def _dbus_type_to_python_type (dbus_value): if type (dbus_value) == dbus.Boolean: return bool(dbus_value) if type (dbus_value) == dbus.Int32 or type (dbus_value) == dbus.UInt32: return int(dbus_value) if type (dbus_value) == dbus.String: return str(dbus_value) if type (dbus_value) == dbus.Byte: return str (dbus_value) return dbus_value class JackController(LadiController): """Wrapper for controlling and monitoring JACK. This class provides an (almost) complete control on configured JACK servers. """ def __init__ (self): LadiController.__init__(self, dbus_type='SessionBus', service_name=service_name, obj_path=obj_path, iface_name=ctrl_iface_name) def is_started (self): return self.controller_iface.IsStarted () def name_owner_changed (name = None, old_owner = None, new_owner = None): sys.stderr.write("Name changed : %r\n" % name) sys.stderr.flush() def is_realtime (self): return self.controller_iface.IsRealtime () def get_load (self): return self.controller_iface.GetLoad () def get_xruns (self): return self.controller_iface.GetXruns () def get_sample_rate (self): return self.controller_iface.GetSampleRate () def get_latency (self): return self.controller_iface.GetLatency () def reset_xruns (self): return self.controller_iface.ResetXruns () def start (self): self.controller_iface.StartServer () def stop (self): self.controller_iface.StopServer () def kill (self): self.controller_iface.Exit () class JackConfigParameter(object): """Wrapper for JACK's parameters. This class provides an (almost) complete control to JACK's configuration parameters. """ def __init__(self, jack, path): self._jack = jack self.path = path self.name = path[-1:] def get_name(self): return self.name def get_type(self): return self._jack.get_param_type(self.path) def get_value(self): return self._jack.get_param_value(self.path) def set_value(self, value): self._jack.set_param_value(self.path, value) def reset_value(self): self._jack.reset_param_value(self.path) def get_short_description(self): return self._jack.get_param_short_description(self.path) def get_long_description(self): descr = self._jack.get_param_long_description(self.path) if not descr: descr = self.get_short_description() return descr def has_range(self): return self._jack.param_has_range(self.path) def get_range(self): return self._jack.param_get_range(self.path) def has_enum(self): return self._jack.param_has_enum(self.path) def is_strict_enum(self): return self._jack.param_is_strict_enum(self.path) def is_fake_values_enum(self): return self._jack.param_is_fake_value(self.path) def get_enum_values(self): return self._jack.param_get_enum_values(self.path) class JackConfigProxy(LadiController): """Wrapper for JACK's configuration. This controller provides access to the JACK's whole configuration. """ def __init__ (self): LadiController.__init__(self, dbus_type='SessionBus', service_name=service_name, obj_path=obj_path, iface_name=conf_iface_name) def name_owner_changed (name = None, old_owner = None, new_owner = None): print "Name changed : %r" % name def get_selected_driver (self): isset, default, value = self.controller_iface.GetParameterValue (['engine', 'driver']) return value def read_container (self, path): is_leaf, children = self.controller_iface.ReadContainer (path) if is_leaf: return [] return children def get_param_names (self, path): is_leaf, children = self.controller_iface.ReadContainer (path) if not is_leaf: return [] return children def get_param_short_description (self, path): type_char, name, short_descr, long_descr = self.controller_iface.GetParameterInfo (path) return short_descr def get_param_long_description (self, path): type_char, name, short_descr, long_descr = self.controller_iface.GetParameterInfo (path) return long_descr def get_param_type (self, path): type_char, name, short_descr, long_descr = self.controller_iface.GetParameterInfo (path) return str (type_char) def get_param_value (self, path): isset, default, value = self.controller_iface.GetParameterValue (path) isset = bool (isset) default = _dbus_type_to_python_type (default) value = _dbus_type_to_python_type (value) return isset, default, value def set_param_value (self, path, value): typestr = self.get_param_type (path) if typestr == "b": value = dbus.Boolean (value) elif typestr == "y": value = dbus.Byte (value) elif typestr == "i": value = dbus.Int32 (value) elif typestr == "u": value = dbus.UInt32 (value) self.controller_iface.SetParameterValue (path, value) def reset_param_value (self, path): self.controller_iface.ResetParameterValue (path) def param_has_range (self, path): is_range, is_strict, is_fake_value, values = self.controller_iface.GetParameterConstraint (path) return bool (is_range) def param_get_range (self, path): is_range, is_strict, is_fake_value, values = self.controller_iface.GetParameterConstraint (path) if not is_range or len (values) != 2: return -1, -1 return _dbus_type_to_python_type (values[0][0]), _dbus_type_to_python_type (values[1][0]) def param_has_enum (self, path): is_range, is_strict, is_fake_value, values = self.controller_iface.GetParameterConstraint (path) return not is_range and len (values) != 0 def param_is_strict_enum (self, path): is_range, is_strict, is_fake_value, values = self.controller_iface.GetParameterConstraint (path) return is_strict def param_is_fake_value (self, path): is_range, is_strict, is_fake_value, values = self.controller_iface.GetParameterConstraint (path) return is_fake_value def param_get_enum_values (self, path): is_range, is_strict, is_fake_value, dbus_values = self.controller_iface.GetParameterConstraint (path) values = [] if not is_range and len (dbus_values) != 0: for dbus_value in dbus_values: values.append ([_dbus_type_to_python_type (dbus_value[0]), _dbus_type_to_python_type (dbus_value[1])]) return values laditools-1.1.0/laditools/ladish.py000066400000000000000000000107251257536635300173370ustar00rootroot00000000000000#!/usr/bin/python # LADITools - Linux Audio Desktop Integration Tools # Copyright (C) 2011-2012 Alessio Treglia # Copyright (C) 2007-2010, Marc-Olivier Barre # Copyright (C) 2007-2009, Nedko Arnaudov # # 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 . from enum import Enum from .controller import LadiController import dbus name_base = 'org.ladish' control_iface_name = name_base + '.Control' studio_iface_name = name_base + '.Studio' control_obj_path = "/org/ladish/Control" studio_obj_path = "/org/ladish/Studio" service_name = name_base LadishStatusType = Enum("STUDIO_STOPPED", "NOT_AVAILABLE", "NO_STUDIO_LOADED", "STUDIO_RUNNING") class LadishProxyError(Exception): pass class LadishStudioException(Exception): pass def check_ladish(): """Connect to ladish and return its current status.""" try: proxy = LadishProxy() except Exception as e: raise LadishProxyError("ladish proxy creation failed: %s" % e.message) if not proxy.is_available(): return LadishStatusType.NOT_AVAILABLE if not proxy.studio_is_loaded(): return LadishStatusType.NO_STUDIO_LOADED else: if proxy.studio_is_started(): return LadishStatusType.STUDIO_RUNNING return LadishStatusType.STUDIO_STOPPED class LadishProxy(LadiController): """Wrapper for controlling and monitoring ladish. This class provides an (almost) complete control on LADI Session Handler. """ def __init__ (self): LadiController.__init__(self, dbus_type='SessionBus', service_name=service_name, obj_path=control_obj_path, iface_name=control_iface_name) self.studio_obj = self.bus.get_object(service_name, studio_obj_path) self.studio_iface = dbus.Interface(self.studio_obj, studio_iface_name) def is_started(self): raise NotImplementedError def is_available(self): """Check if the service is running and a studio is loaded.""" try: self.studio_is_loaded() return True except Exception, e: return False def studio_list(self): """Return a list of configured studios.""" studios = [] for studio in self.controller_iface.GetStudioList(): studios.append(studio[0]) return studios def studio_new(self, name=""): """Setup a new studio and name it as .""" self.controller_iface.NewStudio(name) def studio_is_loaded(self): """Check if a studio is loaded.""" return self.controller_iface.IsStudioLoaded() def studio_load(self, name): """Load the studio named .""" self.controller_iface.LoadStudio(name, {}) def studio_delete(self, name): """Delete the studio named .""" self.controller_iface.DeleteStudio(name) def kill(self): """Kill the service.""" self.controller_iface.Exit() def studio_start(self): """Start the current studio.""" self.studio_iface.Start() def studio_stop(self): """Stop the current studio.""" self.studio_iface.Stop() def studio_rename(self, new_name): """Rename the current studio to .""" self.studio_iface.Rename(new_name) def studio_save(self): """Save the changes to the current studio.""" self.studio_iface.Save() def studio_unload(self): """Unload the current studio.""" self.studio_iface.Unload() def studio_name(self): """Return the current studio's name.""" return self.studio_iface.GetName() def studio_is_started(self): """Check if the current studio is running.""" return self.studio_iface.IsStarted() laditools-1.1.0/laditools/manager.py000066400000000000000000000205141257536635300175020ustar00rootroot00000000000000#!/usr/bin/python # LADITools - Linux Audio Desktop Integration Tools # Copyright (C) 2011-2012 Alessio Treglia # Copyright (C) 2007-2010: # * Marc-Olivier Barre # * Nedko Arnaudov # # 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 . import os import sys import time import subprocess from .controller import LadiController from . import _gettext_domain from . import LadiConfiguration from . import JackConfigProxy from . import JackController from . import A2jController from . import LadishProxy class LadiManager(LadiController): def __init__(self, jack_autostart): self.proxy_jack_controller = None self.proxy_jack_configure = None self.proxy_a2j_controller = None self.proxy_ladish_controller = None self.jack_autostart = jack_autostart self.proc_list = {} if jack_autostart: self.jack_start() def is_available(self): return (self.ladish_is_available, self.jack_is_available, self.a2j_is_available) def is_started(self): return (self.ladish_is_started, self.jack_is_started, self.a2j_is_started) def start(self): self.studio_start() def stop(self): self.studio_stop() def kill(self): self.get_ladish_controller().kill() def killall(self): self.get_ladish_controller().kill() self.get_jack_controller().kill() self.get_a2j_controller().kill() def get_jack_controller(self): if not self.proxy_jack_controller: self.proxy_jack_controller = JackController() return self.proxy_jack_controller def is_jack_controller_available(self): return self.proxy_jack_controller != None def get_jack_configure(self): if not self.proxy_jack_configure: self.proxy_jack_configure = JackConfigProxy() return self.proxy_jack_configure def clear_jack_proxies(self): self.proxy_jack_controller = None self.proxy_jack_configure = None def jack_is_available(self): try: proxy = self.get_jack_controller() except: return False return proxy and proxy.is_available() def jack_start(self, *args, **kwargs): # This has nothing to do here... I suppose # self.set_starting_status() self.get_jack_controller().start() def jack_stop(self, *args, **kwargs): self.get_jack_controller().stop() def jack_reactivate(self, *args, **kwargs): self.get_jack_controller().kill() self.clear_jack_proxies() def jack_reset_xruns(self, *args, **kwargs): self.get_jack_controller().reset_xruns() def jack_is_started(self, *args, **kwargs): return self.get_jack_controller().is_started() def jack_is_realtime(self, *args, **kwargs): return self.get_jack_controller().is_realtime() def jack_get_load(self, *args, **kwargs): return self.get_jack_controller().get_load() def jack_get_xruns(self, *args, **kwargs): return self.get_jack_controller().get_xruns() def jack_get_sample_rate(self, *args, **kwargs): return self.get_jack_controller().get_sample_rate() def jack_get_latency(self, *args, **kwargs): return self.get_jack_controller().get_latency() def get_a2j_controller(self, *args, **kwargs): if not self.proxy_a2j_controller: self.proxy_a2j_controller = A2jController() return self.proxy_a2j_controller def clear_a2j_controller(self, *args, **kwargs): self.proxy_a2j_controller = None def a2j_is_available(self, *args, **kwargs): try: proxy = self.get_a2j_controller() except: return False if proxy.is_available(): return True self.clear_a2j_controller() return False def a2j_is_started(self, *args, **kwargs): return self.get_a2j_controller().is_started() def a2j_start(self, *args, **kwargs): self.get_a2j_controller().start() def a2j_stop(self, *args, **kwargs): self.get_a2j_controller().stop() def a2j_reactivate(self, *args, **kwargs): self.get_a2j_controller().kill() self.clear_a2j_controller() def get_ladish_controller(self, *args, **kwargs): if not self.proxy_ladish_controller: self.proxy_ladish_controller = LadishProxy() return self.proxy_ladish_controller def clear_ladish_controller(self, *args, **kwargs): self.proxy_ladish_controller = None def ladish_is_available(self, *args, **kwargs): try: proxy = self.get_ladish_controller() except: return False if proxy.is_available(): return True self.clear_ladish_controller() return False def studio_is_loaded(self, *args, **kwargs): return self.get_ladish_controller().studio_is_loaded() def studio_is_started(self, *args, **kwargs): return self.get_ladish_controller().studio_is_started() def studio_new(self, *args, **kwargs): if 'name' in kwargs: name = kwargs['name'] self.get_ladish_controller().studio_new(name) return True return False def studio_load(self, *args, **kwargs): if 'studio' in kwargs: studio = kwargs['studio'] self.get_ladish_controller().studio_load(studio) return True return False def studio_start(self, *args, **kwargs): self.get_ladish_controller().studio_start() def studio_stop(self, *args, **kwargs): self.get_ladish_controller().studio_stop() def studio_name(self, *args, **kwargs): return self.get_ladish_controller().studio_name() def studio_rename(self, *args, **kwargs): if 'name' in kwargs: name = kwargs['name'] if self.get_ladish_controller().studio_name() != name: self.get_ladish_controller().studio_rename(name) return True return False def studio_save(self, *args, **kwargs): self.get_ladish_controller().studio_save() def studio_unload(self, *args, **kwargs): self.get_ladish_controller().studio_unload() def studio_delete(self, *args, **kwargs): if 'studio' in kwargs: studio = kwargs['studio'] self.get_ladish_controller().studio_delete(studio) return True return False def ladish_reactivate(self, *args, **kwargs): self.get_ladish_controller().kill() self.clear_ladish_controller() def launcher_exec(self, *args, **kwargs): if 'command' in kwargs: commandline = kwargs['command'] command = commandline[0] if command not in self.proc_list.keys(): self.proc_list[command] = subprocess.Popen(commandline) return True return False def launcher_kill(self, *args, **kwargs): if 'command' in kwargs: command = kwargs['command'][0] if command in self.proc_list: proc = self.proc_list[command] try: proc.terminate() time.sleep(0.5) proc.kill() except OSError: pass return False def update(self, *args, **kwargs): if self.__class__ == LadiManager: raise NotImplementedError("This is a virtual method") else: # Take a look at the processes we've started so we don't get any zombies for i in self.proc_list.keys(): if self.proc_list[i].poll () != None: self.proc_list.pop(i) return True def studio_list(self, *args, **kwargs): return self.get_ladish_controller().studio_list() laditools-1.1.0/new_release000077500000000000000000000003311257536635300157360ustar00rootroot00000000000000#!/bin/bash ## ./retrieve_changelog -r tag:0.7.1.. > ChangeLog python setup.py sdist --formats=gztar,bztar tarballs=`ls dist` for tarball in ${tarballs}; do gpg --armor --sign --detach-sig dist/${tarball} ; done laditools-1.1.0/po/000077500000000000000000000000001257536635300141405ustar00rootroot00000000000000laditools-1.1.0/po/POTFILES.in000066400000000000000000000005051257536635300157150ustar00rootroot00000000000000g15ladi ladi-control-center ladi-player ladi-system-log ladi-system-tray wmladi data/ladi-control-center.desktop.in data/ladi-player.desktop.in data/ladi-system-log.desktop.in data/ladi-system-tray.desktop.in data/ladi-player.ui data/ladi-system-log.ui laditools/gtk/a2jmenu.py laditools/gtk/manager.py laditools/gtk/menu.py laditools-1.1.0/po/es.po000066400000000000000000000220261257536635300151110ustar00rootroot00000000000000# Spanish translation for laditools # Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 # This file is distributed under the same license as the laditools package. # FIRST AUTHOR , 2012. # msgid "" msgstr "" "Project-Id-Version: laditools\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2012-03-23 18:18+0100\n" "PO-Revision-Date: 2012-03-24 15:04+0000\n" "Last-Translator: Fitoschido \n" "Language-Team: Spanish \n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-03-25 05:05+0000\n" "X-Generator: Launchpad (build 14981)\n" #: ../ladi-control-center:62 #, python-format msgid "ladish proxy creation failed: %s\n" msgstr "" #: ../ladi-control-center:71 msgid "ladish is not available\n" msgstr "" #: ../ladi-control-center:76 msgid "" "JACK can only be configured with a loaded and stopped studio. Please create " "a new studio or load and stop an existing one." msgstr "" #: ../ladi-control-center:78 msgid "No studio present" msgstr "" #: ../ladi-control-center:80 msgid "" "JACK can only be configured with a stopped studio. Please stop your studio " "first." msgstr "" #: ../ladi-control-center:82 msgid "Studio is running" msgstr "Estudio en ejecución" #: ../ladi-control-center:84 msgid "Unexpected error!\n" msgstr "Error inesperado\n" #: ../ladi-control-center:486 #, python-format msgid "Double-click to schedule reset of value to %s" msgstr "" #: ../ladi-control-center:489 #, python-format msgid "Value will be reset to %s" msgstr "El valor se restablecerá a %s" #. 'engine' item #: ../ladi-control-center:574 ../laditools/gtk/menu.py:80 msgid "JACK engine" msgstr "" #: ../ladi-control-center:581 msgid "JACK driver" msgstr "Controlador JACK" #. 'params' item #: ../ladi-control-center:584 ../laditools/gtk/menu.py:85 #, python-format msgid "JACK \"%s\" driver" msgstr "" #: ../ladi-control-center:592 ../laditools/gtk/menu.py:91 #, python-format msgid "JACK \"%s\"" msgstr "" #: ../ladi-control-center:597 ../data/ladi-control-center.desktop.in.h:1 msgid "LADI Control Center" msgstr "Centro de control de LADI" #: ../ladi-control-center:676 msgid "Convenient graphical interface for configuring JACK" msgstr "Cómoda interfaz gráfica para configurar JACK" #: ../ladi-control-center:677 ../ladi-player:367 ../ladi-system-log:207 #: ../ladi-system-tray:254 ../wmladi:252 msgid "This program is part of the LADITools suite." msgstr "Este programa es parte del conjunto LADITools." #: ../ladi-control-center:682 msgid "select the module to configure" msgstr "seleccione el módulo a configurar" #: ../ladi-control-center:686 msgid "list available modules" msgstr "" #: ../ladi-control-center:696 #, python-format msgid "Conflicting options, type %s --help for a list of options." msgstr "" #: ../ladi-control-center:702 msgid "Available modules: " msgstr "Módulos disponibles: " #: ../ladi-control-center:708 #, python-format msgid "" "Module %(mod)s is not available, type '%(cmd)s -l' for a list of available " "modules." msgstr "" #: ../ladi-player:43 ../ladi-system-tray:208 #: ../data/ladi-player.desktop.in.h:1 msgid "LADI Player" msgstr "Reproductor de LADI" #: ../ladi-player:66 msgid "No studio is available." msgstr "" #: ../ladi-player:217 msgid "Stopped" msgstr "Detenido" #: ../ladi-player:254 ../laditools/gtk/menu.py:145 msgid "Load studio" msgstr "Cargar estudio" #: ../ladi-player:260 ../laditools/gtk/menu.py:158 msgid "Delete studio" msgstr "Eliminar estudio" #: ../ladi-player:316 ../ladi-system-log:127 #, python-format msgid "Loading interface from %s\n" msgstr "Cargando interfaz desde %s\n" #: ../ladi-player:365 msgid "" "graphical front-end that allows users to start, stop and monitor JACK, as " "well as start some JACK related applications." msgstr "" #: ../ladi-system-log:76 msgid "LADI Log Viewer" msgstr "Visor de registros de LADI" #: ../ladi-system-log:115 #, python-format msgid "Skipping '%s' because it does not exist\n" msgstr "Omitiendo «%s» porque no existe\n" #: ../ladi-system-log:117 #, python-format msgid "Watching %s\n" msgstr "" #: ../ladi-system-log:159 #, python-format msgid "Opening %s...\n" msgstr "" #: ../ladi-system-log:165 msgid "You called Popen with invalid arguments... dumbass\n" msgstr "" #: ../ladi-system-log:167 #, python-format msgid "Unexpected error: %s\n" msgstr "Error inesperado: %s\n" #: ../ladi-system-log:206 msgid "JACK, ladish and a2jmidid log viewer" msgstr "" #: ../ladi-system-tray:51 ../data/ladi-system-tray.desktop.in.h:1 msgid "LADI System Tray" msgstr "" #: ../ladi-system-tray:210 msgid "Session editor" msgstr "Editor de sesiones" #: ../ladi-system-tray:213 msgid "Settings" msgstr "Configuración" #: ../ladi-system-tray:214 msgid "Log Viewer" msgstr "" #: ../ladi-system-tray:218 ../laditools/gtk/menu.py:182 msgid "About" msgstr "Acerca de" #: ../ladi-system-tray:219 ../laditools/gtk/a2jmenu.py:31 #: ../laditools/gtk/menu.py:183 msgid "Quit" msgstr "Salir" #: ../ladi-system-tray:252 msgid "" "system tray icon that allows users to start, stop andmonitor JACK, as well " "as start some JACK related applications" msgstr "" #: ../ladi-system-tray:257 msgid "Force fallback to system tray." msgstr "" #: ../wmladi:53 msgid "LADI WindowMaker dockapp" msgstr "" #: ../wmladi:251 msgid "Window maker dockapp for jackdbus" msgstr "" #: ../data/ladi-control-center.desktop.in.h:2 msgid "Configure the LADI system" msgstr "Configurar el sistema LADI" #: ../data/ladi-control-center.desktop.in.h:3 msgid "LADI configuration" msgstr "Configuración de LADI" #: ../data/ladi-player.desktop.in.h:2 msgid "Control LADI system" msgstr "" #: ../data/ladi-player.desktop.in.h:3 msgid "LADI system controller" msgstr "" #: ../data/ladi-system-log.desktop.in.h:1 msgid "LADI Log File Viewer" msgstr "" #: ../data/ladi-system-log.desktop.in.h:2 msgid "View or monitor LADI log files" msgstr "" #: ../data/ladi-system-log.desktop.in.h:3 msgid "Log file viewer" msgstr "" #: ../data/ladi-system-tray.desktop.in.h:2 msgid "Manage and configure JACK and ladish" msgstr "" #: ../data/ladi-system-tray.desktop.in.h:3 msgid "LADI tray icon" msgstr "" #: ../laditools/gtk/a2jmenu.py:27 msgid "Start bridging" msgstr "" #: ../laditools/gtk/a2jmenu.py:28 msgid "Stop bridging" msgstr "" #: ../laditools/gtk/a2jmenu.py:30 msgid "Reactivate" msgstr "Reactivar" #: ../laditools/gtk/manager.py:78 msgid "New studio" msgstr "Estudio nuevo" #: ../laditools/gtk/manager.py:78 ../laditools/gtk/manager.py:84 msgid "Studio name" msgstr "Nombre del estudio" #: ../laditools/gtk/manager.py:83 ../laditools/gtk/menu.py:153 msgid "Rename studio" msgstr "Renombrar estudio" #: ../laditools/gtk/manager.py:95 msgid "Confirm studio delete" msgstr "Confirmar eliminación del estudio" #: ../laditools/gtk/manager.py:96 #, python-format msgid "Studio \"%s\" will be deleted. Are you sure?" msgstr "Se eliminará el estudio «%s». ¿Está seguro?" #: ../laditools/gtk/manager.py:117 msgid "" "LADITools is a set of tools aiming to achieve the goals of the LADI project " "to improve desktop integration and user workflow of Linux audio system based " "on JACK and ladish." msgstr "" #: ../laditools/gtk/manager.py:123 msgid "translator-credits" msgstr "" "Launchpad Contributions:\n" " Fitoschido https://launchpad.net/~fitoschido" #: ../laditools/gtk/menu.py:45 msgid "Cannot communicate JACK D-Bus" msgstr "" #: ../laditools/gtk/menu.py:57 msgid "Error executing " msgstr "Error al ejecutar " #: ../laditools/gtk/menu.py:59 msgid "" "Unexpected error\n" "\n" msgstr "" "Error inesperado\n" "\n" #: ../laditools/gtk/menu.py:99 msgid "Empty config list" msgstr "" #: ../laditools/gtk/menu.py:115 msgid "Error obtaining studio list" msgstr "Error al obtener la lista de estudios" #: ../laditools/gtk/menu.py:120 msgid "Empty studio list" msgstr "" #: ../laditools/gtk/menu.py:133 msgid "Diagnose" msgstr "Diagnosticar" #: ../laditools/gtk/menu.py:137 msgid "Start gladish" msgstr "" #: ../laditools/gtk/menu.py:144 msgid "New studio..." msgstr "" #: ../laditools/gtk/menu.py:149 msgid "Stop studio" msgstr "Detener estudio" #: ../laditools/gtk/menu.py:150 msgid "Save studio" msgstr "Guardar estudio" #: ../laditools/gtk/menu.py:152 msgid "Start studio" msgstr "Iniciar estudio" #: ../laditools/gtk/menu.py:154 msgid "Unload studio" msgstr "" #: ../laditools/gtk/menu.py:156 msgid "Start automatic studio" msgstr "" #: ../laditools/gtk/menu.py:159 msgid "Reactivate ladishd" msgstr "" #: ../laditools/gtk/menu.py:164 msgid "Start JACK server" msgstr "Iniciar servidor JACK" #: ../laditools/gtk/menu.py:166 msgid "Reset Xruns" msgstr "" #: ../laditools/gtk/menu.py:168 msgid "Stop JACK server" msgstr "Detener servidor JACK" #: ../laditools/gtk/menu.py:169 msgid "Reactivate JACK" msgstr "Reactivar JACK" #: ../laditools/gtk/menu.py:176 msgid "Start A2J bridge" msgstr "Iniciar puente A2J" #: ../laditools/gtk/menu.py:178 msgid "Stop A2J bridge" msgstr "Detener puente A2J" #: ../laditools/gtk/menu.py:179 msgid "Reactivate A2J" msgstr "Reactivar A2J" laditools-1.1.0/po/it.po000066400000000000000000000227171257536635300151250ustar00rootroot00000000000000# Italian translation for laditools # Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 # This file is distributed under the same license as the laditools package. # FIRST AUTHOR , 2012. # msgid "" msgstr "" "Project-Id-Version: laditools\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2012-03-23 18:18+0100\n" "PO-Revision-Date: 2012-03-23 18:32+0000\n" "Last-Translator: Alessio Treglia \n" "Language-Team: Italian \n" "Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-03-24 04:54+0000\n" "X-Generator: Launchpad (build 14981)\n" #: ../ladi-control-center:62 #, python-format msgid "ladish proxy creation failed: %s\n" msgstr "Creazione del proxy ladish fallita: %s\n" #: ../ladi-control-center:71 msgid "ladish is not available\n" msgstr "ladish non é disponibile\n" #: ../ladi-control-center:76 msgid "" "JACK can only be configured with a loaded and stopped studio. Please create " "a new studio or load and stop an existing one." msgstr "" "JACK può essere configurato solo con in presenza di uno studio caricato e " "inattivo. Creare un nuovo studio oppure caricarne uno già esistente e " "arrestarlo." #: ../ladi-control-center:78 msgid "No studio present" msgstr "Nessuno studio presente" #: ../ladi-control-center:80 msgid "" "JACK can only be configured with a stopped studio. Please stop your studio " "first." msgstr "" "JACK può essere configurato solo con uno studio inattivo. Arrestare il " "proprio studio prima di continuare." #: ../ladi-control-center:82 msgid "Studio is running" msgstr "Studio in esecuzione" #: ../ladi-control-center:84 msgid "Unexpected error!\n" msgstr "Errore inatteso!\n" #: ../ladi-control-center:486 #, python-format msgid "Double-click to schedule reset of value to %s" msgstr "" #: ../ladi-control-center:489 #, python-format msgid "Value will be reset to %s" msgstr "Il valore verrà reimpostato a %s" #. 'engine' item #: ../ladi-control-center:574 ../laditools/gtk/menu.py:80 msgid "JACK engine" msgstr "" #: ../ladi-control-center:581 msgid "JACK driver" msgstr "" #. 'params' item #: ../ladi-control-center:584 ../laditools/gtk/menu.py:85 #, python-format msgid "JACK \"%s\" driver" msgstr "" #: ../ladi-control-center:592 ../laditools/gtk/menu.py:91 #, python-format msgid "JACK \"%s\"" msgstr "" #: ../ladi-control-center:597 ../data/ladi-control-center.desktop.in.h:1 msgid "LADI Control Center" msgstr "" #: ../ladi-control-center:676 msgid "Convenient graphical interface for configuring JACK" msgstr "Comoda interfaccia grafica per la configurazione di JACK" #: ../ladi-control-center:677 ../ladi-player:367 ../ladi-system-log:207 #: ../ladi-system-tray:254 ../wmladi:252 msgid "This program is part of the LADITools suite." msgstr "Questo programma fa parte della suite LADITools." #: ../ladi-control-center:682 msgid "select the module to configure" msgstr "selezionare il modulo da configurare" #: ../ladi-control-center:686 msgid "list available modules" msgstr "elenca i moduli disponibili" #: ../ladi-control-center:696 #, python-format msgid "Conflicting options, type %s --help for a list of options." msgstr "" #: ../ladi-control-center:702 msgid "Available modules: " msgstr "Moduli disponibili: " #: ../ladi-control-center:708 #, python-format msgid "" "Module %(mod)s is not available, type '%(cmd)s -l' for a list of available " "modules." msgstr "" "Il modulo %(mod)s non è disponibile, digitare '%(cmd)s -l' per l'elenco dei " "moduli disponibili." #: ../ladi-player:43 ../ladi-system-tray:208 #: ../data/ladi-player.desktop.in.h:1 msgid "LADI Player" msgstr "" #: ../ladi-player:66 msgid "No studio is available." msgstr "Nessuno studio disponible." #: ../ladi-player:217 msgid "Stopped" msgstr "Fermato" #: ../ladi-player:254 ../laditools/gtk/menu.py:145 msgid "Load studio" msgstr "" #: ../ladi-player:260 ../laditools/gtk/menu.py:158 msgid "Delete studio" msgstr "" #: ../ladi-player:316 ../ladi-system-log:127 #, python-format msgid "Loading interface from %s\n" msgstr "Caricamento dell'interfaccia da %s in corso\n" #: ../ladi-player:365 msgid "" "graphical front-end that allows users to start, stop and monitor JACK, as " "well as start some JACK related applications." msgstr "" #: ../ladi-system-log:76 msgid "LADI Log Viewer" msgstr "" #: ../ladi-system-log:115 #, python-format msgid "Skipping '%s' because it does not exist\n" msgstr "" #: ../ladi-system-log:117 #, python-format msgid "Watching %s\n" msgstr "" #: ../ladi-system-log:159 #, python-format msgid "Opening %s...\n" msgstr "Apertura di %s in corso...\n" #: ../ladi-system-log:165 msgid "You called Popen with invalid arguments... dumbass\n" msgstr "" #: ../ladi-system-log:167 #, python-format msgid "Unexpected error: %s\n" msgstr "Errore inatteso: %s\n" #: ../ladi-system-log:206 msgid "JACK, ladish and a2jmidid log viewer" msgstr "Visualizzatore di log per JACK, ladish e a2jmidid" #: ../ladi-system-tray:51 ../data/ladi-system-tray.desktop.in.h:1 msgid "LADI System Tray" msgstr "" #: ../ladi-system-tray:210 msgid "Session editor" msgstr "Editor di sessione" #: ../ladi-system-tray:213 msgid "Settings" msgstr "Impostazioni" #: ../ladi-system-tray:214 msgid "Log Viewer" msgstr "Visualizzatore di registri" #: ../ladi-system-tray:218 ../laditools/gtk/menu.py:182 msgid "About" msgstr "Informazioni" #: ../ladi-system-tray:219 ../laditools/gtk/a2jmenu.py:31 #: ../laditools/gtk/menu.py:183 msgid "Quit" msgstr "Esci" #: ../ladi-system-tray:252 msgid "" "system tray icon that allows users to start, stop and monitor JACK, as well " "as start some JACK related applications" msgstr "" #: ../ladi-system-tray:257 msgid "Force fallback to system tray." msgstr "" #: ../wmladi:53 msgid "LADI WindowMaker dockapp" msgstr "" #: ../wmladi:251 msgid "Window maker dockapp for jackdbus" msgstr "" #: ../data/ladi-control-center.desktop.in.h:2 msgid "Configure the LADI system" msgstr "" #: ../data/ladi-control-center.desktop.in.h:3 msgid "LADI configuration" msgstr "" #: ../data/ladi-player.desktop.in.h:2 msgid "Control LADI system" msgstr "" #: ../data/ladi-player.desktop.in.h:3 msgid "LADI system controller" msgstr "" #: ../data/ladi-system-log.desktop.in.h:1 msgid "LADI Log File Viewer" msgstr "" #: ../data/ladi-system-log.desktop.in.h:2 msgid "View or monitor LADI log files" msgstr "" #: ../data/ladi-system-log.desktop.in.h:3 msgid "Log file viewer" msgstr "Visualizzatore di file di registro" #: ../data/ladi-system-tray.desktop.in.h:2 msgid "Manage and configure JACK and ladish" msgstr "" #: ../data/ladi-system-tray.desktop.in.h:3 msgid "LADI tray icon" msgstr "" #: ../laditools/gtk/a2jmenu.py:27 msgid "Start bridging" msgstr "" #: ../laditools/gtk/a2jmenu.py:28 msgid "Stop bridging" msgstr "" #: ../laditools/gtk/a2jmenu.py:30 msgid "Reactivate" msgstr "" #: ../laditools/gtk/manager.py:78 msgid "New studio" msgstr "" #: ../laditools/gtk/manager.py:78 ../laditools/gtk/manager.py:84 msgid "Studio name" msgstr "" #: ../laditools/gtk/manager.py:83 ../laditools/gtk/menu.py:153 msgid "Rename studio" msgstr "" #: ../laditools/gtk/manager.py:95 msgid "Confirm studio delete" msgstr "" #: ../laditools/gtk/manager.py:96 #, python-format msgid "Studio \"%s\" will be deleted. Are you sure?" msgstr "" #: ../laditools/gtk/manager.py:117 msgid "" "LADITools is a set of tools aiming to achieve the goals of the LADI project " "to improve desktop integration and user workflow of Linux audio system based " "on JACK and ladish." msgstr "" "LADITools é una collezione di strumenti che mirano a raggiungere gli " "obiettivi del progetto LADI per migliorare l'integrazione desktop e " "l'approccio utente a sistemi audio Linux basati su JACK e ladish." #: ../laditools/gtk/manager.py:123 msgid "translator-credits" msgstr "" "Launchpad Contributions:\n" " Alessio Treglia https://launchpad.net/~quadrispro" #: ../laditools/gtk/menu.py:45 msgid "Cannot communicate JACK D-Bus" msgstr "" #: ../laditools/gtk/menu.py:57 msgid "Error executing " msgstr "Errore nell'esecuzione " #: ../laditools/gtk/menu.py:59 msgid "" "Unexpected error\n" "\n" msgstr "" "Errore inatteso\n" "\n" #: ../laditools/gtk/menu.py:99 msgid "Empty config list" msgstr "" #: ../laditools/gtk/menu.py:115 msgid "Error obtaining studio list" msgstr "" #: ../laditools/gtk/menu.py:120 msgid "Empty studio list" msgstr "" #: ../laditools/gtk/menu.py:133 msgid "Diagnose" msgstr "" #: ../laditools/gtk/menu.py:137 msgid "Start gladish" msgstr "Avvia gladish" #: ../laditools/gtk/menu.py:144 msgid "New studio..." msgstr "" #: ../laditools/gtk/menu.py:149 msgid "Stop studio" msgstr "" #: ../laditools/gtk/menu.py:150 msgid "Save studio" msgstr "" #: ../laditools/gtk/menu.py:152 msgid "Start studio" msgstr "" #: ../laditools/gtk/menu.py:154 msgid "Unload studio" msgstr "" #: ../laditools/gtk/menu.py:156 msgid "Start automatic studio" msgstr "" #: ../laditools/gtk/menu.py:159 msgid "Reactivate ladishd" msgstr "" #: ../laditools/gtk/menu.py:164 msgid "Start JACK server" msgstr "Avvia il server JACK" #: ../laditools/gtk/menu.py:166 msgid "Reset Xruns" msgstr "" #: ../laditools/gtk/menu.py:168 msgid "Stop JACK server" msgstr "Arresta il server JACK" #: ../laditools/gtk/menu.py:169 msgid "Reactivate JACK" msgstr "Riavvia JACK" #: ../laditools/gtk/menu.py:176 msgid "Start A2J bridge" msgstr "" #: ../laditools/gtk/menu.py:178 msgid "Stop A2J bridge" msgstr "" #: ../laditools/gtk/menu.py:179 msgid "Reactivate A2J" msgstr "Riavvia A2J" laditools-1.1.0/po/laditools.pot000066400000000000000000000176441257536635300166720ustar00rootroot00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2012-04-12 10:08+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: ../ladi-control-center:62 #, python-format msgid "ladish proxy creation failed: %s\n" msgstr "" #: ../ladi-control-center:71 msgid "ladish is not available\n" msgstr "" #: ../ladi-control-center:76 msgid "" "JACK can only be configured with a loaded and stopped studio. Please create " "a new studio or load and stop an existing one." msgstr "" #: ../ladi-control-center:78 msgid "No studio present" msgstr "" #: ../ladi-control-center:80 msgid "" "JACK can only be configured with a stopped studio. Please stop your studio " "first." msgstr "" #: ../ladi-control-center:82 msgid "Studio is running" msgstr "" #: ../ladi-control-center:84 msgid "Unexpected error!\n" msgstr "" #: ../ladi-control-center:486 #, python-format msgid "Double-click to schedule reset of value to %s" msgstr "" #: ../ladi-control-center:489 #, python-format msgid "Value will be reset to %s" msgstr "" #. 'engine' item #: ../ladi-control-center:574 ../laditools/gtk/menu.py:80 msgid "JACK engine" msgstr "" #: ../ladi-control-center:581 msgid "JACK driver" msgstr "" #. 'params' item #: ../ladi-control-center:584 ../laditools/gtk/menu.py:85 #, python-format msgid "JACK \"%s\" driver" msgstr "" #: ../ladi-control-center:592 ../laditools/gtk/menu.py:91 #, python-format msgid "JACK \"%s\"" msgstr "" #: ../ladi-control-center:597 ../data/ladi-control-center.desktop.in.h:1 msgid "LADI Control Center" msgstr "" #: ../ladi-control-center:676 msgid "Convenient graphical interface for configuring JACK" msgstr "" #: ../ladi-control-center:677 ../ladi-player:367 ../ladi-system-log:207 #: ../ladi-system-tray:254 ../wmladi:252 msgid "This program is part of the LADITools suite." msgstr "" #: ../ladi-control-center:682 msgid "select the module to configure" msgstr "" #: ../ladi-control-center:686 msgid "list available modules" msgstr "" #: ../ladi-control-center:696 #, python-format msgid "Conflicting options, type %s --help for a list of options." msgstr "" #: ../ladi-control-center:702 msgid "Available modules: " msgstr "" #: ../ladi-control-center:708 #, python-format msgid "" "Module %(mod)s is not available, type '%(cmd)s -l' for a list of available " "modules." msgstr "" #: ../ladi-player:43 ../ladi-system-tray:208 #: ../data/ladi-player.desktop.in.h:1 msgid "LADI Player" msgstr "" #: ../ladi-player:66 msgid "No studio is available." msgstr "" #: ../ladi-player:217 msgid "Stopped" msgstr "" #: ../ladi-player:254 ../laditools/gtk/menu.py:145 msgid "Load studio" msgstr "" #: ../ladi-player:260 ../laditools/gtk/menu.py:158 msgid "Delete studio" msgstr "" #: ../ladi-player:316 ../ladi-system-log:127 #, python-format msgid "Loading interface from %s\n" msgstr "" #: ../ladi-player:365 msgid "" "graphical front-end that allows users to start, stop and monitor JACK, as " "well as start some JACK related applications." msgstr "" #: ../ladi-system-log:76 msgid "LADI Log Viewer" msgstr "" #: ../ladi-system-log:115 #, python-format msgid "Skipping '%s' because it does not exist\n" msgstr "" #: ../ladi-system-log:117 #, python-format msgid "Watching %s\n" msgstr "" #: ../ladi-system-log:159 #, python-format msgid "Opening %s...\n" msgstr "" #: ../ladi-system-log:165 msgid "You called Popen with invalid arguments... dumbass\n" msgstr "" #: ../ladi-system-log:167 #, python-format msgid "Unexpected error: %s\n" msgstr "" #: ../ladi-system-log:206 msgid "JACK, ladish and a2jmidid log viewer" msgstr "" #: ../ladi-system-tray:51 ../data/ladi-system-tray.desktop.in.h:1 msgid "LADI System Tray" msgstr "" #: ../ladi-system-tray:210 msgid "Session editor" msgstr "" #: ../ladi-system-tray:213 msgid "Settings" msgstr "" #: ../ladi-system-tray:214 msgid "Log Viewer" msgstr "" #: ../ladi-system-tray:218 ../laditools/gtk/menu.py:182 msgid "About" msgstr "" #: ../ladi-system-tray:219 ../laditools/gtk/a2jmenu.py:31 #: ../laditools/gtk/menu.py:183 msgid "Quit" msgstr "" #: ../ladi-system-tray:252 msgid "" "system tray icon that allows users to start, stop and monitor JACK, as well " "as start some JACK related applications" msgstr "" #: ../ladi-system-tray:257 msgid "Force fallback to system tray." msgstr "" #: ../wmladi:53 msgid "LADI WindowMaker dockapp" msgstr "" #: ../wmladi:251 msgid "Window maker dockapp for jackdbus" msgstr "" #: ../data/ladi-control-center.desktop.in.h:2 msgid "Configure the LADI system" msgstr "" #: ../data/ladi-control-center.desktop.in.h:3 msgid "LADI configuration" msgstr "" #: ../data/ladi-player.desktop.in.h:2 msgid "Control LADI system" msgstr "" #: ../data/ladi-player.desktop.in.h:3 msgid "LADI system controller" msgstr "" #: ../data/ladi-system-log.desktop.in.h:1 msgid "LADI Log File Viewer" msgstr "" #: ../data/ladi-system-log.desktop.in.h:2 msgid "View or monitor LADI log files" msgstr "" #: ../data/ladi-system-log.desktop.in.h:3 msgid "Log file viewer" msgstr "" #: ../data/ladi-system-tray.desktop.in.h:2 msgid "Manage and configure JACK and ladish" msgstr "" #: ../data/ladi-system-tray.desktop.in.h:3 msgid "LADI tray icon" msgstr "" #: ../laditools/gtk/a2jmenu.py:27 msgid "Start bridging" msgstr "" #: ../laditools/gtk/a2jmenu.py:28 msgid "Stop bridging" msgstr "" #: ../laditools/gtk/a2jmenu.py:30 msgid "Reactivate" msgstr "" #: ../laditools/gtk/manager.py:78 msgid "New studio" msgstr "" #: ../laditools/gtk/manager.py:78 ../laditools/gtk/manager.py:84 msgid "Studio name" msgstr "" #: ../laditools/gtk/manager.py:83 ../laditools/gtk/menu.py:153 msgid "Rename studio" msgstr "" #: ../laditools/gtk/manager.py:95 msgid "Confirm studio delete" msgstr "" #: ../laditools/gtk/manager.py:96 #, python-format msgid "Studio \"%s\" will be deleted. Are you sure?" msgstr "" #: ../laditools/gtk/manager.py:117 msgid "" "LADITools is a set of tools aiming to achieve the goals of the LADI project " "to improve desktop integration and user workflow of Linux audio system based " "on JACK and ladish." msgstr "" #: ../laditools/gtk/manager.py:123 msgid "translator-credits" msgstr "" #: ../laditools/gtk/menu.py:45 msgid "Cannot communicate JACK D-Bus" msgstr "" #: ../laditools/gtk/menu.py:57 msgid "Error executing " msgstr "" #: ../laditools/gtk/menu.py:59 msgid "" "Unexpected error\n" "\n" msgstr "" #: ../laditools/gtk/menu.py:99 msgid "Empty config list" msgstr "" #: ../laditools/gtk/menu.py:115 msgid "Error obtaining studio list" msgstr "" #: ../laditools/gtk/menu.py:120 msgid "Empty studio list" msgstr "" #: ../laditools/gtk/menu.py:133 msgid "Diagnose" msgstr "" #: ../laditools/gtk/menu.py:137 msgid "Start gladish" msgstr "" #: ../laditools/gtk/menu.py:144 msgid "New studio..." msgstr "" #: ../laditools/gtk/menu.py:149 msgid "Stop studio" msgstr "" #: ../laditools/gtk/menu.py:150 msgid "Save studio" msgstr "" #: ../laditools/gtk/menu.py:152 msgid "Start studio" msgstr "" #: ../laditools/gtk/menu.py:154 msgid "Unload studio" msgstr "" #: ../laditools/gtk/menu.py:156 msgid "Start automatic studio" msgstr "" #: ../laditools/gtk/menu.py:159 msgid "Reactivate ladishd" msgstr "" #: ../laditools/gtk/menu.py:164 msgid "Start JACK server" msgstr "" #: ../laditools/gtk/menu.py:166 msgid "Reset Xruns" msgstr "" #: ../laditools/gtk/menu.py:168 msgid "Stop JACK server" msgstr "" #: ../laditools/gtk/menu.py:169 msgid "Reactivate JACK" msgstr "" #: ../laditools/gtk/menu.py:176 msgid "Start A2J bridge" msgstr "" #: ../laditools/gtk/menu.py:178 msgid "Stop A2J bridge" msgstr "" #: ../laditools/gtk/menu.py:179 msgid "Reactivate A2J" msgstr "" laditools-1.1.0/po/pt.po000066400000000000000000000202331257536635300151230ustar00rootroot00000000000000# Portuguese translation for laditools # Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 # This file is distributed under the same license as the laditools package. # FIRST AUTHOR , 2012. # msgid "" msgstr "" "Project-Id-Version: laditools\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2012-03-23 18:18+0100\n" "PO-Revision-Date: 2012-03-24 11:41+0000\n" "Last-Translator: Tiago Silva \n" "Language-Team: Portuguese \n" "Language: pt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-03-25 05:05+0000\n" "X-Generator: Launchpad (build 14981)\n" #: ../ladi-control-center:62 #, python-format msgid "ladish proxy creation failed: %s\n" msgstr "" #: ../ladi-control-center:71 msgid "ladish is not available\n" msgstr "" #: ../ladi-control-center:76 msgid "" "JACK can only be configured with a loaded and stopped studio. Please create " "a new studio or load and stop an existing one." msgstr "" #: ../ladi-control-center:78 msgid "No studio present" msgstr "" #: ../ladi-control-center:80 msgid "" "JACK can only be configured with a stopped studio. Please stop your studio " "first." msgstr "" #: ../ladi-control-center:82 msgid "Studio is running" msgstr "" #: ../ladi-control-center:84 msgid "Unexpected error!\n" msgstr "Erro inesperado!\n" #: ../ladi-control-center:486 #, python-format msgid "Double-click to schedule reset of value to %s" msgstr "" #: ../ladi-control-center:489 #, python-format msgid "Value will be reset to %s" msgstr "" #. 'engine' item #: ../ladi-control-center:574 ../laditools/gtk/menu.py:80 msgid "JACK engine" msgstr "" #: ../ladi-control-center:581 msgid "JACK driver" msgstr "" #. 'params' item #: ../ladi-control-center:584 ../laditools/gtk/menu.py:85 #, python-format msgid "JACK \"%s\" driver" msgstr "" #: ../ladi-control-center:592 ../laditools/gtk/menu.py:91 #, python-format msgid "JACK \"%s\"" msgstr "" #: ../ladi-control-center:597 ../data/ladi-control-center.desktop.in.h:1 msgid "LADI Control Center" msgstr "" #: ../ladi-control-center:676 msgid "Convenient graphical interface for configuring JACK" msgstr "" #: ../ladi-control-center:677 ../ladi-player:367 ../ladi-system-log:207 #: ../ladi-system-tray:254 ../wmladi:252 msgid "This program is part of the LADITools suite." msgstr "" #: ../ladi-control-center:682 msgid "select the module to configure" msgstr "" #: ../ladi-control-center:686 msgid "list available modules" msgstr "" #: ../ladi-control-center:696 #, python-format msgid "Conflicting options, type %s --help for a list of options." msgstr "" #: ../ladi-control-center:702 msgid "Available modules: " msgstr "Módulos disponíveis: " #: ../ladi-control-center:708 #, python-format msgid "" "Module %(mod)s is not available, type '%(cmd)s -l' for a list of available " "modules." msgstr "" #: ../ladi-player:43 ../ladi-system-tray:208 #: ../data/ladi-player.desktop.in.h:1 msgid "LADI Player" msgstr "" #: ../ladi-player:66 msgid "No studio is available." msgstr "" #: ../ladi-player:217 msgid "Stopped" msgstr "" #: ../ladi-player:254 ../laditools/gtk/menu.py:145 msgid "Load studio" msgstr "" #: ../ladi-player:260 ../laditools/gtk/menu.py:158 msgid "Delete studio" msgstr "" #: ../ladi-player:316 ../ladi-system-log:127 #, python-format msgid "Loading interface from %s\n" msgstr "" #: ../ladi-player:365 msgid "" "graphical front-end that allows users to start, stop and monitor JACK, as " "well as start some JACK related applications." msgstr "" #: ../ladi-system-log:76 msgid "LADI Log Viewer" msgstr "" #: ../ladi-system-log:115 #, python-format msgid "Skipping '%s' because it does not exist\n" msgstr "" #: ../ladi-system-log:117 #, python-format msgid "Watching %s\n" msgstr "" #: ../ladi-system-log:159 #, python-format msgid "Opening %s...\n" msgstr "" #: ../ladi-system-log:165 msgid "You called Popen with invalid arguments... dumbass\n" msgstr "" #: ../ladi-system-log:167 #, python-format msgid "Unexpected error: %s\n" msgstr "" #: ../ladi-system-log:206 msgid "JACK, ladish and a2jmidid log viewer" msgstr "" #: ../ladi-system-tray:51 ../data/ladi-system-tray.desktop.in.h:1 msgid "LADI System Tray" msgstr "" #: ../ladi-system-tray:210 msgid "Session editor" msgstr "" #: ../ladi-system-tray:213 msgid "Settings" msgstr "" #: ../ladi-system-tray:214 msgid "Log Viewer" msgstr "" #: ../ladi-system-tray:218 ../laditools/gtk/menu.py:182 msgid "About" msgstr "" #: ../ladi-system-tray:219 ../laditools/gtk/a2jmenu.py:31 #: ../laditools/gtk/menu.py:183 msgid "Quit" msgstr "" #: ../ladi-system-tray:252 msgid "" "system tray icon that allows users to start, stop andmonitor JACK, as well " "as start some JACK related applications" msgstr "" #: ../ladi-system-tray:257 msgid "Force fallback to system tray." msgstr "" #: ../wmladi:53 msgid "LADI WindowMaker dockapp" msgstr "" #: ../wmladi:251 msgid "Window maker dockapp for jackdbus" msgstr "" #: ../data/ladi-control-center.desktop.in.h:2 msgid "Configure the LADI system" msgstr "" #: ../data/ladi-control-center.desktop.in.h:3 msgid "LADI configuration" msgstr "" #: ../data/ladi-player.desktop.in.h:2 msgid "Control LADI system" msgstr "" #: ../data/ladi-player.desktop.in.h:3 msgid "LADI system controller" msgstr "" #: ../data/ladi-system-log.desktop.in.h:1 msgid "LADI Log File Viewer" msgstr "" #: ../data/ladi-system-log.desktop.in.h:2 msgid "View or monitor LADI log files" msgstr "" #: ../data/ladi-system-log.desktop.in.h:3 msgid "Log file viewer" msgstr "" #: ../data/ladi-system-tray.desktop.in.h:2 msgid "Manage and configure JACK and ladish" msgstr "" #: ../data/ladi-system-tray.desktop.in.h:3 msgid "LADI tray icon" msgstr "" #: ../laditools/gtk/a2jmenu.py:27 msgid "Start bridging" msgstr "" #: ../laditools/gtk/a2jmenu.py:28 msgid "Stop bridging" msgstr "" #: ../laditools/gtk/a2jmenu.py:30 msgid "Reactivate" msgstr "" #: ../laditools/gtk/manager.py:78 msgid "New studio" msgstr "" #: ../laditools/gtk/manager.py:78 ../laditools/gtk/manager.py:84 msgid "Studio name" msgstr "" #: ../laditools/gtk/manager.py:83 ../laditools/gtk/menu.py:153 msgid "Rename studio" msgstr "" #: ../laditools/gtk/manager.py:95 msgid "Confirm studio delete" msgstr "" #: ../laditools/gtk/manager.py:96 #, python-format msgid "Studio \"%s\" will be deleted. Are you sure?" msgstr "" #: ../laditools/gtk/manager.py:117 msgid "" "LADITools is a set of tools aiming to achieve the goals of the LADI project " "to improve desktop integration and user workflow of Linux audio system based " "on JACK and ladish." msgstr "" #: ../laditools/gtk/manager.py:123 msgid "translator-credits" msgstr "" "Launchpad Contributions:\n" " Tiago Silva https://launchpad.net/~tiagosilva" #: ../laditools/gtk/menu.py:45 msgid "Cannot communicate JACK D-Bus" msgstr "" #: ../laditools/gtk/menu.py:57 msgid "Error executing " msgstr "" #: ../laditools/gtk/menu.py:59 msgid "" "Unexpected error\n" "\n" msgstr "" #: ../laditools/gtk/menu.py:99 msgid "Empty config list" msgstr "" #: ../laditools/gtk/menu.py:115 msgid "Error obtaining studio list" msgstr "" #: ../laditools/gtk/menu.py:120 msgid "Empty studio list" msgstr "" #: ../laditools/gtk/menu.py:133 msgid "Diagnose" msgstr "" #: ../laditools/gtk/menu.py:137 msgid "Start gladish" msgstr "" #: ../laditools/gtk/menu.py:144 msgid "New studio..." msgstr "" #: ../laditools/gtk/menu.py:149 msgid "Stop studio" msgstr "" #: ../laditools/gtk/menu.py:150 msgid "Save studio" msgstr "" #: ../laditools/gtk/menu.py:152 msgid "Start studio" msgstr "" #: ../laditools/gtk/menu.py:154 msgid "Unload studio" msgstr "" #: ../laditools/gtk/menu.py:156 msgid "Start automatic studio" msgstr "" #: ../laditools/gtk/menu.py:159 msgid "Reactivate ladishd" msgstr "" #: ../laditools/gtk/menu.py:164 msgid "Start JACK server" msgstr "" #: ../laditools/gtk/menu.py:166 msgid "Reset Xruns" msgstr "" #: ../laditools/gtk/menu.py:168 msgid "Stop JACK server" msgstr "" #: ../laditools/gtk/menu.py:169 msgid "Reactivate JACK" msgstr "" #: ../laditools/gtk/menu.py:176 msgid "Start A2J bridge" msgstr "" #: ../laditools/gtk/menu.py:178 msgid "Stop A2J bridge" msgstr "" #: ../laditools/gtk/menu.py:179 msgid "Reactivate A2J" msgstr "" laditools-1.1.0/setup.cfg000066400000000000000000000003371257536635300153460ustar00rootroot00000000000000[build_i18n] domain = laditools desktop_files=[ ('share/applications', ['data/ladi-control-center.desktop.in', 'data/ladi-player.desktop.in', 'data/ladi-system-log.desktop.in', 'data/ladi-system-tray.desktop.in']) ] laditools-1.1.0/setup.py000077500000000000000000000127041257536635300152430ustar00rootroot00000000000000#!/usr/bin/python # LADITools - Linux Audio Desktop Integration Tools # setup.py - Setup script for the LADITools suite # Copyright (C) 2011-2012 Alessio Treglia # Copyright (C) 2007-2008, Marc-Olivier Barre # Copyright (C) 2007-2008, Nedko Arnaudov # # 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 . import os import sys import subprocess import glob from distutils.core import setup from distutils.command.clean import clean from DistUtilsExtra.command import * laditools_version = "1.1.0" get_commit_script = "gitcommit.sh" pkg_short_desc = "Linux Audio Desktop Integration Tools" pkg_long_desc = """LADITools is a set of tools aiming to achieve the goals of the LADI project to improve desktop integration and user workflow of Linux audio system based on JACK and ladish. Those tools take advantage of the D-Bus interfaces recently added to JACK and ladish to ease the configuration and use of those two great softwares. The following tools are included: * g15ladi - a JACK monitor for g15 keyboards * ladi-control-center - graphical configuration tool to setup JACK's configuration * ladi-player - convenient VLC-style application to control JACK and manage studios * ladi-system-log - JACK, ladish and a2jmidid log viewer * ladi-system-tray - system indicator that allows users to start, stop and monitor JACK, as well as start some JACK related applications * wmladi - Window Maker dockapp for controlling the LADI system""" pkg_data_files = [('share/laditools/data', glob.glob('data/*.ui')), ('share/laditools/data', glob.glob('data/*.svg'))] pkg_scripts = ['g15ladi', 'ladi-control-center', 'ladi-player', 'ladi-system-log', 'ladi-system-tray', 'wmladi',] os.environ['XGETTEXT_ARGS'] = "--language=Python" if not os.getenv("LADI_RELEASE") and \ os.path.isfile(get_commit_script): commit = subprocess.check_output(["sh", get_commit_script]).strip() laditools_version += "~" + commit iconsizelist = "16 22 24 32 48 64 96 128 256".split() class my_build_extra(build_extra.build_extra): def run(self): data_files = self.distribution.data_files for manpage in glob.glob('data/*.[0-9]'): filename = os.path.split(manpage)[-1] subdir = 'man%s' % filename[-1] path = os.path.join('share', 'man', subdir) print manpage data_files.append((path, (manpage,))) build_extra.build_extra.run(self) class build_icons_extra(build_icons.build_icons): def run(self): icondir = os.path.join('data', 'icons') scalabledir = os.path.join(icondir, "scalable") categories = os.listdir(scalabledir) for size in iconsizelist: sizedir = os.path.join(icondir, "%(size)sx%(size)s" % {'size':size}) for category in categories: sizecategorydir = os.path.join(sizedir, category) self.spawn(['mkdir', '-p', sizecategorydir]) for filename in os.listdir(os.path.join(scalabledir, category)): newfilename = filename.rstrip('svg') + 'png' self.spawn(['rsvg-convert', '-f', 'png', '-w', size, '-h', size, os.path.join(scalabledir, category, filename), '-o', os.path.join(sizecategorydir, newfilename)]) build_icons.build_icons.run(self) class clean_extra(clean_i18n.clean_i18n): def run(self): clean_i18n.clean_i18n.run(self) for path, dirs, files in os.walk('.'): for f in files: f = os.path.join(path, f) if f.endswith('.pyc'): self.spawn(['rm', f]) for d in dirs: if d == '__pycache__': self.spawn(['rm', '-r', os.path.join(path,d)]) for path, dirs, files in os.walk('./data/icons'): if path.endswith('icons'): for d in dirs: if d != 'scalable': self.spawn(['rm', '-r', os.path.join(path,d)]) break setup(name='laditools', version=laditools_version, author='Marc-Olivier Barre, Nedko Arnaudov and Alessio Treglia', author_email='linux-audio-dev@lists.linuxaudio.org', license='GPL-3', url='https://launchpad.net/laditools', download_url='https://launchpad.net/laditools/+download', description=pkg_short_desc, long_description=pkg_long_desc, packages=['laditools', 'laditools.gtk'], scripts=pkg_scripts, data_files=pkg_data_files, cmdclass={ 'build' : my_build_extra, 'build_i18n' : build_i18n.build_i18n, 'build_icons' : build_icons_extra, 'clean' : clean_extra} ) laditools-1.1.0/update_po000077500000000000000000000002121257536635300154230ustar00rootroot00000000000000#!/bin/bash oldpwd="`pwd`" cd po for i in `ls *.po` do intltool-update -g laditools -d `echo $i | sed -e 's/.po//'` done cd $oldpwd laditools-1.1.0/wmladi000077500000000000000000000200761257536635300147320ustar00rootroot00000000000000#!/usr/bin/python # LADITools - Linux Audio Desktop Integration Tools # wmladi - Window maker dockapp for jackdbus # Copyright (C) 2012 Alessio Treglia # Copyright (C) 2007-2010, Marc-Olivier Barre # Copyright (C) 2007-2009, Nedko Arnaudov # # 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 . import sys import os import signal from wmdocklib import wmoo, pywmhelpers import time import argparse import gettext from gi.repository import Gdk sig_handler = signal.getsignal(signal.SIGTERM) signal.signal(signal.SIGINT, sig_handler) from laditools import _gettext_domain gettext.install(_gettext_domain) from laditools import get_version_string from laditools import LadiConfiguration from laditools import LadiApp from gi.repository import Gtk from gi.repository import GObject from laditools.gtk import LadiMenu # Default configuration autostart_default = 0 debug = False class wmladi (wmoo.Application, LadiMenu, LadiApp): _appname = 'wmladi' _appname_long = _("LADI WindowMaker dockapp") _appid = 'org.linuxaudio.ladi.wmlami' # Default configuration _default_config = { 'autostart' : False, } def on_about(self, *args): LadiMenu.on_about(self, version=get_version_string()) def quit(self, *args): Gtk.main_quit() def __init__ (self): # Handle the configuration self.global_config = LadiConfiguration (self.appname, self._default_config) self.config_dict = self.global_config.get_config_section (self.appname) autostart = bool(eval(self.config_dict['autostart'])) wmoo.Application.__init__ ( self, #background = os.path.dirname(sys.argv[0]) + os.sep + "wmjackctl.xpm", margin = 2, debug = False) LadiMenu.__init__(self, autostart) LadiApp.__init__(self) self.connect_signals_quit() self.addCallback (self.on_button_release, 'buttonrelease', area=(0,0,64,64)) self.lines = [] for i in range (6): self.lines.append ("") self.clear () self.started = False def set_starting_status (self): self.set_line (0, "JACK") self.set_line (1, "Starting") self.clear_line (2) self.clear_line (3) self.clear_line (4) self.clear_line (5) def on_button_release (self, event): if event['button'] == 3: self.menu_activate () def set_line (self, line, text): self.lines[line] = text while len (self.lines[line]) < 9: self.lines[line] += ' ' def clear_line (self, line): self.set_line (line, "") def clear (self): for i in range (6): self.clear_line (i) def update (self): try: if self.jack_is_started(): self.started = True line0 = "JACK" if self.jack_is_realtime(): line0 += " RT" else: line0 += " " if self.a2j_is_available(): try: if self.a2j_is_started(): line0 += ' A' else: line0 += ' a' except: pass self.set_line(0, line0) self.set_line(1, "started") self.set_line(2, "%.3f %%" % self.jack_get_load()) xruns = self.jack_get_xruns() if xruns == 0: self.set_line(3, "no xruns") elif xruns == 1: self.set_line(3, "1 xrun") elif xruns > 999: self.set_line(3, "lot xruns") else: self.set_line(3, "%s xruns" % xruns) rate = self.jack_get_sample_rate() if rate % 1000.0 == 0: self.set_line(4, "%.0f Khz" % (rate / 1000.0)) else: self.set_line(4, "%.1f Khz" % (rate / 1000.0)) self.set_line(5, "%.1f ms" % self.jack_get_latency()) else: self.set_line(0, "JACK") self.set_line(1, "stopped") if self.started: self.clear_line(2) self.clear_line(3) self.clear_line(4) self.clear_line(5) self.started = False self.clear_diagnose_text() except Exception, e: self.set_diagnose_text(repr(e)) if debug: print repr (e) self.set_line(0, "JACK") self.set_line(1, "is sick") self.clear_line(2) self.clear_line(3) self.clear_line(4) self.clear_line(5) self.clear_jack_proxies() self.put_lines (self.lines) wmoo.Application.update (self) LadiMenu.update(self) def put_lines (self, lines): x = 3 y = 2 for line in lines: self.putString (x, y, line) y += 9 def do_dockapp (self, user_data = None): """this is called from event loop. events are examined and if a callback has been registered, it is called, passing it the event as argument. """ event = pywmhelpers.getEvent () while not event is None: if event['type'] == 'destroynotify': sys.exit (0) for evtype, key, area, callback in self._events: if evtype is not None and evtype != event['type']: continue if key is not None and key != event['button']: continue if area is not None: if not area[0] <= event['x'] <= area[2]: continue if not area[1] <= event['y'] <= area[3]: continue callback (event) event = pywmhelpers.getEvent () self.redraw () #print "tick" return True def run_sleep (self): self.go = True while self.go: while Gtk.events_pending (): Gtk.main_iteration () self.do_dockapp () while Gtk.events_pending (): Gtk.main_iteration () time.sleep (self._sleep) def run_gtk (self): #print self._sleep GObject.timeout_add (int(self._sleep * 1000), self.do_dockapp, None) Gtk.main () def run (self): self.run_gtk () self.global_config.set_config_section (self.appname, self.config_dict) self.global_config.save () def position_menu(self, menu, data): _, x, y, _ = Gdk.Display.get_default().get_pointer() return x, y, True def menu_activate(self): menu = self.create_menu() try: menu.popup(parent_menu_shell=None, parent_menu_item=None, func=self.position_menu, data=None, button=3, activate_time=0) except Exception, e: print repr(e) pass if __name__ == '__main__': parser = argparse.ArgumentParser(description=_('Window maker dockapp for jackdbus'), epilog=_('This program is part of the LADITools suite.')) parser.add_argument('--version', action='version', version="%(prog)s " + get_version_string()) parser.parse_args() wmladi().run () sys.exit(0)