pax_global_header00006660000000000000000000000064152316245250014517gustar00rootroot0000000000000052 comment=e807381be34db52ad567c804ebee3dec45f1fa3e pd-externals-pddp-1840f26/000077500000000000000000000000001523162452500153265ustar00rootroot00000000000000pd-externals-pddp-1840f26/+pager-help.pd000066400000000000000000000015201523162452500177500ustar00rootroot00000000000000#N canvas 368 122 415 350 10; #X obj 144 178 pddp/open +pager; #X text 20 60 +pager.pd is an object that allows you to navigate through a folder of files with "previous" and "next" buttons.; #X text 24 97 To use it \, copy to the folder where the files that you want to browser thru are. The filenames need to start with a number in order to be controlled by +pager.pd.; #X text 36 241 +pager.pd should be the first file in the list in order for things to work properly.; #N canvas 775 356 494 344 META 0; #X text 12 25 LICENSE GPL v2; #X text 12 5 KEYWORDS control; #X text 12 85 AUTHOR Hans-Christoph Steiner \;; #X text 12 45 DESCRIPTION navigate files in a folder with "previous" and "next" buttons; #X text 12 105 HELP_PATCH_AUTHORS "pd meta" information added by IOhannes m zmölnig for pddp-v0.3; #X restore 350 322 pd META; pd-externals-pddp-1840f26/+pager.pd000066400000000000000000000110461523162452500170260ustar00rootroot00000000000000#N canvas 680 22 435 82 10; #X declare -path zexy -lib zexy; #N canvas 265 17 496 857 guts 0; #X obj 190 19 loadbang; #X obj 60 10 bng 50 450 50 0 \$0-next \$0-next --> 12 25 1 24 #88a4fc #000000 #000000; #X obj 10 10 bng 50 450 50 0 \$0-prev \$0-prev <-- 10 25 1 24 #54649c #000000 #000000; #X text 70 65 next; #X text 4 65 previous; #X text 164 99 up; #X msg 15 803 \; pd open \$2 \$1; #X obj 124 823 send \$0-filename; #X msg 123 545 label \$1; #X obj 123 565 send \$0-folder_name; #X obj 52 347 send \$0-current_page; #X obj 52 301 pack float float; #N canvas 760 129 484 343 generate 0; #X obj 70 70 file patchpath; #X obj 70 259 select +pager.pd; #X obj 70 101 trigger symbol symbol; #X obj 247 143 makefilename %s/+pager.pd; #X text 169 259 (filter out this file to prevent endless loops); #N canvas 121 53 458 308 glob 0; #X obj 75 46 inlet; #X obj 117 222 outlet; #X obj 281 41 operating_system; #X obj 281 65 select windows; #X obj 281 18 loadbang; #X obj 362 87 bang; #X msg 281 109 1; #X text 153 171 glob; #X text 25 164 windows; #X obj 75 73 list prepend 0; #X obj 75 95 route 1 0, f 21; #X msg 362 109 0; #X obj 75 118 symbol; #X msg 75 141 \$1/*.pd; #X msg 136 141 \$1/[0-9]*.pd; #X obj 117 197 symbol; #X obj 136 118 symbol; #X connect 0 0 9 0; #X connect 2 0 3 0; #X connect 3 0 6 0; #X connect 3 1 5 0; #X connect 4 0 2 0; #X connect 5 0 11 0; #X connect 6 0 9 1; #X connect 9 0 10 0; #X connect 10 0 12 0; #X connect 10 1 16 0; #X connect 12 0 13 0; #X connect 13 0 15 0; #X connect 14 0 15 0; #X connect 15 0 1 0; #X connect 16 0 14 0; #X restore 70 143 pd glob or windows pattern; #X obj 163 284 outlet; #X obj 70 17 inlet; #X obj 70 168 file glob; #X obj 70 214 route 0; #X msg 70 191 \$2 \$1; #X obj 70 237 symbol; #X connect 0 0 2 0; #X connect 1 1 6 0; #X connect 2 0 5 0; #X connect 2 1 3 0; #X connect 3 0 1 1; #X connect 5 0 8 0; #X connect 7 0 0 0; #X connect 8 0 10 0; #X connect 9 0 11 0; #X connect 10 0 9 0; #X connect 11 0 1 0; #X restore 211 66 pd generate file list; #X obj 52 278 + 1; #X msg 52 327 label (\$1/\$2); #X obj 42 506 file splitname; #X obj 42 527 unpack s s; #X obj 15 435 file splitname; #X msg 124 800 label \$2; #X obj 15 458 t l s; #X msg 96 458 list . \$1; #X obj 15 413 list store; #X msg 15 390 get \$1; #X obj 118 186 list length; #X obj 211 116 t l l; #X obj 190 139 list; #X obj 211 93 list prepend; #X obj 190 162 t l l l b; #X obj 118 209 t f f; #X msg 15 157 -1; #X msg 92 155 1; #X obj 15 226 mod; #X obj 15 181 +; #X obj 15 251 t f f f; #X msg 299 579 label; #X obj 15 135 r \$0-prev; #X obj 92 133 r \$0-next; #X obj 299 602 t a a a; #X obj 15 601 pack symbol symbol symbol; #X msg 105 687 symbol \$3; #X obj 105 710 t s s; #X obj 105 733 select .; #X msg 234 616 symbol; #X msg 150 756 \; pd-\$1 menuclose 1; #X obj 338 627 send \$0-filename; #X obj 234 485 t b b; #X obj 190 42 trigger bang bang bang; #X obj 299 647 send \$0-current_page; #X obj 318 667 send \$0-folder_name; #X obj 15 631 t l l l l; #X msg 99 641 symbol \$2; #X msg 23 205 0 \$1; #X obj 310 820 declare -path zexy -lib zexy; #X connect 0 0 46 0; #X connect 8 0 9 0; #X connect 11 0 14 0; #X connect 12 0 26 0; #X connect 13 0 11 0; #X connect 14 0 10 0; #X connect 15 0 16 0; #X connect 15 1 8 0; #X connect 16 1 8 0; #X connect 17 0 19 0; #X connect 17 1 20 0; #X connect 18 0 7 0; #X connect 19 0 38 0; #X connect 19 1 15 0; #X connect 20 0 19 0; #X connect 21 0 17 0; #X connect 22 0 21 0; #X connect 23 0 28 0; #X connect 24 0 25 1; #X connect 24 1 26 1; #X connect 25 0 27 0; #X connect 26 0 24 0; #X connect 27 0 23 0; #X connect 27 2 21 1; #X connect 27 3 24 0; #X connect 28 0 51 0; #X connect 28 1 11 1; #X connect 29 0 32 0; #X connect 30 0 32 0; #X connect 31 0 33 0; #X connect 32 0 31 0; #X connect 33 0 22 0; #X connect 33 1 13 0; #X connect 33 2 32 1; #X connect 34 0 37 0; #X connect 35 0 29 0; #X connect 36 0 30 0; #X connect 37 0 47 0; #X connect 37 1 48 0; #X connect 37 2 44 0; #X connect 38 0 49 0; #X connect 39 0 40 0; #X connect 40 0 41 0; #X connect 41 1 43 0; #X connect 42 0 38 2; #X connect 42 0 41 1; #X connect 45 0 42 0; #X connect 45 1 34 0; #X connect 46 0 25 0; #X connect 46 1 12 0; #X connect 46 2 45 0; #X connect 49 0 6 0; #X connect 49 1 18 0; #X connect 49 2 39 0; #X connect 49 3 50 0; #X connect 50 0 38 2; #X connect 51 0 31 0; #X coords 0 -1 1 1 100 50 1 10 10; #X restore 6 8 pd guts; #X obj 167 8 cnv 15 240 25 empty \$0-folder_name empty 5 12 1 14 #fcfcc8 #00006c 0; #X obj 107 33 cnv 15 300 25 empty \$0-filename empty 5 12 1 14 #fcfcc8 #00006c 0; #X obj 107 8 cnv 15 60 25 empty \$0-current_page empty 5 12 1 14 #fcfcc8 #00006c 0; #X coords 0 0 1 1 85 60 0; pd-externals-pddp-1840f26/.github/000077500000000000000000000000001523162452500166665ustar00rootroot00000000000000pd-externals-pddp-1840f26/.github/workflows/000077500000000000000000000000001523162452500207235ustar00rootroot00000000000000pd-externals-pddp-1840f26/.github/workflows/pd-lib-builder.yml000066400000000000000000000004321523162452500242400ustar00rootroot00000000000000--- name: pd-lib-builder on: push jobs: pd55: uses: pure-data/pure-data-ci/.github/workflows/pd-lib-builder.yml@main with: pd-version: "0.55-0" pd56: uses: pure-data/pure-data-ci/.github/workflows/pd-lib-builder.yml@main with: pd-version: "0.56-0" pd-externals-pddp-1840f26/LICENSE.txt000066400000000000000000000353031523162452500171550ustar00rootroot00000000000000GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS pd-externals-pddp-1840f26/Makefile000066400000000000000000000004451523162452500167710ustar00rootroot00000000000000lib.name = pddp class.sources = \ helplink.c \ pddplink.c \ $(empty) datafiles = \ $(wildcard *.pd) \ $(wildcard *.txt) \ $(wildcard *.md) \ pddplink.tcl \ $(empty) datadirs = \ examples \ $(empty) PDLIBBUILDER_DIR=pd-lib-builder include $(PDLIBBUILDER_DIR)/Makefile.pdlibbuilder pd-externals-pddp-1840f26/README.txt000066400000000000000000000031021523162452500170200ustar00rootroot00000000000000pddp ==== This library was started to provide useful objects for documentation, and its name comes from the Pure Data Documentation Project. The [pddplink] object is derived from the pddplink object written by Kzrysztof Czaja in his *miXed* library (externals/miXed/pddp/pddplink.c). That version also includes a web server. [pddplink] ChangeLog ----------------- alpha3 * .pd back-link tries not to open patches that are already open: if a patch window already exists, it is raised and given focus instead * new option "-gop" (visible in a gop) * bug fix: unclickable in gop, unless visible alpha2 * loading tcl scripts through "package require pddp": . storing them in an immediate subdirectory of the path of pddplink's binary . storing a hand-crafted pkgIndex.tcl there . pddplink's setup appends the path of its binary to tcl's "auto_path" * pddpserver asks for auto-assigning its port first, then starts incrementing from 32768 * pddplink's appearance controlled with creation options (an option switch is any symbol starting from '-' followed by a letter) * options currently recognized: . "-box" (standard object box) . "-text" followed by any number of non-option atoms (body text) * nonboxed version (default) has a custom widgetbehavior, which is a thin layer on top of the standard text widgetbehavior (using all rtext routines), so that merging into core Pd, as a new object type, T_LINK, would be easy. alpha1 * prototype versions of the external "pddplink" and two pd-gui extensions "pddpserver.tcl", "pddpclient.tcl" pd-externals-pddp-1840f26/dsp-help.pd000066400000000000000000000023171523162452500173720ustar00rootroot00000000000000#N canvas 105 135 468 434 10; #X obj 30 212 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1; #X obj 2 2 cnv 15 450 20 empty empty pddp/dsp 2 11 1 18 #e0e0e0 #404040 0; #X msg 30 236 \; pd dsp \$1; #X text 18 103 Click in the box to the left in the object to turn on/off the DSP:; #X text 23 279 Notice that if you use the the above message \, [pddp/dsp] still responds to the change in DSP status. [pddp/dsp] also responds to the keyboard shortcuts.; #X text 138 343 On Mac OS X: Cmd-. and Cmd-/; #X text 47 329 On Windows and GNU/Linux: Ctrl-. and Ctrl-/; #X obj 34 142 pddp/dsp; #X text 16 182 [pddp/dsp] is basically a fancy version of this:; #X text 16 39 [pddp/dsp] is a GUI object to turn on and off the audio processing \, aka "DSP". It also shows the status of the DSP \, green means DSP is on \, grey means DSP is off.; #N canvas 775 356 494 344 META 0; #X text 12 25 LICENSE GPL v2; #X text 12 5 KEYWORDS control; #X text 12 85 AUTHOR Hans-Christoph Steiner \;; #X text 12 105 HELP_PATCH_AUTHORS "pd meta" information added by IOhannes m zmölnig for pddp-v0.3; #X text 12 45 DESCRIPTION non-nonsense object to turn on/off audio processing; #X restore 390 412 pd META; #X connect 0 0 2 0; pd-externals-pddp-1840f26/dsp.pd000066400000000000000000000020331523162452500164370ustar00rootroot00000000000000#N canvas 312 196 484 397 10; #X obj 19 1 cnv 16 40 16 empty \$0-canvas dsp 7 8 0 14 #e0e0e0 #202020 0; #X obj 0 0 tgl 18 0 \$0-toggle \$0-toggle empty 1 8 1 9 #e0e0e0 #202020 #202020 0 1; #X msg 0 200 \; pd dsp \$1; #X text 239 358 released under the GNU GPL; #X text 22 344 (C) Copyright 2005 Hans-Christoph Steiner ; #X obj 107 17 r pd-dsp-started; #X msg 107 40 1; #X msg 217 40 0; #X obj 217 17 r pd-dsp-stopped; #X obj 107 86 select 0 1; #X msg 107 109 10; #X msg 135 109 76; #X obj 107 132 t f; #X msg 107 155 color \$1 12 12; #X obj 107 178 t a a; #X obj 230 221 s \$0-toggle; #X obj 107 221 s \$0-canvas; #X obj 107 63 t f f, f 21; #X msg 230 88 set \$1; #X connect 1 0 2 0; #X connect 5 0 6 0; #X connect 6 0 17 0; #X connect 7 0 17 0; #X connect 8 0 7 0; #X connect 9 0 10 0; #X connect 9 1 11 0; #X connect 10 0 12 0; #X connect 11 0 12 0; #X connect 12 0 13 0; #X connect 13 0 14 0; #X connect 14 0 16 0; #X connect 14 1 15 0; #X connect 17 0 9 0; #X connect 17 1 18 0; #X connect 18 0 15 0; #X coords 0 0 1 1 60 18 1 0 0; pd-externals-pddp-1840f26/examples/000077500000000000000000000000001523162452500171445ustar00rootroot00000000000000pd-externals-pddp-1840f26/examples/pddp.css000066400000000000000000000005321523162452500206050ustar00rootroot00000000000000body { color: brown ; background: gray url(test.bg.jpg) ; margin-top: 10 ; font-family: Helvetica, sans-serif ; font-size: larger ; } pre.programlisting { display: table ; background-color: #EEEEEE ; padding: 2pt ; border-style: solid ; border-width: 1pt ; border-color: #000000 ; border-spacing: 3pt ; margin: 3pt ; } pd-externals-pddp-1840f26/examples/pddplink-test-01.html000066400000000000000000000020201523162452500230240ustar00rootroot00000000000000first simple test

first simple test


test patch is here: pddplink-test-01.pd

The above link works if you opened this page from Pd, for example, by clicking on an object

pddplink pddplink-test-01.html

Pd links should also work in all pages opened through any other, initiating, Pd-opened page.

Another simple test page is here: pddplink-test-02.html

pd-externals-pddp-1840f26/examples/pddplink-test-01.pd000066400000000000000000000012451523162452500224730ustar00rootroot00000000000000#N canvas 421 92 475 404 12; #X text 20 10 first entry; #X text 50 50 three ways of linking to a; #X obj 270 50 pddplink pddplink-test-01.html -text local html page ; #X obj 50 75 pddplink pddplink-test-01.html; #X obj 50 110 pddplink pddplink-test-01.html -box; #X text 50 170 three ways of linking to a; #X obj 270 170 pddplink http://puredata.info -text remote html page ; #X obj 50 195 pddplink http://puredata.info; #X obj 50 230 pddplink http://puredata.info -box; #X text 50 290 three ways of linking to; #X obj 260 290 pddplink pddplink-test-02.pd -text another local patch ; #X obj 50 315 pddplink pddplink-test-02.pd; #X obj 50 350 pddplink pddplink-test-02.pd -box; pd-externals-pddp-1840f26/examples/pddplink-test-01.xml000066400000000000000000000012441523162452500226670ustar00rootroot00000000000000 first simple test test patch is here: The above link works if you opened this page from Pd, for example, by clicking on an object pddplink pddplink-test-01.html Pd links should also work in all pages opened through any other, initiating, Pd-opened page. Another simple test page is here: pd-externals-pddp-1840f26/examples/pddplink-test-02.html000066400000000000000000000020221523162452500230270ustar00rootroot00000000000000second simple test

second simple test


test patch is here: pddplink-test-02.pd

The above link works if you opened this page from Pd, for example, by clicking on an object

pddplink pddplink-test-02.html

Pd links should also work in all pages opened through any other, initiating, Pd-opened page.

Another simple test page is here: pddplink-test-01.html

pd-externals-pddp-1840f26/examples/pddplink-test-02.pd000066400000000000000000000012461523162452500224750ustar00rootroot00000000000000#N canvas 321 192 475 404 12; #X text 20 10 first entry; #X text 50 50 three ways of linking to a; #X obj 270 50 pddplink pddplink-test-02.html -text local html page ; #X obj 50 75 pddplink pddplink-test-02.html; #X obj 50 110 pddplink pddplink-test-02.html -box; #X text 50 170 three ways of linking to a; #X obj 270 170 pddplink http://puredata.info -text remote html page ; #X obj 50 195 pddplink http://puredata.info; #X obj 50 230 pddplink http://puredata.info -box; #X text 50 290 three ways of linking to; #X obj 260 290 pddplink pddplink-test-01.pd -text another local patch ; #X obj 50 315 pddplink pddplink-test-01.pd; #X obj 50 350 pddplink pddplink-test-01.pd -box; pd-externals-pddp-1840f26/examples/pddplink-test-02.xml000066400000000000000000000012451523162452500226710ustar00rootroot00000000000000 second simple test test patch is here: The above link works if you opened this page from Pd, for example, by clicking on an object pddplink pddplink-test-02.html Pd links should also work in all pages opened through any other, initiating, Pd-opened page. Another simple test page is here: pd-externals-pddp-1840f26/examples/test.bg.jpg000066400000000000000000000125631523162452500212230ustar00rootroot00000000000000ÿØÿàJFIFHHÿí ˆPhotoshop 3.08BIMíHH8BIMó8BIM 8BIM' 8BIMõH/fflff/ff¡™š2Z5-8BIMøpÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿèÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿèÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿèÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿè8BIM@@8BIM €€€ÀüÿØÿàJFIFHHÿþ'File written by Adobe Photoshop¨ 4.0ÿîAdobed€ÿÛ„            ÿÀ€€"ÿÝÿÄ?   3!1AQa"q�2‘¡±B#$RÁb34r‚ÑC%’Sðáñcs5¢²ƒ&D“TdE£t6ÒUâeò³„ÃÓuãóF'”¤…´•ÄÔäô¥µÅÕåõVfv†–¦¶ÆÖæö7GWgw‡—§·Ç×ç÷5!1AQaq"2�‘¡±B#ÁRÑð3$bár‚’CScs4ñ%¢²ƒ&5ÂÒD“T£dEU6teâò³„ÃÓuãóF”¤…´•ÄÔäô¥µÅÕåõVfv†–¦¶ÆÖæö'7GWgw‡—§·ÇÿÚ ?ô’àtÉù° v ­Î™Ñ>ðÖ“ÁqRµWq%ÂGµ¼¦ÖǸ™Ñ48–�Ú&T¸;ÈI)møl¹Ä}É‹t²M†‚÷sŒñ& 1 ðIJ$Fœ%ÈÔI�€p$ø$ÓÜÈ$$¥ÚdÉE¼¹ÎsZ|´íi†D&ÓfÑ ~ô”É €7@Xó)„oÛH™H¶H�x§-ˆá%1�ÒgBŸÜL4 ;”Ó 8O@“©ðIJ-—$‘È%¸IkG—É*Ãw'¿dÀ�Opža%?ÿÐô†�d’|SºI÷C£°O¹ÀN�£€¢Ö´$¸É…+U—¶eÚÜçö:‰f‚ ŸúqÏd”¦¸—}<âH&&p Fãx €²ù;x )RNí¤Ð�-©°~'Å @oѦ.m&�’™3ÔÜIÁD}¸K§F¤v´Ë¦{'€ÒÝ s’R�´w'X $5­€y)´æK¿"�ÔäwIKrØÝ 1!#»†™'º@ÙˆÝÀø¥à^{@hIK�kHã�d–µ£FŽOšP p‚{’ž$ jJÿÑô€Z!­i$‰$©¼ÁyÁ&�ÎsàÀ¢$9òI+U�$“Æ�Ê‹œ s¹!93´ìœ. öö””Äú`D¥‡q$ë¢�’tp€u)¥Æb$¥:H ŠyÔ�Ì$àwDa3€ç'MR¹LÇ‚yoµî:p˜€6µ€�ܤídíaIJÐìhðiI¥º rXHñ1�ƒ_l¤¥†Ó éÁk‰‰�ÉNfy�¿š›w†¿”­âlÇŠPL4䔵۫tJ �¯¤§ÿÒô‚á°È•!2HÐÉH’eäàÎ#i¼©Zªf¤9¦HîR0KµŸå.FÑí`JaÐ&{$¥Î®8šÖ´m:”ˆ $—{�¢M8µ²tÔ””¡¶\ã;G‡u°6‡ÉO´m i˜:©¸�èh{ø$¥´ä;„À{çOÁ6ÐFؙ䧆˜h0Rƒ˜ íí¢P@kœ8à|R.–‰öŽR€@;�™?Á%-Éx§nÒHÏð ô�¡á©7tÁN¤”ÆCÄÉÚ yfù2Od¤“°4@ÕJ ŽÀø$§ÿÓô—É�e#´jã$%¸�Ä $íh €cwI%ǘRµW/÷D4'k´ÞGDĵÐÝCcP”‚èD$¥«7“:¤â9RœµÎ-lè50‘$“ä’•²$O¹é‹Gw@§!äIÔ¤æ´mißD”¼—8£Bf6<†ˆIþæ�;ÓlI0;”»¸òîÉ:Ã@�Ú;µ<“A#é@“â’–s˜%ñäpÐÒ]:žÉ\KÇ¥Ö¤¥jè Àh$ý"ÑSö€Lj–È~“�©IK@ R�¤cR}¿œÃ´ À×S£{x¤¦,kŒË“Á�»„˜\çÖ÷I€@ðäùÊJSÚZÐ$ó¬'"îÅܵ¤ë©n°œI’LBJXµÄžåJx“ hL ÚvŸ™I¡á�sŒø”³Fã$ý"Iø'kˆi?œã¤¥:d<µß©ã�”ÿÿÙ8BIMÿþ'File written by Adobe Photoshop¨ 4.0ÿîAdobed€ÿÛ„              ÿÀ"ÿÝÿÄ¢  s!1AQa"q�2‘¡±B#ÁRÑá3bð$r‚ñ%C4S’¢²csÂ5D'“£³6TdtÃÒâ&ƒ „”EF¤´VÓU(òãóÄÔäôeu…•¥µÅÕåõfv†–¦¶ÆÖæö7GWgw‡—§·Ç×ç÷8HXhxˆ˜¨¸ÈØèø)9IYiy‰™©¹ÉÙéù*:JZjzŠšªºÊÚêúm!1AQa"q�‘2¡±ðÁÑá#BRbrñ3$4C‚’S%¢c²ÂsÒ5âDƒT“ &6E'dtU7ò£³Ã()Óã󄔤´ÄÔäôeu…•¥µÅÕåõFVfv†–¦¶ÆÖæöGWgw‡—§·Ç×ç÷8HXhxˆ˜¨¸ÈØèø9IYiy‰™©¹ÉÙéù*:JZjzŠšªºÊÚêúÿÚ ?îEÀRõäWáU\¢?b�¸þÈÊ^GRM~w¨±©o²\æ¹µ·ff_�>ÖP4�Ÿ_UŠSeš¸ï²}VüœU¯†9x­]Ø}ÙE6 û9IDWž*£Ò­Ä–§Â¾«‰PŘmösu«/ÙQ˜PΤ·òæSûMUfÚ59;¶&®ï²F~<ºÒ«?8�B…Çí6`iÍ…‘Š´¿ÄHÜòË«Ÿ�B…øy6Q5£(íÇ,€(…�Åö©Š»‚¼‡rãö¿—0“•Bƒ·Úl¨‚zmÄž4ðÆ³ªÀŽ+FÅ_ÿÐî(ßÔ“üÙoÈŸŽ�ÇöF_'QËeAöW#@Ç‘.y53\Ú©ðräûåÆ(›Éû'á\ÄŲÐÕ¼rþÝ>×ìàW#±o°ùs�‹i^+–(æiÈý•Ê yISÃì®uY½N Ÿ ¶`JÀ”õ›Ç0 'Øå_³é–â~8ªèýZHXòW»"mÎJýÙg‚^\Û.‹„PkNLÞ«œÆ¬PÕˆý‘š…Ø  òÊN*JÖ¬ß6_/Ý3ö~×¾*ï¶¹ñ_òs0wøõûM›ˆEçì®X�³š¹û*;b­9ýÙ¶û4¦S7"¬E#QQï™BÆ‡ŠŸµŽ5jh«ð�Š¿ÿÑî PQ ,93yIMB²¹”ó’I8šÇ–W’¥˜|+šæÕà³Óáý£ŒgB�Éßí2å“ZsøCþÎX+ÉÖ?ƒöyb«O¢ -áÍX�¨ÄŸ‹áÇ/&? Š)øŽU\òãFUû8«�ðÔ*Ç]Ê�µLÌ*q i�p£ãt<›áøp+ŽëÉ�.'örÉEnr¶2€Ò$%96Qøèî›)â¸UÁ™£ª(^_µþN]P‚Ô,Å‹ÄõÅ.1ªrZñgûM”Þ�^NçŠøwË(äu«•–Ô ˆoÚÅ ¼�ÁqUÌ»pG&V¹›ã(Ïöq®ñ+ôË58â«‘}4 7sñ6js`ò/.?g1à Ä9V›æøPz®OÁöWh�׌Ÿ‹Û.‰UI«й££›r9“ˆy·ÚÅ\¼9= ÊU �‘'¯†_6€å•ð àÄÛ“\ ÿÔî_—`x¨Ê%~Â1]ù3e’›ÅÈÑ~/že+Ä· Ö¶µRG%�ü~8â(ª¼ÁþQ”€±ReW2¡<QÁ¿ep«¹|^šÓ’�‹�lo71Õˆ_Ú8å*„´Ù_n1Äü qWJ$$F€ño´Øà±££p2û‘ðåm¿•g5i'6ÙU®‘8! Ù�"B’8�öW7ĵ¶jðµÛí`W(,äôå”w5ÿ',óA͈åöW5©!¿ÄÍ…Z;F‡“åHX?þÈì¸ê¿"}JŸ Ã�=¹·Å�.a'÷QÁÎüx"ª» ¶Ë£µ û>¸Ðj®±‰N.nJÈøÏ†1ù¹$«(¯ž?ŠÆDÜ‹½8ñ®P3S_µŠ¸„O‡ž`"EÔQŽfäüÔRŸ³ï™�*"EøÚlUÿÖî!c«ñRY²ÇZ$|Y¾Óxe†fPA=2ÈuG¡äÙ­mSP•ܳp•ŽZìÃíSíf¡ÕÏÂ~Ð\ª¦î:°£\:.`R>L:¨â¬r‚² <ªOP:  ¨´D ’jìO|*åTâŠñøºõËBÄ*¹­|3:/ä߀鎚�öŽ*¦Š EW‘ø›Ezp +}¦Ì¢F4†ƒ²Œ°Ÿìh¿,U¦$‰A¯|Ü~Ú1åðãc1ïÀ`PëLºœ‰?êâ­ð-ÄíÀ}£–vÌæµ§À£aÊ„•OÙ V@¼“Ó¾*µP ßöGÞÙˆuŒD»HÛ¶Z£ïÉÖ¼ªM3 £6ç‘ë㊿ÿÙpd-externals-pddp-1840f26/examples/toonepage000077500000000000000000000007511523162452500210560ustar00rootroot00000000000000#!/bin/sh usage () { cat << EOF usage: toonepage .xml EOF exit $1 } [ $# -eq 0 ] && usage 1 infile="$1" SOURCE_NAME="$(basename "${infile}")" SOURCE_STUB="$(basename "${SOURCE_NAME}" .xml)" [ "${SOURCE_STUB}" = "${SOURCE_NAME}" ] && usage 1 xmllint >/dev/null --xinclude --postvalid "${infile}" xsltproc --nonet --xinclude \ --stringparam html.stylesheet pddp.css \ -o "$SOURCE_STUB.html" \ /usr/share/xml/docbook/stylesheet/nwalsh/html/docbook.xsl \ "${infile}" pd-externals-pddp-1840f26/examples/topdf000077500000000000000000000007731523162452500202150ustar00rootroot00000000000000#!/bin/sh usage () { cat << EOF usage: topdf .xml EOF exit $1 } infile="$1" [ $# -eq 0 ] && usage 1 SOURCE_NAME="${infile##*/}" SOURCE_STUB="${SOURCE_NAME%.xml}" [ "${SOURCE_STUB}" = "${SOURCE_NAME}" ] && usage 1 xmllint >/dev/null --xinclude --postvalid "${infile}" xsltproc --nonet --xinclude \ -o "$SOURCE_STUB.fo" \ /usr/share/xml/docbook/stylesheet/nwalsh/fo/docbook.xsl \ "${infile}" # FIXME need to run this twice, it should be check-wrapped too pdfxmltex "$SOURCE_STUB.fo" pd-externals-pddp-1840f26/ezoutput~-help.pd000066400000000000000000000030501523162452500206740ustar00rootroot00000000000000#N canvas 103 48 450 416 10; #X obj 92 118 osc~ 480; #X obj 322 122 noise~; #X text 38 28 a GUI replacement for [dac~] with controls for "compute audio" \, volume \, and a mute button.; #X obj 91 166 ezoutput~; #X obj 301 165 ezoutput~; #X obj 150 141 *~ 0.5; #X obj 91 211 env~; #X floatatom 91 234 5 0 0 0 - - - 0; #X obj 131 211 env~; #X floatatom 131 234 5 0 0 0 - - - 0; #X floatatom 174 212 5 0 0 0 - - - 0; #X obj 301 211 env~; #X floatatom 301 234 5 0 0 0 - - - 0; #X obj 341 211 env~; #X floatatom 341 234 5 0 0 0 - - - 0; #X floatatom 384 212 5 0 0 0 - - - 0; #X obj 150 118 osc~ 990; #X text 64 308 see also:; #X obj 138 305 output~; #N canvas 775 356 494 344 META 0; #X text 12 25 LICENSE GPL v2; #X text 12 5 KEYWORDS control; #X text 12 85 AUTHOR Hans-Christoph Steiner \;; #X text 12 105 HELP_PATCH_AUTHORS "pd meta" information added by IOhannes m zmölnig for pddp-v0.3; #X text 12 45 DESCRIPTION GUI replacement for [dac~ 1 2] with controls for volume \, mute and DSP; #X text 13 146 INLET_0 signal; #X text 13 166 INLET_1 signal; #X text 13 196 OUTLET_0 signal0 (with gain applied and DC removed); #X text 13 216 OUTLET_1 signal1 (with gain applied and DC removed); #X text 13 237 OUTLET_2 float (gain); #X restore 380 382 pd META; #X connect 0 0 3 0; #X connect 1 0 4 1; #X connect 1 0 4 0; #X connect 3 0 6 0; #X connect 3 1 8 0; #X connect 3 2 10 0; #X connect 4 0 11 0; #X connect 4 1 13 0; #X connect 4 2 15 0; #X connect 5 0 3 1; #X connect 6 0 7 0; #X connect 8 0 9 0; #X connect 11 0 12 0; #X connect 13 0 14 0; #X connect 16 0 5 0; pd-externals-pddp-1840f26/ezoutput~.pd000066400000000000000000000065761523162452500177660ustar00rootroot00000000000000#N canvas 146 25 606 479 10; #X obj 13 108 hsl 67 18 0.01 1.01 1 0 \$0-v \$0-v volume 20 10 1 9 #ececec #0c4410 #000000 0 0; #X obj 82 90 tgl 18 0 \$0-dsp-toggle \$0-dsp-toggle dsp 2 9 1 9 #fcfcfc #bcbcbc #202020 0 1; #N canvas 678 234 334 233 dsp 0; #X obj 112 96 select 0 1; #X msg 145 118 6; #X msg 11 70 dsp \$1; #X obj 11 95 send pd; #X msg 235 148 set \$1; #X msg 112 148 color \$1 20 12; #X obj 112 179 send \$0-dsp-toggle; #X msg 112 117 0; #X obj 112 11 r pd-dsp-started; #X msg 112 34 1; #X obj 222 11 r pd-dsp-stopped; #X msg 222 34 0; #X obj 112 57 t f f, f 21; #X obj 11 7 r \$0-dsp-toggle; #X obj 11 39 route float; #X connect 0 0 7 0; #X connect 0 1 1 0; #X connect 1 0 5 0; #X connect 2 0 3 0; #X connect 4 0 6 0; #X connect 5 0 6 0; #X connect 7 0 5 0; #X connect 8 0 9 0; #X connect 9 0 12 0; #X connect 10 0 11 0; #X connect 11 0 12 0; #X connect 12 0 0 0; #X connect 12 1 4 0; #X connect 13 0 14 0; #X connect 14 0 2 0; #X restore 402 118 pd dsp logic; #X obj 315 2 inlet; #X obj 82 108 bng 18 1000 50 0 \$0-mute \$0-mute empty 0 9 2 8 #fcfcfc #fc2828 #bcbcbc; #X obj 201 2 inlet~; #X obj 86 363 line~; #X obj 186 403 *~; #X obj 206 433 dac~; #X text 203 22 audio in; #X obj 264 2 inlet~; #X obj 248 402 *~; #X obj 201 73 hip~ 3; #X obj 263 73 hip~ 3; #X obj 10 338 send pd; #X msg 10 317 dsp 1; #X obj 248 432 outlet~; #X obj 148 432 outlet~; #X obj 355 232 outlet; #X obj 86 342 pack 0 50; #X text 153 341 <-- make a ramp to avoid clicks or zipper noise; #X text 307 74 filter out DC; #N canvas 148 311 564 364 mute 0; #X obj 127 20 inlet; #X obj 222 171 float; #X obj 255 108 tgl 15 1 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 1 1; #X obj 222 149 spigot; #X obj 222 81 trigger bang bang; #X obj 249 226 outlet; #X msg 309 194 0; #X obj 282 149 select 0; #X msg 166 85 set 1; #X msg 127 323 color \$1 13 20; #X obj 127 275 bang; #X msg 127 295 0; #X msg 160 295 3; #X obj 127 344 send \$0-mute; #X obj 222 28 r \$0-mute; #X obj 222 58 route bang; #X obj 222 194 t a a; #X obj 127 64 t b b, f 7; #X obj 282 172 t b b; #X obj 255 126 t a a; #X obj 127 43 t f f, f 12; #X connect 0 0 20 0; #X connect 1 0 16 0; #X connect 2 0 19 0; #X connect 3 0 1 0; #X connect 4 0 3 0; #X connect 4 1 2 0; #X connect 6 0 5 0; #X connect 7 0 18 0; #X connect 8 0 2 0; #X connect 9 0 13 0; #X connect 10 0 11 0; #X connect 11 0 9 0; #X connect 12 0 9 0; #X connect 14 0 15 0; #X connect 15 0 4 0; #X connect 16 0 10 0; #X connect 16 1 5 0; #X connect 17 0 10 0; #X connect 17 1 8 0; #X connect 18 0 12 0; #X connect 18 1 6 0; #X connect 19 0 3 1; #X connect 19 1 7 0; #X connect 20 0 17 0; #X connect 20 1 1 1; #X restore 86 228 pd mute; #X obj 10 147 r \$0-v; #X obj 10 170 route float; #X msg 153 250 set \$1; #X obj 153 273 s \$0-v; #X obj 86 251 t f f; #X obj 10 193 t b f f f; #X obj 355 210 - 0.01; #X obj 86 294 - 0.01; #X obj 86 317 max 0; #X connect 3 0 0 0; #X connect 5 0 12 0; #X connect 6 0 11 0; #X connect 6 0 7 0; #X connect 7 0 8 0; #X connect 7 0 17 0; #X connect 10 0 13 0; #X connect 11 0 8 1; #X connect 11 0 16 0; #X connect 12 0 7 1; #X connect 13 0 11 1; #X connect 15 0 14 0; #X connect 19 0 6 0; #X connect 22 0 27 0; #X connect 23 0 24 0; #X connect 24 0 28 0; #X connect 25 0 26 0; #X connect 27 0 30 0; #X connect 27 1 25 0; #X connect 28 0 15 0; #X connect 28 1 30 0; #X connect 28 2 22 0; #X connect 28 3 29 0; #X connect 29 0 18 0; #X connect 30 0 31 0; #X connect 31 0 19 0; #X coords 0 0 1 1 90 40 1 10 90; pd-externals-pddp-1840f26/helplink-help.pd000066400000000000000000000024651523162452500204160ustar00rootroot00000000000000#N canvas 280 108 458 497 12; #X declare -stdpath extra/Gem; #X text 20 10 [helplink] makes a clickable link to a help patch based on the object name. It is useful for providing links to help patches in other patches.; #X obj 51 101 helplink select; #X obj 54 304 helplink; #X obj 50 143 helplink cyclone/counter; #X obj 50 181 helplink iemguts/propertybang; #X text 29 234 If the help patch or object does not exist \, [helplink] will not output an error until someone clicks on the link.; #X obj 55 339 helplink Gem/scale; #X obj 210 308 helplink gemwin; #X obj 239 153 declare -stdpath extra/Gem; #X text 33 384 helplink also has a hidden inlet. You can send a bang to simulate clicking a helplink:; #X obj 54 447 helplink select; #X obj 54 425 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X obj 209 341 helplink fudel; #X text 30 74 usage: [helplink objectname]; #X text 256 341 <-- probably does not exist; #N canvas 476 295 494 344 META 0; #X text 12 25 LICENSE GPL v2; #X text 12 5 KEYWORDS control; #X text 12 85 AUTHOR Hans-Christoph Steiner \;; #X text 12 105 HELP_PATCH_AUTHORS "pd meta" information added by IOhannes m zmölnig for pddp-v0.3; #X text 13 146 INLET_0 bang; #X text 12 45 DESCRIPTION clickable links to helppatches; #X restore 380 462 pd META; #X connect 11 0 10 0; pd-externals-pddp-1840f26/helplink.c000066400000000000000000000140551523162452500173050ustar00rootroot00000000000000/* Copyright (c) 2005 krzYszcz and others. * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ /* This is a prototype of an active comment. It might be replaced with a new core object type, T_LINK (te_type bitfield would have to be extended then). */ #include "pddplink.h" #include #include #ifdef _WIN32 # include #else # include #endif #include "m_imp.h" /* required for glob_evalfile() */ /* this isn't in any header, but its declared in s_path.c */ void open_via_helppath(const char *name, const char *dir); typedef struct _pddplink t_helplink; static t_class *helplink_class; static void helplink_getrect(t_gobj *z, t_glist *glist, int *xp1, int *yp1, int *xp2, int *yp2) { t_helplink *x = (t_helplink *)z; int width, height; int x1, y1, x2, y2; if (glist->gl_editor && glist->gl_editor->e_rtext) { if (x->x_rtextactive) { t_rtext *y = _glist_getrtext(glist, (t_text *)x); _getrect_dimen(y, &width, &height); height -= 2; } else { int font = glist_getfont(glist); width = x->x_vislength * sys_fontwidth(font) + 2; height = sys_fontheight(font) + 2; } } else width = height = 10; x1 = text_xpix(&x->x_ob, glist); y1 = text_ypix(&x->x_ob, glist) + 1; x2 = x1 + width; y2 = y1 + height + 1; *xp1 = x1; *yp1 = y1; *xp2 = x2; *yp2 = y2; } static void helplink_displace(t_gobj *z, t_glist *glist, int dx, int dy) { t_text *t = (t_text *)z; t->te_xpix += dx; t->te_ypix += dy; if (glist_isvisible(glist)) { t_rtext *y = _glist_getrtext(glist, t); rtext_displace(y, dx, dy); } } static void helplink_select(t_gobj *z, t_glist *glist, int state) { t_helplink *x = (t_helplink *)z; t_rtext *y = _glist_getrtext(glist, (t_text *)x); rtext_select(y, state); if (glist_isvisible(glist) && glist->gl_havewindow) { if (state) pdgui_vmess(0, "crs rk", glist, "itemconfigure", rtext_gettag(y) , "-fill", 0x0000FF ); else pdgui_vmess(0, "crs rs rk rk", glist, "itemconfigure", rtext_gettag(y) , "-text", x->x_vistext , "-fill", 0x0000DD , "-activefill", 0xE70000 ); } } static void helplink_activate(t_gobj *z, t_glist *glist, int state) { t_helplink *x = (t_helplink *)z; t_rtext *y = _glist_getrtext(glist, (t_text *)x); rtext_activate(y, state); x->x_rtextactive = state; } static void helplink_vis(t_gobj *z, t_glist *glist, int vis) { t_helplink *x = (t_helplink *)z; t_rtext *y; if (vis) { if ((glist->gl_havewindow || x->x_isgopvisible) && (y = _glist_getrtext(glist, (t_text *)x))) { rtext_draw(y); pdgui_vmess(0, "crs rs rk rk", glist_getcanvas(glist), "itemconfigure", rtext_gettag(y) , "-text", x->x_vistext , "-fill", 0x0000DD , "-activefill", 0xE70000 ); } } else { if ((glist->gl_havewindow || x->x_isgopvisible) && (y = _glist_getrtext(glist, (t_text *)x))) rtext_erase(y); } } static void helplink_doclick(t_helplink *x) { const char* objectname = x->x_ulink->s_name; char dirbuf[MAXPDSTRING], *nameptr; int fd = canvas_open(x->x_glist, objectname, "-help.pd", dirbuf, &nameptr, MAXPDSTRING, 0); if (fd < 0) { /* if canvas_open() failed try open_via_helppath() */ open_via_helppath(objectname, canvas_getdir(x->x_glist)->s_name); } else { /* if canvas_open() gave us a filehandle, then we have a helppatch to * open in dirbuf and nameptr, but we don't need the filehandle */ close(fd); glob_evalfile(NULL, gensym(nameptr), gensym(dirbuf)); } } static int helplink_click(t_gobj *z, t_glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit) { (void)xpix;(void)ypix;(void)shift;(void)alt;(void)dbl; t_helplink *x = (t_helplink *)z; if (glist->gl_havewindow || x->x_isgopvisible) { if (doit) helplink_doclick(x); return (1); } else return (0); } static void helplink_free(t_helplink *x) { if (x->x_vistext) freebytes(x->x_vistext, x->x_vissize); } static void *helplink_new(t_symbol *s) { t_helplink *x = (t_helplink *) pd_new(helplink_class); x->x_isgopvisible = 0; x->x_vistext = 0; x->x_vissize = 0; x->x_vislength = (x->x_vistext ? strlen(x->x_vistext) : 0); x->x_rtextactive = 0; x->x_glist = canvas_getcurrent(); if (s == &s_) x->x_ulink = gensym("helplink"); /* default to helplink help patch */ else x->x_ulink = s; /* do we need to set ((t_text *)x)->te_type = T_TEXT; ? */ if (!x->x_vistext) { x->x_vislength = strlen(x->x_ulink->s_name); x->x_vissize = x->x_vislength + 1; x->x_vistext = getbytes(x->x_vissize); strcpy(x->x_vistext, x->x_ulink->s_name); } return (x); } static void helplink_delete(t_gobj *z, t_glist *glist) { canvas_deletelinesfor(glist, (t_text *)z); } static t_widgetbehavior helplink_widgetbehavior = { helplink_getrect, helplink_displace, helplink_select, helplink_activate, helplink_delete, helplink_vis, helplink_click, }; void helplink_setup(void) { if(!pddplink_compatfuns()) return; helplink_class = class_new(gensym("helplink"), (t_newmethod)helplink_new, (t_method)helplink_free, sizeof(t_helplink), CLASS_PATCHABLE, A_DEFSYMBOL, 0); class_addbang(helplink_class, helplink_doclick); class_setwidget(helplink_class, &helplink_widgetbehavior); } pd-externals-pddp-1840f26/open-help.pd000066400000000000000000000014341523162452500175440ustar00rootroot00000000000000#N canvas 176 296 462 312 10; #X text 48 47 open the specified file on the click of the button:; #X text 66 200 only relative paths work \, no absolute.; #X text 29 241 for better or worse \, the .pd is automatically appended; #X obj 56 78 pddp/open dsp-help; #X text 19 9 BUG: relative paths now work \, but files with no path don't; #X obj 57 107 pddp/open dsp-help; #X obj 57 137 pddp/open ../../3.audio.examples/F02.just.say; #N canvas 775 356 494 344 META 0; #X text 12 25 LICENSE GPL v2; #X text 12 5 KEYWORDS control; #X text 12 85 AUTHOR Hans-Christoph Steiner \;; #X text 12 105 HELP_PATCH_AUTHORS "pd meta" information added by IOhannes m zmölnig for pddp-v0.3; #X text 12 45 DESCRIPTION helper to open the specified Pd patch with a button; #X restore 390 282 pd META; pd-externals-pddp-1840f26/open.pd000066400000000000000000000023441523162452500166170ustar00rootroot00000000000000#N canvas 128 78 535 398 10; #X obj 200 7 inlet; #X obj 47 0 bng 17 250 50 0 \$0- \$0- empty 0 -6 0 8 #28f4f4 #000000 #000000; #X obj 40 71 symbol \$1; #X obj 98 50 symbol; #X text 315 360 released under the GNU GPL; #X text 98 348 (C) Copyright 2005 Hans-Christoph Steiner ; #X text 111 71 <-- store the last value so that the GOP bang will open it; #X text 20 317 This patch opens a patch either from the first argument or sent in as a message.; #X obj 0 0 cnv 16 46 18 empty empty open: 6 9 0 14 #e0e0e0 #000000 0; #X text 20 184 GOP: 168x18; #X obj 112 252 pack symbol symbol, f 20; #X obj 269 173 file patchpath; #X obj 112 149 file splitname, f 19; #X obj 112 172 unpack s s, f 14; #X msg 112 276 \; pd open \$2.pd \$1; #X obj 112 205 list prepend; #X obj 112 228 file join; #X obj 202 172 t b s; #X obj 112 111 trigger symbol bang; #X connect 0 0 3 0; #X connect 0 0 18 0; #X connect 1 0 2 0; #X connect 2 0 18 0; #X connect 3 0 2 1; #X connect 10 0 14 0; #X connect 11 0 15 1; #X connect 12 0 13 0; #X connect 12 1 17 0; #X connect 13 0 15 0; #X connect 13 1 10 1; #X connect 15 0 16 0; #X connect 16 0 10 0; #X connect 17 0 15 0; #X connect 17 1 10 1; #X connect 18 0 12 0; #X connect 18 1 11 0; #X coords 0 0 1 1 124 17 1 0 0; pd-externals-pddp-1840f26/parse_meta.pd000066400000000000000000000027761523162452500200070ustar00rootroot00000000000000#N canvas 408 104 665 545 10; #X obj 100 122 textfile; #X obj 153 143 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 30 80 bang; #X msg 111 80 rewind; #X obj 242 185 route #X #N; #X obj 210 451 pddp/print; #X obj 277 206 route canvas; #X msg 316 308 1; #X obj 184 341 spigot 0; #X obj 316 288 bang; #X obj 175 268 route text restore; #X obj 235 288 bang; #X msg 235 308 0; #X obj 184 364 list split 2; #X obj 100 163 trigger bang anything; #X obj 48 140 bang; #X obj 277 227 list split 4; #X obj 316 247 list trim; #X obj 316 267 route META; #X obj 336 149 print ----------------------------------; #X obj 29 11 inlet; #X obj 30 40 route symbol; #X msg 193 81 read \$1; #X obj 30 60 trigger bang bang symbol; #X msg 76 10 symbol test/test-meta.pd; #X msg 257 10 symbol test2/test2-meta.pd; #X obj 223 386 list trim; #X obj 111 433 print; #X connect 0 0 14 0; #X connect 0 1 1 0; #X connect 0 1 19 0; #X connect 2 0 0 0; #X connect 3 0 0 0; #X connect 4 0 10 0; #X connect 4 1 6 0; #X connect 6 0 16 0; #X connect 7 0 8 1; #X connect 8 0 13 0; #X connect 9 0 7 0; #X connect 10 0 8 0; #X connect 10 1 11 0; #X connect 11 0 12 0; #X connect 12 0 8 1; #X connect 13 1 26 0; #X connect 14 0 15 0; #X connect 14 1 4 0; #X connect 15 0 0 0; #X connect 16 1 17 0; #X connect 17 0 18 0; #X connect 18 0 9 0; #X connect 20 0 21 0; #X connect 21 0 23 0; #X connect 22 0 0 0; #X connect 23 0 2 0; #X connect 23 1 3 0; #X connect 23 2 22 0; #X connect 24 0 21 0; #X connect 25 0 21 0; #X connect 26 0 5 0; #X connect 26 0 27 0; pd-externals-pddp-1840f26/pd-lib-builder/000077500000000000000000000000001523162452500201215ustar00rootroot00000000000000pd-externals-pddp-1840f26/pd-lib-builder/CHANGELOG.txt000066400000000000000000000074011523162452500221530ustar00rootroot00000000000000Changelog for Makefile.pdlibbuilder. v0.7.0, dated 2023-07-06 - build double-precision externals with the 'floatsize' variable - allow building multiple flavours of an external side-by-side (#78) - facilitate multiple platform co-installation of shared lib (#58) - fix use of shared.ldflags with helper-library (#64) - fix broken armv6l platform detection (#71) - improve documentation v0.6.0, dated 2019-12-21 - detect target platform (OS and architecture) rather than build platform (#55) - introduce optional user variable 'PLATFORM' for cross compilation - no longer build OSX/MacOS fat binaries by default (#21, #50) - do build fat binaries when 'extension=d_fat' is specified for OSX/MacOS - fix bug where minimum OSX/MacOS version wasn't defined, and set it to 10.6 v0.5.1, dated 2018-03-15 Fixes and improvements for Windows builds: - properly evaluate variables 'PDDIR' and 'PDBINDIR' to find pd.dll - define default path of 32 bit Pd on 64 bit Windows - link C++ externals with standard C libs on Windows, they don't load otherwise - strip installed Windows binaries by default (issues #34, #39, #41, #42 respectively) Warning for all platforms: variable 'PD_PATH' is no longer supported, use the equivalent 'PDDIR'. v0.5.0, dated 2018-01-23 Implement target architecture detection for Windows builds, and set appropriate options for 32 and 64 bit (used to be for 32 bit only). (feature, issue #37 #38, merge commit 215bf3e) v0.4.4, dated 2016-11-22 Use variable 'system' when evaluating 'for{Linux,Darwin,Windows}' (bugfix, issue #31, commit 2c14110) v0.4.3, dated 2016-11-02 Replace flags '-fpic' by 'fPIC'. (bugfix, issue #29, commit 426b38b) v0.4.2, dated 2016-10-30 Fix issue where incorrect message about m_pd.h is given. (bugfix, commit 2e13d8f) v0.4.1, dated 2016-10-27 Respect cflag for minimum OSX version when defined by lib makefile. (bugfix, pull request #22, commit 48c4127) v0.4.0, dated 2016-10-14 Introduced path variables PDDIR, PDINCLUDEDIR, PDBINDIR, PDLIBDIR which can also be defined in environment. (feature, issue #27, commit b0dab72) v0.3.1, dated 2016-10-13 Fix bug where pd.dll wouldn't be found. (bugfix, commit a0c87be) v0.3.0, dated 2016-10-09 Variable 'PD_PATH' introduced for pd-extended / pd-l2ork compatibility. (feature, issue #26, commit 41e9743) v0.2.8, dated 2016-10-09 Allow installed files to contain weird characters (notably '$'). (bugfix, pull request #20, commit 5b920b1) v0.2.7, dated 2016-10-04 Remove all default pd search paths except vanilla's. (discussion, issue #25, commit a6a89dc) v0.2.6, dated 2016-09-20 Redefined dependency checking so it won't stall rebuilds on OSX. (bugfix, issue #16, commit 9fd1795) v0.2.5, dated 2016-06-26 Fixed dependency checking for object files in other directories. (bugfix, commit f06e550) v0.2.4, dated 2016-06-25 Fixed regression bug that disabled all dependency checking. (bugfix, commit 1d7bb5e) v0.2.3, dated 2016-03-29 Disabled dependency checking for OSX <= 10.5 because it stalled rebuilds. (bugfix, issue #16, commit eb614fd) v0.2.2, dated 2016-03-28 Removed target 'pre' because it forced rebuild of everything in 'all'. (bugfix, issue #17, commit c989c8e) v0.2.1, dated 2015-12-27 Implement / respect 'CPPFLAGS','CFLAGS'and 'LDFLAGS'. (bugfix, issue #5, commit 98f3582) v0.2.0, dated 2015-12-19 Added per-platform multiline defines 'forLinux', 'forDarwin', 'forWindows'. (feature, pull request #9, commit 3946ea5) v0.1.0, dated 2015-12-08 Added targets 'pre' and 'post' to automatically run before and after 'all'. (feature, pull request #4, commit a5678ac) v0.0.2, dated 2015-12-06 Improved methods for searching pd paths. (bugfix, commit ed37e6b) v0.0.1, dated 2015-10-31 Fixed expansion of variable 'lib.version'. (bugfix, issue #1, commit 974b617) v0.0.0, dated 2015-06-24 Initial version. (commit 16517a2) pd-externals-pddp-1840f26/pd-lib-builder/Makefile.pdlibbuilder000066400000000000000000001314521523162452500242270ustar00rootroot00000000000000# Makefile.pdlibbuilder dated 2019-12-21 version = 0.7.0 # Helper makefile for Pure Data external libraries. # Written by Katja Vetter March-June 2015 for the public domain. No warranties. # Inspired by Hans Christoph Steiner's Makefile Template and Stephan Beal's # ShakeNMake. # # Grab the newest version of Makefile.pdlibbuilder from # https://github.com/pure-data/pd-lib-builder/ # # GNU make version >= 3.81 required. # # #=== characteristics =========================================================== # # # - defines build settings based on autodetected OS and architecture # - defines rules to build Pd class- or lib executables from C or C++ sources # - defines rules for libdir installation # - defines convenience targets for developer and user # - evaluates implicit dependencies for non-clean builds # # #=== basic usage =============================================================== # # # In your Makefile, define your Pd lib name and class files, and include # Makefile.pdlibbuilder at the end of the Makefile. Like so: # # ________________________________________________________________________ # # # Makefile for mylib # # lib.name = mylib # # class.sources = myclass1.c myclass2.c # # datafiles = myclass1-help.pd myclass2-help.pd README.txt LICENSE.txt # # include Makefile.pdlibbuilder # ________________________________________________________________________ # # # For files in class.sources it is assumed that class basename == source file # basename. The default target builds all classes as individual executables # with Pd's default extension for the platform. For anything more than the # most basic usage, continue reading. # # #=== list of Makefile.pdlibbuilder API variables =============================== # # # Variables available for definition in your library Makefile: # # - lib.name # - lib.setup.sources # - class.sources # - common.sources # - shared.sources # - .class.sources # - .class.ldflags # - .class.ldlibs # - cflags # - ldflags # - ldlibs # - datafiles # - datadirs # - makefiles # - makefiledirs # - externalsdir # # Optional multiline defines evaluated per operating system: # # - forLinux # - forDarwin # - forWindows # # Variables available for your makefile or make command line: # # - make-lib-executable # - suppress-wunused # # Path variables for make command line or environment: # # - PDDIR # - PDINCLUDEDIR # - PDBINDIR # - PDLIBDIR # # Standard make variables for make command line or environment: # # - CPPFLAGS # - CFLAGS # - LDFLAGS # - CC # - CXX # - INSTALL # - STRIP # - DESTDIR # # Optional user variables for make command line or environment: # # - PLATFORM # - extension # - floatsize # # Deprecated path variables: # # - pdincludepath # - pdbinpath # - objectsdir # # #=== descriptions of Makefile.pdlibbuilder API variables ======================= # # # lib.name: # Name of the library directory as it will be installed / distributed. Also the # name of the lib executable in the case where all classes are linked into # a single binary. # # lib.setup.sources: # Source file(s) (C or C++) which must be compiled only when linking all classes # into a single lib binary. # # class.sources: # All sources files (C or C++) for which the condition holds that # class name == source file basename. # # .class.sources: # Source file(s) (C or C++) specific to class . Use this for # multiple-source classes or when class name != source file basename. # # common.sources: # Source file(s) which must be statically linked to each class in the library. # # shared.sources: # Source file(s) (C or C++) to build a shared dynamic link lib, to be linked # with all class executables. # # cflags, ldflags, ldlibs: # Define cflags (preprocessor&compiler), ldflags (linker) and ldlibs (dynamic # link libs) for the whole library. These flags are added to platform-specific # flags defined by Makefile.pdlibbuilder. # # .class.ldflags and .class.ldlibs: # Define ldflags resp. ldlibs specific to class . These flags are # added to platform-specific flags defined by Makefile.pdlibbuilder, and flags # defined in your Makefile for the whole library. Note: cflags can not be # defined per class in the current implementation. # # datafiles and datadirs: # All extra files you want to include in binary distributions of the # library: abstractions and help patches, example patches, meta patch, readme # and license texts, manuals, sound files, etcetera. Use 'datafiles' for all # files that should go into your lib rootdir and 'datadirs' for complete # directories you want to copy from source to distribution. # # forLinux, forDarwin, forWindows: # Shorthand for 'variable definitions for Linux only' etc. Use like: # define forLinux # cflags += -DLINUX # class.sources += linuxthing.c # endef # # makefiles and makefiledirs: # Extra makefiles or directories with makefiles that should be made in sub-make # processes. # # make-lib-executable: # When this variable is defined 'yes' in your makefile or as command argument, # Makefile.pdlibbuilder will try to build all classes into a single library # executable (but it will force exit if lib.setup.sources is undefined). # If your makefile defines 'make-lib-executable=yes' as the library default, # this can still be overridden with 'make-lib-executable=no' as command argument # to build individual class executables (the Makefile.pdlibbuilder default.) # # suppress-wunused: # When this variable is defined ('yes' or any other value), -Wunused-variable, # -Wunused-parameter, -Wunused-value and -Wunused-function are suppressed, # but the other warnings from -Wall are retained. # # PDDIR: # Root directory of 'portable' pd package. When defined, PDINCLUDEDIR and # PDBINDIR will be evaluated as $(PDDIR)/src and $(PDDIR)/bin. # # PDINCLUDEDIR: # Directory where Pd API m_pd.h should be found, and other Pd header files. # Overrides the default search path. # # PDBINDIR: # Directory where pd.dll should be found for linking (Windows only). Overrides # the default search path. # # PDLIBDIR: # Root directory for installation of Pd library directories. Overrides the # default install location. # # DESTDIR: # Prepended path component for staged install. # # PLATFORM: # Target platform for cross compilation in the form of GNU triplet: # cpu-vendor-os. Example: x86_64-w64-mingw32. This specifies the tool chain that # pdlibbuilder will use, if installed and locatable. System and architecture # will then be autodefined accordingly. In most cases no other variables need to # be overridden. # # extension: # Extension for the external to use. Example: m_amd64 # A sane default is picked, but it is useful if you want to provide # co-installable externals for multiple platforms (for the same operating # systems) # # floatsize: # the size of the t_float in bits. Example: 32 # t_float are usually single precision (32bit), which is the default. # For double precision use floatsize=64 # When building double precision externals, you will want to set the extension # as well, e.g. extension=windows-amd64-64.dll (--.) # # CPPFLAGS: # Preprocessor flags which are not strictly required for building. # # CFLAGS: # Compiler flags which are not strictly required for building. Compiler flags # defined by Makefile.pdlibbuilder for warning, optimization and architecture # specification are overriden by CFLAGS. # # LDFLAGS: # Linker flags which are not strictly required for building. Linker flags # defined by Makefile.pdlibbuilder for architecture specification are overriden # by LDFLAGS. # # CC and CXX: # C and C++ compiler programs as defined in your build environment. # # INSTALL # Definition of install program. # # STRIP # Name of strip program. Default 'strip' can be overridden in cross compilation # environments. # # objectsdir: # Root directory for installation of Pd library directories, like PDLIBDIR but # not overridable by environment. Supported for compatibility with pd-extended # central makefile, but deprecated otherwise. # # pdincludepath, pdbinpath: # As PDINCLUDEDIR and PDBINDIR but not overridable by environment. Deprecated # as user variables. # # #=== paths ===================================================================== # # # Source files in directories other than current working directory must be # prefixed with their relative path. Do not rely on VPATH or vpath. # Object (.o) files are built in the directory of their source files. # Executables are built in current working directory. # # Default search path for m_pd.h and other API header files is platform # dependent, and overridable by PDINCLUDEDIR: # # Linux: /usr/include/pd # # OSX: /Applications/Pd*.app/Contents/Resources/src # # Windows: %PROGRAMFILES%/Pd/src # %PROGRAMFILES(X86)%/Pd/src (32 bit builds on 64 bit Windows) # # Default search path for binary pd.dll (Windows), overridable by PDBINDIR # # %PROGRAMFILES%/Pd/bin # %PROGRAMFILES(X86)%/Pd/bin (32 bit builds on 64 bit Windows) # # Default location to install pd libraries is platform dependent, and # overridable by PDLIBDIR: # # Linux: /usr/local/lib/pd-externals # OSX: ~/Library/Pd # Windows: %APPDATA%/Pd # # https://puredata.info/docs/faq/how-do-i-install-externals-and-help-files # The rationale for not installing to ~/pd-externals by default on Linux # is that some people share the home dir between 32 and 64 bit installations. # # #=== targets =================================================================== # # # all: build $(executables) plus optional post target # post: target to build after $(executables) # alldebug: build all with -g option turned on for debug symbols # : force clean build of an individual class # .pre: make preprocessor output file in current working directory # .lst: make asm/source output file in current working directory # # install: install executables and data files # clean: remove build products from source tree # # help: print help text # vars: print makefile variables # allvars: print all variables # depend: print generated prerequisites # dumpmachine: print compiler output of option '-dumpmachine' # coffee: dummy target # # Variable $(executables) expands to class executables plus optional shared lib, # or alternatively to single lib executable when make-lib-executable=true. # Targets pre and post can be defined by library makefile. Make sure to include # Makefile.pdlibbuilder first so default target all will not be redefined. # # #=== Pd-extended libdir concept ================================================ # # # For libdir layout as conceived by Hans-Christoph Steiner, see: # # https://puredata.info/docs/developer/Libdir # # Files README.txt, LICENSE.txt and -meta.pd are part of the libdir # convention. Help patches for each class and abstraction are supposed to be # available. Makefile.pdlibbuilder does not force the presence of these files # however. It does not automatically include such files in libdir installations. # Data files you want to include in distributions must be defined explicitly in # your Makefile. # # #=== Makefile.pdlibbuilder syntax conventions ================================== # # # Makefile.pdlibbuilder variable names are lower case. Default make variables, # environment variables, and standard user variables (CC, CXX, CFLAGS, DESTDIR) # are upper case. Use target 'allvars' to print all variables and their values. # # 'Fields' in data variables are separated by dots, like in 'foo.class.sources'. # Words in variables expressing a function or command are separated by dashes, # like in 'make-lib-executable'. # # #=== useful make options ======================================================= # # # Use 'make -d ' to print debug details of the make process. # Use 'make -p ' to print make's database. # # #=== TODO ====================================================================== # # # - decide whether to use -static-libgcc or shared dll in MinGW # - cygwin support # - android support # - figure out how to handle '$' in filenames # - add makefile template targets dpkg-source dist libdir distclean tags? # # #=== end of documentation sections ============================================= # # ################################################################################ ################################################################################ ################################################################################ # GNU make version 3.81 (2006) or higher is required because of the following: # - function 'info' # - variable '.DEFAULT_GOAL' # force exit when make version is < 3.81 ifneq ($(firstword $(sort 3.81 $(MAKE_VERSION))), 3.81) $(error GNU make version 3.81 or higher is required) endif # Relative path to externals root dir in multi-lib source tree like # pd-extended SVN. Default is parent of current working directory. May be # defined differently in including makefile. externalsdir ?= .. # variable you can use to check if Makefile.pdlibbuilder is already included Makefile.pdlibbuilder = true ################################################################################ ### target platform detection ################################################## ################################################################################ #=== target platform =========================================================== # PLATFORM: optional user variable to define target platform for cross # compilation. Redefine build tools accordingly. PLATFORM should match # the exact target prefix of tools present in $PATH, like x86_64-w64-mingw32, # x86_64-apple-darwin12 etc. Tool definitions are exported to ensure submakes # will get the same. ifneq ($(PLATFORM),) ifneq ($(findstring darwin, $(PLATFORM)),) export CC = $(PLATFORM)-cc export CXX = $(PLATFORM)-c++ export CPP = $(PLATFORM)-cc else export CC = $(PLATFORM)-gcc export CXX = $(PLATFORM)-g++ export CPP = $(PLATFORM)-cpp endif STRIP = $(PLATFORM)-strip endif # Let (native or cross-) compiler report target triplet and isolate individual # words therein to facilitate later processing. target.triplet := $(subst -, ,$(shell $(CC) -dumpmachine)) #=== operating system ========================================================== # The following systems are defined: Linux, Darwin, Windows. GNU and # GNU/kFreeBSD are treated as Linux to get the same options. ifneq ($(filter linux gnu% kfreebsd, $(target.triplet)),) system = Linux endif ifneq ($(filter darwin%, $(target.triplet)),) system = Darwin endif ifneq ($(filter mingw% cygwin%, $(target.triplet)),) system = Windows endif # evaluate possible system-specific multiline defines from library makefile $(eval $(for$(system))) # TODO: Cygwin, Android #=== architecture ============================================================== # The following CPU names can be processed by pdlibbuilder: # i*86 Intel 32 bit # x86_64 Intel 64 bit # arm ARM 32 bit # aarch64 ARM 64 bit target.arch := $(firstword $(target.triplet)) ################################################################################ ### variables per platform ##################################################### ################################################################################ #=== flags per floatsize == ==================================================== floatsize = 32 ifneq ($(filter-out 32,$(floatsize)),) floatsize.flags = -DPD_FLOATSIZE=$(floatsize) else floatsize.flags = endif #=== flags per architecture ==================================================== # Set architecture-dependent cflags, mainly for Linux. For Mac and Windows, # arch.c.flags are overriden below. To see gcc's default architecture flags: # $ gcc -Q --help=target # ARMv6: Raspberry Pi 1st gen, not detectable from target.arch ifeq ($(shell uname -m), armv6l) arch.c.flags = -march=armv6 -mfpu=vfp -mfloat-abi=hard # ARMv7: Beagle, Udoo, RPi2 etc. else ifeq ($(target.arch), arm) arch.c.flags = -march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard # ARMv8 64 bit, not tested yet else ifeq ($(target.arch), aarch64) arch.c.flags = -mcpu=cortex-a53 # Intel 32 bit, build with SSE and SSE2 instructions else ifneq ($(filter i%86, $(target.arch)),) arch.c.flags = -march=pentium4 -mfpmath=sse -msse -msse2 # Intel/AMD 64 bit, build with SSE, SSE2 and SSE3 instructions else ifeq ($(target.arch), x86_64) arch.c.flags = -march=core2 -mfpmath=sse -msse -msse2 -msse3 # if none of the above architectures detected else arch.c.flags = endif #=== flags and paths for Linux ================================================= ifeq ($(system), Linux) prefix = /usr/local libdir := $(prefix)/lib pkglibdir = $(libdir)/pd-externals pdincludepath := $(wildcard /usr/include/pd) extension = pd_linux cpp.flags := -DUNIX c.flags := -fPIC c.ldflags := -rdynamic -shared -fPIC -Wl,-rpath,"\$$ORIGIN",--enable-new-dtags c.ldlibs := -lc -lm cxx.flags := -fPIC -fcheck-new cxx.ldflags := -rdynamic -shared -fPIC -Wl,-rpath,"\$$ORIGIN",--enable-new-dtags cxx.ldlibs := -lc -lm -lstdc++ shared.extension = so shared.ldflags = -rdynamic -fPIC -shared -Wl,-soname,$(shared.lib) endif #=== flags and paths for Darwin ================================================ # LLVM-clang doesn't support -fcheck-new, therefore this flag is only used when # compiling with g++. ifeq ($(system), Darwin) pkglibdir = $(HOME)/Library/Pd pdincludepath := $(firstword $(wildcard \ /Applications/Pd*.app/Contents/Resources/src)) extension = pd_darwin cpp.flags := -DUNIX -DMACOSX -I /sw/include c.flags := c.ldflags := -undefined suppress -flat_namespace -bundle c.ldlibs := -lc cxx.ldflags := -undefined suppress -flat_namespace -bundle cxx.ldlibs := -lc shared.extension = dylib shared.ldflags = -dynamiclib -undefined dynamic_lookup \ -install_name @loader_path/$(shared.lib) \ -compatibility_version 1 -current_version 1.0 ifneq ($(filter %g++, $(CXX)),) cxx.flags := -fcheck-new endif ifeq ($(extension), d_fat) arch := i386 x86_64 else arch := $(target.arch) endif ifneq ($(filter -mmacosx-version-min=%, $(cflags)),) version.flag := $(filter -mmacosx-version-min=%, $(cflags)) else version.flag = -mmacosx-version-min=10.6 endif arch.c.flags := $(addprefix -arch , $(arch)) $(version.flag) arch.ld.flags := $(arch.c.flags) endif #=== flags and paths for Windows =============================================== # Standard paths on Windows contain spaces, and GNU make functions treat such # paths as lists, with unintended effects. Therefore we must use shell function # ls instead of make's wildcard when probing for a path, and use double quotes # when specifying a path in a command argument. # Default paths in Mingw / Mingw-w64 environments. 'PROGRAMFILES' is standard # location for builds with native architecture, 'ProgramFiles(x86)' for i686 # builds on x86_64 Windows (detection method by Lucas Cordiviola). Curly braces # required because of parentheses in variable name. ifeq ($(system), Windows) pkglibdir := $(APPDATA)/Pd ifeq ($(target.arch), i686) programfiles := ${ProgramFiles(x86)} else programfiles := $(PROGRAMFILES) endif pdbinpath := $(programfiles)/Pd/bin pdincludepath := $(programfiles)/Pd/src endif # Store default path to pd.dll in PDBINDIR if the latter is not user-defined. # For include path this is done in the platform-independent paths section below, # but for PDBINDIR it is done here so ld flags can be evaluated as immediate # variables. ifeq ($(system), Windows) ifdef PDDIR PDBINDIR := $(PDDIR)/bin endif PDBINDIR ?= $(pdbinpath) endif # TODO: decide whether -mms-bitfields should be specified. ifeq ($(system), Windows) cpp.flags := -DMSW -DNT ifeq ($(target.arch), i686) arch.c.flags := -march=pentium4 -msse -msse2 -mfpmath=sse else ifeq ($(target.arch), x86_64) cpp.flags := -DMSW -DNT -DPD_LONGINTTYPE=__int64 arch.c.flags := -march=core2 -msse -msse2 -msse3 -mfpmath=sse else arch.c.flags = endif extension = dll c.flags := c.ldflags := -static-libgcc -shared \ -Wl,--enable-auto-import "$(PDBINDIR)/pd$(filter-out 32,$(floatsize)).dll" c.ldlibs := cxx.flags := -fcheck-new cxx.ldflags := -static-libgcc -static-libstdc++ -shared \ -Wl,--enable-auto-import "$(PDBINDIR)/pd$(filter-out 32,$(floatsize)).dll" cxx.ldlibs := shared.extension = dll shared.ldflags := -static-libgcc -shared "$(PDBINDIR)/pd$(filter-out 32,$(floatsize)).dll" stripflags = --strip-all endif #=== paths ===================================================================== # Platform-dependent default paths are specified above, but overridable. # Path variables in upper case can be defined as make command argument or in the # environment. Variable 'objectsdir' is supported for compatibility with # the build system that pd-l2ork has inherited from pd-extended. PDINCLUDEDIR ?= $(pdincludepath) PDLIBDIR ?= $(firstword $(objectsdir) $(pkglibdir)) ifdef PDDIR PDINCLUDEDIR := $(wildcard $(PDDIR)/src) endif # base path where all components of the lib will be installed by default installpath := $(DESTDIR)$(PDLIBDIR)/$(lib.name) # check if include path contains spaces (as is often the case on Windows) # if so, store the path so we can later do checks with it pdincludepathwithspaces := $(if $(word 2, $(PDINCLUDEDIR)), $(PDINCLUDEDIR)) #=== accumulated build flags =================================================== # From GNU make docs: 'Users expect to be able to specify CFLAGS freely # themselves.' So we use CFLAGS to define options which are not strictly # required for compilation: optimizations, architecture specifications, and # warnings. CFLAGS can be safely overriden using a make command argument. # Variables cflags, ldflags and ldlibs may be defined in including makefile. optimization.flags = -O3 -ffast-math -funroll-loops -fomit-frame-pointer warn.flags = -Wall -Wextra -Wshadow -Winline -Wstrict-aliasing # suppress -Wunused-variable & Co if you don't want to clutter a build log ifdef suppress-wunused warn.flags += $(addprefix -Wno-unused-, function parameter value variable) endif CFLAGS = $(warn.flags) $(optimization.flags) $(arch.c.flags) # preprocessor flags cpp.flags := -DPD -I "$(PDINCLUDEDIR)" $(floatsize.flags) $(cpp.flags) $(CPPFLAGS) # flags for dependency checking (cflags from makefile may define -I options) depcheck.flags := $(cpp.flags) $(cflags) # architecture specifications for linker are overridable by LDFLAGS LDFLAGS := $(arch.ld.flags) # now add the same ld flags to shared dynamic lib shared.ldflags += $(LDFLAGS) # accumulated flags for C compiler / linker c.flags := $(cpp.flags) $(c.flags) $(cflags) $(CFLAGS) c.ldflags := $(c.ldflags) $(ldflags) $(LDFLAGS) c.ldlibs := $(c.ldlibs) $(ldlibs) # accumulated flags for C++ compiler / linker cxx.flags := $(cpp.flags) $(cxx.flags) $(cflags) $(CFLAGS) cxx.ldflags := $(cxx.ldflags) $(ldflags) $(LDFLAGS) cxx.ldlibs := $(cxx.ldlibs) $(ldlibs) ################################################################################ ### variables: library name and version ######################################## ################################################################################ # strip possibles spaces from lib.name, they mess up calculated file names lib.name := $(strip $(lib.name)) # if meta file exists, check library version metafile := $(wildcard $(lib.name)-meta.pd) ifdef metafile lib.version := $(shell sed -n \ 's|^\#X text [0-9][0-9]* [0-9][0-9]* VERSION \(.*\);|\1|p' \ $(metafile)) endif ################################################################################ ### variables: files ########################################################### ################################################################################ object.extension = $(extension).o #=== sources =================================================================== # (re)define .class.sources using file names in class.sources define add-class-source $(notdir $(basename $v)).class.sources += $v endef $(foreach v, $(class.sources), $(eval $(add-class-source))) # derive class names from .class.sources variables sourcevariables := $(filter %.class.sources, $(.VARIABLES)) classes := $(basename $(basename $(sourcevariables))) # accumulate all source files specified in makefile classes.sources := $(sort $(foreach v, $(sourcevariables), $($v))) all.sources := $(classes.sources) $(lib.setup.sources) \ $(shared.sources) $(common.sources) #=== object files ============================================================== # construct object filenames from all C and C++ source file names classes.objects := $(addsuffix .$(object.extension), $(basename $(classes.sources))) common.objects := $(addsuffix .$(object.extension), $(basename $(common.sources))) shared.objects := $(addsuffix .$(object.extension), $(basename $(shared.sources))) lib.setup.objects := $(addsuffix .$(object.extension), $(basename $(lib.setup.sources))) all.objects = $(classes.objects) $(common.objects) $(shared.objects) \ $(lib.setup.objects) #=== executables =============================================================== # construct class executable names from class names classes.executables := $(addsuffix .$(extension), $(classes)) # Construct shared lib executable name if shared sources are defined. # If extension does not end with shared extension, use both to facilitate co- # installation for different platforms, like .m_i386.dll and .linux-amd64-32.so ifdef shared.sources ifneq ($(filter %.$(shared.extension), .$(extension)), ) # $(extension) already ends with $(shared.extension), no need to duplicate it shared.lib = lib$(lib.name).$(extension) else shared.lib = lib$(lib.name).$(extension).$(shared.extension) endif else shared.lib := endif ################################################################################ ### variables: tools ########################################################### ################################################################################ # aliases so we can later define 'compile-$1' and set 'c' or 'cxx' as argument compile-c := $(CC) compile-cxx := $(CXX) ################################################################################ ### checks ##################################################################### ################################################################################ # At this point most variables are defined. Now do some checks and info's # before rules begin. # print Makefile.pdlibbuilder version before possible termination $(info ++++ info: using Makefile.pdlibbuilder version $(version)) # Terminate if target triplet remained empty, to avoid all sorts of confusing # scenarios and spurious bugs. ifeq ($(target.triplet),) $(error Command "$(CC) -dumpmachine" did not return a target triplet, \ needed for a build. \ Is compiler "$(CC)" installed in your PATH? ($(PATH)). \ Does compiler "$(CC)" support option "-dumpmachine"?) endif # 'forward declaration' of default target, needed to do checks all: # To avoid unpredictable results, make sure the default target is not redefined # by including makefile. ifneq ($(.DEFAULT_GOAL), all) $(error Default target must be 'all'.) endif # find out which target(s) will be made ifdef MAKECMDGOALS goals := $(MAKECMDGOALS) else goals := all endif # store path to Pd API m_pd.h if it is found ifdef PDINCLUDEDIR mpdh := $(shell ls "$(PDINCLUDEDIR)/m_pd.h") endif # store path to pd.dll; if not found, ls will give a useful error ifeq ($(system), Windows) pddll := $(shell ls "$(PDBINDIR)/pd$(filter-out 32,$(floatsize)).dll") endif # when making target all, check if m_pd.h is found and print info about it ifeq ($(goals), all) $(if $(mpdh), \ $(info ++++ info: using Pd API $(mpdh)), \ $(warning Where is Pd API m_pd.h? Do 'make help' for info.)) endif # print target info $(info ++++ info: making target $(goals) $(if $(lib.name),in lib $(lib.name))) # when installing, print installpath info $(if $(filter install install-lib, $(goals)), $(info ++++ info: \ installpath is '$(installpath)')) #=== define executables ======================================================== # By default we build class executables, and optionally a shared dynamic link # lib. When make-lib-executable=yes we build all classes into a single lib # executable, on the condition that variable lib.setup.sources is defined. ifeq ($(make-lib-executable),yes) $(if $(lib.setup.sources), ,\ $(error Can not build library blob because lib.setup.sources is undefined)) executables := $(lib.name).$(extension) else executables := $(classes.executables) $(shared.lib) endif ################################################################################ ### rules: special targets ##################################################### ################################################################################ # Disable built-in rules. If some target can't be built with the specified # rules, it should not be built at all. MAKEFLAGS += --no-builtin-rules .PRECIOUS: .SUFFIXES: .PHONY: all post build-lib \ $(classes) $(makefiledirs) $(makefiles) \ install install-executables install-datafiles install-datadirs \ force clean vars allvars depend help ################################################################################ ### rules: build targets ####################################################### ################################################################################ # Target all forces the build of targets [$(executables) post] in # deterministic order. Target $(executables) builds class executables plus # optional shared lib or alternatively a single lib executable when # make-lib-executable=true. Target post is optionally defined by # library makefile. all: post post: $(executables) all: $(info ++++info: target all in lib $(lib.name) completed) # build all with -g option turned on for debug symbols alldebug: c.flags += -g alldebug: cxx.flags += -g alldebug: all #=== class executable ========================================================== # recipe for linking objects in class executable # argument $1 = compiler type (c or cxx) # argument $2 = class basename define link-class $(compile-$1) \ $($1.ldflags) $($2.class.ldflags) \ -o $2.$(extension) \ $(addsuffix .$(object.extension), $(basename $($2.class.sources))) \ $(addsuffix .$(object.extension), $(basename $(common.sources))) \ $($1.ldlibs) $($2.class.ldlibs) $(shared.lib) endef # general rule for linking object files in class executable %.$(extension): $(shared.lib) $(info ++++ info: linking objects in $@ for lib $(lib.name)) $(if $(filter %.cc %.cpp, $($*.class.sources)), \ $(call link-class,cxx,$*), \ $(call link-class,c,$*)) #=== library blob ============================================================== # build all classes into single executable build-lib: $(lib.name).$(extension) $(info ++++ info: library blob $(lib.name).$(extension) completed) # recipe for linking objects in lib executable # argument $1 = compiler type (c or cxx) define link-lib $(compile-$1) \ $($1.ldflags) $(lib.ldflags) \ -o $(lib.name).$(extension) $(all.objects) \ $($1.ldlibs) $(lib.ldlibs) endef # rule for linking objects in lib executable # declared conditionally to avoid name clashes ifeq ($(make-lib-executable),yes) $(lib.name).$(extension): $(all.objects) $(if $(filter %.cc %.cpp, $(all.sources)), \ $(call link-lib,cxx), \ $(call link-lib,c)) endif #=== shared dynamic lib ======================================================== # recipe for linking objects in shared executable # argument $1 = compiler type (c or cxx) define link-shared $(compile-$1) \ $(shared.ldflags) \ -o $(shared.lib) $(shared.objects) \ $($1.ldlibs) $(shared.ldlibs) endef # rule for linking objects in shared executable # build recipe is in macro 'link-shared' $(shared.lib): $(shared.objects) $(info ++++ info: linking objects in shared lib $@) $(if $(filter %.cc %.cpp, $(shared.sources)), \ $(call link-shared,cxx), \ $(call link-shared,c)) #=== object files ============================================================== # recipe to make .o file from source # argument $1 is compiler type (c or cxx) define make-object-file $(info ++++ info: making $@ in lib $(lib.name)) $(compile-$1) \ $($1.flags) \ -o $@ -c $< endef # Three rules to create .o files. These are double colon 'terminal' rules, # meaning they are the last in a rules chain. %.$(object.extension):: %.c $(call make-object-file,c) %.$(object.extension):: %.cc $(call make-object-file,cxx) %.$(object.extension):: %.cpp $(call make-object-file,cxx) #=== explicit prerequisites for class executables ============================== # For class executables, prerequisite rules are declared in run time. Target # 'depend' prints these rules for debugging purposes. # declare explicit prerequisites rule like 'class: class.extension' # argument $v is class basename define declare-class-target $v: $v.$(extension) endef # declare explicit prerequisites rule like 'class.extension: object1.o object2.o' # argument $v is class basename define declare-class-executable-target $v.$(extension): $(addsuffix .$(object.extension), $(basename $($v.class.sources))) \ $(addsuffix .$(object.extension), $(basename $(common.sources))) endef # evaluate explicit prerequisite rules for all classes $(foreach v, $(classes), $(eval $(declare-class-target))) $(foreach v, $(classes), $(eval $(declare-class-executable-target))) #=== implicit prerequisites for class executables ============================== # Evaluating implicit prerequisites (header files) with help from the # preprocessor is 'expensive' so this is done conditionally and selectively. # Note that it is also possible to trigger a build via install targets, in # which case implicit prerequisites are not checked. # When the Pd include path contains spaces it will mess up the implicit # prerequisites rules. disable-dependency-tracking := $(strip $(pdincludepathwithspaces)) ifndef disable-dependency-tracking must-build-everything := $(filter all, $(goals)) must-build-class := $(filter $(classes), $(goals)) must-build-sources := $(foreach v, $(must-build-class), $($v.class.sources)) endif # declare implicit prerequisites rule like 'object.o: header1.h header2.h ...' # argument $1 is input source file(s) # dir is explicitly added because option -MM strips it by default define declare-object-target $(dir $1)$(patsubst %.o:,%.$(object.extension):,$(filter %.o: %.h, $(shell $(CPP) $(depcheck.flags) -MM $1))) $(MAKEFILE_LIST) endef # evaluate implicit prerequisite rules when rebuilding everything ifdef must-build-everything $(if $(wildcard $(all.objects)), \ $(info ++++ info: evaluating implicit prerequisites in lib $(lib.name).....) \ $(foreach v, $(all.sources), $(eval $(call declare-object-target, $v)))) endif # evaluate implicit prerequisite rules when selectively building classes ifdef must-build-class $(foreach v, $(must-build-sources), \ $(eval $(call declare-object-target, $v))) $(foreach v, $(shared.sources), \ $(eval $(call declare-object-target, $v))) endif ################################################################################ ### rules: preprocessor and assembly files ##################################### ################################################################################ # Preprocessor and assembly output files for bug tracing etc. They are not part # of the build processes for executables. By default these files are created in # the current working directory. Dependency tracking is not performed, the build # is forced instead to make sure it's up to date. force: #=== preprocessor file ========================================================= # make preprocessor output file with extension .pre # argument $1 = compiler type (c or cxx) define make-preprocessor-file $(info ++++ info: making preprocessor output file $(notdir $*.pre) \ in current working directory) $(compile-$1) -E $< $(c.flags) $($1.flags) -o $(notdir $*.pre) endef %.pre:: %.c force $(call make-preprocessor-file,c) %.pre:: %.cc force $(call make-preprocessor-file,cxx) %.pre:: %.cpp force $(call make-preprocessor-file,cxx) #=== assembly file ============================================================= # make C / assembly interleaved output file with extension .lst # argument $1 = compiler type (c or cxx) define make-assembly-file $(info ++++ info: making assembly output file $(notdir $*.lst) \ in current working directory) $(compile-$1) \ -c -Wa,-a,-ad -fverbose-asm \ $($1.flags) \ $< > $(notdir $*.lst) endef %.lst:: %.c force $(call make-assembly-file,c) %.lst:: %.cc force $(call make-assembly-file,cxx) %.lst:: %.cpp force $(call make-assembly-file,cxx) ################################################################################ ### rules: installation targets ################################################ ################################################################################ #=== strip ===================================================================== # Stripping of installed binaries will only be done when variable 'stripflags' # is defined non-empty. No default definition is provided except for Windows # where the unstripped binaries are large, especially in the case of Mingw-w64. # Note: while stripping all symbols ('-s' or '--strip-all') is possible for # Linux and Windows, in the case of OSX only non-global symbols can be stripped # (option '-x' or '--discard-all'). # Make definition of strip command overridable so it can be defined in an # environment for cross-compilation. STRIP ?= strip # Commands in 'strip-executables' will be executed conditionally in the rule for # target 'install-executables'. strip-executables = cd "$(installpath)" && \ $(foreach v, $(executables), $(STRIP) $(stripflags) '$v';) #=== install =================================================================== # Install targets depend on successful exit status of target all because nothing # must be installed in case of a build error. # -p = preserve time stamps # -m = set permission mode (as in chmod) # -d = create all components of specified directories INSTALL = install INSTALL_PROGRAM := $(INSTALL) -p -m 644 INSTALL_DATA := $(INSTALL) -p -m 644 INSTALL_DIR := $(INSTALL) -m 755 -d # strip spaces from file names executables := $(strip $(executables)) datafiles := $(strip $(datafiles)) datadirs := $(strip $(datadirs)) # Do not make any install sub-target with empty variable definition because the # install program would exit with an error. install: $(if $(executables), install-executables) install: $(if $(datafiles), install-datafiles) install: $(if $(datadirs), install-datadirs) install-executables: all $(INSTALL_DIR) -v "$(installpath)" $(foreach v, $(executables), \ $(INSTALL_PROGRAM) '$v' "$(installpath)";) $(info ++++ info: executables of lib $(lib.name) installed \ from $(CURDIR) to $(installpath)) $(if $(stripflags), $(strip-executables),) install-datafiles: all $(INSTALL_DIR) -v "$(installpath)" $(foreach v, $(datafiles), \ $(INSTALL_DATA) '$(v)' "$(installpath)";) $(info ++++ info: data files of lib $(lib.name) installed \ from $(CURDIR) to $(installpath)) install-datadirs: all $(foreach v, $(datadirs), $(INSTALL_DIR) "$(installpath)/$v";) $(foreach v, $(datadirs), \ $(INSTALL_DATA) $(wildcard $v/*) "$(installpath)/$v";) $(info ++++ info: data directories of lib $(lib.name) installed \ from $(CURDIR) to $(installpath)) ################################################################################ ### rules: distribution targets ################################################ ################################################################################ # TODO # These targets are implemented in Makefile Template, but I have to figure out # how to do it under the not-so-strict conditions of Makefile.pdlibbuilder. # make source package dist: @echo "target dist not yet implemented" # make Debian source package dpkg-source: @echo "target dpkg-source not yet implemented" $(ORIGDIR): $(DISTDIR): ################################################################################ ### rules: clean targets ####################################################### ################################################################################ # delete build products from build tree clean: rm -f $(all.objects) rm -f $(classes.executables) $(lib.name).$(extension) $(shared.lib) rm -f *.pre *.lst # remove distribution directories and tarballs from build tree distclean: clean @echo "target distclean not yet implemented" ################################################################################ ### rules: submake targets ##################################################### ################################################################################ # Iterate over sub-makefiles or makefiles in other directories. # When 'continue-make=yes' is set, sub-makes will report 'true' to the parent # process regardless of their real exit status. This prevents the parent make # from being aborted by a sub-make error. Useful when you want to quickly find # out which sub-makes from a large set will succeed. ifeq ($(continue-make),yes) continue = || true endif # These targets will trigger sub-make processes for entries in 'makefiledirs' # and 'makefiles'. all alldebug install clean distclean dist dkpg-source: \ $(makefiledirs) $(makefiles) # this expands to identical rules for each entry in 'makefiledirs' $(makefiledirs): $(MAKE) --directory=$@ $(MAKECMDGOALS) $(continue) # this expands to identical rules for each entry in 'makefiles' $(makefiles): $(MAKE) --directory=$(dir $@) --makefile=$(notdir $@) $(MAKECMDGOALS) $(continue) ################################################################################ ### rules: convenience targets ################################################# ################################################################################ #=== show variables ============================================================ # Several 'function' macro's cause errors when expanded within a rule or without # proper arguments. Variables which are set with the define directive are only # shown by name for that reason. functions = \ add-class-source \ declare-class-target \ declare-class-executable-target \ declare-object-target \ link-class \ link-lib \ link-shared \ make-object-file \ make-preprocessor-file \ make-assembly-file # show variables from makefiles vars: $(info ++++ info: showing makefile variables:) $(foreach v,\ $(sort $(filter-out $(functions) functions, $(.VARIABLES))),\ $(if $(filter file, $(origin $v)),\ $(info variable $v = $($v)))) $(foreach v, $(functions), $(info 'function' name: $v)) @echo # show all variables allvars: $(info ++++ info: showing default, automatic and makefile variables:) $(foreach v, \ $(sort $(filter-out $(functions) functions, $(.VARIABLES))), \ $(info variable ($(origin $v)) $v = $($v))) $(foreach v, $(functions), $(info 'function' name: $v)) @echo #=== show dependencies ========================================================= # show generated prerequisites rules depend: $(info ++++ info: generated prerequisite rules) $(foreach v, $(classes), $(info $(declare-class-target))) $(foreach v, $(classes), $(info $(declare-class-executable-target))) $(foreach v, $(all.sources), $(info $(call declare-object-target, $v))) @echo #=== show help text ============================================================ # brief info about targets and paths ifdef mpdh mpdhinfo := $(mpdh) else mpdhinfo := m_pd.h was not found. Is Pd installed? endif help: @echo @echo " Main targets:" @echo " all: build executables (default target)" @echo " install: install all components of the library" @echo " vars: print makefile variables for troubleshooting" @echo " allvars: print all variables for troubleshooting" @echo " help: print this help text" @echo @echo " Pd API m_pd.h:" @echo " $(mpdhinfo)" @echo " You may specify your preferred Pd include directory as argument" @echo " to the make command, like 'PDINCLUDEDIR=path/to/pd/src'." @echo @echo " Path for installation of your libdir(s):" @echo " $(PDLIBDIR)" @echo " Alternatively you may specify your path for installation as argument" @echo " to the make command, like 'PDLIBDIR=path/to/pd-externals'." @echo @echo " Default paths are listed in the doc sections in Makefile.pdlibbuilder." @echo #=== platform test ============================================================= # This target can be used to test if the compiler for specified PLATFORM is # correctly defined and available. dumpmachine: @$(CC) -dumpmachine #=== dummy target ============================================================== coffee: @echo "Makefile.pdlibbuilder: Can not make coffee. Sorry." ################################################################################ ### end of rules sections ###################################################### ################################################################################ # for syntax highlighting in vim and github # vim: set filetype=make: pd-externals-pddp-1840f26/pd-lib-builder/README.md000066400000000000000000000131461523162452500214050ustar00rootroot00000000000000 ### Makefile.pdlibbuilder ### Helper makefile for Pure Data external libraries. Written by Katja Vetter March-June 2015 for the public domain and since then developed as a Pd community project. No warranties. Inspired by Hans Christoph Steiner's Makefile Template and Stephan Beal's ShakeNMake. GNU make version >= 3.81 required. ### characteristics ### * defines build settings based on autodetected target platform * defines rules to build Pd class- or lib executables from C or C++ sources * defines rules for libdir installation * defines convenience targets for developer and user * evaluates implicit dependencies for non-clean builds ### basic usage ### In your Makefile, define your Pd lib name and class files, and include Makefile.pdlibbuilder at the end of the Makefile. Like so: # Makefile for mylib lib.name = mylib class.sources = myclass1.c myclass2.c datafiles = myclass1-help.pd myclass2-help.pd README.txt LICENSE.txt PDLIBBUILDER_DIR=. include $(PDLIBBUILDER_DIR)/Makefile.pdlibbuilder For files in class.sources it is assumed that class name == source file basename. The default target builds all classes as individual executables with Pd's default extension for the platform. For anything more than the most basic usage, read the documentation sections in Makefile.pdlibbuilder. ### paths ### Makefile.pdlibbuilder >= v0.4.0 supports pd path variables which can be defined not only as make command argument but also in the environment, to override platform-dependent defaults: PDDIR: Root directory of 'portable' pd package. When defined, PDINCLUDEDIR and PDBINDIR will be evaluated as $(PDDIR)/src and $(PDDIR)/bin. PDINCLUDEDIR: Directory where Pd API m_pd.h should be found, and other Pd header files. Overrides the default search path. PDBINDIR: Directory where pd.dll should be found for linking (Windows only). Overrides the default search path. PDLIBDIR: Root directory for installation of Pd library directories. Overrides the default install location. ### platform detection and predefined variables ### Makefile.pdlibbuilder tries to detect architecture and operating system in order to define platform-specific variables. Since v0.6.0 we let the compiler report target platform, rather than taking the build machine as reference. This simplifies cross compilation. The kind of build options that are predefined: - optimizations useful for realtime DSP processing - options strictly required for the platform - options to make the build work accross a range of CPU's and OS versions The exact choice and definition predefined variables changes over time, as new platforms arrive and older platforms become obsolete. The easiest way to get an overview for your platform is by checking the flags categories in the output of target `vars`. Variables written in capitals (like `CFLAGS`) are intentionally exposed as user variables, although technically all makefile variables can be overridden by make command arguments. ### specific language versions ### Makefile.pdlibbuilder handles C and C++, but can not detect if your code uses features of a specific version (like C99, C++11, C++14 etc.). In such cases your makefile should specify that version as compiler option: cflags = -std=c++11 Also you may need to be explicit about minimum OSX version. For example, C++11 needs OSX 10.9 or higher: define forDarwin cflags = -mmacosx-version-min=10.9 endef ### documentation ### This README.md provides only basic information. A large comment section inside Makefile.pdlibbuilder lists and explains the available user variables, default paths, and targets. The internal documentation reflects the exact functionality of the particular version. For suggestions about project maintenance and advanced compilation see tips-tricks.md. ### versioning ### The project is versioned in MAJOR.MINOR.BUGFIX format (see http://semver.org), and maintained at https://github.com/pure-data/pd-lib-builder. Pd lib developers are invited to regulary check for updates, and to contribute and discuss improvements here. If you really need to distribute a personalized version with your library, rename Makefile.pdlibbuilder to avoid confusion. ### examples ### The list of projects using pd-lib-builder can be helpful if you are looking for examples, from the simplest use case to more complex implementations. - helloworld: traditional illustration of simplest use case - pd-windowing: straightforward real world use case of a small library - pd-nilwind / pd-cyclone: more elaborate source tree - zexy: migrated from autotools to pd-lib-builder ### projects using pd-lib-builder ### non-exhaustive list https://github.com/pure-data/helloworld https://github.com/electrickery/pd-nilwind https://github.com/electrickery/pd-maxlib https://github.com/electrickery/pd-sigpack https://github.com/electrickery/pd-tof https://github.com/electrickery/pd-windowing https://github.com/electrickery/pd-smlib https://github.com/porres/pd-cyclone https://github.com/porres/pd-else https://github.com/porres/pd-psycho https://git.iem.at/pd/comport https://git.iem.at/pd/hexloader https://git.iem.at/pd/iemgui https://git.iem.at/pd/iemguts https://git.iem.at/pd/iemlib https://git.iem.at/pd/iemnet https://git.iem.at/pd/iem_ambi https://git.iem.at/pd/iem_tab https://git.iem.at/pd/iem_adaptfilt https://git.iem.at/pd/iem_roomsim https://git.iem.at/pd/iem_spec2 https://git.iem.at/pd/mediasettings https://git.iem.at/pd/zexy https://git.iem.at/pd-gui/punish https://github.com/residuum/PuRestJson https://github.com/libpd/abl_link https://github.com/wbrent/timbreID https://github.com/MetaluNet/moonlib pd-externals-pddp-1840f26/pd-lib-builder/tips-tricks.md000066400000000000000000000210121523162452500227130ustar00rootroot00000000000000pd-lib-builder cheatsheet ========================= # Creating special builds ## Building for non-native platform Using pd-lib-builder >=0.6.0 we can define variable `PLATFORM` to specify a target triplet for cross-compilation. Assuming a W32 package for Pd is unzipped into path `${PDWIN32}`, to build for Windows 32 bit: make PLATFORM=i686-w64-mingw32 PDDIR="${PDWIN32}" #### Older pd-lib-builder versions Using pd-lib-builder < 0.6.0, in the absence of variable `PLATFORM`, you would instead override variables `system`, `target.arch`, `CC` and / or `CXX`, `STRIP`. Example: make system=Windows target.arch=i686 CC=i686-w64-mingw32-gcc STRIP=i686-w64-mingw32-strip PDDIR="${PDWIN32}" #### Toolchains To build for non-native OS and/or architecture you need a cross toolchain. On Linux such toolchains are relatively easy to get. For example Debian Buster amd64 provides them for the following platforms (install g++ with dependencies for a given platform to get the whole toolchain): - `arm-linux-gnueabihf` - `aarch64-linux-gnu` - `i686-linux-gnu` - `i686-w64-mingw32` and `x86_64-w64-mingw32` (install `mingw-w64`) Cross toolchains for OSX/MacOS are not generally distributed. Project `osxcross` from Thomas Poechtraeger can create them for Linux. ## Universal binaries on macOS The compiler, by default, builds for the native architecture of the build machine. To make a "universal" multi-arch build, specify the desired archtectures on the command line using the "arch" pd-lib-builder Makefile variable. For example, to build a "fat" external for both 64-bit Intel and Arm (Apple Silicon): make arch="x86_64 arm64" If the build is successful, the compiled architectures in the built external can be confirmed via the `file` command: ~~~sh % file vbap.pd_darwin vbap.pd_darwin: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit bundle x86_64] [arm64:Mach-O 64-bit bundle arm64] vbap.pd_darwin (for architecture x86_64): Mach-O 64-bit bundle x86_64 vbap.pd_darwin (for architecture arm64): Mach-O 64-bit bundle arm64 ~~~ Note: The available architectures depend on which macOS version & command line tools/Xcode combination the build system has. For example, any newer macOS 10.15+ will support both x86_64 (Intel 64-bit) and arm64 (Apple Silicon) while OSX 10.6 - macOS 10.14 can build for x86_64 and i386 (Intel 32-bit). ## Building double-precision externals At the time of writing (2023-07-06) there is no official Pd that supports double-precision numbers yet. However, if you do get hold of an experimental double-precision Pd, you can easily build your externals for 64-bit numbers, by passing `floatsize=64` as an argument to `make`. Starting with Pd>=0.54, double precision externals use different extensions from traditional (single-precision) externals. The extension consists of the OS ("linux", "darwin", "windows"), the CPU architecture ("amd64" (x86_64), "i386" (x86), "arm64",...) and the floatsize in bits ("64" for double-precision), followed by the system's native extension for dynamic libraries (".dll" on Windows, ".so" on macOS/Linux/un*xes). As of pd-lib-builder==0.7.0, you have to manually pass this extension: make floatsize=64 extension=windows-amd64-64.dll make floatsize=64 extension=linux-arm64-64.so make floatsize=64 extension=darwin-fat-64.so arch="x86_64 arm64" # Project management In general it is advised to put the `Makefile.pdlibbuilder` into a separate subdirectory (e.g. `pd-lib-builder/`). This makes it much easier to update the `Makefile.pdlibbuilder` later You *should* also use a variable to the actual path of the Makefile.pdlibbuilder (even if you keep it in the root-directory), as this allows easy experimenting with newer (or older) (or site-specific) versions of the pd-lib-builder Makefile. ~~~make PDLIBBUILDER_DIR=pd-lib-builder/ include $(PDLIBBUILDER_DIR)/Makefile.pdlibbuilder ~~~ ## Keeping pd-lib-builder up-to-date ### `git subtree` With git-subtrees, you make the pd-lib-builder repository (or any other repository for that matter) part of your own repository - with full history and everything - put nicely into a distinct subdirectory. Support for *manipulating* subtrees has been added with Git-v1.7.11 (May 2012). The nice thing however is, that from "outside" the subtree is part of your repository like any other directory. E.g. older versions of Git can clone your repository with the full subtree (and all it's history) just fine. You can also use git-archive to make a complete snapshot of your repository (including the subtree) - nice, if you e.g. want self-contained downloads of your project from git hosting platforms (like Github, Gitlab, Bitbucket,...) In short, `git subtree` is the better `git submodule`. So here's how to do it: #### Initial setup/check-out This will create a `pd-lib-builder/` directory containing the full history of the pd-lib-builder repository up to its release `v0.5.0` ~~~sh git subtree add --prefix=pd-lib-builder/ https://github.com/pure-data/pd-lib-builder v0.5.0 ~~~ This will automatically merge the `pd-lib-builder/` history into your current branch, so everything is ready to go. #### Cloning your repository with the subtree Nothing special, really. Just clone your repository as always: ~~~sh git clone https://git.example.org/pd/superbonk~.git ~~~ #### Updating the subtree Time passes and sooner or later you will find, that there is a shiny new pd-lib-builder with plenty of bugfixes and new features. To update your local copy to pd-lib-builder's current `master`, simply run: ~~~sh git subtree pull --prefix pd-lib-builder/ https://github.com/pure-data/pd-lib-builder master ~~~ #### Pulling the updated subtree into existing clones Again, nothing special. Just pull as always: ~~~sh git pull ~~~ #### Further reading More on the power of `git subtree` can be found online - https://medium.com/@v/git-subtrees-a-tutorial-6ff568381844 - https://www.atlassian.com/blog/git/alternatives-to-git-submodule-git-subtree - ... ### ~~`git submodule`~~ [DISCOURAGED] #### Initial setup/check-out To add a new submodule to your repository, just run `git submodule add` and commit the changes: ~~~sh git submodule add https://github.com/pure-data/pd-lib-builder git commit .gitmodules pd-lib-builder/ -m "Added pd-lib-builder as git-submodule" ~~~ #### Cloning your repository with the submodule When doing a fresh clone of your repository, pass the `--recursive` option to automatically fetch all submodules: ~~~sh git clone --recursive https://git.example.org/pd/superbonk~.git ~~~ If you've cloned non-recursively, you can initialize and update the submodules manually: ~~~sh git submodule init git submodule update ~~~ #### Updating the submodule Submodules are usually fixed to a given commit in their repository. To update the `pd-lib-builder` submodule to the current `master` do something like: ~~~sh cd pd-lib-builder git checkout master git pull cd .. git status pd-lib-builder git commit pd-lib-builder -m "Updated pd-lib-builder to current master" ~~~ #### Pulling the updated submodule into existing clones After you have pushed the submodule updates in your repository, other clones of the repository can be updated as follows: ~~~sh git pull ~~~ The above will make your repository aware, that the submodule is out-of-sync. ~~~sh $ LANG=C git status pd-lib-builder On branch master Your branch is up to date with 'origin/master'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) modified: pd-lib-builder (new commits) $ ~~~ In order to sync the submodule to the correct commit, run the following: ~~~sh git submodule update ~~~ #### Drawbacks `git submodule` has a number of drawbacks: - it requires special commands to synchronize the submodules, in addition to synching your repository. - you must make sure to use an URL for the submodule that is accessible to your potential users. e.g. using `git@github.com:pure-data/pd-lib-builder` is bad, because it requires everybody who wants to checkout your sources to have a github-account - even if they could checkout *your* repository anonymously. - submodules will be excluded from `git archive`. This means, that if you use a mainstream git provider (like Github, GitLab, Bitbucket,...) and make releases by creating a `git tag`, the automatically generated zipfiles with the sources will lack the submodule - and your users will not be able to compile your source code. In general, I would suggest to **avoid** `git submodule`, and instead use the better `git subtree` (above). pd-externals-pddp-1840f26/pddp-meta.pd000066400000000000000000000004731523162452500175320ustar00rootroot00000000000000#N canvas 10 10 200 200 10; #N canvas 20 20 420 300 META 0; #X text 10 10 META this is a prototype of a libdir meta file; #X text 10 30 NAME pddp; #X text 10 50 LICENSE GNU GPL; #X text 10 70 DESCRIPTION support objects for the Pure Data Documentation Project; #X text 10 100 VERSION 0.3; #X restore 10 10 pd META; pd-externals-pddp-1840f26/pddplink-help.pd000066400000000000000000000030341523162452500204060ustar00rootroot00000000000000#N canvas 319 94 672 397 12; #X text 20 10 first entry; #X text 50 50 three ways of linking to a; #X text 50 170 three ways of linking to a; #X obj 50 195 pddplink http://puredata.info; #X obj 50 239 pddplink http://puredata.info -box; #X text 50 290 three ways of linking to; #X obj 260 290 pddplink dsp-help.pd -text another local patch; #X obj 50 315 pddplink dsp-help.pd; #X obj 52 359 pddplink dsp-help.pd -box; #X obj 270 170 pddplink http://puredata.info -text remote URL; #X obj 270 50 pddplink README.txt -text local file; #X obj 50 75 pddplink README.txt; #X obj 50 120 pddplink README.txt -box; #X obj 52 339 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X text 73 336 <-- bang to open the link; #X obj 50 219 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X text 71 216 <-- bang to open the link; #X obj 50 99 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000; #X text 71 96 <-- bang to open the link; #X text 376 49 [pddplink README.txt -text local file]; #X text 376 69 [pddplink README.txt]; #X text 376 119 [pddplink README.txt -box]; #N canvas 775 356 494 344 META 0; #X text 12 25 LICENSE GPL v2; #X text 12 5 KEYWORDS control; #X text 12 85 AUTHOR Hans-Christoph Steiner \;; #X text 12 105 HELP_PATCH_AUTHORS "pd meta" information added by IOhannes m zmölnig for pddp-v0.3; #X text 12 45 DESCRIPTION clickable links to files/URIs in patches; #X text 13 146 INLET_0 bang; #X restore 590 362 pd META; #X connect 13 0 8 0; #X connect 15 0 4 0; #X connect 17 0 12 0; pd-externals-pddp-1840f26/pddplink.c000066400000000000000000000232541523162452500173050ustar00rootroot00000000000000/* Copyright (c) 2005 krzYszcz and others. * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ /* This is a prototype of an active comment. It might be replaced with a new core object type, T_LINK (te_type bitfield would have to be extended then). */ #include "pddplink.h" #include #include #include "s_stuff.h" static t_class *pddplink_class; static t_class *pddplinkbox_class; /* Code that might be merged back to g_text.c starts here: */ static void pddplink_getrect(t_gobj *z, t_glist *glist, int *xp1, int *yp1, int *xp2, int *yp2) { t_pddplink *x = (t_pddplink *)z; int width, height; float x1, y1, x2, y2; if (glist->gl_editor && glist->gl_editor->e_rtext) { if (x->x_rtextactive) { t_rtext *y = _glist_getrtext(glist, (t_text *)x); _getrect_dimen(y, &width, &height); height -= 2; } else { int font = glist_getfont(glist); width = x->x_vislength * sys_fontwidth(font) + 2; height = sys_fontheight(font) + 2; } } else width = height = 10; x1 = text_xpix((t_text *)x, glist); y1 = text_ypix((t_text *)x, glist); x2 = x1 + width; y2 = y1 + height; y1 += 1; *xp1 = x1; *yp1 = y1; *xp2 = x2; *yp2 = y2; } static void pddplink_displace(t_gobj *z, t_glist *glist, int dx, int dy) { t_text *t = (t_text *)z; t->te_xpix += dx; t->te_ypix += dy; if (glist_isvisible(glist)) { t_rtext *y = _glist_getrtext(glist, t); rtext_displace(y, dx, dy); } } static void pddplink_select(t_gobj *z, t_glist *glist, int state) { t_pddplink *x = (t_pddplink *)z; t_rtext *y = _glist_getrtext(glist, (t_text *)x); rtext_select(y, state); if (state) pdgui_vmess(0, "crs rk", glist, "itemconfigure", rtext_gettag(y) , "-fill", 0x0000FF ); else pdgui_vmess(0, "crs rs rk rk", glist, "itemconfigure", rtext_gettag(y) , "-text", x->x_vistext , "-fill", 0x0000DD , "-activefill", 0xE70000 ); } static void pddplink_activate(t_gobj *z, t_glist *glist, int state) { t_pddplink *x = (t_pddplink *)z; t_rtext *y = _glist_getrtext(glist, (t_text *)x); rtext_activate(y, state); x->x_rtextactive = state; } static void pddplink_vis(t_gobj *z, t_glist *glist, int vis) { t_pddplink *x = (t_pddplink *)z; t_rtext *y = _glist_getrtext(glist, (t_text *)x); if (vis) { rtext_draw(y); pdgui_vmess(0, "crs rs rk rk", glist_getcanvas(glist), "itemconfigure", rtext_gettag(y) , "-text", x->x_vistext , "-fill", 0x0000DD , "-activefill", 0xE70000 ); } else rtext_erase(y); } static int pddplink_wbclick(t_gobj *z, t_glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit); static t_widgetbehavior pddplink_widgetbehavior = { pddplink_getrect, pddplink_displace, pddplink_select, pddplink_activate, 0, pddplink_vis, pddplink_wbclick, }; /* Code that might be merged back to g_text.c ends here. */ /* FIXME need access to glob_pdobject... */ static t_pd *pddplink_pdtarget(t_pddplink *x) { t_pd *pdtarget = gensym("pd")->s_thing; if (pdtarget && !strcmp(class_getname(*pdtarget), "pd")) return (pdtarget); else return ((t_pd *)x); /* internal error */ } static void pddplink_anything(t_pddplink *x, t_symbol *s, int ac, t_atom *av) { if (x->x_ishit) { startpost("pddplink: internal error (%s", (s ? s->s_name : "")); postatom(ac, av); post(")"); } } static void pddplink_click(t_pddplink *x, t_floatarg xpos, t_floatarg ypos, t_floatarg shift, t_floatarg ctrl, t_floatarg alt) { (void)xpos;(void)ypos;(void)shift;(void)ctrl;(void)alt; x->x_ishit = 1; pdgui_vmess("pddplink_open", "oss" , x , x->x_ulink->s_name , x->x_dirsym->s_name ); x->x_ishit = 0; } static void pddplink_bang(t_pddplink *x) { pddplink_click(x, 0, 0, 0, 0, 0); } static int pddplink_wbclick(t_gobj *z, t_glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit) { (void)glist;(void)dbl; t_pddplink *x = (t_pddplink *)z; if (doit) { pddplink_click(x, (t_floatarg)xpix, (t_floatarg)ypix, (t_floatarg)shift, 0, (t_floatarg)alt); return (1); } else return (0); } static int pddplink_isoption(const char *name) { if (*name == '-') { char c = name[1]; return ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')); } else return (0); } static t_symbol *pddplink_nextsymbol(int ac, t_atom *av, int opt, int *skipp) { int ndx; for (ndx = 0; ndx < ac; ndx++, av++) { if (av->a_type == A_SYMBOL && (!opt || pddplink_isoption(av->a_w.w_symbol->s_name))) { *skipp = ++ndx; return (av->a_w.w_symbol); } } return (0); } static int pddplink_dooptext(char *dst, int maxsize, int ac, t_atom *av) { int i, sz, sep, len; char buf[32]; const char *src; for (i = 0, sz = 0, sep = 0; i < ac; i++, av++) { if (sep) { sz++; if (sz >= maxsize) break; else if (dst) { *dst++ = ' '; *dst = 0; } } else sep = 1; if (av->a_type == A_SYMBOL) src = av->a_w.w_symbol->s_name; else if (av->a_type == A_FLOAT) { src = buf; sprintf(buf, "%g", av->a_w.w_float); } else { sep = 0; continue; } len = strlen(src); sz += len; if (sz >= maxsize) break; else if (dst) { strcpy(dst, src); dst += len; } } return (sz); } static char *pddplink_optext(int *sizep, int ac, t_atom *av) { char *result; int sz = pddplink_dooptext(0, MAXPDSTRING, ac, av); *sizep = sz + (sz >= MAXPDSTRING ? 4 : 1); result = getbytes(*sizep); pddplink_dooptext(result, sz + 1, ac, av); if (sz >= MAXPDSTRING) { sz = strlen(result); strcpy(result + sz, "..."); } return (result); } static void pddplink_free(t_pddplink *x) { if (x->x_vistext) freebytes(x->x_vistext, x->x_vissize); } static void *pddplink_new(t_symbol *s, int ac, t_atom *av) { (void)s; t_pddplink xgen, *x; int skip; xgen.x_isboxed = 0; xgen.x_vistext = 0; xgen.x_vissize = 0; if ((xgen.x_ulink = pddplink_nextsymbol(ac, av, 0, &skip))) { t_symbol *opt; ac -= skip; av += skip; while ((opt = pddplink_nextsymbol(ac, av, 1, &skip))) { ac -= skip; av += skip; if (opt == gensym("-box")) xgen.x_isboxed = 1; else if (opt == gensym("-text")) { t_symbol *nextsym = pddplink_nextsymbol(ac, av, 1, &skip); int natoms = (nextsym ? skip - 1 : ac); if (natoms) xgen.x_vistext = pddplink_optext(&xgen.x_vissize, natoms, av); } } } x = (t_pddplink *) pd_new(xgen.x_isboxed ? pddplinkbox_class : pddplink_class); x->x_glist = canvas_getcurrent(); x->x_dirsym = canvas_getdir(x->x_glist); /* FIXME */ x->x_isboxed = xgen.x_isboxed; x->x_vistext = xgen.x_vistext; x->x_vissize = xgen.x_vissize; x->x_vislength = (x->x_vistext ? strlen(x->x_vistext) : 0); x->x_rtextactive = 0; if (xgen.x_ulink) x->x_ulink = xgen.x_ulink; else x->x_ulink = gensym("Untitled"); SETSYMBOL(&x->x_openargs[0], x->x_ulink); SETSYMBOL(&x->x_openargs[1], x->x_dirsym); x->x_ishit = 0; if (x->x_isboxed) outlet_new((t_object *)x, &s_anything); else { /* do we need to set ((t_text *)x)->te_type = T_TEXT; ? */ if (!x->x_vistext) { x->x_vislength = strlen(x->x_ulink->s_name); x->x_vissize = x->x_vislength + 1; x->x_vistext = getbytes(x->x_vissize); strcpy(x->x_vistext, x->x_ulink->s_name); } } return (x); } void pddplink_setup(void) { if(!pddplink_compatfuns()) return; pddplink_class = class_new(gensym("pddplink"), (t_newmethod)pddplink_new, (t_method)pddplink_free, sizeof(t_pddplink), CLASS_NOINLET | CLASS_PATCHABLE, A_GIMME, 0); class_addanything(pddplink_class, pddplink_anything); class_setwidget(pddplink_class, &pddplink_widgetbehavior); pddplinkbox_class = class_new(gensym("pddplink"), 0, (t_method)pddplink_free, sizeof(t_pddplink), 0, A_GIMME, 0); class_addbang(pddplinkbox_class, pddplink_bang); class_addanything(pddplinkbox_class, pddplink_anything); class_addmethod(pddplinkbox_class, (t_method)pddplink_click, gensym("click"), A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0); char tclsourcefile[MAXPDSTRING]; pd_snprintf(tclsourcefile, MAXPDSTRING, "%s/pddplink.tcl", class_gethelpdir(pddplink_class)); tclsourcefile[MAXPDSTRING-1] = 0; pdgui_vmess("source", "s", tclsourcefile); } pd-externals-pddp-1840f26/pddplink.h000066400000000000000000000051661523162452500173140ustar00rootroot00000000000000/* Copyright (c) 2005 krzYszcz and others. * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ #ifndef _pddplink_h #define _pddplink_h #include "m_pd.h" #include "g_canvas.h" typedef t_rtext *(*t_glist_rtext_fn)(t_glist *, t_text *); typedef void (*t_rtext_getrect_fn)(t_rtext *x, int *x1p, int *y1p, int *x2p, int *y2p); typedef int (*t_rtext_dimen_fn)(t_rtext *x); typedef void (*t_getrect_dimen_fn)(t_rtext *x, int *w, int *h); static t_glist_rtext_fn _glist_getrtext = 0; static t_rtext_dimen_fn _rtext_width = 0, _rtext_height = 0; static t_rtext_getrect_fn _rtext_getrect = 0; static t_getrect_dimen_fn _getrect_dimen = 0; #define PDDP_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + ((c) > 255 ? 255 : (c))) static void _getrect_dummy (t_rtext *y, int *width, int *height) { (void)y; *width = 100; *height = 25; } static void _getrect_legacy (t_rtext *y, int *width, int *height) { *width = _rtext_width(y); *height = _rtext_height(y); } static void _getrect_056 (t_rtext *y, int *width, int *height) { int x1, y1, x2, y2; _rtext_getrect(y, &x1, &y1, &x2, &y2); *width = x2 - x1; *height = y2 - y1; } static int pddplink_compatfuns(void) { #if (PDDP_VERSION(PD_MAJOR_VERSION, PD_MINOR_VERSION, PD_BUGFIX_VERSION) >= PDDP_VERSION(0, 55, 0)) /* sys_getfunbyname() requires Pd>=0.55 */ _glist_getrtext = (t_glist_rtext_fn)sys_getfunbyname("glist_getrtext"); if (!_glist_getrtext) _glist_getrtext = (t_glist_rtext_fn)sys_getfunbyname("glist_findrtext"); _rtext_width = (t_rtext_dimen_fn)sys_getfunbyname("rtext_width"); _rtext_height = (t_rtext_dimen_fn)sys_getfunbyname("rtext_height"); _rtext_getrect = (t_rtext_getrect_fn)sys_getfunbyname("rtext_getrect"); #endif if (!_glist_getrtext) { pd_error(0, "Unable to find 'glist_getrtext'/'glist_findrtext' in this Pd runtime"); return 0; } if(_rtext_getrect) _getrect_dimen = _getrect_056; else if (_rtext_width && _rtext_height) _getrect_dimen = _getrect_legacy; else _getrect_dimen = _getrect_dummy; return 1; } typedef struct _pddplink { t_object x_ob; t_glist *x_glist; union { int x_isboxed; /* number of items per channel */ int x_isgopvisible; /* for source compatibility: pre-0.54 name */ }; char *x_vistext; int x_vissize; int x_vislength; int x_rtextactive; t_symbol *x_dirsym; t_symbol *x_ulink; t_atom x_openargs[2]; int x_linktype; int x_ishit; } t_pddplink; #endif /* _pddplink_h */ pd-externals-pddp-1840f26/pddplink.tcl000066400000000000000000000012121523162452500176330ustar00rootroot00000000000000 proc pddplink_open {obj filename dir} { if {[string first "://" $filename] > -1} { menu_openfile $filename } elseif {[file pathtype $filename] eq "absolute"} { menu_openfile $filename } elseif {[file exists [file join $dir $filename]]} { set fullpath [file normalize [file join $dir $filename]] set dir [file dirname $fullpath] set filename [file tail $fullpath] menu_doc_open $dir $filename } else { bell ;# beep on error to provide instant feedback set err [_ "\[pddplink\] ERROR file not found: %s" $filename] ::pdwindow::logpost ${obj} 1 "${err}\n" } } pd-externals-pddp-1840f26/print-help.pd000066400000000000000000000017121523162452500177360ustar00rootroot00000000000000#N canvas 716 408 466 316 10; #X obj 151 182 pddp/print; #X text 17 48 this object is for displaying generic messages in the patch rather than in the Pd window.; #X msg 24 104 word; #X msg 94 104 symbol asdf; #X msg 197 104 list 1 2 3; #X msg 274 104 selector series of 4; #X msg 246 148 bang; #X text 280 147 flashes and resets to blank; #X text 38 245 because of Pd's type handling \, it strips off data selectors "float" \, "symbol" and "list".; #N canvas 775 356 494 344 META 0; #X text 12 25 LICENSE GPL v2; #X text 12 5 KEYWORDS control; #X text 12 85 AUTHOR Hans-Christoph Steiner \;; #X text 12 105 HELP_PATCH_AUTHORS "pd meta" information added by IOhannes m zmölnig for pddp-v0.3; #X text 12 45 DESCRIPTION display generic messages in the patch rather than the Pd window; #X text 13 146 INLET_0 arbitrary messages; #X restore 400 282 pd META; #X connect 2 0 0 0; #X connect 3 0 0 0; #X connect 4 0 0 0; #X connect 5 0 0 0; #X connect 6 0 0 0; pd-externals-pddp-1840f26/print.pd000066400000000000000000000054141523162452500170130ustar00rootroot00000000000000#N canvas 388 179 439 354 10; #X declare -path zexy -lib zexy; #X obj 169 48 inlet; #X obj 226 266 send \$0-pddp_print; #X obj 226 140 list2symbol; #X text 239 225 reset to blank; #X obj 169 90 route bang; #N canvas 673 22 458 308 reset 0; #X obj 72 21 inlet; #X obj 69 264 outlet; #X msg 233 127 label; #X obj 250 101 loadbang; #X msg 36 130 color 0 22; #X obj 55 57 trigger bang bang bang; #X obj 35 99 delay 50; #X msg 116 130 color 26 22; #X connect 0 0 5 0; #X connect 2 0 1 0; #X connect 3 0 2 0; #X connect 4 0 1 0; #X connect 5 0 6 0; #X connect 5 1 7 0; #X connect 5 2 2 0; #X connect 6 0 4 0; #X connect 7 0 1 0; #X restore 169 222 pd reset; #X msg 129 169 bang; #X obj 85 0 cnv 15 15 20 empty empty empty 2 7 0 14 #fcfcfc #fcfcfc 0; #X obj 1 3 cnv 15 98 15 empty \$0-pddp_print empty 2 7 0 14 #fcfcfc #000000 0; #X obj 226 170 list prepend label; #X obj 226 194 list trim; #N canvas 673 22 458 308 flash 0; #X obj 35 38 inlet; #X obj 161 284 outlet; #X msg 35 160 color 0 22; #X obj 35 129 delay 50; #X msg 134 200 color 5 22; #X obj 35 104 trigger bang bang; #X obj 134 179 spigot 1; #X obj 35 212 t b a; #X msg 35 235 1; #X obj 134 222 t b a; #X msg 134 245 0; #X connect 0 0 5 0; #X connect 2 0 7 0; #X connect 3 0 2 0; #X connect 4 0 9 0; #X connect 5 0 3 0; #X connect 5 1 6 0; #X connect 6 0 4 0; #X connect 7 0 8 0; #X connect 7 1 1 0; #X connect 8 0 6 1; #X connect 9 0 10 0; #X connect 9 1 1 0; #X connect 10 0 6 1; #X restore 27 223 pd flash on input; #X msg 75 190 bang; #N canvas 365 22 342 273 convert_pointer_to_anything 0; #X obj 169 102 symbol; #X obj 169 224 t a; #X obj 104 177 spigot; #X obj 137 147 0; #X obj 232 169 b; #X obj 232 192 1; #X obj 104 8 inlet; #X obj 104 246 outlet; #X obj 104 35 t a a; #X obj 169 58 list append foo; #X obj 169 124 sel if(pointer); #X msg 169 80 if\$1; #X text 204 76 (hack to get pointer; #X text 220 88 to substitute); #X text 8 38 enormous; #X text 14 60 hack; #X text 15 84 to; #X text 11 104 keep; #X text 16 125 pointer; #X text 14 144 from; #X text 12 203 and crashing; #X text 13 222 pd; #X text 10 162 passing thru; #X text 13 184 [route] and; #X msg 169 146 (pointer); #X connect 0 0 10 0; #X connect 1 0 7 0; #X connect 2 0 7 0; #X connect 3 0 2 1; #X connect 4 0 5 0; #X connect 5 0 2 1; #X connect 6 0 8 0; #X connect 8 0 2 0; #X connect 8 1 9 0; #X connect 9 0 11 0; #X connect 10 0 24 0; #X connect 10 0 3 0; #X connect 10 1 4 0; #X connect 11 0 0 0; #X connect 24 0 1 0; #X restore 226 116 pd convert_pointer_to_anything; #X obj 100 310 declare -path zexy -lib zexy; #X connect 0 0 4 0; #X connect 2 0 9 0; #X connect 4 0 5 0; #X connect 4 1 11 0; #X connect 4 1 13 0; #X connect 5 0 1 0; #X connect 6 0 5 0; #X connect 9 0 10 0; #X connect 10 0 1 0; #X connect 11 0 1 0; #X connect 12 0 11 0; #X connect 13 0 2 0; #X coords 0 -1 1 1 100 20 1 0 0; pd-externals-pddp-1840f26/print_long-help.pd000066400000000000000000000022631523162452500207570ustar00rootroot00000000000000#N canvas 93 178 458 308 10; #X text 13 30 this object is for displaying generic messages in the patch rather than in the Pd window.; #X msg 41 114 word; #X msg 111 114 symbol asdf; #X msg 214 114 list 1 2 3; #X msg 234 162 selector series of 4; #X text 33 68 its got a longer box and its closed on four sides; #X obj 140 220 pddp/print_long; #X obj 83 93 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 #fcfcfc #000000 #000000 0 1; #X msg 229 138 list of words?; #X text 11 262 because of Pd's type handling \, it strips off data selectors "float" \, "symbol" and "list".; #X msg 222 193 bang; #X text 256 192 flashes and resets to blank; #N canvas 775 356 494 344 META 0; #X text 12 25 LICENSE GPL v2; #X text 12 5 KEYWORDS control; #X text 12 85 AUTHOR Hans-Christoph Steiner \;; #X text 12 105 HELP_PATCH_AUTHORS "pd meta" information added by IOhannes m zmölnig for pddp-v0.3; #X text 12 45 DESCRIPTION display generic messages in the patch rather than the Pd window; #X text 13 146 INLET_0 arbitrary messages; #X restore 400 282 pd META; #X connect 1 0 6 0; #X connect 2 0 6 0; #X connect 3 0 6 0; #X connect 4 0 6 0; #X connect 7 0 6 0; #X connect 8 0 6 0; #X connect 10 0 6 0; pd-externals-pddp-1840f26/print_long.pd000066400000000000000000000053051523162452500200310ustar00rootroot00000000000000#N canvas 590 245 429 345 10; #X declare -path zexy -lib zexy; #X obj 1 3 cnv 12 198 12 empty \$0-pddp_print empty 2 6 1 14 #fcfcfc #202020 0; #X obj 169 48 inlet; #X obj 226 246 send \$0-pddp_print; #X obj 226 138 list2symbol; #X text 238 213 reset to blank; #X obj 169 90 route bang; #N canvas 673 22 458 308 reset 0; #X obj 72 21 inlet; #X obj 69 264 outlet; #X msg 233 127 label; #X obj 250 101 loadbang; #X msg 36 130 color 0 22; #X obj 55 57 trigger bang bang bang; #X obj 35 99 delay 50; #X msg 116 130 color 26 22; #X connect 0 0 5 0; #X connect 2 0 1 0; #X connect 3 0 2 0; #X connect 4 0 1 0; #X connect 5 0 6 0; #X connect 5 1 7 0; #X connect 5 2 2 0; #X connect 6 0 4 0; #X connect 7 0 1 0; #X restore 169 202 pd reset; #X msg 129 169 bang; #N canvas 365 22 342 273 convert_pointer_to_anything 0; #X obj 169 102 symbol; #X obj 169 224 t a; #X obj 104 177 spigot; #X obj 137 147 0; #X obj 232 169 b; #X obj 232 192 1; #X obj 104 8 inlet; #X obj 104 246 outlet; #X obj 104 35 t a a; #X obj 169 58 list append foo; #X obj 169 124 sel if(pointer); #X msg 169 80 if\$1; #X text 204 76 (hack to get pointer; #X text 220 88 to substitute); #X text 8 38 enormous; #X text 14 60 hack; #X text 15 84 to; #X text 11 104 keep; #X text 16 125 pointer; #X text 14 144 from; #X text 12 203 and crashing; #X text 13 222 pd; #X text 10 162 passing thru; #X text 13 184 [route] and; #X msg 169 146 (pointer); #X connect 0 0 10 0; #X connect 1 0 7 0; #X connect 2 0 7 0; #X connect 3 0 2 1; #X connect 4 0 5 0; #X connect 5 0 2 1; #X connect 6 0 8 0; #X connect 8 0 2 0; #X connect 8 1 9 0; #X connect 9 0 11 0; #X connect 10 0 24 0; #X connect 10 0 3 0; #X connect 10 1 4 0; #X connect 11 0 0 0; #X connect 24 0 1 0; #X restore 226 113 pd convert_pointer_to_anything; #X msg 27 162 bang; #X obj 226 163 list prepend label; #X obj 226 183 list trim; #N canvas 834 17 458 308 flash 0; #X obj 35 38 inlet; #X obj 161 284 outlet; #X msg 35 160 color 0 22; #X obj 35 129 delay 50; #X msg 134 200 color 5 22; #X obj 35 104 trigger bang bang; #X obj 134 179 spigot 1; #X obj 35 212 t b a; #X msg 35 235 1; #X obj 134 222 t b a; #X msg 134 245 0; #X connect 0 0 5 0; #X connect 2 0 7 0; #X connect 3 0 2 0; #X connect 4 0 9 0; #X connect 5 0 3 0; #X connect 5 1 6 0; #X connect 6 0 4 0; #X connect 7 0 8 0; #X connect 7 1 1 0; #X connect 8 0 6 1; #X connect 9 0 10 0; #X connect 9 1 1 0; #X connect 10 0 6 1; #X restore 21 203 pd flash on input; #X obj 100 290 declare -path zexy -lib zexy; #X connect 1 0 5 0; #X connect 3 0 10 0; #X connect 5 0 6 0; #X connect 5 1 8 0; #X connect 5 1 12 0; #X connect 6 0 2 0; #X connect 7 0 6 0; #X connect 8 0 3 0; #X connect 9 0 12 0; #X connect 10 0 11 0; #X connect 11 0 2 0; #X connect 12 0 2 0; #X coords 0 -1 1 1 200 18 1 0 0;